/* public/css/trails.css — MTB Trails page */

/* ── Reset & Variables (mirrors app.css) ───────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --clr-bg:        #0f1117;
  --clr-surface:   #1a1d27;
  --clr-surface2:  #22263a;
  --clr-border:    #2e3347;
  --clr-text:      #e8ecf4;
  --clr-muted:     #7a8099;
  --clr-accent:    #4f9dff;
  --clr-mtb:       #22c55e;

  --clr-black-trail:  #ef4444;
  --clr-red-trail:    #f59e0b;
  --clr-blue-trail:   #4f9dff;
  --clr-green-trail:  #22c55e;

  --radius:   10px;
  --shadow:   0 4px 24px rgba(0,0,0,.45);
  --header-h: 56px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--clr-bg);
  color: var(--clr-text);
  min-height: 100vh;
  padding-top: var(--header-h);
}

/* ── Header (identical to app.css) ─────────────────────────────── */
.app-header {
  height: var(--header-h);
  background: var(--clr-surface);
  border-bottom: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 1000;
}
.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo svg { display: block; }

.header-back {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--clr-muted);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--clr-border);
  transition: color .15s, border-color .15s;
}
.header-back:hover { color: var(--clr-text); border-color: var(--clr-accent); }

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

/* ── Page wrapper ───────────────────────────────────────────────── */
.trails-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 60px;
}

/* ── Hero ───────────────────────────────────────────────────────── */
.location-hero {
  margin-bottom: 32px;
}
.hero-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--clr-muted);
  margin-bottom: 10px;
}
.hero-breadcrumb a { color: var(--clr-muted); text-decoration: none; }
.hero-breadcrumb a:hover { color: var(--clr-accent); }
.hero-breadcrumb .sep { opacity: .4; }

.hero-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.hero-title {
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: -.5px;
}
.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 12px;
  border-radius: 99px;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.chip-mtb {
  background: rgba(34,197,94,.15);
  color: var(--clr-mtb);
  border: 1px solid rgba(34,197,94,.3);
}
.chip-country {
  background: var(--clr-surface2);
  color: var(--clr-muted);
  border: 1px solid var(--clr-border);
}

.hero-subtitle {
  margin-top: 6px;
  font-size: .88rem;
  color: var(--clr-muted);
}

/* ── Park status badge ──────────────────────────────────────────── */
.park-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 14px 5px 10px;
  border-radius: 99px;
  border: 1px solid;
  font-size: .78rem;
  font-weight: 700;
  margin-left: auto;
}
.park-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.park-status-detail {
  font-weight: 400;
  opacity: .75;
}

.park-status--open {
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.35);
  color: #4ade80;
}
.park-status--open .park-status-dot {
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74,222,128,.7);
  animation: status-pulse 2s ease-in-out infinite;
}

.park-status--partial {
  background: rgba(134,239,172,.12);
  border-color: rgba(134,239,172,.35);
  color: #86efac;
}
.park-status--partial .park-status-dot {
  background: #86efac;
  box-shadow: 0 0 6px rgba(134,239,172,.6);
  animation: status-pulse 2s ease-in-out infinite;
}

.park-status--closed {
  background: rgba(239,68,68,.08);
  border-color: rgba(239,68,68,.25);
  color: #f87171;
}
.park-status--closed .park-status-dot { background: #f87171; }

.park-status--unknown {
  background: var(--clr-surface2);
  border-color: var(--clr-border);
  color: var(--clr-muted);
}
.park-status--unknown .park-status-dot { background: var(--clr-muted); }

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .4; }
}

/* ── Main grid ──────────────────────────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  margin-bottom: 28px;
  align-items: start;
}

/* Left column: season dates + 3D map + photos, all same width */
.left-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
}

/* ── Slideshow ──────────────────────────────────────────────────── */
.slideshow-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  overflow: hidden;
}
.slideshow-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #0d1117;
  overflow: hidden;
}
.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .5s ease;
}
.slide.active { opacity: 1; }
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--clr-muted);
  font-size: .85rem;
  background: var(--clr-surface2);
}
.slide-placeholder svg { opacity: .3; }

.slide-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 16px 12px;
  background: linear-gradient(transparent, rgba(0,0,0,.7));
  font-size: .8rem;
  color: #fff;
  opacity: .9;
}

/* Prev / Next buttons */
.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,.5);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 50%;
  width: 38px; height: 38px;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
  z-index: 10;
}
.slide-btn:hover { background: rgba(0,0,0,.8); }
.slide-btn-prev { left: 12px; }
.slide-btn-next { right: 12px; }

/* Dot indicators */
.slideshow-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
}
.slide-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}
.slide-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--clr-border);
  cursor: pointer;
  transition: background .2s, transform .2s;
  border: none;
  padding: 0;
}
.slide-dot.active {
  background: var(--clr-accent);
  transform: scale(1.3);
}
.slide-counter {
  font-size: .75rem;
  color: var(--clr-muted);
}

/* ── Info sidebar ───────────────────────────────────────────────── */
.info-stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.info-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 18px;
}
.info-card-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 14px;
}

/* Location overview map */
.info-card-locmap { padding: 14px 16px; }
.info-card-locmap .info-card-title { margin-bottom: 8px; }
.location-map {
  height: 190px;
  border-radius: 6px;
  overflow: hidden;
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.stat-item {
  background: var(--clr-surface2);
  border-radius: 8px;
  padding: 11px 12px;
  text-align: center;
}
.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--clr-text);
  line-height: 1.1;
}
.stat-value.accent { color: var(--clr-accent); }
.stat-value.mtb { color: var(--clr-mtb); }
.stat-label {
  font-size: .65rem;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-top: 3px;
}
.trail-status-img-wrap {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--clr-border);
  margin-top: 8px;
}
.trail-status-img-label {
  font-size: .68rem;
  color: var(--clr-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.trail-status-img {
  display: block;
  max-width: 100%;
  border-radius: 6px;
  background: #d1d5db;
  padding: 8px;
}

/* Difficulty breakdown */
.difficulty-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.diff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .82rem;
}
.diff-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.diff-dot.black { background: var(--clr-black-trail); }
.diff-dot.red   { background: var(--clr-red-trail); }
.diff-dot.blue  { background: var(--clr-blue-trail); }
.diff-dot.green { background: var(--clr-green-trail); }

.diff-label { flex: 1; color: var(--clr-muted); }
.diff-bar-wrap { width: 80px; background: var(--clr-surface2); border-radius: 99px; height: 5px; }
.diff-bar { height: 5px; border-radius: 99px; }
.diff-bar.black { background: var(--clr-black-trail); }
.diff-bar.red   { background: var(--clr-red-trail); }
.diff-bar.blue  { background: var(--clr-blue-trail); }
.diff-bar.green { background: var(--clr-green-trail); }
.diff-count { font-size: .78rem; font-weight: 700; width: 22px; text-align: right; }

/* Key info list */
.key-info-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.key-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .83rem;
}
.key-info-icon { font-size: 1rem; width: 24px; text-align: center; flex-shrink: 0; }
.key-info-label { color: var(--clr-muted); flex: 1; }
.key-info-value { font-weight: 600; }

/* ── Season dates card ──────────────────────────────────────────── */
.season-dates-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  overflow: hidden;
}

.season-dates-header {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--clr-border);
}
.season-dates-icon { font-size: 1.05rem; }
.season-dates-title {
  font-size: .95rem;
  font-weight: 700;
}

.season-dates-list {
  display: flex;
  flex-direction: column;
}

.season-date-entry {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--clr-border);
}
.season-date-entry:last-child { border-bottom: none; }

.sde-indicator {
  width: 4px;
  border-radius: 99px;
  flex-shrink: 0;
  margin-top: 2px;
  align-self: stretch;
  min-height: 20px;
}
.sde-type-main_season .sde-indicator { background: var(--clr-mtb); }
.sde-type-partial     .sde-indicator { background: #86efac; }
.sde-type-special     .sde-indicator { background: var(--clr-accent); }

.sde-body { display: flex; flex-direction: column; gap: 4px; flex: 1; }

.sde-label {
  font-size: .88rem;
  font-weight: 700;
  color: var(--clr-text);
}
.sde-type-main_season .sde-label { color: var(--clr-mtb); }
.sde-type-partial     .sde-label { color: #86efac; }
.sde-type-special     .sde-label { color: var(--clr-accent); }

.sde-range {
  font-size: .83rem;
  color: var(--clr-text);
  font-weight: 500;
}
.sde-planned {
  font-size: .74rem;
  color: var(--clr-muted);
  font-weight: 400;
}

.sde-notes {
  font-size: .78rem;
  color: var(--clr-muted);
  line-height: 1.55;
  margin-top: 2px;
}

.season-dates-empty {
  padding: 24px 20px;
  font-size: .85rem;
  color: var(--clr-muted);
}

/* Shared form controls (reused from lifts panel style) */
.lp-btn {
  background: #1e3a5f; border: none; color: #93c5fd;
  padding: .45rem 1rem; border-radius: 6px; font-size: .8rem;
  cursor: pointer; font-family: inherit; transition: background .15s;
}
.lp-btn:hover { background: #1d4ed8; color: #fff; }
.lp-btn:disabled { opacity: .5; cursor: default; }
.lp-btn.secondary { background: #0f172a; color: #475569; border: 1px solid #1e293b; }
.lp-btn.secondary:hover { background: #1e293b; color: #94a3b8; }
.lp-input, .lp-select {
  background: #0f172a; border: 1px solid #1e293b;
  border-radius: 6px; color: #e2e8f0; padding: .38rem .6rem;
  font-size: .8rem; font-family: inherit; box-sizing: border-box;
}
.lp-input:focus, .lp-select:focus { outline: none; border-color: #3b82f6; }
.lp-select option { background: #0f172a; }

/* Edit button in season-dates header */
.sde-edit-btn {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-muted);
  border-radius: 5px;
  padding: .22rem .6rem;
  font-size: .72rem;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
}
.sde-edit-btn:hover { color: #93c5fd; border-color: #3b82f6; }

/* Report wrong data button */
.rwd-btn {
  background: transparent;
  border: 1px solid var(--clr-border);
  color: var(--clr-muted);
  border-radius: 5px;
  padding: .22rem .65rem;
  font-size: .72rem;
  cursor: pointer;
  font-family: inherit;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.rwd-btn:hover { color: #fbbf24; border-color: #f59e0b; }

/* Report wrong data modal */
.rwd-modal { width: min(520px, 96vw); }
.rwd-body { gap: .85rem; }
.rwd-radio-group {
  display: flex; flex-direction: column; gap: .55rem;
  background: #0d1625; border: 1px solid #1e293b;
  border-radius: 7px; padding: .7rem .85rem;
}
.rwd-radio-label {
  display: flex; align-items: flex-start; gap: .55rem;
  font-size: .82rem; color: #cbd5e1; cursor: pointer; line-height: 1.4;
}
.rwd-radio-label input[type=radio] {
  margin-top: .17rem; accent-color: #3b82f6; flex-shrink: 0;
}
.rwd-station-input { width: 100%; }
.rwd-textarea {
  width: 100%; min-height: 130px; resize: vertical;
  background: #0f172a; border: 1px solid #1e293b;
  border-radius: 6px; color: #e2e8f0; padding: .5rem .65rem;
  font-size: .82rem; font-family: inherit; box-sizing: border-box;
  transition: border-color .15s;
}
.rwd-textarea:focus { outline: none; border-color: #3b82f6; }
.rwd-char-count {
  display: block; text-align: right;
  font-size: .7rem; color: #475569; margin-top: .2rem;
}
.rwd-char-count.rwd-near-limit { color: #f59e0b; }

/* Season dates edit modal */
.sde-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.65);
  z-index: 9000; display: flex; align-items: center; justify-content: center;
}
.sde-overlay.hidden { display: none; }
.sde-modal {
  background: #0f172a; border: 1px solid #1e293b; border-radius: 10px;
  width: min(560px, 96vw); max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,.7);
}
.sde-modal-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .85rem 1rem; border-bottom: 1px solid #1e293b;
  flex-shrink: 0;
}
.sde-modal-title { font-size: .88rem; font-weight: 700; color: #e2e8f0; flex: 1; }
.sde-modal-close {
  background: none; border: none; color: #475569;
  font-size: 1.1rem; cursor: pointer; padding: 0; line-height: 1;
}
.sde-modal-close:hover { color: #e2e8f0; }
.sde-modal-body {
  padding: .85rem 1rem; overflow-y: auto; flex: 1;
  display: flex; flex-direction: column; gap: .6rem;
}
.sde-modal-footer {
  padding: .75rem 1rem; border-top: 1px solid #1e293b;
  display: flex; gap: .5rem; align-items: center; flex-shrink: 0;
}

/* Modal row */
.sde-erow {
  background: #0d1625; border: 1px solid #1e293b;
  border-radius: 7px; padding: .65rem .75rem;
  display: flex; flex-direction: column; gap: .45rem;
}
.sde-erow-top { display: flex; gap: .5rem; align-items: flex-start; }
.sde-drag-handle {
  cursor: grab;
  color: #2a3347;
  font-size: 1rem;
  flex-shrink: 0;
  user-select: none;
  padding: .15rem .1rem;
  transition: color .15s;
  line-height: 1.2;
  margin-top: 2px;
}
.sde-drag-handle:hover { color: #64748b; }
.sde-drag-handle:active { cursor: grabbing; }
.sde-erow.is-dragging { opacity: .35; }
.sde-erow.drag-over-above { box-shadow: 0 -2px 0 #3b82f6; }
.sde-erow.drag-over-below { box-shadow: 0 2px 0 #3b82f6; }
.sde-erow-dates {
  display: flex; gap: .45rem; align-items: center; flex-wrap: wrap;
}
.sde-erow-dates span { color: #475569; font-size: .8rem; }
.sde-planned-lbl {
  display: flex; align-items: center; gap: .3rem;
  font-size: .72rem; color: #64748b; cursor: pointer; white-space: nowrap;
}
.sde-remove-btn {
  margin-left: auto; background: none; border: none;
  color: #475569; font-size: 1rem; cursor: pointer;
  padding: .1rem .3rem; flex-shrink: 0; line-height: 1;
}
.sde-remove-btn:hover { color: #ef4444; }
.sde-add-row-btn {
  background: none; border: 1px dashed #2a3347; color: #475569;
  border-radius: 6px; padding: .55rem; font-size: .78rem;
  cursor: pointer; text-align: center; font-family: inherit;
  transition: color .15s, border-color .15s; flex-shrink: 0;
}
.sde-add-row-btn:hover { color: #93c5fd; border-color: #3b82f6; }
.sde-status-msg { font-size: .75rem; color: #64748b; margin-left: .25rem; }

/* ── Photos (slideshow) section ─────────────────────────────────── */
.slideshow-section {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  overflow: hidden;
}
.slideshow-section .slideshow-card {
  border-radius: 0;
  border: none;
}

/* ── Trail Conditions section ───────────────────────────────────── */
.cond-section {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
}

.cond-ts {
  font-size: .72rem;
  color: var(--clr-muted);
}

.cond-refresh-btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-family: inherit;
  color: var(--clr-muted);
  background: transparent;
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  padding: 4px 9px;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  line-height: 1;
  white-space: nowrap;
}
.cond-refresh-btn:hover { color: var(--clr-text); border-color: var(--clr-muted); }
.cond-refresh-btn:disabled { opacity: .45; cursor: default; }
.cond-refresh-btn .crb-icon {
  font-size: .95rem;
  line-height: 1;
  display: inline-block;
}
.cond-refresh-btn.spinning .crb-icon { animation: spin360 .9s linear infinite; }
@keyframes spin360 { to { transform: rotate(360deg); } }

/* Notice popup — mirrors the Leaflet popup card style */
.cond-refresh-notice {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 240px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: var(--clr-text);
  z-index: 100;
}
/* Tip arrow pointing up toward the button */
.cond-refresh-notice::before {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 14px;
  border: 7px solid transparent;
  border-bottom-color: var(--clr-border);
}
.cond-refresh-notice::after {
  content: '';
  position: absolute;
  bottom: 100%;
  right: 15px;
  border: 6px solid transparent;
  border-bottom-color: var(--clr-surface);
}
.crn-body { padding: 12px 14px; }
.crn-msg {
  font-size: .78rem;
  color: var(--clr-muted);
  line-height: 1.45;
  margin: 0 0 10px;
}
.crn-ok-btn {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  text-align: center;
  padding: 5px;
  background: var(--clr-surface2);
  border: none;
  border-radius: 6px;
  font-size: .78rem;
  color: var(--clr-accent);
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.crn-ok-btn:hover { background: var(--clr-border); }

.cond-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cond-empty {
  padding: 24px 20px;
  color: var(--clr-muted);
  font-size: .85rem;
  text-align: center;
}

.cond-score-note {
  margin: 10px 20px 4px;
  padding: 10px 14px;
  background: rgba(255,255,255,.04);
  border-left: 3px solid var(--clr-muted, #7a8099);
  border-radius: 0 6px 6px 0;
  font-size: .78rem;
  color: var(--clr-muted, #7a8099);
  line-height: 1.5;
}
.cond-score-note-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .85;
}
.cond-score-note-link:hover { opacity: 1; }

/* Trail Conditions info tooltip */
.tc-info-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.tc-info-btn {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--clr-muted, #7a8099);
  background: transparent;
  color: var(--clr-muted, #7a8099);
  font-size: .68rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color .15s, color .15s;
  padding: 0;
}
.tc-info-btn:hover,
.tc-info-btn.active {
  border-color: var(--clr-accent, #4aaca7);
  color: var(--clr-accent, #4aaca7);
}
.tc-info-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  background: var(--clr-surface, #252733);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: .78rem;
  font-weight: 400;
  color: var(--clr-muted, #7a8099);
  line-height: 1.55;
  width: 290px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  white-space: normal;
}
.tc-info-tooltip-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tc-info-tooltip-link:hover { opacity: .8; }

/* Score + breakdown row */
.cond-panel {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Left: score ring */
.cond-score-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 108px;
  flex-shrink: 0;
  text-align: center;
}

.cond-score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: 3px solid;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.cond-score-num {
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.cond-score-sub {
  font-size: .58rem;
  color: var(--clr-muted);
}

.cond-quality-label {
  font-size: .78rem;
  font-weight: 700;
}

.cond-summary-text {
  font-size: .68rem;
  color: var(--clr-muted);
  line-height: 1.4;
}

/* Right: breakdown bars */
.cond-breakdown-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.cond-bar-row {
  display: grid;
  grid-template-columns: 88px 1fr 26px;
  align-items: center;
  gap: 8px;
}

.cond-bar-label {
  font-size: .71rem;
  color: var(--clr-muted);
  white-space: nowrap;
}

.cond-bar-track {
  height: 5px;
  background: var(--clr-surface2);
  border-radius: 99px;
  overflow: hidden;
}

.cond-bar-fill {
  height: 100%;
  border-radius: 99px;
}

.cond-bar-num {
  font-size: .68rem;
  color: var(--clr-muted);
  text-align: right;
}

/* Last 3 observations */
/* Slideshow wrapper */
.cond-obs-wrap {
  display: flex;
  align-items: stretch;
  gap: 6px;
  margin-top: 2px;
}
.cond-obs-viewport {
  flex: 1;
  min-width: 0;
  /* overflow toggled to hidden via JS only during slide animation */
}
.cond-obs-track {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.cond-obs-arrow {
  flex-shrink: 0;
  width: 22px;
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  color: var(--clr-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s, opacity .15s;
  padding: 0;
  user-select: none;
}
.cond-obs-arrow:hover:not(:disabled) {
  background: var(--clr-border);
  color: var(--clr-text);
}
.cond-obs-arrow:disabled {
  opacity: .18;
  cursor: default;
}

.cond-obs-card {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 10px;
  padding: 12px 14px;
  position: relative;
  transition: transform .2s ease, box-shadow .2s ease;
}
.cond-obs-card:hover {
  transform: scale(1.04) translateY(-3px);
  box-shadow: 0 10px 28px rgba(0,0,0,.45);
  z-index: 2;
}

.cond-obs-card--latest {
  border-color: rgba(79,157,255,.4);
  background: rgba(79,157,255,.05);
}

.cond-obs-header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 7px;
}

.cond-obs-time {
  font-size: .67rem;
  color: var(--clr-muted);
}

.cond-obs-badge {
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  background: rgba(79,157,255,.15);
  color: var(--clr-accent);
  border: 1px solid rgba(79,157,255,.3);
  padding: 1px 5px;
  border-radius: 4px;
}

.cond-obs-score {
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -1px;
}

.cond-obs-label {
  font-size: .7rem;
  font-weight: 600;
  margin-top: 2px;
  margin-bottom: 7px;
}

.cond-obs-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  font-size: .67rem;
  color: var(--clr-muted);
  margin-bottom: 6px;
}

.cond-obs-summary {
  font-size: .67rem;
  color: var(--clr-muted);
  line-height: 1.35;
}

@media (max-width: 560px) {
  .cond-panel { flex-direction: column; align-items: flex-start; }
  .cond-score-col { flex-direction: row; width: 100%; align-items: center; text-align: left; }
  .cond-obs-track { grid-template-columns: 1fr; }
}

/* ── Section shared styles ──────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--clr-border);
}
.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .95rem;
  font-weight: 700;
}
.section-title-icon { font-size: 1.1rem; }

/* ── Bikepark index grid ────────────────────────────────────────── */
/* ── Bikepark index filters ────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 14px 16px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
}
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 130px;
}
.filter-group label {
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--clr-muted);
}
.filter-group select {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  color: var(--clr-text);
  font-size: .82rem;
  padding: 6px 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 26px;
}
.filter-group select:focus {
  outline: none;
  border-color: var(--clr-accent);
}
.filter-group select.filter-active {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}
.filter-group--search {
  min-width: 160px;
  flex: 1.4;
}
.filter-group input[type="text"] {
  background: var(--clr-surface2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%237a8099' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  color: var(--clr-text);
  font-size: .82rem;
  padding: 6px 10px 6px 30px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s;
}
.filter-group input[type="text"]::placeholder {
  color: var(--clr-muted);
  font-style: italic;
}
.filter-group input[type="text"]:focus {
  outline: none;
  border-color: var(--clr-accent);
}
.filter-group input[type="text"].filter-active {
  border-color: var(--clr-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%234f9dff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E");
}
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-end;
  justify-content: flex-end;
  align-self: flex-end;
  padding-bottom: 1px;
}
.filter-reset-btn {
  background: none;
  border: 1px solid var(--clr-border);
  border-radius: 6px;
  color: var(--clr-muted);
  font-size: .78rem;
  padding: 6px 12px;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color .15s, color .15s;
}
.filter-reset-btn:hover {
  border-color: var(--clr-accent);
  color: var(--clr-accent);
}
.filter-count {
  font-size: .7rem;
  color: var(--clr-muted);
  white-space: nowrap;
}
.bikepark-index-card[hidden] { display: none; }
.filter-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: var(--clr-muted);
  font-size: .9rem;
}

.bikepark-index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.bikepark-index-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: border-color .15s, background .15s;
  color: var(--clr-text);
}
.bikepark-index-card:hover {
  border-color: var(--clr-accent);
  background: var(--clr-surface2);
}

/* Logo banner at the top of index cards that have one */
.bic-logo-wrap {
  margin: -16px -18px 12px;
  height: 80px;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid var(--clr-border);
}
.bic-logo {
  height: 64px;
  width: auto;
  object-fit: contain;
}

.bic-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  gap: 8px;
}
.bic-name {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.2;
}
.bic-country {
  font-size: .72rem;
  color: var(--clr-muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bic-flag {
  font-size: .95rem;
}
.bic-type-badge {
  font-size: .6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
  color: var(--clr-muted);
  border: 1px solid var(--clr-border);
  border-radius: 4px;
  padding: 1px 5px;
}
.bic-location {
  font-size: .78rem;
  color: var(--clr-muted);
  margin-bottom: 10px;
}
.bic-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}
.bic-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bic-stats span {
  font-size: .72rem;
  background: var(--clr-surface2);
  color: var(--clr-muted);
  border: 1px solid var(--clr-border);
  border-radius: 99px;
  padding: 2px 9px;
}

/* ── Card score row ─────────────────────────────────────────────── */
.bic-score-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 0 6px;
  border-top: 1px solid var(--clr-border);
  margin-bottom: 6px;
}
.bic-score-num {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.bic-score-label {
  font-size: .75rem;
  font-weight: 600;
}
.bic-score-no-data {
  font-size: .75rem;
  color: var(--clr-muted);
}

/* ── Card status badge ──────────────────────────────────────────── */
.bic-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.bic-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bic-status--open   .bic-status-dot { background: #22c55e; }
.bic-status--partial .bic-status-dot { background: #86efac; }
.bic-status--closed .bic-status-dot { background: #ef4444; }
.bic-status--unknown .bic-status-dot { background: #6b7280; }

.bic-status--open    .bic-status-label { color: #22c55e; }
.bic-status--partial .bic-status-label { color: #86efac; }
.bic-status--closed  .bic-status-label { color: #ef4444; }
.bic-status--unknown .bic-status-label { color: #6b7280; }

.bic-status-detail {
  font-weight: 400;
  color: var(--clr-muted);
  font-size: .68rem;
}

/* ── Hero logo (bikepark detail page) ───────────────────────────── */
.hero-logo {
  height: 56px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
}

/* ── Notice card ────────────────────────────────────────────────── */
.notice-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: .88rem;
  color: var(--clr-muted);
  margin-bottom: 20px;
}
.notice-card a { color: var(--clr-accent); }

/* ── Description card ───────────────────────────────────────────── */
.bikepark-desc {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--clr-muted);
}

/* ── Key info link ──────────────────────────────────────────────── */
.key-info-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--clr-accent);
  text-decoration: none;
}
.key-info-link:hover { text-decoration: underline; }


/* ── 3D Trail Map section ───────────────────────────────────────── */
.trail3d-section {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  overflow: hidden;
}

/* Legend bar */
.trail3d-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--clr-border);
  min-height: 0;
  background: var(--clr-surface2);
}
.trail3d-legend:empty { display: none; }

.trail3d-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .8rem;
  user-select: none;
  transition: opacity .15s;
}
.trail3d-legend-item:hover { opacity: .75; }

.trail3d-legend-swatch {
  display: inline-block;
  width: 22px;
  height: 4px;
  border-radius: 99px;
  flex-shrink: 0;
}
.trail3d-legend-name { color: var(--clr-text); font-weight: 500; }

.trail3d-legend-badge {
  padding: 1px 7px;
  border-radius: 99px;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.diff-black { background: rgba(239,68,68,.15);  color: #ef4444; }
.diff-red   { background: rgba(249,115,22,.15); color: #f97316; }
.diff-blue  { background: rgba(79,157,255,.15); color: #4f9dff; }
.diff-green { background: rgba(34,197,94,.15);  color: #22c55e; }

/* Map canvas */
.trail3d-map {
  height: 560px;
  width: 100%;
  background: #0d1117;
}

/* "No trails yet" placeholder */
.trail3d-empty {
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--clr-muted);
  font-size: .85rem;
}
.trail3d-empty svg { opacity: .25; }

/* Override MapLibre popup to match dark theme */
.maplibregl-popup-content {
  background: var(--clr-surface2) !important;
  color: var(--clr-text) !important;
  border: 1px solid var(--clr-border) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow) !important;
  padding: 8px 12px !important;
  font-family: var(--font) !important;
  font-size: .83rem !important;
}
.maplibregl-popup-tip {
  border-top-color: var(--clr-surface2) !important;
  border-bottom-color: var(--clr-surface2) !important;
}
.maplibregl-ctrl-group {
  background: var(--clr-surface2) !important;
  border: 1px solid var(--clr-border) !important;
}
.maplibregl-ctrl-group button {
  background-color: transparent !important;
  border-bottom-color: var(--clr-border) !important;
}
.maplibregl-ctrl-group button:hover { background: var(--clr-surface) !important; }
.maplibregl-ctrl-scale {
  background: rgba(26,29,39,.75) !important;
  border-color: var(--clr-border) !important;
  color: var(--clr-muted) !important;
  font-size: .7rem !important;
  padding: 1px 4px !important;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
  .info-stack { flex-direction: row; flex-wrap: wrap; }
  .info-card { flex: 1; min-width: 220px; }
  .trailforks-embed { height: 460px; }
  .hero-title { font-size: 1.5rem; }
}
@media (max-width: 600px) {
  .trails-page { padding: 20px 14px 40px; }
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
  .trailforks-embed { height: 360px; }
}

/* ── Light mode variables ───────────────────────────────────────── */
[data-theme="light"] {
  --clr-bg:       #f4f6fb;
  --clr-surface:  #ffffff;
  --clr-surface2: #edf0f7;
  --clr-border:   #d8dde8;
  --clr-text:     #1a1d27;
  --clr-muted:    #6b7399;
  --clr-accent:   #2563eb;
  --shadow:       0 4px 24px rgba(0,0,0,.10);
}

/* ── Light mode overrides ───────────────────────────────────────── */
[data-theme="light"] .trail3d-map          { background: #c8d5e8; }
[data-theme="light"] .slideshow-viewport   { background: #e4e9f4; }
[data-theme="light"] .bic-logo-wrap        { background: #f0f0f0; }

/* MapLibre controls */
[data-theme="light"] .maplibregl-popup-content {
  background: #fff !important;
  color: #1a1d27 !important;
  border-color: #d8dde8 !important;
}
[data-theme="light"] .maplibregl-popup-tip {
  border-top-color: #fff !important;
  border-bottom-color: #fff !important;
}
[data-theme="light"] .maplibregl-ctrl-group {
  background: #fff !important;
  border-color: #d8dde8 !important;
}
[data-theme="light"] .maplibregl-ctrl-group button {
  border-bottom-color: #d8dde8 !important;
  color: #1a1d27;
}
[data-theme="light"] .maplibregl-ctrl-group button:hover { background: #edf0f7 !important; }
[data-theme="light"] .maplibregl-ctrl-scale {
  background: rgba(255,255,255,.88) !important;
  border-color: #d8dde8 !important;
  color: #6b7399 !important;
}

/* ── Theme toggle button (shared style, same as app.css) ────────── */
.theme-toggle-btn {
  background: var(--clr-surface2);
  border: 1px solid var(--clr-border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
  line-height: 1;
  flex-shrink: 0;
}
.theme-toggle-btn:hover {
  background: var(--clr-border);
  border-color: var(--clr-accent);
}

/* ── Station section tab switcher ──────────────────────────────────── */
.station-tab-bar {
  display: flex;
  gap: 4px;
  align-items: center;
}
.station-tab-btn {
  background: none;
  border: 1px solid transparent;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--clr-muted);
  cursor: pointer;
  line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
.station-tab-btn:hover {
  background: var(--clr-surface2);
  color: var(--clr-text);
  border-color: var(--clr-border);
}
.station-tab-btn.active {
  background: var(--clr-surface2);
  color: var(--clr-text);
  border-color: var(--clr-accent, #4aaca7);
}

.station-tab-panel { display: none; }
.station-tab-panel.active { display: block; }

.station-tab-ext {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--clr-muted);
  text-decoration: none;
  border: 1px solid transparent;
  line-height: 1.4;
  transition: background .15s, color .15s, border-color .15s;
}
.station-tab-ext:hover {
  background: var(--clr-surface2);
  color: var(--clr-text);
  border-color: var(--clr-border);
  text-decoration: none;
}

/* "No lifts" overlay inside the lifts map */
.lifts-empty-notice {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(13,17,23,.8);
  color: var(--clr-muted);
  padding: 12px 20px;
  border-radius: 8px;
  z-index: 1000;
  font-size: .875rem;
  pointer-events: none;
}

/* ── VWS station list (below weather station map) ─────────────────── */
.vws-station-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 12px;
}

/* ── Station row ── */
.vws-station-row {
  background: var(--clr-surface2);
  border-radius: 6px;
  overflow: hidden;
  font-size: .82rem;
}
.vws-station-row--no-detail .vws-station-header { cursor: default; }

.vws-station-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  cursor: pointer;
  user-select: none;
}
.vws-station-header:hover { background: var(--clr-border); }
.vws-station-row--no-detail .vws-station-header:hover { background: transparent; }

.vws-station-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 1.5px solid rgba(255,255,255,.35);
}
.vws-station-name {
  flex: 1;
  color: var(--clr-text);
  font-weight: 500;
}
.vws-station-name small {
  color: var(--clr-muted);
  font-weight: 400;
  margin-left: 4px;
}
.vws-station-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.vws-station-score {
  font-weight: 700;
  font-size: .9rem;
  min-width: 22px;
  text-align: right;
}
.vws-station-label {
  color: var(--clr-muted);
  font-size: .78rem;
  min-width: 76px;
  text-align: right;
}
.vws-station-chevron {
  color: var(--clr-muted);
  font-size: 1rem;
  line-height: 1;
  transition: transform .2s;
  transform: rotate(0deg);
  display: inline-block;
  margin-left: 2px;
}
.vws-station-row.open .vws-station-chevron { transform: rotate(90deg); }

/* ── Accordion detail panel ── */
.vws-station-detail {
  overflow: hidden;
  height: 0;
  transition: height .22s ease;
}
.vws-detail-inner {
  padding: 2px 10px 10px 26px; /* indent past dot */
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.vws-detail-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: .78rem;
  color: var(--clr-muted);
}
.vws-detail-breakdown {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vws-bar-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .74rem;
}
.vws-bar-label {
  width: 78px;
  flex-shrink: 0;
  color: var(--clr-muted);
}
.vws-bar-track {
  flex: 1;
  height: 4px;
  background: var(--clr-border);
  border-radius: 2px;
  overflow: hidden;
}
.vws-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width .3s;
}
.vws-bar-num {
  width: 22px;
  text-align: right;
  font-size: .74rem;
  color: var(--clr-muted);
}
.vws-detail-summary {
  font-size: .76rem;
  color: var(--clr-muted);
  line-height: 1.4;
}

/* ── Station map pulsing markers ────────────────────────────────── */
.vws-pulse-marker {
  position: relative;
  width: 14px;
  height: 14px;
}
.vws-pulse-dot {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 0 5px rgba(0,0,0,.45);
  z-index: 1;
}
.vws-pulse-ring {
  position: absolute;
  top: 50%; left: 50%;
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 3px solid;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
  animation: vws-pulse 2s ease-out infinite;
  pointer-events: none;
}
@keyframes vws-pulse {
  0%   { transform: translate(-50%, -50%) scale(1);    opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(2.8);  opacity: 0; }
}


/* Suppress browser SVG focus rectangle on Leaflet polylines */
.leaflet-overlay-pane path:focus,
.leaflet-overlay-pane path:focus-visible { outline: none; }

/* ── Map fullscreen expand ─────────────────────────────────────────── */
.map-expand-btn {
  background: rgba(15,23,42,.82);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: .73rem;
  font-weight: 600;
  font-family: inherit;
  padding: 5px 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background .15s;
}
.map-expand-btn:hover { background: rgba(30,41,59,.98); }

.map-fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.78);
  z-index: 9100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
}
.map-fullscreen-overlay.hidden { display: none; }

.map-fullscreen-inner {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1280px;
  max-height: calc(100vh - 40px);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}

.map-fullscreen-close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10001;
  background: rgba(15,23,42,.88);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 6px;
  color: #e2e8f0;
  font-size: .8rem;
  font-weight: 600;
  font-family: inherit;
  padding: 6px 13px;
  cursor: pointer;
  transition: background .15s;
}
.map-fullscreen-close:hover { background: rgba(30,41,59,1); }

/* ── Lift legend overlay ────────────────────────────────────────────── */
.lifts-legend {
  position: absolute;
  bottom: 24px;
  left: 12px;
  background: rgba(13,17,23,.82);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  padding: 8px 12px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: .75rem;
  color: #cbd5e1;
  pointer-events: none;
}
.lifts-legend-item { display: flex; align-items: center; gap: 7px; }
.lifts-legend-line {
  display: inline-block;
  width: 22px;
  height: 3px;
  border-radius: 99px;
}

/* ── Historical Trend chart ─────────────────────────────────────────── */
.history-chart-outer {
  padding: 16px 16px 8px;
  background: var(--clr-surface);
}
.history-chart-hint {
  margin: 6px 0 0;
  font-size: .72rem;
  color: var(--clr-muted, #7a8099);
  text-align: right;
  user-select: none;
}
.history-empty-msg {
  padding: 2.5rem 2rem;
  text-align: center;
  color: var(--clr-muted, #7a8099);
  font-size: .9rem;
}

/* ── Lift schedule dialog ───────────────────────────────────────────── */
.lift-sched-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}
.lift-sched-modal {
  background: #0f172a;
  border: 1px solid #1e293b;
  border-radius: 12px;
  width: min(540px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0,0,0,.7);
  overflow: hidden;
}
.lift-sched-header {
  display: flex; align-items: center; gap: .75rem;
  padding: .9rem 1rem; border-bottom: 1px solid #1e293b; flex-shrink: 0;
}
.lift-sched-title { font-size: .9rem; font-weight: 700; color: #e2e8f0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lift-sched-status { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; white-space: nowrap; }
.lift-sched-status--open   { background: rgba(34,197,94,.15); color: #22c55e; border: 1px solid rgba(34,197,94,.3); }
.lift-sched-status--closed { background: rgba(107,114,128,.15); color: #9ca3af; border: 1px solid rgba(107,114,128,.3); }
.lift-sched-close {
  background: none; border: none; color: #475569;
  font-size: 1.1rem; cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0;
}
.lift-sched-close:hover { color: #e2e8f0; }
.lift-sched-body { padding: 1rem; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: .85rem; }
.lift-sched-footer {
  padding: .75rem 1rem; border-top: 1px solid #1e293b;
  display: flex; gap: .5rem; align-items: center; flex-shrink: 0;
}
.lift-sched-current-box {
  background: #0d1625; border: 1px solid #1e293b; border-radius: 7px;
  padding: .6rem .85rem; font-size: .8rem; color: #94a3b8; line-height: 1.5;
}
.lift-sched-current-box strong { color: #e2e8f0; }
.lift-sched-label { display: block; font-size: .72rem; color: #64748b; margin-bottom: .3rem; }
.lift-sched-sep {
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px;
  color: #475569; border-top: 1px solid #1e293b; padding-top: .75rem; margin-top: .1rem;
}
.lift-sched-dates { display: flex; gap: .65rem; }
.lift-sched-dates > div { flex: 1; }
.lift-sched-specials-hdr {
  display: flex; align-items: center; justify-content: space-between;
  font-size: .78rem; font-weight: 600; color: #94a3b8;
}
.lift-special-row {
  display: flex; gap: .45rem; align-items: center;
  background: #0d1625; border: 1px solid #1e293b; border-radius: 6px;
  padding: .45rem .6rem; margin-top: .4rem; flex-wrap: wrap;
}
.lift-special-row span { color: #475569; font-size: .8rem; }

/* ── Feature #1/#3/#12: Stats strip ────────────────────────────── */
.cond-stats-strip {
  display: flex; flex-wrap: wrap; gap: .5rem;
  padding: .75rem 0 .25rem;
  border-top: 1px solid var(--clr-border);
  margin-top: .75rem;
}
.css-chip {
  display: flex; align-items: center; gap: .35rem;
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 20px; padding: .3rem .65rem; font-size: .78rem;
}
.css-chip--good  { border-color: #22c55e44; }
.css-chip--warn  { border-color: #f97316aa; }
.css-chip--bad   { border-color: #f8717166; }
.css-chip--sat   { border-color: #4f9dff44; gap: .45rem; }
.css-icon  { font-size: .9rem; line-height: 1; }
.css-label { color: var(--clr-muted); font-size: .72rem; }
.css-value { color: var(--clr-text); font-weight: 600; font-size: .78rem; }
.css-value small { color: var(--clr-muted); font-weight: 400; margin-left: 2px; }
.css-sparkline { display: flex; align-items: flex-end; }
.css-sparkline svg { display: block; }

/* ── Feature #5: Condition distribution pills ───────────────────── */
.cond-dist-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  padding: .6rem 0 .2rem;
  border-top: 1px solid var(--clr-border);
  margin-top: .5rem;
}
.cond-dist-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--clr-muted); margin-right: .2rem;
}
.cond-dist-pill {
  display: flex; align-items: center; gap: .3rem;
  background: color-mix(in srgb, var(--clr) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--clr) 40%, transparent);
  border-radius: 20px; padding: .2rem .55rem; font-size: .72rem;
}
.cdp-label { color: var(--clr, #7a8099); font-weight: 600; }
.cdp-days  { color: var(--clr-muted); }

/* ── Feature #8: Elevation-band breakdown ───────────────────────── */
.elev-bands {
  padding: .75rem 1rem; border-bottom: 1px solid var(--clr-border);
}
.elev-bands-title {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--clr-muted); margin-bottom: .6rem;
}
.elev-bands-bars { display: flex; flex-direction: column; gap: .45rem; }
.elev-band-row {
  display: flex; align-items: center; gap: .6rem; font-size: .78rem;
}
.elev-band-alt {
  width: 52px; text-align: right; color: var(--clr-muted); flex-shrink: 0;
  font-size: .72rem;
}
.elev-band-bar-wrap {
  flex: 1; height: 8px; background: var(--clr-border); border-radius: 4px; overflow: hidden;
}
.elev-band-bar { height: 100%; border-radius: 4px; transition: width .3s ease; }
.elev-band-label { font-size: .76rem; font-weight: 600; min-width: 120px; }

/* ── Feature #10: Monthly averages table ────────────────────────── */
.monthly-stats-wrap {
  padding: 1rem;
}
.monthly-stats-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .5px; color: var(--clr-muted); margin-bottom: .75rem;
}
.monthly-stats-scroll { overflow-x: auto; }
.monthly-stats-table {
  width: 100%; border-collapse: collapse; font-size: .8rem; min-width: 420px;
}
.monthly-stats-table th {
  text-align: left; padding: .4rem .6rem; font-size: .7rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--clr-muted); border-bottom: 1px solid var(--clr-border);
  white-space: nowrap;
}
.monthly-stats-table td {
  padding: .4rem .6rem; border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text); vertical-align: middle;
}
.monthly-stats-table tr:last-child td { border-bottom: none; }
.ms-year { color: var(--clr-muted); font-weight: 400; margin-left: 3px; }
.ms-good-bar-wrap {
  display: inline-block; width: 60px; height: 6px;
  background: var(--clr-border); border-radius: 3px; overflow: hidden;
  vertical-align: middle; margin-right: .4rem;
}
.ms-good-bar { height: 100%; background: var(--clr-mtb); border-radius: 3px; }

/* ── Feature #13: "I rode it" validation ─────────────────────────── */
.rode-it-section {
  background: var(--clr-surface); border: 1px solid var(--clr-border);
  border-radius: var(--radius); padding: 1rem 1.25rem; margin-bottom: 1rem;
}
.ri-header { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .65rem; }
.ri-title { font-size: .85rem; font-weight: 700; color: var(--clr-text); }
.ri-tally { font-size: .75rem; color: var(--clr-muted); }
.ri-auth-note { font-size: .8rem; color: var(--clr-muted); }
.ri-auth-note a { color: var(--clr-accent); }
.ri-btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.ri-btn {
  border: 1px solid var(--clr-border); background: var(--clr-surface2);
  color: var(--clr-text); border-radius: 20px; padding: .35rem .9rem;
  font-size: .78rem; cursor: pointer; transition: background .15s, border-color .15s;
}
.ri-btn:hover { background: var(--clr-border); }
.ri-btn.active, .ri-btn:disabled.active { opacity: 1; }
.ri-btn--better.active  { background: #14532d; border-color: #22c55e; color: #86efac; }
.ri-btn--matches.active { background: #1e3a5f; border-color: #4f9dff; color: #93c5fd; }
.ri-btn--worse.active   { background: #7f1d1d; border-color: #f87171; color: #fca5a5; }
.ri-btn:disabled:not(.active) { opacity: .4; cursor: default; }
.ri-tag { display: inline-block; border-radius: 10px; padding: .1rem .4rem; font-size: .7rem; }
.ri-tag--better  { background: #14532d; color: #86efac; }
.ri-tag--matches { background: #1e3a5f; color: #93c5fd; }
.ri-tag--worse   { background: #7f1d1d; color: #fca5a5; }
.ri-note-wrap { margin-top: .4rem; }
.ri-note-input {
  width: 100%; background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 7px; color: var(--clr-text); padding: .45rem .7rem;
  font-size: .8rem; outline: none;
}
.ri-note-input:focus { border-color: var(--clr-accent); }
.ri-own-note { font-size: .78rem; color: var(--clr-muted); margin-top: .3rem; }
.ri-msg { font-size: .78rem; color: var(--clr-mtb); margin-top: .4rem; }

/* ── Feature #14 + #13 merged: Ride Log card ─────────────────────── */
.lrf-header { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.lrf-header .info-card-title { margin-bottom: 0; }
.lrf-toggle-btn {
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  color: var(--clr-text); border-radius: 20px; padding: .25rem .75rem;
  font-size: .75rem; cursor: pointer; transition: background .15s; white-space: nowrap;
}
.lrf-toggle-btn:hover { background: var(--clr-border); }
.lrf-toggle-btn--open { background: var(--clr-border); }
.lrf-rating-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.log-ride-msg-saved {
  font-size: .78rem; color: var(--clr-mtb); margin-bottom: .4rem;
}
.log-ride-saved-rating { font-weight: 600; }
.log-ride-form { margin-top: .7rem; display: flex; flex-direction: column; gap: .6rem; }
.log-ride-form[hidden] { display: none; }
.lrf-label { display: flex; flex-direction: column; gap: .2rem; font-size: .78rem; color: var(--clr-muted); }
.lrf-input {
  background: var(--clr-surface2); border: 1px solid var(--clr-border);
  border-radius: 7px; color: var(--clr-text); padding: .4rem .65rem; font-size: .8rem; outline: none;
}
.lrf-input:focus { border-color: var(--clr-accent); }
.lrf-actions { display: flex; gap: .5rem; }
.lrf-submit {
  background: var(--clr-mtb); color: #fff; border: none; border-radius: 20px;
  padding: .35rem .9rem; font-size: .78rem; cursor: pointer;
}
.lrf-submit:disabled { opacity: .5; cursor: default; }
.lrf-msg { font-size: .78rem; color: var(--clr-mtb); }
.log-ride-link { display: block; font-size: .78rem; color: var(--clr-accent); margin-top: .6rem; }

/* ── Bikepark index card: last rain chip ────────────────────────── */
.bic-last-rain {
  display: flex; align-items: center; gap: .3rem;
  font-size: .71rem; padding: .15rem .5rem;
  border-radius: 10px; margin-bottom: .35rem;
  border: 1px solid transparent;
}
.bic-last-rain small { color: inherit; opacity: .75; }
.bic-lr--good { background: #14532d22; border-color: #22c55e44; color: #86efac; }
.bic-lr--warn { background: #7c2d1222; border-color: #f9731666; color: #fdba74; }
.bic-lr--bad  { background: #7f1d1d22; border-color: #f8717166; color: #fca5a5; }

/* ── Lift Schedules summary card ────────────────────────────────── */
.lift-sched-row { display: flex; justify-content: space-between; align-items: center;
  gap: .5rem; padding: .45rem 0; border-bottom: 1px solid #2e3347; flex-wrap: wrap; }
.lift-sched-row:last-child { border-bottom: none; }
.lift-sched-row-name   { font-size: .8rem; color: #e2e8f0; font-weight: 600; }
.lift-sched-row-detail { font-size: .75rem; color: #7a8099; flex: 1; }
.lift-sched-row-edit {
  font-size: .68rem; padding: .2rem .5rem; border-radius: 6px; cursor: pointer;
  background: transparent; border: 1px solid #2e3347; color: #64748b;
  transition: color .15s, border-color .15s; white-space: nowrap;
}
.lift-sched-row-edit:hover { color: #94a3b8; border-color: #475569; }

/* ── Lift Schedules approval footer ─────────────────────────────── */
.lift-sched-approval {
  display: flex; align-items: center; justify-content: space-between;
  gap: .5rem; padding-top: .65rem; margin-top: .5rem;
  border-top: 1px solid #2e3347; flex-wrap: wrap;
}
.lift-approval-count { font-size: .73rem; color: #64748b; }
.lift-approve-btn {
  font-size: .73rem; padding: .3rem .7rem; border-radius: 8px; cursor: pointer;
  background: transparent; border: 1px solid #2e3347; color: #94a3b8;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap;
}
.lift-approve-btn:hover:not(:disabled) { background: #14532d22; border-color: #22c55e55; color: #86efac; }

/* ── Public gate (unauthenticated preview) ─────────────────────── */
.public-gate {
  position: relative;
  margin-top: 24px;
  padding-top: 40px;
  padding-bottom: 64px;
}
.gate-fade {
  position: absolute;
  top: -360px; left: 0; right: 0;
  height: 560px;
  background: linear-gradient(to bottom, transparent 0%, var(--clr-bg) 38%, var(--clr-bg) 100%);
  pointer-events: none;
  z-index: 3;
}
.gate-wall-card {
  position: absolute;
  top: 50%; left: 50%;
  width: 400px; max-width: 400px;
  margin-left: -200px;
  margin-top: -400px;
  z-index: 5;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 18px;
  padding: 32px 28px 28px;
  box-shadow: 0 8px 48px rgba(0,0,0,.5);
}
.gate-wall-icon  { font-size: 2rem; margin-bottom: 10px; text-align: center; }
.gate-wall-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -.3px; margin-bottom: 6px; text-align: center; }
.gate-wall-sub   { font-size: .84rem; color: var(--clr-muted); line-height: 1.5; margin-bottom: 16px; text-align: center; }
.gate-wall-features { list-style: none; margin: 0 0 22px; display: flex; flex-direction: column; gap: 7px; }
.gate-wall-features li { font-size: .82rem; color: var(--clr-muted); display: flex; align-items: center; gap: 8px; }
.gate-wall-features li::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--clr-accent); flex-shrink: 0; }
/* gate form — mirrors app.css; needed here since trails.php does not load app.css */
.gate-error { font-size: .8rem; color: #f87171; background: rgba(239,68,68,.1); border: 1px solid rgba(239,68,68,.3); border-radius: 7px; padding: 8px 12px; margin-bottom: 8px; }
.gate-form  { display: flex; flex-direction: column; gap: 10px; }
.gate-input { width: 100%; background: var(--clr-surface2); border: 1px solid var(--clr-border); color: var(--clr-text); border-radius: 8px; padding: 10px 12px; font-family: inherit; font-size: .88rem; transition: border-color .15s; }
.gate-input:focus { outline: none; border-color: var(--clr-accent); }
.gate-pw-wrap { position: relative; }
.gate-btn-primary { width: 100%; background: #4aaca7; color: #fff; border: none; border-radius: 8px; padding: 11px 16px; font-size: .9rem; font-weight: 700; cursor: pointer; transition: background .15s; font-family: inherit; }
.gate-btn-primary:hover    { background: #3d9a96; }
.gate-btn-primary:disabled { background: var(--clr-surface2); color: var(--clr-muted); cursor: not-allowed; }
.gate-divider { display: flex; align-items: center; gap: 8px; color: var(--clr-muted); font-size: .78rem; margin: 8px 0; }
.gate-divider::before, .gate-divider::after { content: ''; flex: 1; height: 1px; background: var(--clr-border); }
.gate-btn-google { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; background: var(--clr-surface2); border: 1px solid var(--clr-border); border-radius: 8px; padding: 10px 16px; font-size: .88rem; font-weight: 600; color: var(--clr-text); text-decoration: none; transition: background .15s; }
.gate-btn-google:hover { background: var(--clr-border); }
.gate-btn-google svg { width: 17px; height: 17px; flex-shrink: 0; }
.gate-footer-links { margin-top: 14px; display: flex; justify-content: center; gap: 8px; font-size: .78rem; color: var(--clr-muted); }
.gate-footer-links a { color: var(--clr-accent); text-decoration: none; font-weight: 500; }
.gate-footer-links a:hover { text-decoration: underline; }
.lift-approve-btn--done { color: #22c55e; border-color: #22c55e44; background: #14532d22; cursor: default; }
