:root {
  --bg: #f4f7fb;
  --panel: #fff;
  --ink: #1f2937;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #0f766e;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  --radius: 14px;
  --detail-h: 160px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
  --map-h: min(46vh, 675px);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
}
.app {
  display: grid;
  grid-template-rows: auto auto auto auto;
  min-height: 100%;
  min-height: 100dvh;
  max-width: 100%;
  overflow-x: hidden;
}
.banner {
  background: #111827;
  color: #f9fafb;
  padding: 8px 16px;
  font-size: 12px;
  line-height: 1.45;
}
.banner strong { color: #fbbf24; }
.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 18px; }
.topbar .sub { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.mtf-callout {
  margin: 6px 0 0;
  max-width: 52rem;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 8px;
  padding: 6px 10px;
}
.toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.about-btn {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  white-space: nowrap;
}
.about-btn:hover { border-color: var(--accent); color: var(--accent); }
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip,
.select-wrap select,
.check-wrap {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  line-height: 1.3;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-sizing: border-box;
}
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.select-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.select-wrap select {
  color: var(--ink);
  color-scheme: light;
}
.check-wrap {
  color: var(--ink);
  user-select: none;
}
.check-wrap input {
  margin: 0;
  width: 14px;
  height: 14px;
  accent-color: var(--accent);
}
.filter-control { flex: 0 0 auto; }

/* Stacked layout: map above list on all breakpoints */
.main {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto;
  gap: 0;
  min-width: 0;
  max-width: 100%;
  padding: 8px 28px 20px;
  overflow: visible;
}
.map-pane {
  position: relative;
  min-width: 0;
  max-width: 100%;
  display: grid;
  grid-template-rows: var(--map-h) auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  margin: 0;
}
#map {
  width: 100%;
  height: var(--map-h);
  min-height: var(--map-h);
  max-height: var(--map-h);
}
.list-pane {
  background: transparent;
  overflow: visible;
  padding: 12px 2px 8px;
  min-height: 0;
  border: 0;
}
.list-meta, .muted { font-size: 12px; color: var(--muted); }
.list-meta { margin: 0 0 10px; }
.empty-list {
  font-size: 13px;
  color: var(--muted);
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}
.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.card:hover, .card.active { border-color: var(--accent); }
.card h2 { margin: 0 0 4px; font-size: 15px; }
.card .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ecfeff;
  color: #0f766e;
  border: 1px solid #99f6e4;
}
.pill.warn { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.pill.muted { background: #f3f4f6; color: #4b5563; border-color: #e5e7eb; }
.pill.mtf { background: #eef2ff; color: #3730a3; border-color: #c7d2fe; }
.card p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.hover-card {
  position: relative;
  z-index: 500;
  width: 100%;
  min-height: 0;
  max-height: var(--detail-h);
  overflow: auto;
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 8px 16px;
  display: block;
}
.hover-card:not(.has-place) {
  height: 0;
  min-height: 0;
  max-height: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
}
.hover-card.has-place { background: #f8fffe; }
.hover-card h3 { margin: 0 0 6px; font-size: 16px; }
.hover-card .close {
  float: right;
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--muted);
}
.people { font-size: 12px; margin-top: 8px; }
.people strong { display: block; margin-bottom: 4px; }
.pin-wrap { background: transparent; border: 0; }
.pin-label {
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.is-selected .pin-label { outline: 3px solid #f59e0b; outline-offset: 2px; }

.topbar .page-lang-menu__btn {
  color: #111827;
  background: transparent;
}


.patient-type-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.patient-type-wrap select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 6px 10px;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  color-scheme: light;
  cursor: pointer;
  line-height: 1.3;
  min-height: 34px;
  max-width: 11.5rem;
}
.patient-type-wrap select:hover { border-color: var(--accent); }
.check-wrap.is-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.check-wrap.is-disabled input { cursor: not-allowed; }
.mtf-access {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: #6b7280;
  font-weight: 500;
  border-left: 3px solid #c7d2fe;
  padding-left: 8px;
}
.hover-card .mtf-access { margin-top: 6px; }

@media (min-width: 901px) {
  :root {
    --map-h: min(52dvh, 675px);
    --detail-h: 140px;
  }
  .hover-card.has-place { max-height: min(var(--detail-h), 22vh); }
}
@media (max-width: 900px) {
  :root {
    --map-h: min(41dvh, 390px);
    --detail-h: 200px;
  }
  .hover-card.has-place { max-height: min(42vh, 220px); }
  .map-pane { min-height: 240px; }
  .main { padding: 8px 16px 16px; }
}


.map-credits {
  margin: 0;
  padding: 12px 28px 24px;
  max-width: 52rem;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}
.map-credits p { margin: 0 0 6px; }
.map-credits strong { color: var(--ink); font-weight: 600; }
@media (max-width: 900px) {
  .map-credits { padding: 10px 16px 20px; }
}
