@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@600;700;800&display=swap");

:root {
  --ink: #17221d;
  --muted: #6b756f;
  --paper: #fbfcf9;
  --white: #ffffff;
  --line: #dfe4df;
  --forest: #173f32;
  --forest-soft: #eaf1ed;
  --orange: #e55c32;
  --orange-soft: #fff0e9;
  --slate: #87928c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: "DM Sans", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: inherit;
}

.app-shell {
  display: grid;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: 68px minmax(0, 1fr);
  overflow: hidden;
}

.topbar {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.97);
}

.brand-lockup,
.topbar-summary,
.topbar-summary span {
  display: flex;
  align-items: center;
}

.brand-lockup {
  gap: 11px;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-content: center;
  border-radius: 11px;
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 7px 18px rgba(23, 63, 50, 0.18);
  font: 800 12px "Manrope", sans-serif;
  letter-spacing: -0.04em;
}

.brand-lockup strong,
.brand-lockup span {
  display: block;
}

.brand-lockup strong {
  font-size: 13px;
  letter-spacing: -0.02em;
}

.brand-lockup div > span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.topbar-summary {
  position: absolute;
  left: 50%;
  gap: 0;
  height: 100%;
  transform: translateX(-50%);
}

.topbar-summary span {
  align-self: stretch;
  gap: 7px;
  padding: 0 17px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.topbar-summary span:last-child {
  border-right: 1px solid var(--line);
}

.topbar-summary b {
  color: var(--forest);
  font-size: 15px;
}

.pdf-link {
  display: inline-flex;
  min-height: 37px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.pdf-link:hover {
  border-color: #bfc9c2;
  box-shadow: 0 5px 16px rgba(30, 46, 38, 0.07);
}

.workspace {
  display: grid;
  min-height: 0;
  grid-template-columns: minmax(0, 57fr) minmax(420px, 43fr);
  overflow: hidden;
}

.map-panel {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background: #e5ebe6;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 0;
  background: #e5ebe6;
}

.leaflet-control-zoom {
  margin-bottom: 22px !important;
  margin-left: 20px !important;
  overflow: hidden;
  border: 0 !important;
  border-radius: 11px !important;
  box-shadow: 0 7px 22px rgba(24, 44, 36, 0.15) !important;
}

.leaflet-control-zoom a {
  width: 36px !important;
  height: 36px !important;
  border-color: #e8ebe9 !important;
  color: var(--forest) !important;
  line-height: 34px !important;
}

.leaflet-control-attribution {
  font-size: 8px !important;
}

.map-context,
.map-legend {
  position: absolute;
  z-index: 700;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 8px 26px rgba(29, 45, 38, 0.12);
  backdrop-filter: blur(12px);
}

.map-context {
  top: 18px;
  left: 18px;
  align-items: flex-start;
  gap: 11px;
  max-width: 330px;
  padding: 13px 15px;
  border-radius: 13px;
}

.live-dot {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 3px;
  border: 2px solid var(--white);
  border-radius: 50%;
  background: var(--orange);
  box-shadow: 0 0 0 3px rgba(229, 92, 50, 0.16);
}

.map-context strong,
.map-context span {
  display: block;
}

.map-context strong {
  font-size: 11px;
}

.map-context span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.map-legend {
  right: 18px;
  bottom: 18px;
  gap: 14px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 11px;
  color: #58635d;
  font-size: 9px;
  font-weight: 700;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.legend-dot.demand {
  border: 1px solid var(--orange);
  background: rgba(244, 121, 77, 0.58);
}

.legend-dot.recommended {
  background: var(--forest);
}

.legend-dot.existing {
  background: #2e6f8e;
}

.legend-dot.closing {
  background: var(--orange);
}

.detail-panel {
  position: relative;
  z-index: 500;
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--line);
  background: var(--paper);
  box-shadow: -14px 0 35px rgba(33, 47, 41, 0.055);
}

.panel-heading {
  flex: 0 0 auto;
  padding: 25px 28px 18px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.panel-heading h1 {
  margin: 0;
  font: 800 clamp(28px, 2.65vw, 42px)/0.98 "Manrope", sans-serif;
  letter-spacing: -0.055em;
}

.panel-intro {
  max-width: 590px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.model-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--white);
}

.model-stats div {
  padding: 11px 12px;
}

.model-stats div + div {
  border-left: 1px solid var(--line);
}

.model-stats strong,
.model-stats span {
  display: block;
}

.model-stats strong {
  color: var(--forest);
  font: 800 15px "Manrope", sans-serif;
  letter-spacing: -0.03em;
}

.model-stats span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 8px;
}

.method-source {
  display: inline-block;
  margin-top: 9px;
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
  text-decoration: none;
}

.method-source:hover,
.method-source:focus-visible {
  color: var(--orange);
  text-decoration: underline;
}

.recommendation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 10px 18px 18px;
  scrollbar-color: #cfd6d1 transparent;
  scrollbar-width: thin;
}

.recommendation-card {
  position: relative;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.recommendation-card + .recommendation-card {
  margin-top: 5px;
}

.recommendation-card:hover {
  background: var(--white);
}

.recommendation-card.is-active {
  border-color: #dce3de;
  background: var(--white);
  box-shadow: 0 10px 25px rgba(35, 49, 43, 0.08);
  transform: translateY(-1px);
}

.site-select {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 22px;
  gap: 12px;
  align-items: start;
  padding: 15px 14px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.site-select:focus-visible,
.card-links a:focus-visible,
.pdf-link:focus-visible,
.panel-footer a:focus-visible {
  outline: 3px solid rgba(36, 140, 114, 0.25);
  outline-offset: 2px;
}

.rank-badge {
  display: grid;
  width: 36px;
  height: 36px;
  place-content: center;
  border-radius: 11px;
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 6px 15px rgba(23, 63, 50, 0.16);
  font: 800 12px "Manrope", sans-serif;
}

.recommendation-card.backup .rank-badge {
  background: #79857f;
}

.card-copy {
  min-width: 0;
}

.card-topline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.priority-label {
  color: var(--orange);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.09em;
}

.fit-pill {
  padding: 4px 7px;
  border-radius: 99px;
  background: var(--forest-soft);
  color: var(--forest);
  font-size: 8px;
  font-weight: 800;
}

.recommendation-card.backup .fit-pill {
  background: #eef0ee;
  color: #66716b;
}

.card-copy h2 {
  margin: 0;
  font: 800 16px/1.15 "Manrope", sans-serif;
  letter-spacing: -0.035em;
}

.card-address {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #6f7a74;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-rationale {
  margin: 8px 0 0;
  color: #5f6a64;
  font-size: 10px;
  line-height: 1.45;
}

.card-arrow {
  align-self: center;
  color: #9ba59f;
  font-size: 17px;
  transition: color 160ms ease, transform 160ms ease;
}

.recommendation-card:hover .card-arrow,
.recommendation-card.is-active .card-arrow {
  color: var(--forest);
  transform: translateX(2px);
}

.tag-list,
.card-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.tag-list {
  gap: 5px;
  margin-top: 9px;
}

.tag-list span {
  padding: 4px 6px;
  border-radius: 6px;
  background: #f0f3f0;
  color: #68736d;
  font-size: 8px;
  font-weight: 700;
}

.card-links {
  gap: 14px;
  margin: 0 14px 13px 64px;
}

.card-links a {
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.card-links a:hover {
  text-decoration: underline;
}

.panel-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 66px;
  padding: 12px 28px;
  border-top: 1px solid var(--line);
  background: var(--forest);
  color: var(--white);
}

.footer-label,
.panel-footer strong {
  display: block;
}

.footer-label {
  margin-bottom: 3px;
  color: #a9c2b6;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.panel-footer strong {
  font-size: 10px;
}

.panel-footer a {
  flex: 0 0 auto;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 800;
  text-decoration: none;
}

.panel-footer a:hover {
  background: rgba(255, 255, 255, 0.08);
}

.site-pin {
  border: 0;
  background: transparent;
}

.site-pin span {
  display: grid;
  width: 38px;
  height: 38px;
  place-content: center;
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  background: var(--forest);
  color: var(--white);
  box-shadow: 0 8px 18px rgba(22, 33, 28, 0.25);
  transform: rotate(-45deg);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.site-pin span b {
  transform: rotate(45deg);
  font: 800 12px "Manrope", sans-serif;
}

.site-pin.backup span {
  background: #7d8983;
}

.site-pin.active span {
  box-shadow:
    0 0 0 7px rgba(23, 63, 50, 0.16),
    0 9px 22px rgba(22, 33, 28, 0.3);
  transform: rotate(-45deg) scale(1.12);
}

.site-pin.closing span {
  width: 34px;
  height: 34px;
  background: var(--orange);
}

.site-pin.closing span b {
  font-size: 18px;
}

.existing-dlc-pin {
  border: 0;
  background: transparent;
}

.existing-dlc-pin span {
  display: grid;
  width: 34px;
  height: 34px;
  place-content: center;
  border: 3px solid var(--white);
  border-radius: 50%;
  background: #2e6f8e;
  color: var(--white);
  box-shadow: 0 7px 17px rgba(26, 66, 88, 0.25);
}

.existing-dlc-pin span b {
  font: 800 8px "Manrope", sans-serif;
  letter-spacing: -0.03em;
}

.leaflet-div-icon {
  border: 0;
  background: transparent;
}

.heat-label {
  border: 0;
  background: transparent;
  box-shadow: none;
  color: #55240f;
  text-align: center;
}

.heat-label::before {
  display: none;
}

.heat-label strong,
.heat-label span {
  display: block;
}

.heat-label strong {
  color: #431b0b;
  font: 800 12px/1 "Manrope", sans-serif;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 5px rgba(255, 255, 255, 0.8);
}

.spacing-label {
  border: 1px solid rgba(22, 63, 51, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 5px 16px rgba(22, 63, 51, 0.14);
  color: var(--forest);
  font: 800 8px/1 "Manrope", sans-serif;
  letter-spacing: 0.02em;
  padding: 6px 8px;
}

.spacing-label::before {
  display: none;
}

.heat-label span {
  margin-top: 2px;
  color: #6e351d;
  font-size: 7px;
  font-weight: 800;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    0 0 5px rgba(255, 255, 255, 0.8);
}

.leaflet-popup-content-wrapper {
  border-radius: 13px;
  box-shadow: 0 14px 35px rgba(24, 35, 30, 0.18);
}

.leaflet-popup-content {
  margin: 15px 17px !important;
}

.map-popup {
  min-width: 220px;
}

.map-popup small,
.map-popup strong,
.map-popup span {
  display: block;
}

.map-popup small {
  color: var(--orange);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.11em;
}

.map-popup strong {
  margin-top: 5px;
  font: 800 15px "Manrope", sans-serif;
}

.map-popup span,
.map-popup p {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.45;
}

.map-popup p {
  margin: 8px 0;
}

.map-popup div {
  display: flex;
  gap: 12px;
}

.map-popup a {
  color: var(--forest);
  font-size: 9px;
  font-weight: 800;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }

  .topbar-summary {
    display: none;
  }

  .workspace {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  .map-panel {
    height: 52dvh;
    min-height: 410px;
  }

  .detail-panel {
    overflow: visible;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .recommendation-list {
    overflow: visible;
  }
}

@media (max-width: 620px) {
  .app-shell {
    grid-template-rows: 62px auto;
  }

  .topbar {
    padding: 0 14px;
  }

  .brand-lockup div > span,
  .pdf-link {
    display: none;
  }

  .map-panel {
    height: 48dvh;
    min-height: 350px;
  }

  .map-context {
    top: 12px;
    left: 12px;
    max-width: calc(100% - 24px);
  }

  .map-legend {
    right: 12px;
    bottom: 12px;
  }

  .panel-heading {
    padding: 22px 18px 17px;
  }

  .panel-heading h1 {
    font-size: 32px;
  }

  .model-stats div {
    padding: 10px 8px;
  }

  .recommendation-list {
    padding: 9px 8px 16px;
  }

  .panel-footer {
    align-items: flex-start;
    padding: 13px 18px;
  }
}
