/* Import Plein Serif Display Font from Fontshare/Framer */
@font-face {
  font-family: 'Plein';
  src: url('https://framerusercontent.com/third-party-assets/fontshare/wf/LXBUVZ5GZM5VXMNBQTPWRERAJDBJJQRQ/VIZHC2BL4P47U6NUECP6HVLUHOMK4GNB/MNGXIZV722WRVVTC4EPCRCSLLB6OX4ZV.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Plein';
  src: url('https://framerusercontent.com/third-party-assets/fontshare/wf/MWTPXBQEIUM3HZSV5S7ELGRLSIE2PQWW/RIGN2UZVGZVE3KGJ7KUOAKK43ZYFMRFV/RDZVZJY7FMJJ4X6FSXLIXD57DCCWLB7A.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* Design Tokens & Variables */
:root {
  --font-heading: 'Plein', 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Harmonious Light Forest Green Palette matching gwunderwald.ch */
  --bg-panel: rgba(255, 255, 255, 0.78);
  --bg-panel-solid: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.62);
  --bg-card-hover: rgba(233, 243, 236, 0.75);
  --bg-card-active: rgba(43, 138, 73, 0.1);
  
  --accent: #005f21;        /* Deep Brand Green */
  --accent-light: #2b8a49;  /* Medium Brand Green */
  --accent-glow: rgba(43, 138, 73, 0.15);
  --accent-glow-intense: rgba(43, 138, 73, 0.3);
  
  --text-primary: #121614;   /* Dark charcoal */
  --text-secondary: #2f3733; /* Slate gray */
  --text-muted: #8a9a90;     /* Greenish Muted Gray */
  
  --border-light: #eaf2ed;
  --border-highlight: #c5d8cc;
  --border-accent: rgba(43, 138, 73, 0.3);
  
  --glass-blur: blur(16px) saturate(1.35);
  --shadow-premium: 0 10px 40px rgba(18, 22, 20, 0.05);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  --transition-smooth: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  --border-radius-lg: 20px;
  --border-radius-md: 12px;
  --border-radius-sm: 8px;
}

/* Base Reset & Setup */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background-color: #ffffff;
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Map Container full screen */
#map {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Loader Screen Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #f6f8f6;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease;
}

.loader-overlay.fade-out {
  opacity: 0;
  pointer-events: none;
}

.loader-content {
  text-align: center;
}

.loader-icon {
  font-size: 2.6rem;
  color: var(--accent);
  margin: 0 auto 16px;
  animation: loaderPulse 1.6s ease-in-out infinite;
}

@keyframes loaderPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.94); }
}

.loader-title {
  font-size: 2.2rem;
  color: var(--accent);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
  font-family: var(--font-heading);
}

.loader-subtitle {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ==========================================================================
   Control Panel Layout (Desktop Sidebar)
   ========================================================================== */
.control-panel {
  position: fixed;
  top: 20px;
  left: 20px;
  bottom: 20px;
  width: 380px;
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-premium);
  box-shadow: var(--shadow-premium), var(--shadow-inset);
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.drag-handle {
  display: none; /* Only visible on mobile */
  padding: 12px;
  cursor: pointer;
  justify-content: center;
  align-items: center;
}

.handle-bar {
  width: 40px;
  height: 4px;
  background: var(--text-muted);
  border-radius: 2px;
  opacity: 0.6;
  transition: var(--transition-smooth);
}

.drag-handle:hover .handle-bar {
  opacity: 1;
  background: var(--text-secondary);
}

.panel-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px;
}

.panel-header {
  margin-bottom: 20px;
  flex-shrink: 0;
}

.brand-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.weather-widget {
  background: #f1f8f3;
  border: 1px solid var(--border-highlight);
  border-radius: 12px;
  padding: 6px 12px;
  display: none; /* Hide by default, show when loaded */
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(43, 138, 73, 0.05);
  transition: var(--transition-smooth);
}

.weather-widget:hover {
  background: #e1efe5;
  transform: translateY(-1px);
}

.weather-icon {
  font-size: 0.95rem;
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: var(--accent-glow);
  border: 1px solid var(--accent);
  border-radius: var(--border-radius-md);
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--accent);
  font-size: 1.3rem;
  box-shadow: 0 0 15px var(--accent-glow);
}

.brand-title {
  font-size: 1.5rem;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.brand-tagline {
  font-size: 0.8rem;
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 2px;
}

/* Views Navigation system */
.views-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

.view {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow-y: auto;
  padding-right: 4px;
}

/* Custom Scrollbar for the panels */
.view::-webkit-scrollbar {
  width: 4px;
}

.view::-webkit-scrollbar-track {
  background: transparent;
}

.view::-webkit-scrollbar-thumb {
  background: rgba(0, 95, 33, 0.15);
  border-radius: 2px;
}

.view::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 95, 33, 0.35);
}

.view.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

/* VIEW 1: Trail List Styles */
.intro-section {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 24px;
  line-height: 1.45;
}

/* Search Bar Styles - Premium Refinement */
.search-section {
  margin-bottom: 22px;
  padding: 0 2px;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--accent);
  font-size: 0.95rem;
  opacity: 0.75;
  pointer-events: none;
}

#trail-search {
  width: 100%;
  padding: 13px 40px 13px 44px;
  border: 1px solid var(--border-light);
  border-radius: 30px; /* Pill shape for premium aesthetic */
  background: #f1f8f3; /* Light tint green background */
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 500;
  outline: none;
  transition: all 0.25s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.015);
}

#trail-search::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

#trail-search:focus {
  border-color: var(--accent-light);
  background: #ffffff;
  box-shadow: 0 4px 15px rgba(0, 95, 33, 0.06), inset 0 1px 2px rgba(0, 0, 0, 0.01);
}

.search-clear-btn {
  position: absolute;
  right: 14px;
  background: rgba(0, 95, 33, 0.06);
  border: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  transition: var(--transition-smooth);
  opacity: 0;
  pointer-events: none;
}

.search-clear-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

.search-clear-btn:hover {
  background: rgba(0, 95, 33, 0.15);
  color: var(--accent);
}

.section-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-section {
  margin-bottom: 24px;
  flex-shrink: 0;
}

/* One chip row: Barrierefrei toggle + POI category filters */
.poi-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.poi-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 5px 12px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.poi-btn i {
  font-size: 0.8rem;
}

.poi-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.poi-btn.active {
  background: rgba(43, 138, 73, 0.08);
  border-color: var(--accent-light);
  color: var(--accent);
}

.trail-list-section {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.trail-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Trail card: quiet card with the trail color as left edge */
.trail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-left: 4px solid var(--border-highlight);
  border-radius: var(--border-radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.trail-card:hover {
  background: var(--bg-card-hover);
}

.trail-card.selected {
  background: var(--bg-card-active);
  border-color: var(--accent);
  border-left-width: 4px;
}

.trail-card-info {
  min-width: 0;
}

.trail-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.trail-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trail-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 3px;
}

/* Skeletons */
.trail-skeleton-loader {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  height: 65px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: var(--border-radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: loading 1.5s infinite;
}

/* VIEW 2: Detail View Styles */
.back-btn {
  background: var(--border-light);
  border: 1px solid var(--border-highlight);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  padding: 10px 16px;
  border-radius: var(--border-radius-sm);
  align-self: flex-start;
  transition: var(--transition-smooth);
}

.back-btn:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--accent-light);
  box-shadow: 0 4px 12px rgba(43, 138, 73, 0.08);
}

.back-btn i {
  transition: var(--transition-smooth);
}

.back-btn:hover i {
  transform: translateX(-3px);
}

/* Hero: trail image with badge + title overlay.
   flex-shrink: 0 is required — .view is a flex column and would collapse the hero otherwise */
.detail-hero {
  position: relative;
  width: 100%;
  height: 190px;
  flex-shrink: 0;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  background-color: var(--bg-card-hover);
}

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

.detail-hero.no-image {
  height: 120px;
}

.detail-hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 14px 16px 12px;
  background: linear-gradient(transparent, rgba(10, 25, 15, 0.72));
}

.trail-badge {
  display: inline-block;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 20px;
  margin-bottom: 5px;
  letter-spacing: 0.05em;
}

.detail-title {
  font-size: 1.35rem;
  color: #ffffff;
  line-height: 1.2;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Inline stats row */
.stats-row {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 4px;
  padding: 10px 12px;
  margin-bottom: 16px;
  background: var(--bg-card-hover);
  border-radius: var(--border-radius-sm);
}

.stat-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.stat-item i {
  color: var(--accent-light);
  font-size: 0.85rem;
}

.detail-description-box {
  background: var(--bg-card);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  line-height: 1.5;
  border-top: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.detail-description-box p {
  margin-bottom: 8px;
}

.detail-description-box p:last-child {
  margin-bottom: 0;
}

.action-buttons-group {
  margin-bottom: 24px;
}

.action-btn {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--border-radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-smooth);
}

.flyover-btn {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 15px var(--accent-glow);
}

.flyover-btn:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
}

/* Secondary actions: share + GPX */
.secondary-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.secondary-action-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-highlight);
  border-radius: var(--border-radius-sm);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.secondary-action-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-light);
}

/* Elevation Chart Box */
.elevation-profile-section {
  display: flex;
  flex-direction: column;
  margin-top: 10px;
}

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

.elevation-hover-info {
  font-size: 0.72rem;
  color: var(--accent-light);
  font-weight: 500;
}

.elevation-profile-container {
  background: transparent;
  border: none;
  border-radius: var(--border-radius-md);
  height: 180px;
  width: 100%;
  position: relative;
  overflow: hidden;
  padding: 10px 0 0 0;
}

.chart-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  z-index: 5;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.chart-loading-overlay.hidden {
  opacity: 0;
}

.mini-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(46, 184, 114, 0.1);
  border-radius: 50%;
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* Elevation SVG details */
#elevation-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.elevation-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.elevation-area {
  fill: url(#chart-gradient);
}

.chart-axis {
  stroke: var(--border-light);
  stroke-width: 1;
}

.chart-text {
  fill: var(--text-muted);
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 500;
}

.chart-hover-line {
  stroke: var(--text-muted);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  pointer-events: none;
}

.chart-hover-dot {
  fill: #ffffff;
  stroke: var(--accent);
  stroke-width: 2;
  box-shadow: 0 0 10px rgba(0,0,0,0.5);
  pointer-events: none;
}

/* Footer Section / Basemap Toggler */
.panel-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 18px;
  flex-shrink: 0;
}

.settings-bar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.style-toggle-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.settings-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.style-switch {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  padding: 3px;
  gap: 2px;
}

.style-btn {
  background: transparent;
  border: none;
  border-radius: 16px;
  padding: 6px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.style-btn:hover {
  color: var(--text-primary);
}

.style-btn.active {
  background: var(--bg-panel-solid);
  color: var(--accent);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08), var(--shadow-inset);
}

/* ==========================================================================
   Flyover Custom HUD Controls (Overlay on the map)
   ========================================================================== */
.flyover-hud {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-highlight);
  border-radius: 24px;
  padding: 16px 24px;
  z-index: 100;
  box-shadow: var(--shadow-premium);
  display: flex;
  flex-direction: column;
  width: 440px;
  max-width: 90%;
  gap: 12px;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  pointer-events: auto;
}

.flyover-hud.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -20px);
}

.hud-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.hud-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.hud-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 12px;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: pulse 2s infinite;
}

#hud-trail-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.hud-stop-btn {
  background: rgba(18, 22, 20, 0.06);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.hud-stop-btn:hover {
  background: #db4436;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(219, 68, 54, 0.3);
}

.hud-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.hud-play-btn {
  background: var(--accent);
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px var(--accent-glow);
  flex-shrink: 0;
}

.hud-play-btn:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

.hud-slider-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.hud-time {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
  min-width: 32px;
}

.hud-time:first-of-type {
  text-align: right;
}

#hud-scrubber {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--border-highlight);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

#hud-scrubber::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}

#hud-scrubber::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

#hud-scrubber::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.1s ease;
}

#hud-scrubber::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.hud-speed-selector {
  display: flex;
  background: rgba(18, 22, 20, 0.04);
  border-radius: 12px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.speed-btn {
  background: transparent;
  border: none;
  border-radius: 10px;
  padding: 4px 8px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.speed-btn:hover {
  color: var(--text-primary);
}

.speed-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Control Panel Hidden transition during flyover */
.control-panel.flyover-hidden {
  transform: translateX(-420px);
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 768px) {
  /* !important: must also override the .half / .expanded snap positions */
  .control-panel.flyover-hidden {
    transform: translateY(100%) !important;
    opacity: 0;
    pointer-events: none;
  }
}

/* Flyover Hike Pointer Map Marker */
.flyover-position-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 10;
  pointer-events: none;
}

.flyover-position-marker i {
  font-size: 1.1rem;
  color: #db4436;
  background: #ffffff;
  border: 2px solid #db4436;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(219, 68, 54, 0.4);
}

.flyover-position-marker .marker-glow {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid #db4436;
  animation: marker-pulse 1.8s infinite ease-out;
  opacity: 0;
  pointer-events: none;
}

/* No Results Card styling */
.no-results-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-highlight);
  border-radius: var(--border-radius-md);
  padding: 24px 16px;
  text-align: center;
  margin-top: 12px;
}

.no-results-icon {
  font-size: 2.2rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  opacity: 0.6;
}

.no-results-title {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.no-results-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   Maplibre Overrides & Custom UI Elements (GPS dot / POI markers)
   ========================================================================== */

/* Overrides Maplibre's native controls */
.maplibregl-ctrl-top-right {
  top: 20px;
  right: 20px;
}

.maplibregl-ctrl-group {
  background: var(--bg-panel) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: 1px solid var(--border-light) !important;
  border-radius: var(--border-radius-md) !important;
  box-shadow: var(--shadow-premium) !important;
  overflow: hidden;
}

.maplibregl-ctrl-group button {
  width: 38px !important;
  height: 38px !important;
  background-color: transparent !important;
  border: none !important;
  transition: var(--transition-smooth);
}

.maplibregl-ctrl-group button span {
  filter: none; /* Keep original black icons on light buttons */
}

.maplibregl-ctrl-group button:hover {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

.maplibregl-ctrl-group button+button {
  border-top: 1px solid var(--border-light) !important;
}

/* Customize the native geolocate active state */
.maplibregl-ctrl-geolocate.maplibregl-ctrl-geolocate-active span {
  filter: invert(42%) sepia(93%) saturate(350%) hue-rotate(100deg) brightness(95%) contrast(85%) !important; /* Green geolocate */
}

/* Popup adjustments */
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--bg-panel-solid) !important; }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--bg-panel-solid) !important; }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg-panel-solid) !important; }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg-panel-solid) !important; }

.maplibregl-popup-content {
  background: var(--bg-panel-solid) !important;
  border: 1px solid var(--border-highlight) !important;
  border-radius: var(--border-radius-md) !important;
  padding: 14px 18px !important;
  box-shadow: var(--shadow-premium) !important;
  color: var(--text-primary) !important;
  max-width: 240px;
}

.maplibregl-popup-close-button {
  color: var(--text-secondary) !important;
  font-size: 1.1rem !important;
  top: 8px !important;
  right: 8px !important;
  padding: 4px !important;
  border-radius: 50% !important;
  line-height: 0.5 !important;
  transition: var(--transition-smooth);
}

.maplibregl-popup-close-button:hover {
  color: var(--text-primary) !important;
  background-color: rgba(255, 255, 255, 0.05) !important;
}

.popup-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--text-primary);
  padding-right: 14px;
}

.popup-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Custom Interactive POI Markers on the Map */
.custom-poi-marker {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  justify-content: center;
  align-items: center;
}

.marker-inner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 0.72rem;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
  transition: var(--transition-smooth);
}

.custom-poi-marker:hover {
  transform: scale(1.15);
  z-index: 5;
}

.custom-poi-marker:hover .marker-inner {
  background: #ffffff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35);
}

/* Category colors: muted, only on the icon itself */
.custom-poi-marker[data-category="restaurant"] .marker-inner { color: #b45d0e; }
.custom-poi-marker[data-category="bus"] .marker-inner { color: #a03a34; }
.custom-poi-marker[data-category="toilet"] .marker-inner { color: #0e6b80; }
.custom-poi-marker[data-category="fireplace"] .marker-inner { color: #a4700b; }
.custom-poi-marker[data-category="parking"] .marker-inner { color: #2f66a3; }

/* Prevent Maplibre from fading out markers when covered by 3D terrain on mobile */
.maplibregl-marker.maplibregl-marker-covered {
  opacity: 1 !important;
}

/* Custom Geolocate user marker styling (Pulse Dot) */
.user-gps-marker {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(46, 184, 114, 0.25);
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.user-gps-marker::before {
  content: '';
  width: 12px;
  height: 12px;
  background: var(--accent);
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-glow-intense);
}

.user-gps-marker::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  animation: marker-pulse 2s infinite ease-out;
  opacity: 0;
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes loading {
  100% { transform: translateX(100%); }
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(46, 184, 114, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(46, 184, 114, 0); }
  100% { box-shadow: 0 0 0 0 rgba(46, 184, 114, 0); }
}

@keyframes marker-pulse {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  30% {
    opacity: 0.7;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}

/* ==========================================================================
   Responsive Viewport Adaptations (Mobile Bottom Sheet Mode)
   ========================================================================== */
@media (max-width: 768px) {
  
  /* Sidebar transforms to bottom sheet drawer with three snap points */
  .control-panel {
    top: auto;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 88vh;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    border: none;
    border-top: 1px solid var(--border-light);
    box-shadow: 0 -10px 30px rgba(18, 22, 20, 0.08);
    transform: translateY(calc(100% - 96px)); /* Snap 1: Peek (handle + header) */
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  }

  .control-panel.half {
    transform: translateY(calc(100% - 45vh)); /* Snap 2: Half (map + list visible) */
  }

  .control-panel.expanded {
    transform: translateY(0); /* Snap 3: Full */
  }

  /* Show the mobile drag handle */
  .drag-handle {
    display: flex;
    flex-shrink: 0;
    height: 24px;
    z-index: 10;
  }

  .panel-content {
    padding: 0 20px 20px 20px;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  .panel-header {
    margin-bottom: 12px;
  }

  .brand-icon {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .brand-tagline {
    font-size: 0.75rem;
  }

  .intro-section {
    margin-bottom: 14px;
    font-size: 0.8rem;
  }

  .section-title {
    margin-bottom: 8px;
    font-size: 0.8rem;
  }

  .filter-section {
    margin-bottom: 16px;
  }

  .poi-btn,
  .barrierefrei-chip {
    padding: 4px 10px;
    font-size: 0.7rem;
  }

  .trail-card {
    padding: 10px 12px;
  }

  .trail-title {
    font-size: 0.88rem;
  }

  .trail-meta {
    font-size: 0.72rem;
  }

  /* Detail view mobile overrides */
  .back-btn {
    margin-bottom: 14px;
  }

  .detail-title {
    font-size: 1.15rem;
  }

  .detail-hero {
    height: 150px;
    margin-bottom: 12px;
  }

  .stats-row {
    padding: 8px 8px;
    margin-bottom: 12px;
  }

  .stat-item {
    font-size: 0.74rem;
    gap: 4px;
  }

  .detail-description-box {
    padding: 10px;
    font-size: 0.78rem;
    margin-bottom: 14px;
  }

  .action-btn {
    padding: 10px;
    font-size: 0.82rem;
  }

  .elevation-profile-container {
    height: 140px;
  }

  .panel-footer {
    padding-top: 12px;
    margin-top: 14px;
  }

  .style-toggle-container {
    flex-direction: row;
    justify-content: space-between;
  }

  /* Relocate map controls for mobile safe area */
  .maplibregl-ctrl-top-right {
    top: 12px;
    right: 12px;
  }

  .maplibregl-ctrl-group button {
    width: 34px !important;
    height: 34px !important;
  }

  /* Relocate HUD controls for mobile overlay */
  .flyover-hud {
    width: 90%;
    padding: 8px 16px;
  }

  .hud-content {
    width: 100%;
    justify-content: space-between;
    gap: 12px;
  }

  #hud-trail-name {
    font-size: 0.8rem;
  }
}

/* ==========================================================================
   New Components (Detail Image, Tabs, and Structured Info Blocks)
   ========================================================================== */

/* Tabs as segmented control */
.tabs-container {
  display: flex;
  flex-shrink: 0;
  background: var(--bg-card-hover);
  border-radius: 10px;
  padding: 3px;
  gap: 3px;
  margin-bottom: 18px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 7px 6px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: #ffffff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(18, 22, 20, 0.1);
}

/* Tab content view toggles */
.tab-content-wrapper {
  position: relative;
  width: 100%;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block;
}

/* Info content sections */
.info-block {
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px dashed var(--border-light);
}

.info-block:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.info-block-title {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.info-block-content {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.info-block-content p {
  margin-bottom: 8px;
}

.info-block-content p:last-child {
  margin-bottom: 0;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.accessibility-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  background-color: var(--border-light);
  border-radius: 50%;
  color: var(--accent-light);
  font-size: 0.65rem;
  margin-left: 4px;
  vertical-align: middle;
  border: 1px solid var(--border-highlight);
}

/* Floating Back Button (Mobile Only) */
.floating-back-btn {
  position: absolute;
  top: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(18, 22, 20, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 10;
  transition: var(--transition-smooth);
}

.floating-back-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 22, 20, 0.18);
}

.floating-back-btn.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.8) translateY(-10px);
}

/* Floating Map Style Widget */
.map-style-widget {
  position: absolute;
  z-index: 10;
  transition: var(--transition-smooth);
}

.style-layer-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-highlight);
  color: var(--text-primary);
  box-shadow: 0 6px 20px rgba(18, 22, 20, 0.12);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.style-layer-btn:hover {
  background-color: var(--bg-card-hover);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(18, 22, 20, 0.18);
}

/* Popover Panel styling */
.style-popover {
  position: absolute;
  background-color: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-highlight);
  border-radius: var(--border-radius-md);
  padding: 16px;
  box-shadow: 0 10px 30px rgba(18, 22, 20, 0.15);
  width: 235px;
  z-index: 20;
  transition: var(--transition-smooth);
}

.style-popover.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
}

.popover-title {
  font-family: var(--font-heading);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.popover-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.popover-opt-btn {
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: center;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.popover-opt-btn span {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.opt-preview {
  width: 72px;
  height: 52px;
  border-radius: var(--border-radius-sm);
  background-color: var(--border-light);
  border: 2px solid transparent;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.style-icon-svg {
  width: 24px;
  height: 24px;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

/* Active & Hover States */
.popover-opt-btn.active .opt-preview {
  background-color: var(--accent-glow);
  border-color: var(--accent-light);
}

.popover-opt-btn.active .style-icon-svg {
  color: var(--accent);
  transform: scale(1.1);
}

.popover-opt-btn.active span {
  color: var(--accent);
}

.popover-opt-btn:hover .opt-preview {
  background-color: var(--accent-glow-intense);
  border-color: var(--border-highlight);
}

.popover-opt-btn:hover .style-icon-svg {
  color: var(--accent-light);
}

/* Custom 2D/3D Maplibre Control Button */
.ctrl-dimension-btn {
  display: flex;
  justify-content: center;
  align-items: center;
}

.dimension-btn-text {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.72rem;
  color: var(--text-primary);
  transition: var(--transition-smooth);
}

.ctrl-dimension-btn:hover .dimension-btn-text {
  color: var(--accent);
}

/* Mobile Placement vs Desktop Placement for the Widget and Popover */
@media (max-width: 768px) {
  .map-style-widget {
    top: 20px;
    left: 20px;
  }
  
  /* Shift widget to the right if the floating back button is active on mobile */
  body.trail-selected .map-style-widget {
    transform: translateX(60px);
  }
  
  .style-popover {
    top: 60px;
    left: 0;
    transform-origin: top left;
  }
}

@media (min-width: 769px) {
  .floating-back-btn {
    display: none !important; /* Never show floating back on desktop */
  }

  .map-style-widget {
    bottom: 24px;
    right: 24px;
  }
  
  .style-popover {
    bottom: 60px;
    right: 0;
    transform-origin: bottom right;
  }
}

/* Start flag & km markers of the selected trail */
.trail-start-marker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 8px rgba(18, 22, 20, 0.3);
  white-space: nowrap;
  cursor: default;
}

.trail-km-marker {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid var(--accent-light);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(18, 22, 20, 0.25);
  cursor: default;
}

/* Pulsing Stroller Warning Marker */
.stroller-warning-marker {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #e74c3c; /* Red warning color */
  border: 2px solid white;
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  z-index: 5;
  transition: var(--transition-smooth);
  animation: pulseWarning 2s infinite;
}

.stroller-warning-marker:hover {
  transform: scale(1.15);
  background-color: #c0392b;
}

.stroller-warning-marker i {
  font-size: 0.85rem;
}

@keyframes pulseWarning {
  0% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(231, 76, 60, 0); }
  100% { box-shadow: 0 0 0 0 rgba(231, 76, 60, 0); }
}

/* Premium Popover Toggle Switch Styles */
.popover-divider {
  height: 1px;
  background-color: var(--border-light);
  margin: 12px 0 8px 0;
}

.popover-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}

.toggle-label {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.toggle-label i {
  font-size: 0.85rem;
  color: var(--accent-light);
  width: 14px;
  text-align: center;
}

/* The switch - container */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 20px;
  flex-shrink: 0;
}

/* Hide default checkbox */
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

/* The slider track */
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--border-light);
  border: 1px solid var(--border-highlight);
  transition: var(--transition-smooth);
}

/* The knob */
.slider:before {
  position: absolute;
  content: "";
  height: 14px;
  width: 14px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: var(--transition-smooth);
}

/* Checked states */
input:checked + .slider {
  background-color: var(--accent);
  border-color: var(--accent-light);
}

input:checked + .slider:before {
  transform: translateX(18px);
}

/* Rounded sliders */
.slider.round {
  border-radius: 20px;
}

.slider.round:before {
  border-radius: 50%;
}

/* ==========================================================================
   Barrierefrei Mode: Chip, Legend, Trail List Badges, Detail Toggle
   ========================================================================== */

/* Barrierefrei chip: sits in the same row as the POI filters, amber when active */
.barrierefrei-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 20px;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.barrierefrei-chip i {
  font-size: 0.8rem;
}

.barrierefrei-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.barrierefrei-chip.active {
  background: rgba(255, 159, 0, 0.1);
  border-color: #ff9f00;
  color: #b36f00;
}

/* Accessibility status badges on trail cards */
.access-badge {
  flex-shrink: 0;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.access-badge.hidden {
  display: none;
}

.access-badge-ok {
  background: rgba(43, 138, 73, 0.1);
  color: var(--accent);
}

.access-badge-warning {
  background: rgba(255, 159, 0, 0.12);
  color: #b36f00;
}

.access-badge-blocked {
  background: rgba(231, 76, 60, 0.1);
  color: #c0392b;
}

/* Map legend (visible only while Barrierefrei mode is active) */
.map-legend {
  position: absolute;
  z-index: 10;
  background: var(--bg-panel);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-premium);
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  color: var(--text-secondary);
  pointer-events: none;
}

.map-legend.hidden {
  display: none;
}

.legend-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 0;
}

.legend-line {
  display: inline-block;
  width: 22px;
  height: 0;
  border-top-width: 3px;
  border-top-color: #e74c3c;
}

.legend-line-blocked {
  border-top-style: dashed;
  border-top-color: #e74c3c;
}

.legend-line-detour {
  border-top-style: solid;
  border-top-color: #ff9f00;
}

.legend-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e74c3c;
  color: #ffffff;
  font-size: 0.55rem;
  flex-shrink: 0;
  margin-left: 3px;
  margin-right: 3px;
}

@media (min-width: 769px) {
  .map-legend {
    right: 24px;
    bottom: 90px;
  }
}

@media (max-width: 768px) {
  .map-legend {
    left: 20px;
    top: 80px;
  }
}

/* Detail view Barrierefrei toggle box (previously inline styles) */
.stroller-mode-section {
  margin-bottom: 20px;
  padding: 15px;
  background: rgba(255, 159, 0, 0.1);
  border-radius: var(--border-radius-md);
  border: 1px solid rgba(255, 159, 0, 0.2);
}

.stroller-mode-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.stroller-mode-title {
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.stroller-mode-desc {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Fallback: solid surfaces when the browser does not support backdrop-filter */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .control-panel,
  .map-legend,
  .style-popover,
  .style-layer-btn,
  .floating-back-btn,
  .flyover-hud {
    background: var(--bg-panel-solid);
    background-color: var(--bg-panel-solid);
  }
}

