/* ============================================================
   KVB Live Map — stylesheet
   ============================================================ */

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

.hidden { display: none !important; }

:root {
  --sidebar-w: 280px;
  --sidebar-bg: rgba(255, 255, 255, 0.97);
  --sidebar-border: #d9dde4;
  --accent: #0078d7;
  --text: #1a1a1a;
  --text-muted: #6b7280;
  --panel-bg: #f9fafb;
  --panel-radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.15);
  --transition: 0.2s ease;
  --loading-bg: rgba(255,255,255,0.9);
  --popup-bg: #fff;
  --popup-text: inherit;
  --btn-bg: #fff;
  --btn-text: #6b7280;

  /* Delay colours */
  --ontime: #27ae60;
  --slight-delay: #e67e22;
  --delayed: #c0392b;

  /* Map label colours (referenced by JS style functions) */
  --station-label-fill: #333;
  --station-label-stroke: rgba(255,255,255,0.85);
}

/* -------- Dark theme overrides -------- */
[data-theme="dark"] {
  --sidebar-bg: rgba(26, 28, 35, 0.97);
  --sidebar-border: #2e3140;
  --accent: #3a9efd;
  --text: #e8eaf0;
  --text-muted: #8b92a8;
  --panel-bg: #1e2030;
  --shadow: 0 2px 12px rgba(0,0,0,0.5);
  --loading-bg: rgba(18, 20, 28, 0.92);
  --popup-bg: #1a1c23;
  --popup-text: #e8eaf0;
  --btn-bg: #252731;
  --btn-text: #8b92a8;
  --station-label-fill: #dde1ed;
  --station-label-stroke: rgba(20, 22, 30, 0.85);
}

/* ---------- Base ---------- */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  overflow: hidden;
  height: 100vh;
}

[data-theme="dark"] body {
  background: #000;
}

/* ---------- Map ---------- */
#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: #000;
  transition: right var(--transition);
}
body.sidebar-open #map {
  right: var(--sidebar-w);
}

.kiosk-exit-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 180;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.74);
  color: #fff;
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity var(--transition), transform var(--transition);
}

body.kiosk-mode.kiosk-exit-visible .kiosk-exit-btn {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

/* ---------- Loading overlay ---------- */
#loading {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--loading-bg);
  font-size: 16px;
  transition: opacity 0.4s;
}
#loading.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid var(--accent);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Popup ---------- */
.popup {
  position: absolute;
  z-index: 200;
  background: var(--popup-bg);
  color: var(--popup-text);
  border-radius: var(--panel-radius);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  min-width: 200px;
  max-width: 280px;
  font-size: 13px;
  line-height: 1.5;
}
.popup.hidden { display: none; }

.hover-popup {
  min-width: 180px;
  max-width: 240px;
  padding: 8px 10px;
  pointer-events: auto;
}

.hover-popup-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hover-popup-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hover-popup-header .popup-line-badge {
  margin-bottom: 0;
}

.hover-popup-topline {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hover-popup-delay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 120, 215, 0.12);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-bg));
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
}

.hover-popup-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hover-popup-direction {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hover-popup-journey {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hover-popup-stop-box {
  appearance: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  background: var(--panel-bg);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition), transform var(--transition);
}

.hover-popup-stop-heading {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hover-popup-stop-name {
  font-size: 12px;
  font-weight: 600;
  text-align: left;
  line-height: 1.3;
}

.hover-popup-stop-box:hover,
.hover-popup-stop-box:focus-visible {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--sidebar-border));
  color: var(--accent);
  outline: none;
}

.hover-popup-stop-box:active {
  transform: translateY(1px);
}

#popup-close {
  position: absolute;
  top: 6px;
  right: 8px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}
#popup-close:hover { color: var(--text); }

.popup-line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  padding: 1px 8px;
  border-radius: 12px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
}
.popup-row { margin: 3px 0; }
.popup-label { color: var(--text-muted); font-size: 12px; }
.popup-value { font-weight: 600; }

/* ---------- Sidebar ---------- */
#sidebar {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-left: 1px solid var(--sidebar-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(0);
  transition: transform var(--transition);
  box-shadow: -4px 0 16px rgba(0,0,0,0.08);
}
#sidebar.collapsed {
  transform: translateX(100%);
}

/* When collapsed, a floating button remains visible */
#sidebar-open-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 101;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sidebar-bg);
  border: 1px solid var(--sidebar-border);
  box-shadow: var(--shadow);
  cursor: pointer;
  font-size: 16px;
  color: var(--text);
  display: none;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] #sidebar-open-btn {
  color: #fff;
}

#sidebar-open-btn.visible { display: flex; }

/* ---------- Sidebar header ---------- */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.sidebar-title {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.sidebar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

#sidebar-toggle,
#copy-link-btn,
#enter-kiosk-link-btn,
#dark-mode-btn {
  background: none;
  border: none;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
#sidebar-toggle:hover,
#copy-link-btn:hover,
#enter-kiosk-link-btn:hover,
#dark-mode-btn:hover,
#dark-mode-btn.is-active { background: var(--panel-bg); color: var(--text); }

/* Btn with just an icon (no text), used for copy-link */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
}

.btn-icon .material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  font-variation-settings: 'FILL' 0, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.btn-theme {
  position: relative;
}

.btn-theme .theme-icon-sun {
  display: none;
}

.btn-theme .theme-icon-moon {
  display: block;
}

[data-theme="dark"] .btn-theme .theme-icon-sun {
  display: block;
}

[data-theme="dark"] .btn-theme .theme-icon-moon {
  display: none;
}

.selected-tram-panel {
  background: linear-gradient(180deg, rgba(0, 120, 215, 0.06), transparent);
}

.selected-tram-empty {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.selected-tram-content.hidden { display: none; }

.selected-tram-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.selected-tram-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.selected-tram-title-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.selected-tram-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
}

.selected-tram-direction {
  font-size: 14px;
  font-weight: 700;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-tram-direction-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-tram-delay-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 120, 215, 0.12);
  background: color-mix(in srgb, var(--accent) 12%, var(--panel-bg));
  color: var(--text);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.selected-tram-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.selected-tram-status-inline {
  margin-bottom: 0;
}

.selected-tram-status {
  font-size: 11px;
  color: var(--text-muted);
}

.selected-tram-stop-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 10px;
}

.selected-tram-stop {
  appearance: none;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 8px;
  border: 1px solid var(--sidebar-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), transform var(--transition);
}

[data-theme="dark"] .selected-tram-stop {
  background: rgba(255, 255, 255, 0.02);
}

.selected-tram-stop:hover,
.selected-tram-stop:focus-visible {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--sidebar-border));
  outline: none;
}

.selected-tram-stop:active {
  transform: translateY(1px);
}

.selected-tram-stop.is-current {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(0, 120, 215, 0.35);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
  background: rgba(0, 120, 215, 0.08);
  background: color-mix(in srgb, var(--accent) 8%, var(--panel-bg));
}

.selected-tram-stop.is-next {
  border-color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 45%, var(--sidebar-border));
  background: rgba(0, 120, 215, 0.04);
  background: color-mix(in srgb, var(--accent) 4%, var(--panel-bg));
}

.selected-tram-stop-name-wrap {
  display: flex;
  align-items: flex-start;
  min-width: 0;
}

.selected-tram-stop-name {
  font-weight: 600;
  font-size: 12px;
  min-width: 0;
}

.selected-tram-stop-heading {
  grid-column: 1 / -1;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.selected-tram-stop-heading.current {
  color: var(--accent);
}

.selected-tram-stop-heading.next {
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 80%, var(--text-muted));
}

.selected-tram-stop-time,
.selected-tram-stop-delay {
  font-size: 11px;
  color: var(--text-muted);
}

.selected-tram-stop-delay {
  text-align: right;
}

/* ---------- Status bar ---------- */
.status-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
.dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-connected    { background: var(--ontime); }
.dot-disconnected { background: var(--delayed); }
.dot-connecting   { background: var(--slight-delay); }
.last-update { margin-left: auto; font-size: 11px; }

/* ---------- Station search ---------- */
.search-box {
  position: relative;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}
#station-search {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  background: var(--panel-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
  transition: border-color var(--transition);
}
#station-search::placeholder { color: var(--text-muted); }
#station-search:focus { border-color: var(--accent); }

.search-results {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(100% - 4px);
  z-index: 200;
  background: var(--popup-bg);
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 200px;
  overflow-y: auto;
}
.search-results.hidden { display: none; }
.search-result-item {
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-item:hover,
.search-result-item.active { background: var(--panel-bg); }

/* ---------- Panels ---------- */
.panel {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sidebar-border);
}
.panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.panel-title-with-action {
  justify-content: space-between;
}

/* ---------- Toggle switches ---------- */
.layer-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
  cursor: pointer;
  user-select: none;
}
.layer-toggle input[type="checkbox"] { display: none; }
.toggle-track {
  position: relative;
  width: 34px;
  height: 18px;
  background: #ccc;
  border-radius: 9px;
  transition: background var(--transition);
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  transition: transform var(--transition);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.layer-toggle input:checked + .toggle-track { background: var(--accent); }
.layer-toggle input:checked + .toggle-track::after { transform: translateX(16px); }

/* ---------- Tile options ---------- */
.tile-options { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-option {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  user-select: none;
  transition: background var(--transition), border-color var(--transition);
}
.tile-option input { display: none; }
.tile-option:has(input:checked) {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ---------- Line list ---------- */
#line-list { display: flex; flex-direction: column; gap: 4px; }

.line-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.line-row input[type="checkbox"] { accent-color: var(--accent); width: 15px; height: 15px; flex-shrink: 0; }
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 20px;
  padding: 0 6px;
  border-radius: 4px;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
}
.line-color-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 1px solid var(--sidebar-border);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}

/* ---------- Tiny buttons ---------- */
.btn-small {
  font-size: 10px;
  padding: 1px 6px;
  border: 1px solid var(--sidebar-border);
  border-radius: 4px;
  background: var(--btn-bg);
  cursor: pointer;
  color: var(--btn-text);
  transition: background var(--transition), color var(--transition);
}
.btn-small:hover { background: var(--panel-bg); color: var(--text); }

.btn-inline-action {
  margin-top: 10px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover,
.btn-link:focus-visible {
  color: var(--accent);
  color: color-mix(in srgb, var(--accent) 80%, white);
  outline: none;
}

.option-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.panel-legal {
  padding-top: 10px;
  padding-bottom: 12px;
}

/* ---------- Legend ---------- */
.legend-items { display: flex; flex-direction: column; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 10px; font-size: 12px; }

.legend-station {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #555;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-line-route {
  display: inline-block;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  flex-shrink: 0;
}
.legend-tram-ontime,
.legend-tram-late {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: 10px;
  flex-shrink: 0;
}
.legend-tram-ontime { background: var(--ontime); }
.legend-tram-late   { background: var(--slight-delay); }

/* ---------- Stats bar ---------- */
.stats-bar {
  margin-top: auto;
  display: flex;
  gap: 16px;
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid var(--sidebar-border);
  flex-shrink: 0;
}

/* ---------- Remarks / service alerts in popup ---------- */
.popup-remarks {
  margin-top: 8px;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 6px;
}
.popup-remark {
  font-size: 11px;
  padding: 3px 6px;
  background: rgba(230, 126, 34, 0.15);
  border-left: 3px solid var(--slight-delay);
  border-radius: 3px;
  margin-bottom: 3px;
  color: var(--text);
  line-height: 1.4;
}

/* ---------- Station departure board (item C) ---------- */
.popup-departures {
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.popup-dep-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
}
.popup-dep-dir {
  flex: 1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.popup-dep-eta {
  font-weight: bold;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.popup-dep-title {
  margin-top: 8px;
  font-size: 10px;
  font-weight: bold;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-top: 1px solid var(--sidebar-border);
  padding-top: 6px;
}
.dep-ontime { color: var(--ontime); }
.dep-slight  { color: var(--slight-delay); }
.dep-late    { color: var(--delayed); }

/* ---------- OL attribution (keep visible) ---------- */
.ol-attribution {
  bottom: 6px !important;
  right: 6px !important;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(12, 18, 28, 0.56);
  backdrop-filter: blur(10px);
}

.modal-backdrop.hidden { display: none; }

.modal-card {
  width: min(60vw, 860px);
  min-height: min(60vh, 560px);
  max-height: min(86vh, 900px);
  max-height: min(86dvh, 900px);
  max-width: 100%;
  background: var(--sidebar-bg);
  color: var(--text);
  border: 1px solid var(--sidebar-border);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.28);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  overflow-y: auto;
}

.modal-card-legal {
  width: min(60vw, 760px);
  min-height: auto;
  justify-content: flex-start;
}

.modal-close {
  position: sticky;
  top: 0;
  align-self: flex-end;
  border: none;
  background: var(--sidebar-bg);
  color: var(--text-muted);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 1;
}

.modal-close:hover,
.modal-close:focus-visible {
  color: var(--text);
  outline: none;
}

.modal-eyebrow {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.modal-card h2 {
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.1;
}

.modal-card p {
  font-size: 15px;
  line-height: 1.7;
  max-width: 58ch;
}

.legal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.legal-block {
  border: 1px solid var(--sidebar-border);
  border-radius: 12px;
  padding: 14px;
  background: var(--panel-bg);
}

.legal-block-wide {
  grid-column: 1 / -1;
}

.legal-block h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.legal-block p {
  font-size: 13px;
  line-height: 1.6;
  max-width: none;
}

.modal-actions {
  display: flex;
  justify-content: flex-start;
  margin-top: 6px;
}

.modal-primary {
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.modal-footnote {
  font-size: 12px;
  color: var(--text-muted);
}

body.kiosk-mode #sidebar,
body.kiosk-mode #sidebar-open-btn {
  display: none !important;
}

body.kiosk-mode #map {
  right: 0;
  bottom: 0;
}

/* ---------- Mobile ---------- */
@media (max-width: 600px) {
  :root { --sidebar-w: 100vw; }
  #sidebar { top: auto; height: 55vh; border-left: none; border-top: 1px solid var(--sidebar-border); }
  body.sidebar-open #map { right: 0; bottom: 55vh; }
  .modal-backdrop {
    align-items: flex-start;
    padding: 12px;
  }
  .modal-card {
    width: min(92vw, 860px);
    min-height: auto;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    padding: 22px;
  }
  .legal-grid { grid-template-columns: 1fr; }
  .legal-block-wide { grid-column: auto; }
  .kiosk-exit-btn {
    top: 12px;
    right: 12px;
    padding: 9px 12px;
  }
}
