:root {
  color-scheme: dark;
  --bg: #101613;
  --surface: rgba(25, 33, 29, 0.86);
  --surface-solid: #1a231f;
  --surface-soft: rgba(255, 255, 255, 0.055);
  --chrome: rgba(16, 22, 19, 0.88);
  --panel-bg: rgba(16, 22, 19, 0.76);
  --sheet-bg: rgba(25, 33, 29, 0.96);
  --ink: #f2f5f0;
  --muted: #a5b2ab;
  --line: rgba(221, 235, 228, 0.14);
  --accent: #67b8a9;
  --accent-strong: #91d6c8;
  --blue: #3d6f9f;
  --gold: #a97d3f;
  --danger: #a35a54;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --map-filter: brightness(0.78) contrast(1.08) saturate(0.8);
  --radius: 18px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f7f4;
  --surface: rgba(255, 255, 255, 0.86);
  --surface-solid: #ffffff;
  --surface-soft: rgba(31, 93, 84, 0.07);
  --chrome: rgba(246, 247, 244, 0.88);
  --panel-bg: rgba(246, 247, 244, 0.72);
  --sheet-bg: rgba(255, 255, 255, 0.94);
  --ink: #17201d;
  --muted: #65716c;
  --line: rgba(31, 48, 43, 0.12);
  --accent: #2f756b;
  --accent-strong: #1f5d54;
  --shadow: 0 20px 70px rgba(17, 33, 29, 0.16);
  --map-filter: none;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

body {
  overflow: hidden;
}

img,
video,
.protected-media,
.map-stage {
  -webkit-user-drag: none;
  user-select: none;
}

button, a {
  font: inherit;
}

.app-shell {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px clamp(14px, 3vw, 28px);
  border-bottom: 1px solid var(--line);
  background: var(--chrome);
  backdrop-filter: blur(22px);
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #1f5d54, #5f9b92);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
  box-shadow: 0 10px 24px rgba(47, 117, 107, 0.22);
}

.brand strong {
  display: block;
  font-size: 16px;
  line-height: 1.1;
  letter-spacing: 0;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.header-current-time {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #45c981;
  line-height: 1.05;
  text-align: right;
}

.header-current-time > span:last-child {
  display: grid;
  gap: 2px;
}

.header-current-time small,
.header-current-time strong {
  display: block;
}

.header-current-time small {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-current-time strong {
  font-size: 15px;
}

.language-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.language-picker select {
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

@media (max-width: 560px) {
  .language-picker > span { display: none; }
  .language-picker { padding-left: 6px; }
}

.mode-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-soft);
  border-radius: 999px;
}

.mode-button {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  padding: 0 14px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.mode-button.active {
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: 0 5px 16px rgba(17, 33, 29, 0.12);
}

.theme-toggle {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px 0 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.theme-icon {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background:
    radial-gradient(circle at 66% 36%, transparent 0 8px, var(--surface-solid) 8.5px),
    linear-gradient(145deg, #f2c86b, #67b8a9);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

:root[data-theme="light"] .theme-icon {
  background:
    radial-gradient(circle at 50% 50%, #f2c86b 0 7px, transparent 7.5px),
    conic-gradient(from 0deg, transparent 0 10deg, rgba(242, 200, 107, 0.55) 10deg 24deg, transparent 24deg 45deg);
  box-shadow: none;
}

.theme-label {
  font-size: 13px;
  font-weight: 700;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(340px, 420px) 1fr;
}

.side-panel {
  overflow: auto;
  padding: 20px;
  border-right: 1px solid var(--line);
  background: var(--panel-bg);
}

.panel-section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(20px);
  box-shadow: 0 10px 40px rgba(17, 33, 29, 0.06);
  margin-bottom: 14px;
}

.intro h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.04;
  letter-spacing: 0;
}

.intro p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.live-status {
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
}

.live-status-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--accent-strong);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.live-pulse {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}

.live-status h2 {
  margin: 14px 0 7px;
  font-size: 20px;
}

.live-status p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.live-status small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
}

.map-live-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-solid) 92%, transparent);
  color: var(--ink);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .16);
}

.map-live-status strong {
  color: var(--accent-strong);
  font-size: 11px;
  text-transform: uppercase;
}

.map-live-status span {
  font-size: 13px;
  font-weight: 750;
}

.route-legend{display:inline-flex;align-items:center;gap:12px;white-space:nowrap}
.route-legend b{display:inline-flex;align-items:center;gap:6px;font:inherit}
.route-legend i{width:18px;height:4px;border-radius:999px;display:inline-block;background:#1f5799}
.route-legend i.hiked{background:#e2bd36}

.stats-private { max-width: 920px; }

.private-stats-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0;
}

.private-stats-summary div {
  display: grid;
  gap: 6px;
  padding: 20px;
  border-radius: 16px;
  background: var(--surface-soft);
}

.private-stats-summary strong { font-size: 32px; }
.private-stats-summary span { color: var(--muted); }

.private-stats-tables {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.private-stats-tables table {
  width: 100%;
  border-collapse: collapse;
}

.private-stats-tables th,
.private-stats-tables td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.private-stats-tables th:last-child,
.private-stats-tables td:last-child { text-align: right; }

@media (max-width: 640px) {
  .private-stats-tables { grid-template-columns: 1fr; }
}

.overline {
  margin: 0 0 10px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

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

.stats-grid div {
  min-height: 74px;
  display: grid;
  align-content: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--surface-soft);
}

.stats-grid .stats-value {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 24px;
  font-weight: 780;
}

.stats-grid .stats-value strong {
  min-width: 0;
  font: inherit;
  white-space: nowrap;
}

.stats-grid .live-pulse {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
}

.stat-hiking-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: #e2bd36;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stats-grid small {
  margin-top: 3px;
  color: var(--muted);
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-section h2 {
  margin: 0 0 12px;
  font-size: 15px;
}

.panel-collapse {
  padding: 0;
  overflow: clip;
}

.panel-collapse > summary {
  min-height: 48px;
  padding: 11px 13px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.panel-collapse > summary::-webkit-details-marker { display: none; }

.panel-collapse > summary::after {
  content: "›";
  flex: 0 0 auto;
  margin-left: 5px;
  color: var(--accent-strong);
  font-size: 22px;
  line-height: 1;
  transform: rotate(90deg);
  transition: transform 160ms ease;
}

.panel-collapse[open] > summary::after { transform: rotate(-90deg); }

.panel-collapse > summary h2 { margin: 0; }

.panel-collapse .collapse-content {
  padding: 0 11px 11px;
  border-top: 1px solid var(--line);
}

.panel-collapse .section-hint { margin-top: 10px; }

#visibleCount {
  color: var(--muted);
  font-size: 12px;
}

.filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-hint {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.filter-chip {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  padding: 0 12px;
  cursor: pointer;
}

.filter-chip.active {
  border-color: rgba(47, 117, 107, 0.3);
  background: rgba(47, 117, 107, 0.12);
  color: var(--accent-strong);
  font-weight: 700;
}

.place-list {
  display: grid;
  gap: 8px;
}

.route-plan-list {
  display: grid;
  gap: 12px;
}

.section-hint {
  margin: -3px 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.soundtrack-list {
  display: grid;
  gap: 10px;
}

.soundtrack-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(103, 184, 169, 0.14), rgba(25, 33, 29, 0.16));
}

.soundtrack-art {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #1ed760, #117a3e);
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  overflow: hidden;
}

.soundtrack-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.soundtrack-copy,
.soundtrack-copy strong,
.soundtrack-copy span {
  min-width: 0;
  display: block;
}

.soundtrack-copy small {
  display: block;
  margin-top: 5px;
  color: var(--accent-strong);
  font-size: 10px;
  line-height: 1.3;
}

.soundtrack-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.soundtrack-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.soundtrack-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.soundtrack-load,
.soundtrack-open {
  min-height: 34px;
  display: inline-grid;
  place-items: center;
  padding: 0 10px;
  border: 1px solid rgba(30, 215, 96, 0.38);
  border-radius: 11px;
  background: rgba(30, 215, 96, 0.12);
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.soundtrack-open {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 650;
}

.soundtrack-embed {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 352px;
  border: 0;
  border-radius: 12px;
  background: #121212;
}

.day-etappen-list {
  display: grid;
  gap: 7px;
}

.day-etappe-row {
  width: 100%;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.day-etappe-row:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 184, 169, 0.42);
}

.day-etappe-row.active {
  border-color: rgba(103, 184, 169, 0.58);
  background: linear-gradient(135deg, rgba(103, 184, 169, 0.18), rgba(61, 111, 159, 0.1));
  box-shadow: inset 3px 0 0 var(--accent);
}

.day-etappe-number {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-solid);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
}

.day-etappe-copy,
.day-etappe-copy strong,
.day-etappe-copy small {
  min-width: 0;
  display: block;
}

.day-etappe-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.2;
}

.day-etappe-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.day-etappe-state {
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.route-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(145deg, var(--surface-soft), rgba(47, 117, 107, 0.06));
}

.route-week-menu,
.route-day-menu {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
  overflow: hidden;
}

.route-week-menu + .route-week-menu,
.route-day-menu + .route-day-menu {
  margin-top: 8px;
}

.route-week-menu > summary,
.route-day-menu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  list-style: none;
}

.route-week-menu > summary::-webkit-details-marker,
.route-day-menu > summary::-webkit-details-marker { display: none; }

.route-week-menu > summary::after,
.route-day-menu > summary::after {
  content: "⌄";
  color: var(--muted);
  font-weight: 800;
  transition: transform .18s ease;
}

.route-week-menu[open] > summary::after,
.route-day-menu[open] > summary::after { transform: rotate(180deg); }

.route-week-menu > summary span,
.route-day-menu > summary span {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.route-week-content,
.route-day-content {
  padding: 0 8px 8px;
}

.route-day-menu { background: var(--surface); }
.route-day-content .route-card + .route-card { margin-top: 8px; }

.route-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.route-card h3 {
  margin: 10px 0 5px;
  font-size: 14px;
  line-height: 1.25;
}

.route-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.route-stages {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 18px;
  margin: 10px 0 12px;
  padding: 0 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

.route-stages li {
  padding-left: 1px;
}

.route-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.route-action,
.route-focus {
  display: grid;
  place-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  color: var(--ink);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.route-action-google { border-color: rgba(66, 133, 244, 0.32); }
.route-action-apple { border-color: rgba(25, 25, 25, 0.28); }
.route-action-waze { border-color: rgba(31, 163, 218, 0.35); }

.route-stop-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.route-stop-links strong {
  width: 100%;
  color: var(--muted);
  font-size: 10px;
}

.route-stop-links a {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
}

.route-focus {
  width: 100%;
  margin-top: 7px;
  background: rgba(47, 117, 107, 0.1);
}

.route-source {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.place-row {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: var(--surface-soft);
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.place-row strong {
  display: block;
  font-size: 14px;
  line-height: 1.24;
}

.place-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.map-stage {
  position: relative;
  min-width: 0;
}

#map {
  height: 100%;
  min-height: 360px;
  background: #dce5df;
}

#map .leaflet-tile {
  filter: var(--map-filter);
}

.map-toolbar {
  position: absolute;
  left: 82px;
  top: 18px;
  z-index: 500;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: calc(100% - 36px);
}

.public-map-layer-picker {
  position: absolute;
  z-index: 520;
  top: 50%;
  left: 12px;
  right: auto;
  display: flex;
  flex-direction: column;
  transform: translateY(-50%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(17, 33, 29, .18);
  backdrop-filter: blur(16px);
}

.public-map-layer-picker button {
  display: grid;
  width: 42px;
  height: 42px;
  padding: 0;
  place-items: center;
  border: 0;
  border-right: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.public-map-layer-picker button:last-child { border-bottom: 0; }
.public-map-layer-picker button.active { background: var(--accent); color: #fff; }
.public-map-layer-picker button:disabled { cursor: not-allowed; opacity: .38; }
.public-map-layer-picker svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.public-weather-marker { background: transparent; border: 0; }
.public-weather-marker-card {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 1px 5px;
  min-width: 72px;
  min-height: 58px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, .68);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 5px 18px rgba(17, 33, 29, .28);
  color: var(--ink);
  text-decoration: none;
  backdrop-filter: blur(16px);
}
.public-weather-marker-card.is-cluster { cursor: pointer; }
.public-weather-marker-card .weather-count {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border-radius: 999px;
  background: #3478f6;
  color: white;
  font-size: 10px;
  font-weight: 800;
}
.public-weather-marker-card .weather-stack {
  position: absolute;
  left: -5px;
  bottom: -5px;
  width: 19px;
  height: 19px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--surface-solid);
  font-size: 11px;
  font-weight: 800;
}
.public-weather-marker-card.weather-spider-member {
  position: absolute;
  transition: transform 220ms ease, opacity 180ms ease;
  z-index: 900;
}
.public-weather-marker .weather-stack-close {
  position: absolute;
  left: -6px;
  bottom: -7px;
  z-index: 2;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--ink);
  cursor: pointer;
}
.public-weather-state {
  position: absolute;
  z-index: 521;
  left: 62px;
  top: 50%;
  max-width: min(290px, calc(100% - 80px));
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  transform: translateY(43px);
  box-shadow: 0 6px 20px rgba(17, 33, 29, .18);
}
@media (prefers-reduced-motion: reduce) {
  .public-weather-marker-card.weather-spider-member { transition: none; }
}
.public-weather-marker span { font-size: 18px; }
.public-weather-marker strong { font-size: 13px; }
.public-weather-marker small { grid-column: 1 / -1; font-size: 9px; font-weight: 700; }

.map-toolbar span,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(16px);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
}

.route-view-picker {
  display: grid;
  gap: 3px;
  min-width: min(330px, calc(100vw - 112px));
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  backdrop-filter: blur(16px);
}

.map-toolbar .route-view-picker span {
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.route-view-picker select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.map-apple-action {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid rgba(25, 25, 25, .28);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 750;
}

.map-apple-action[hidden] { display: none; }

.detail-sheet {
  position: fixed;
  z-index: 1200;
  left: 50%;
  bottom: 22px;
  width: min(520px, calc(100% - 28px));
  transform: translate(-50%, calc(100% + 50px));
  opacity: 0;
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--sheet-bg);
  backdrop-filter: blur(26px);
  box-shadow: var(--shadow);
  transition: transform 220ms ease, opacity 180ms ease;
  max-height: calc(100dvh - 44px);
  overflow: hidden;
}

.detail-sheet.open {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}

.sheet-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
}

.sheet-content {
  padding: 48px 18px 18px;
  max-height: calc(100dvh - 44px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.sheet-content h2 {
  margin: 4px 0 8px;
  font-size: 22px;
  line-height: 1.12;
}

.sheet-content p {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.48;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.media-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.media-section { margin: 12px 0; }
.media-strip-heading { display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px; }
.media-strip-heading span { color:var(--muted);font-size:12px; }
.media-kind-chip { position:absolute;z-index:2;left:8px;top:8px;margin:0;padding:4px 8px;border-radius:999px;background:rgba(5,7,6,.72);color:rgba(255,255,255,.94);font-size:10px;font-weight:850;line-height:1;pointer-events:none; }

.place-media-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(118px, 100%), 1fr));
  gap: 8px;
  width: 100%;
}

.place-media-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
}

.place-media-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.place-media-preview-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 750;
}

.place-media-hint {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.media-card {
  min-height: 78px;
  border-radius: 14px;
  background:
    linear-gradient(140deg, rgba(103,184,169,0.18), rgba(61,111,159,0.14)),
    radial-gradient(circle at 25% 20%, rgba(255,255,255,0.14), rgba(255,255,255,0));
  border: 1px solid var(--line);
  padding: 9px;
  color: var(--muted);
  font-size: 12px;
}

.media-card strong,
.media-card span {
  display: block;
}

.media-card strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}

.media-card span {
  margin-top: 6px;
  line-height: 1.35;
}

.media-card .media-location,
.media-viewer-copy .media-location {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 750;
}

.media-card-video {
  grid-column: span 3;
  padding: 10px;
}

.media-card-photo {
  grid-column: span 3;
  padding: 10px;
}

.media-frame {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  background: #050706;
}

.media-frame-button {
  width: 100%;
  display: block;
  padding: 0;
  border: 0;
  color: inherit;
  cursor: zoom-in;
}

.media-frame::after,
.media-viewer-frame::after {
  content: attr(data-copyright);
  position: absolute;
  right: 8px;
  bottom: 7px;
  max-width: calc(100% - 16px);
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.48);
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.42);
}

.media-card-video video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: contain;
}

.media-card-photo img {
  width: 100%;
  height: auto;
  max-height: min(68vh, 720px);
  display: block;
  object-fit: contain;
}

.media-open-button {
  position: absolute;
  right: 8px;
  top: 8px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(5, 7, 6, 0.52);
  color: rgba(255, 255, 255, 0.9);
  cursor: zoom-in;
  font-size: 11px;
  font-weight: 800;
}

.media-card-video strong,
.media-card-photo strong {
  margin-top: 9px;
}

.place-notes {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.place-notes > strong,
.place-notes > span {
  display: block;
}

.place-notes > strong {
  font-size: 12px;
  color: var(--ink);
}

.place-notes > span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.place-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.place-note span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.place-note p {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 13px;
}

.sheet-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.sheet-actions a {
  display: grid;
  place-items: center;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--surface-soft);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.bottom-nav {
  display: none;
}

.site-copyright {
  position: fixed;
  z-index: 700;
  left: 616px;
  right: auto;
  bottom: 12px;
  max-width: calc(100vw - 800px);
  margin: 0;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.46);
  color: rgba(255, 255, 255, 0.76);
  font-size: clamp(8px, 0.72vw, 10px);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

.legal-links {
  position: fixed;
  z-index: 710;
  left: 438px;
  right: auto;
  bottom: 12px;
  display: flex;
  gap: 8px;
}

@media (min-width: 861px) and (max-width: 1020px) {
  .site-copyright {
    left: 584px;
    max-width: calc(100vw - 776px);
    overflow: hidden;
    text-overflow: clip;
    font-size: 8px;
  }

  .legal-links a {
    padding: 0 6px;
    font-size: 9px;
  }
}

.legal-links a {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.46);
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
}

.legal-page {
  min-height: 100%;
  overflow: auto;
  padding: 24px;
  background: var(--bg);
  color: var(--ink);
}

.legal-container {
  width: min(860px, 100%);
  margin: 0 auto;
}

.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.legal-header a {
  color: var(--accent-strong);
  text-decoration: none;
  font-weight: 800;
}

.legal-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  padding: clamp(18px, 4vw, 32px);
  box-shadow: var(--shadow);
}

.legal-card h1 {
  margin: 0 0 16px;
  font-size: clamp(28px, 5vw, 44px);
  line-height: 1.05;
}

.legal-card h2 {
  margin: 28px 0 10px;
  font-size: 18px;
}

.legal-card p,
.legal-card li {
  color: var(--muted);
  line-height: 1.58;
}

.legal-card strong {
  color: var(--ink);
}

.legal-warning {
  margin: 0 0 18px;
  padding: 12px;
  border: 1px solid rgba(169, 125, 63, 0.42);
  border-radius: 14px;
  background: rgba(169, 125, 63, 0.12);
}

.legal-placeholder {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 7px;
  background: rgba(163, 90, 84, 0.16);
  color: #f0b8b4;
  font-weight: 800;
}

.legal-footer {
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.media-viewer {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  place-items: center;
  padding: 14px;
}

.map-3d {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.map-3d[hidden] {
  display: none;
}

.map-dimension-toggle {
  position: absolute;
  z-index: 620;
  top: 82px;
  left: 12px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(62, 67, 65, 0.9);
  color: var(--accent);
  box-shadow: 0 5px 16px rgba(0, 0, 0, 0.24);
  cursor: pointer;
}

.map-dimension-toggle[hidden] {
  display: none;
}

.map-dimension-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-dimension-toggle .map-dimension-flat,
.map-dimension-toggle[aria-pressed="true"] .map-dimension-flat {
  display: none;
}

.map-dimension-toggle[aria-pressed="true"] .map-dimension-cube {
  display: block;
}

.map-poi-filter {
  position: absolute;
  z-index: 625;
  top: 128px;
  left: 12px;
  color: var(--ink);
}

.map-poi-filter[hidden] { display: none; }

.map-poi-filter > summary {
  position: relative;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 999px;
  background: rgba(62, 67, 65, .9);
  color: var(--accent);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .24);
  cursor: pointer;
  list-style: none;
}

.map-poi-filter > summary::-webkit-details-marker { display: none; }
.map-poi-filter > summary::marker { content: ""; }
.map-poi-filter > summary svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-poi-filter[open] > summary { background: var(--accent); color: #fff; }

.map-poi-filter-count {
  position: absolute;
  top: -5px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 999px;
  background: #3478f6;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
}

.map-poi-filter-count:empty { display: none; }

.map-poi-filter-menu {
  position: absolute;
  top: 44px;
  left: 0;
  width: max-content;
  min-width: 224px;
  max-width: min(290px, calc(100vw - 32px));
  overflow: hidden;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: 0 12px 34px rgba(17, 33, 29, .28);
}

.map-poi-filter-menu label,
.map-poi-hide-all {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.map-poi-hide-all, .map-poi-show-all { color: var(--accent); font-weight: 760; }
.map-poi-filter-menu label:hover, .map-poi-hide-all:hover, .map-poi-show-all:hover { background: rgba(128, 128, 128, .13); }
.map-poi-filter-menu input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.map-3d .maplibregl-ctrl-attrib {
  max-width: min(78vw, 760px);
  color: #313735;
  font-size: 10px;
}

.media-viewer.open {
  display: grid;
}

.media-viewer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 7, 6, 0.72);
  backdrop-filter: blur(10px);
}

.media-viewer-panel {
  position: relative;
  z-index: 1;
  width: min(1900px, calc(100vw - 28px));
  max-height: min(1200px, calc(100vh - 28px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet-bg);
  box-shadow: var(--shadow);
  transition: width 280ms cubic-bezier(.22, .75, .2, 1);
}

.media-viewer-close {
  position: absolute;
  z-index: 2;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(5, 7, 6, 0.58);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.media-viewer-body {
  padding: 14px;
  max-height: min(1172px, calc(100vh - 56px));
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}

.media-gallery {
  padding: 38px 2px 2px;
}

.media-gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.media-gallery-heading div,
.media-gallery-heading span,
.media-gallery-heading strong {
  display: block;
}

.media-gallery-heading span,
.media-gallery-heading b {
  color: var(--muted);
  font-size: 12px;
}

.media-gallery-heading strong {
  margin-top: 3px;
  font-size: 18px;
}

.media-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(148px, 100%), 1fr));
  gap: 8px;
  width: 100%;
}

.media-gallery-grid button {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #050706;
  cursor: zoom-in;
}

.media-gallery-grid img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.media-gallery-grid .media-gallery-index,
.media-gallery-grid .media-gallery-kind {
  position: absolute;
  min-width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 8px;
  background: rgba(5, 7, 6, .72);
  color: #fff;
  font-size: 11px;
  font-weight: 850;
  pointer-events: none;
}

.media-gallery-grid .media-gallery-index {
  right: 6px;
  bottom: 6px;
}

.media-gallery-grid .media-gallery-kind {
  left: 6px;
  top: 6px;
  width: 24px;
  min-width: 24px;
  padding: 0;
  border-radius: 8px;
}

.media-gallery-grid .media-gallery-kind svg {
  width: 16px;
  height: 16px;
  display: block;
}

.media-viewer-toolbar {
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-right: 46px;
  margin-bottom: 8px;
}

.media-viewer-toolbar button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
}

.media-viewer-toolbar strong {
  color: var(--muted);
  font-size: 12px;
}

.media-viewer-tools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.media-location-toggle {
  width: 34px;
  min-width: 34px;
  padding: 0 !important;
  display: grid;
  place-items: center;
}

.media-location-toggle svg {
  width: 20px;
  height: 20px;
}

.media-location-toggle[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.media-viewer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
}

.media-viewer-layout.location-open {
  grid-template-columns: minmax(0, 1fr) clamp(320px, 24vw, 430px);
  gap: 16px;
}

.media-viewer-primary {
  min-width: 0;
}

.media-viewer-stage {
  position: relative;
  display: block;
}

.media-viewer-nav {
  position: absolute;
  z-index: 3;
  top: 0;
  bottom: 0;
  width: clamp(54px, 9%, 112px);
  height: auto;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, .86);
  cursor: pointer;
  font-size: 38px;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .86);
  transition: background-color 160ms ease;
}

.media-viewer-nav.previous { left: 0; text-align: left; padding-left: 16px; }
.media-viewer-nav.next { right: 0; text-align: right; padding-right: 16px; }
.media-viewer-nav:not(:disabled):hover,
.media-viewer-nav:not(:disabled):focus-visible { background: rgba(5, 7, 6, .16); }

.media-viewer-stage.has-video .media-viewer-nav {
  bottom: 56px;
}

.media-viewer-nav:disabled {
  opacity: .22;
  cursor: default;
}

.media-viewer-frame {
  position: relative;
  display: grid;
  place-items: center start;
  overflow: hidden;
  border-radius: 14px;
  background: #050706;
}

.media-viewer-frame img,
.media-viewer-frame video {
  width: 100%;
  max-width: 100%;
  height: min(74vh, 850px);
  max-height: min(74vh, 850px);
  display: block;
  object-fit: contain;
  background: #050706;
  cursor: default;
}

.media-activity-badge {
  position: absolute;
  z-index: 4;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .34);
  border-radius: 10px;
  background: rgba(5, 7, 6, .66);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22);
  pointer-events: none;
}

.media-activity-badge svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-location-panel {
  position: relative;
  min-width: 0;
  min-height: min(74vh, 850px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #050706;
}

.media-location-empty {
  position: absolute;
  z-index: 500;
  inset: 50% 18px auto;
  transform: translateY(-50%);
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 12px;
  background: rgba(5, 7, 6, .82);
  color: #fff;
  text-align: center;
  font-size: 13px;
}

.media-location-empty[hidden] { display: none; }

.media-location-panel[hidden] { display: none; }

.media-location-map {
  width: 100%;
  height: 100%;
  min-height: min(74vh, 850px);
  background: #d8ddd9;
}

.media-location-marker {
  background: transparent;
  border: 0;
}

.media-location-marker span {
  width: 36px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .5));
}

.media-location-marker svg {
  width: 34px;
  height: 42px;
  fill: #1f6f63;
  stroke: #fff;
}

.media-location-map .leaflet-control-attribution {
  max-width: calc(100% - 8px);
  font-size: 9px;
}

.media-viewer-copy {
  padding: 12px 2px 2px;
}

.media-viewer-copy strong,
.media-viewer-copy span {
  display: block;
}

.media-viewer-copy strong {
  color: var(--ink);
  font-size: 15px;
}

.media-viewer-copy span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.cookie-banner {
  position: fixed;
  z-index: 1700;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100% - 28px));
  display: none;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--sheet-bg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.cookie-banner.visible {
  display: flex;
}

.cookie-banner strong {
  display: block;
  font-size: 13px;
}

.cookie-banner p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.cookie-actions {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}

.cookie-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 12px;
  background: var(--surface-soft);
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.cookie-actions button:last-child {
  border-color: rgba(103, 184, 169, 0.42);
  background: rgba(103, 184, 169, 0.16);
  color: var(--accent-strong);
}

.leaflet-control-zoom,
.leaflet-control-attribution {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(17, 33, 29, 0.13) !important;
}

.leaflet-bottom.leaflet-right {
  right: 12px;
  bottom: 10px;
  max-width: 180px;
}

.leaflet-control-attribution {
  max-width: 180px;
  padding: 3px 7px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  color: #1a231f !important;
  font-size: clamp(8px, 0.68vw, 10px) !important;
  line-height: 1.2 !important;
  white-space: normal !important;
  text-align: right;
}

.leaflet-control-attribution a {
  color: #1a231f !important;
}

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

/* Tablet-Ansicht: browserunabhängig über Touch + typische iPad-Breite. */
@media (min-width: 700px) and (max-width: 1180px),
       (min-width: 700px) and (max-width: 1400px) and (hover: none) and (pointer: coarse) {
  .panel-collapse[open] .collapse-content {
    max-height: min(52vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }

  .side-panel { padding: 11px; }
  .panel-section { padding: 12px; margin-bottom: 8px; }
  .intro h1 { font-size: 24px; }
  .intro p { margin-top: 8px; font-size: 12px; line-height: 1.38; }
  .overline { margin-bottom: 6px; font-size: 10px; }
  .live-status-heading { font-size: 10px; }
  .live-status h2 { margin: 8px 0 4px; font-size: 16px; }
  .live-status p { font-size: 12px; line-height: 1.35; }
  .live-status small { margin-top: 6px; font-size: 10px; }
  .stats-grid { gap: 6px; }
  .stats-grid div { min-height: 54px; padding: 8px; border-radius: 11px; }
  .stats-grid .stats-value { gap: 4px; font-size: 15px; }
  .stat-hiking-icon { width: 17px; height: 17px; }
  .stats-grid small { font-size: 9px; line-height: 1.15; }
  .panel-section h2 { margin-bottom: 8px; font-size: 13px; }
  .filter-grid { gap: 5px; }
  .filter-chip { min-height: 29px; padding: 0 9px; font-size: 11px; }
  .section-hint { font-size: 10px; line-height: 1.32; }
  .panel-collapse { padding: 0; }
  .panel-collapse > summary { min-height: 42px; padding: 9px 11px; }
  .panel-collapse > summary h2 { margin: 0; }
  .panel-collapse .collapse-content { padding: 0 9px 9px; }
  .day-etappe-row { min-height: 46px; padding: 6px 8px; gap: 7px; }
  .day-etappe-copy strong { font-size: 11px; }
  .day-etappe-copy small, .day-etappe-state { font-size: 9px; }
  .route-plan-list { gap: 8px; }
  .route-card { padding: 9px; border-radius: 13px; }
  .route-card h3 { margin: 6px 0 3px; font-size: 12px; }
  .route-card p { font-size: 10px; line-height: 1.3; }
  .route-stages { margin: 7px 0 8px; font-size: 9px; }
  .route-action, .route-focus { min-height: 30px; font-size: 9px; }
  .place-row { padding: 8px; border-radius: 11px; }
  .place-row strong { font-size: 12px; }
  .place-row span { font-size: 10px; }
}

@media (max-width: 860px) {
  body { overflow: hidden; }

  .topbar {
    height: 64px;
    gap: 10px;
  }

  .brand small {
    display: none;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
  }

  .brand strong {
    font-size: 15px;
  }

  .header-actions {
    gap: 6px;
  }

  .mode-switch {
    gap: 2px;
    padding: 3px;
  }

  .mode-button {
    min-height: 32px;
    padding: 0 10px;
    font-size: 13px;
  }

  .theme-toggle {
    width: 38px;
    min-height: 38px;
    justify-content: center;
    padding: 0;
  }

  .theme-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .layout {
    display: block;
    flex: 1;
  }

  .side-panel {
    display: block;
    position: fixed;
    z-index: 1150;
    top: 64px;
    bottom: calc(62px + var(--safe-bottom));
    left: 0;
    width: min(100%, 430px);
    overflow: auto;
    padding: 14px;
    border-right: 1px solid var(--line);
    background: var(--panel-bg);
    box-shadow: 18px 0 40px rgba(0, 0, 0, 0.18);
    transform: translateX(-106%);
    transition: transform 180ms ease;
  }

  .side-panel.mobile-open {
    transform: translateX(0);
  }

  .map-stage {
    height: calc(100vh - 64px - 62px - var(--safe-bottom));
  }

  .map-toolbar {
    inset: 12px;
    max-width: none;
    display: block;
    pointer-events: none;
  }

  .map-toolbar > * { pointer-events: auto; }

  .map-live-status {
    position: absolute;
    top: 0;
    left: 0;
    max-width: calc(100vw - 24px);
  }

  .route-view-picker {
    position: absolute;
    top: 58px;
    left: 0;
    min-width: min(280px, calc(100vw - 94px));
  }

  .route-legend {
    position: absolute;
    left: 0;
    bottom: 24px;
  }

  .public-map-layer-picker {
    top: auto;
    right: 12px;
    bottom: 24px;
    left: auto;
    transform: none;
  }

  .leaflet-control-zoom {
    display: none;
  }

  .map-toolbar span:nth-child(3) {
    display: none;
  }

  .bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 3px;
    min-height: calc(62px + var(--safe-bottom));
    padding: 7px 8px calc(7px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: var(--chrome);
    backdrop-filter: blur(20px);
  }

  .site-copyright {
    left: 164px;
    right: auto;
    bottom: calc(68px + var(--safe-bottom));
    max-width: calc(100% - 330px);
    overflow: hidden;
    text-overflow: clip;
    font-size: clamp(7px, 2vw, 9px);
  }

  .legal-links {
    left: 10px;
    right: auto;
    bottom: calc(68px + var(--safe-bottom));
    gap: 5px;
  }

  .legal-links a {
    min-height: 22px;
    padding: 0 7px;
    font-size: 9px;
  }

  .leaflet-bottom.leaflet-right {
    right: 6px;
    bottom: 8px;
    max-width: 158px;
  }

  .leaflet-control-attribution {
    max-width: 158px;
    font-size: 8px !important;
    line-height: 1.1 !important;
  }

  .legal-page {
    padding: 14px;
  }

  .legal-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .bottom-nav a {
    display: grid;
    place-items: center;
    border-radius: 14px;
    color: var(--muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 700;
  }

  .bottom-nav a.active {
    color: var(--accent-strong);
    background: rgba(47, 117, 107, 0.1);
  }

  .detail-sheet {
    width: 100%;
    left: 0;
    bottom: 0;
    transform: translateY(calc(100% + 50px));
    border-radius: 24px 24px 0 0;
    max-height: min(74vh, 680px);
    overflow: hidden;
  }

  .detail-sheet.open {
    transform: translateY(0);
  }

  .sheet-content {
    max-height: min(74vh, 680px);
    overflow-y: auto;
  }

  .media-card-video {
    grid-column: span 1;
  }

  .media-card-photo {
    grid-column: span 1;
  }

  .cookie-banner {
    left: 10px;
    right: 10px;
    bottom: calc(72px + var(--safe-bottom));
    width: auto;
    display: none;
    align-items: stretch;
    flex-direction: column;
  }

  .cookie-banner.visible {
    display: flex;
  }

  .cookie-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .media-viewer {
    padding: 4px;
  }

  .media-viewer-panel {
    width: calc(100vw - 8px);
    max-height: calc(100vh - 8px);
    border-radius: 16px;
  }

  .media-viewer-body {
    padding: 10px;
  }

  .media-gallery-grid {
    gap: 6px;
  }


  .media-viewer-layout.location-open {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .media-location-panel,
  .media-location-map {
    min-height: min(56vh, 520px);
  }

  .media-viewer-nav {
    position: absolute;
    z-index: 3;
    top: 0;
    bottom: 0;
    width: 64px;
    height: auto;
    border-color: rgba(255, 255, 255, .22);
    background: transparent;
    color: #fff;
  }

  .media-viewer-nav.previous { left: 0; }
  .media-viewer-nav.next { right: 0; }

  .media-viewer-frame img,
  .media-viewer-frame video {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(54vh, 460px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
.tomorrow-route-button {
  width: 100%;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent) 13%, var(--panel));
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.tomorrow-route-button span,
.tomorrow-route-button strong,
.tomorrow-route-button small { display: block; }
.tomorrow-route-button span { color: var(--accent); font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.tomorrow-route-button strong { margin-top: 3px; font-size: 1rem; }
.tomorrow-route-button small { margin-top: 3px; color: var(--muted); }

.route-brief-modal { position: fixed; inset: 0; z-index: 1200; display: none; }
.route-brief-modal.open { display: block; }
.route-brief-backdrop { position: absolute; inset: 0; background: rgba(4, 10, 8, .72); backdrop-filter: blur(8px); }
.route-brief-panel {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(680px, calc(100% - 24px));
  max-height: calc(100vh - 36px);
  overflow: auto;
  transform: translateX(-50%);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .48);
}
.route-brief-close { position: absolute; top: 12px; right: 14px; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.7rem; cursor: pointer; }
.route-brief-overline { margin: 0 54px 5px 0; color: var(--accent); font-size: .78rem; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.route-brief-panel h2 { margin: 0 48px 10px 0; font-size: clamp(1.7rem, 5vw, 2.6rem); line-height: 1.05; }
.route-brief-line { margin: 16px 0; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); font-weight: 750; }
.route-trip-card { margin: 14px 0; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.route-trip-card h3 { margin: 7px 0 4px; font-size: 1.2rem; }
.route-trip-card p { margin: 0 0 12px; color: var(--muted); }
.route-trip-card a { display: block; padding: 12px 14px; border-radius: 12px; background: var(--panel); color: var(--text); text-align: center; text-decoration: none; font-weight: 800; }
.route-trip-card .route-brief-primary { background: var(--accent); color: #122018; }
.route-trip-heading { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.route-trip-heading span { color: var(--accent); font-size: .76rem; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.route-trip-heading strong { font-size: .9rem; }
.route-trip-optional { border-style: dashed; }
.route-brief-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.route-brief-stats div { padding: 13px; border-radius: 14px; background: var(--surface); }
.route-brief-stats strong, .route-brief-stats span { display: block; }
.route-brief-stats strong { color: var(--accent); }
.route-brief-stats span { color: var(--muted); }
.route-brief-actions { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; margin: 14px 0; }
.route-brief-actions a { padding: 13px 14px; border-radius: 13px; background: var(--surface); color: var(--text); text-align: center; text-decoration: none; font-weight: 800; }
.route-brief-actions .route-brief-primary { background: var(--accent); color: #122018; }
.route-brief-rest { padding: 14px; border-radius: 14px; background: var(--surface); }
.route-brief-rest p { margin: 5px 0; }
.route-brief-rest span, .route-brief-warning { color: var(--muted); }
.route-brief-warning { margin-bottom: 8px; }
body.route-brief-open { overflow: hidden; }

@media (max-width: 560px) {
  .route-brief-panel { bottom: 0; width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding: 21px 16px 28px; }
  .route-brief-stats, .route-brief-actions { grid-template-columns: 1fr; }
}
.media-map-marker {
  width: 58px !important;
  height: 58px !important;
  background: transparent;
  border: 0;
}

.media-map-thumb {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 58px;
  height: 58px;
  aspect-ratio: 1 / 1;
  overflow: visible;
}

.media-map-image {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  border: 3px solid #fff;
  border-radius: 12px;
  background: #26332f;
  box-shadow: 0 5px 18px rgba(17, 33, 29, .38);
}

.media-map-marker-cluster .media-map-image {
  border-color: #83c9bb;
  box-shadow:
    0 0 0 4px rgba(47, 117, 107, .26),
    0 7px 22px rgba(17, 33, 29, .44);
}

.media-map-marker-cluster .media-map-kind {
  background: rgba(31, 93, 84, .92);
}

.media-map-marker-animating {
  transition:
    transform 460ms cubic-bezier(.22, 1, .36, 1),
    opacity 300ms ease-out !important;
  will-change: transform, opacity;
  z-index: 790 !important;
}

.media-map-marker-exiting .media-map-thumb {
  transition: transform 300ms ease-out;
  transform: scale(.78);
}

@media (prefers-reduced-motion: reduce) {
  .media-map-marker-animating,
  .media-map-marker-exiting .media-map-thumb {
    transition: none !important;
  }
}

.media-map-image img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
}

.media-map-kind {
  position: absolute;
  left: 4px;
  bottom: 4px;
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 8px;
  background: rgba(17, 25, 23, .78);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px) saturate(1.2);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  color: #fff;
}

.media-map-kind svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.media-map-kind .media-map-kind-fill {
  fill: currentColor;
  stroke: none;
}

.media-map-thumb em {
  position: absolute;
  top: -10px;
  right: -10px;
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 9px;
  background: #f28c28;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(17, 25, 23, .32);
}

.media-map-popup {
  display: grid;
  grid-template-columns: repeat(3, 72px);
  gap: 7px;
}

.media-map-popup button {
  position: relative;
  box-sizing: border-box;
  width: 72px;
  height: 72px;
  aspect-ratio: 1 / 1;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 9px;
  background: #26332f;
  cursor: pointer;
}

.media-map-popup img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.media-map-popup span {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 2px 4px;
  border-radius: 4px;
  background: rgba(17, 25, 23, .82);
  color: #fff;
  font-size: 9px;
}
.tour-milestone {
  background: transparent;
  border: 0;
}

.tour-milestone span {
  display: block;
  color: #e77817;
  font-size: 28px;
  line-height: 1;
  filter: drop-shadow(0 2px 2px rgba(17, 33, 29, 0.42));
}

.tour-milestone-small span {
  font-size: 20px;
}

.tour-milestone-home span {
  color: #1f5799;
  font-size: 34px;
}
