:root {
  color-scheme: light;
  --ink: #263d38;
  --muted: #5a7067;
  --teal: #26716b;
  --hairline: #d9e3da;
  --surface: #ffffff;
  --canvas: #f7f9f5;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { min-width: 320px; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
button:focus-visible, input:focus-visible, .map-viewport:focus-visible, a:focus-visible {
  outline: 3px solid #1c7d83;
  outline-offset: 3px;
}
::selection { color: #18342f; background: #b9dfcf; }
* { scrollbar-color: #b6c8bd transparent; scrollbar-width: thin; }
a { color: #1f666c; text-underline-offset: 3px; }

.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; overflow: hidden; }
.site-header {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 102px;
  padding: 17px 26px 16px 30px;
  background: #fff;
  border-bottom: 1px solid var(--hairline);
}
.identity { display: flex; align-items: center; gap: 27px; min-width: 0; }
.brand {
  flex: none;
  color: var(--teal);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.heading h1 { margin: 0; font-size: clamp(28px, 3.2vw, 43px); line-height: 1.05; letter-spacing: -.025em; }
.heading p { margin: 7px 0 0; color: var(--muted); font-size: 14px; }
.header-actions { display: flex; align-items: center; gap: 12px; width: min(390px, 38vw); }
.search {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 46px;
  padding: 0 15px;
  background: #f7faf7;
  border: 1px solid #cddbd1;
  border-radius: 13px;
  transition: border-color .16s ease, background .16s ease;
}
.search:focus-within { border-color: var(--teal); background: #fff; }
.search svg { width: 19px; height: 19px; flex: none; fill: none; stroke: var(--teal); stroke-width: 2; stroke-linecap: round; }
.search input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search input::placeholder { color: #687f74; opacity: 1; }
.mobile-list-toggle, .drawer-close { display: none; }

.layout { display: grid; grid-template-columns: 335px minmax(0, 1fr); flex: 1; min-height: 0; }
.directory {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--hairline);
  z-index: 3;
}
.directory-intro { display: flex; justify-content: space-between; padding: 26px 22px 18px; }
.directory-intro h2 { margin: 0; font-size: 19px; letter-spacing: -.015em; }
.directory-intro p { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 18px 16px 22px; border-bottom: 1px solid #edf1ea; }
.filter {
  min-height: 34px;
  padding: 7px 10px;
  background: #f5f8f4;
  border: 1px solid #e4ebe3;
  border-radius: 999px;
  color: #38544b;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-align: left;
}
.filter:hover { background: #edf3eb; }
.filter.active { color: #fff; background: var(--filter-color, var(--teal)); border-color: var(--filter-color, var(--teal)); }
.place-list { overflow: auto; flex: 1; padding: 10px 12px 20px 14px; }
.list-group { margin: 8px 0 16px; }
.list-group h3 { margin: 0 8px 6px; padding: 0 0 8px; border-bottom: 1px solid var(--hairline); color: var(--category-color); font-size: 12px; font-weight: 800; }
.place-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  min-height: 43px;
  padding: 8px 7px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-size: 13px;
  line-height: 1.25;
}
.place-row:hover, .place-row:focus-visible { background: #edf4ed; }
.place-row.selected { background: #e6f0e8; font-weight: 700; }
.place-code { flex: none; padding: 4px 5px 3px; border-radius: 5px; background: var(--category-color); color: #fff; font-size: 11px; font-weight: 800; line-height: 1; }
.place-name { padding-top: 2px; }
.facilities-group { --category-color: #256a69; margin-top: 22px; }
.facilities-group h3 { color: #256a69; }
.facility-code { min-width: 29px; text-align: center; }
.empty-results { padding: 22px 10px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.directory-note { padding: 13px 22px 17px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 11px; line-height: 1.4; }

.map-panel { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.map-viewport { position: absolute; inset: 0; overflow: hidden; background: #fff; touch-action: none; cursor: grab; }
.map-viewport.dragging { cursor: grabbing; }
.map-world { position: absolute; left: 0; top: 0; width: 2600px; height: 1550px; transform-origin: 0 0; will-change: transform; }
.map-world img { display: block; width: 2600px; height: 1550px; user-select: none; pointer-events: none; }
.map-graphics { position: absolute; inset: 0; width: 2600px; height: 1550px; overflow: visible; pointer-events: none; }
.connector-under { stroke: #fff; stroke-width: 6; stroke-linecap: round; }
.connector { stroke: #6a8177; stroke-width: 2; stroke-linecap: round; }
.anchor-dot { fill: #59776b; }
.house rect { fill: #f8f8f1; }
.house text { fill: #56645b; font-size: 17px; font-weight: 800; text-anchor: middle; dominant-baseline: middle; }
.map-label { fill: #26716b; font-size: 25px; font-weight: 700; paint-order: stroke; stroke: #f8faf6; stroke-width: 3; }
.map-label.water { letter-spacing: .17em; }
.pin-layer { position: absolute; inset: 0; pointer-events: none; }
.map-pin {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 37px;
  height: 29px;
  padding: 0 3px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 8px;
  background: var(--pin-color);
  box-shadow: 0 2px 7px #24423835;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .015em;
  font-variant-numeric: tabular-nums;
  pointer-events: auto;
  transition: box-shadow .16s ease, scale .16s ease;
}
.map-pin:hover { scale: 1.12; box-shadow: 0 4px 11px #24423855; }
.map-pin[hidden] { display: none; }
.map-pin.selected { z-index: 2; scale: 1.2; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--pin-color), 0 5px 15px #24423855; }
.facility-pin { --pin-color: #256a69; min-width: 42px; height: 32px; border-radius: 10px; font-size: 10px; letter-spacing: .04em; }
.facility-pin.wc { --pin-color: #286c88; }
.map-pin:focus-visible { outline-offset: 3px; }
.map-hint {
  position: absolute;
  left: 20px;
  top: 19px;
  max-width: min(320px, 50%);
  padding: 9px 13px;
  border-radius: 9px;
  background: #ffffffeb;
  box-shadow: 0 3px 18px #27413714;
  color: #3f5d52;
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
}
.map-controls { position: absolute; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 5px; }
.map-controls button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid #d7e2d8;
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 3px 13px #27413716;
  color: var(--ink);
}
.map-controls button:hover { background: #eff5ee; }
.map-controls svg, .mobile-list-toggle svg, .drawer-close svg, .detail-close svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.detail-panel {
  position: absolute;
  z-index: 5;
  right: 72px;
  bottom: 55px;
  width: min(450px, calc(100% - 95px));
  max-height: calc(100% - 85px);
  overflow-y: auto;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 10px 35px #1c3d2a2b;
  animation: detail-in .24s cubic-bezier(.2,.8,.2,1) both;
}
.detail-panel.on-left { left: 24px; right: auto; }
.detail-panel[hidden] { display: none; }
@keyframes detail-in { from { opacity: .5; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.detail-body { padding: 21px 25px 25px; }
.detail-photo { position: relative; margin: 0; background: #e8ede5; }
.detail-photo img { display: block; width: 100%; height: 215px; object-fit: cover; }
.detail-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.detail-code { padding: 5px 7px 4px; border-radius: 5px; background: var(--detail-color); color: #fff; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.detail-close { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #526a5c; }
.detail-close:hover { background: #edf3ed; }
.detail-category { margin: 15px 0 7px; color: var(--detail-color); font-size: 12px; font-weight: 800; }
.detail-panel h2 { margin: 0; font-size: 23px; line-height: 1.18; letter-spacing: -.025em; text-wrap: balance; }
.detail-address-label { margin: 20px 0 5px; color: var(--muted); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.detail-address { margin: 0; font-size: 14px; line-height: 1.45; }
.detail-address.missing { color: var(--muted); }
.detail-contacts { display: grid; gap: 12px; margin: 19px 0 0; padding: 18px 0 0; border-top: 1px solid var(--hairline); }
.detail-contacts > div { display: grid; grid-template-columns: 83px minmax(0, 1fr); gap: 10px; align-items: start; }
.detail-contacts dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.detail-contacts dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
.detail-contacts a { font-weight: 700; }
.detail-description-label { margin: 21px 0 8px; padding-top: 19px; border-top: 1px solid var(--hairline); color: var(--ink); font-size: 14px; }
.detail-description { margin: 0; white-space: pre-line; overflow-wrap: anywhere; font-size: 14px; line-height: 1.55; }
.map-credit {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 7px 16px 8px;
  background: #ffffffed;
  border-top: 1px solid #e7ede7;
  color: #53695f;
  font-size: 10px;
  line-height: 1.4;
  text-align: center;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 290px minmax(0, 1fr); }
  .site-header { min-height: 88px; }
  .identity { gap: 14px; }
  .header-actions { width: min(340px, 42vw); }
  .detail-panel { right: 16px; }
  .detail-panel.on-left { left: 16px; }
}

@media (max-width: 680px) {
  .site-header { flex-wrap: wrap; gap: 12px; min-height: 0; padding: 13px 15px 12px; }
  .identity { width: 100%; gap: 13px; }
  .brand { font-size: 10px; }
  .heading h1 { font-size: 28px; }
  .heading p { margin-top: 4px; font-size: 12px; }
  .header-actions { width: 100%; }
  .search { height: 42px; }
  .mobile-list-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: none;
    min-width: 77px;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #ccd9cf;
    border-radius: 10px;
    background: #fff;
    color: var(--teal);
    font-size: 13px;
    font-weight: 700;
  }
  .layout { position: relative; display: block; }
  .directory {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: min(60vh, 490px);
    border: 0;
    border-radius: 17px 17px 0 0;
    box-shadow: 0 -10px 30px #1c3d2a29;
    transform: translateY(105%);
    transition: transform .22s cubic-bezier(.2,.8,.2,1);
    pointer-events: none;
  }
  .directory.open { transform: translateY(0); pointer-events: auto; }
  .directory-intro { padding: 17px 20px 13px; }
  .drawer-close { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--ink); }
  .drawer-close:hover { background: #edf3ed; }
  .filters { padding-left: 20px; padding-right: 16px; max-height: 102px; overflow: auto; }
  .map-panel { width: 100%; height: 100%; }
  .map-hint { top: 11px; left: 11px; max-width: 220px; font-size: 11px; }
  .map-controls { top: 11px; right: 10px; }
  .detail-panel, .detail-panel.on-left { left: 0; right: 0; bottom: 38px; width: 100%; max-height: 60vh; border-radius: 17px 17px 0 0; }
  .detail-body { padding: 18px 20px 23px; }
  .detail-photo img { height: 168px; }
  .detail-panel h2 { font-size: 22px; }
  .map-credit { padding: 5px 10px; font-size: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
