:root {
  --bg: #121212;
  --panel: rgba(28, 28, 28, 0.96);
  --border: rgba(255, 255, 255, 0.14);
  --text: #f0f0f0;
  --muted: #9a9a9a;
  --accent: #d0d0d0;
  --accent2: #ffffff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

html[data-site-theme="light"] {
  color-scheme: light;
  --bg: #f2f2f2;
  --panel: rgba(255, 255, 255, 0.98);
  --border: rgba(0, 0, 0, 0.14);
  --text: #1a1a1a;
  --muted: #666666;
}

* {
  box-sizing: border-box;
}

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100dvh;
  background: var(--bg);
}

html,
body {
  margin: 0;
  height: 100%;
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
}

body {
  background: var(--bg);
}

.map-stack {
  flex: 1 1 auto;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.map-pane {
  flex: 1;
  min-height: 0;
  position: relative;
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.map-float {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 12px;
  z-index: 550;
  display: flex;
  gap: 10px;
  pointer-events: none;
}

.map-float .fab {
  pointer-events: auto;
}

.fab {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(32, 32, 32, 0.92);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  touch-action: manipulation;
}

.fab:active {
  filter: brightness(1.08);
}

.fab-accent {
  background: #2a2a2a;
  border-color: rgba(255, 255, 255, 0.28);
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
}

.leaflet-bottom.leaflet-right {
  bottom: 8px;
}

.leaflet-top.leaflet-left {
  top: calc(48px + var(--safe-top));
}

.split-splitter {
  flex: 0 0 12px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(18, 18, 18, 0.96));
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 610;
}

.split-splitter:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: -2px;
}

.split-splitter::after {
  content: "";
  width: 52px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}

.sheet {
  flex: 0 0 auto;
  height: 280px;
  min-height: 140px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--border);
  overflow: hidden;
  z-index: 600;
}

.sheet-tabs {
  display: flex;
  gap: 0;
  padding: 0;
  margin: 0;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
}

.app-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: calc(10px + var(--safe-top)) 12px 10px;
  background: linear-gradient(180deg, rgba(18, 18, 18, 0.92), transparent);
  pointer-events: none;
}

.app-header > * {
  pointer-events: auto;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.festival-switcher {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.festival-select {
  appearance: none;
  -webkit-appearance: none;
  max-width: min(58vw, 14.5rem);
  min-width: 0;
  margin: 0;
  padding: 0.2rem 1.35rem 0.2rem 0.35rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background-color: rgba(24, 24, 24, 0.88);
  background-image: linear-gradient(45deg, transparent 50%, var(--text) 50%),
    linear-gradient(135deg, var(--text) 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 7px) 55%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-shadow: none;
  cursor: pointer;
  line-height: 1.3;
}

.festival-select:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.festival-select option {
  color: #14081c;
  background: #fff;
  font-weight: 600;
}

.festival-online-status,
.app-title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.app-header-end {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.settings-menu {
  position: relative;
  z-index: 560;
}

.settings-menu-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(24, 24, 24, 0.88);
  color: var(--text);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}

.settings-menu-btn:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

.settings-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 10px;
}

.settings-menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.settings-menu-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text);
}

.settings-menu-status .offline-badge {
  margin: 0;
}

.settings-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.settings-account-email {
  margin: 0 0 8px;
  font-size: 0.78rem;
  color: var(--muted);
  word-break: break-all;
}

.settings-auth-btn {
  width: 100%;
}

.settings-sync-hint,
.settings-login-msg {
  margin: 8px 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
}

.settings-theme-toggle {
  gap: 0;
}

html[data-site-theme="light"] .settings-menu-btn {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}

html[data-site-theme="light"] .settings-menu-panel {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.16);
}

html[data-site-theme="light"] .festival-select {
  background-color: rgba(255, 255, 255, 0.88);
  border-color: rgba(0, 0, 0, 0.14);
  text-shadow: none;
}

.site-theme-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.04em;
}

.site-theme-toggle-text {
  min-width: 2.5em;
}

html[data-site-theme="light"] .app-title,
html[data-site-theme="light"] .festival-online-status {
  text-shadow: none;
}

html[data-site-theme="light"] .app-header {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94), transparent);
}

html[data-site-theme="light"] .offline-badge {
  color: #0a5c24;
  border-color: rgba(40, 140, 60, 0.45);
  background: rgba(57, 255, 20, 0.18);
}

html[data-site-theme="light"] .offline-badge[data-state="pending"] {
  color: #8a5a00;
  border-color: rgba(200, 140, 0, 0.45);
  background: rgba(255, 200, 0, 0.2);
}

html[data-site-theme="light"] .sheet-tabs {
  background: rgba(0, 0, 0, 0.04);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

html[data-site-theme="light"] .sheet-tab-count {
  background: rgba(0, 0, 0, 0.06);
}

html[data-site-theme="light"] .split-splitter {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(245, 245, 245, 0.98));
  border-top-color: var(--border);
}

html[data-site-theme="light"] .split-splitter::after {
  background: rgba(0, 0, 0, 0.22);
}

html[data-site-theme="light"] .fab {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  color: var(--text);
}

html[data-site-theme="light"] .fab-accent {
  background: #e8e8e8;
  border-color: rgba(0, 0, 0, 0.18);
}

html[data-site-theme="light"] .poi-search,
html[data-site-theme="light"] .poi-cat {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-site-theme="light"] .cat-chip {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-site-theme="light"] .map-attribution {
  border-top-color: rgba(0, 0, 0, 0.08);
}

html[data-site-theme="light"] .empty-hint {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-site-theme="light"] .leaflet-tooltip.poi-tip {
  background: rgba(255, 255, 255, 0.96);
  color: var(--text);
  border-color: var(--border);
}

html[data-site-theme="light"] .btn-ghost {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-site-theme="light"] .pin-item {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-site-theme="light"] .schedule-item {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(0, 0, 0, 0.08);
}

html[data-site-theme="light"] .schedule-item[data-selected="true"] {
  background: rgba(255, 255, 255, 0.06);
}

html[data-site-theme="light"] .schedule-item[data-conflict="true"] {
  border-left: 5px solid #c62828;
  border-color: rgba(198, 40, 40, 0.55);
  background: linear-gradient(90deg, rgba(255, 205, 210, 0.95) 0%, rgba(255, 240, 245, 0.75) 55%, rgba(255, 255, 255, 0.78) 100%);
  box-shadow:
    0 0 0 1px rgba(198, 40, 40, 0.28) inset,
    0 2px 12px rgba(198, 40, 40, 0.12);
}

html[data-site-theme="light"] .schedule-item[data-selected="true"][data-conflict="true"] {
  border-left: 5px solid #b71c1c;
  border-color: rgba(183, 28, 28, 0.65);
  background: linear-gradient(90deg, rgba(200, 200, 200, 0.9) 0%, rgba(230, 230, 230, 0.55) 50%, rgba(255, 255, 255, 0.06) 100%);
  box-shadow:
    0 0 0 1px rgba(183, 28, 28, 0.35) inset,
    0 3px 14px rgba(183, 28, 28, 0.14);
}

html[data-site-theme="light"] .schedule-conflict-summary {
  color: #6d101c;
  background: rgba(255, 205, 210, 0.92);
  border-color: rgba(198, 40, 40, 0.45);
  font-weight: 600;
}

html[data-site-theme="light"] .schedule-conflict-chip {
  color: #5d0a12;
  background: rgba(255, 235, 238, 0.98);
  border-color: rgba(198, 40, 40, 0.55);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

html[data-site-theme="light"] .schedule-meta,
html[data-site-theme="light"] .schedule-leave {
  color: var(--muted);
}

html[data-site-theme="light"] .pin-actions button {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(0, 0, 0, 0.12);
  color: var(--text);
}

html[data-site-theme="light"] .pin-actions button[data-a="del"] {
  color: #b00020;
}

html[data-site-theme="light"] .leaflet-container {
  background: #d8dce3;
}

html[data-site-theme="light"] .leaflet-popup-nav-shell .leaflet-popup-content-wrapper {
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border-color: var(--border);
}

html[data-site-theme="light"] .leaflet-popup-nav-shell .leaflet-popup-tip {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--border);
}

html[data-site-theme="light"] .toast {
  background: rgba(255, 255, 255, 0.97);
  color: var(--text);
}

html[data-site-theme="light"] dialog.modal {
  background: #faf8ff;
  color: var(--text);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
}

html[data-site-theme="light"] dialog.modal::backdrop {
  background: rgba(40, 20, 60, 0.35);
}

html[data-site-theme="light"] .modal-body input[type="text"] {
  background: #fff;
  border-color: rgba(0, 0, 0, 0.12);
}

html[data-site-theme="light"] .nav-overlay {
  background: radial-gradient(ellipse at center, #eeeeee 0%, #d0d0d0 72%);
}

html[data-site-theme="light"] .nav-debug-readout {
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
  border-color: var(--border);
}

html[data-site-theme="light"] .nav-compass-fallback {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(120, 60, 140, 0.28);
}

html[data-site-theme="light"] .compass-ring {
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 0 28px rgba(255, 255, 255, 0.06), inset 0 0 40px rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.55);
}

html[data-site-theme="light"] .toggle-track {
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.18);
}

html[data-site-theme="light"] .toggle-thumb {
  background: rgba(255, 255, 255, 0.95);
}

.offline-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #b8e0c0;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.offline-badge[data-state="pending"] {
  background: rgba(255, 255, 255, 0.06);
  color: #d0d0d0;
  border-color: rgba(255, 255, 255, 0.14);
}

.sheet-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 8px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sheet-tab[aria-selected="true"] {
  color: var(--text);
  border-bottom-color: var(--accent);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
}

.sheet-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.sheet-tab[aria-selected="true"] .sheet-tab-count {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.sheet-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

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

.sheet-panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.sheet-panel-body .pin-list {
  flex: none;
  overflow: visible;
  min-height: 0;
}

.venue-toolbar {
  display: flex;
  padding: 8px 12px 4px;
  flex-shrink: 0;
}

.cat-chips {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.cat-chips::-webkit-scrollbar {
  display: none;
}

.cat-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}

.cat-chip[data-active="true"] {
  color: var(--text);
}

.poi-search {
  flex: 1 1 60%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 16px;
  -webkit-appearance: none;
  appearance: none;
}

.poi-cat {
  flex: 1 1 40%;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  font-size: 0.9rem;
  -webkit-appearance: none;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 28px;
}

.poi-list {
  min-height: 0;
}

.schedule-panel {
  min-height: 0;
}

.schedule-toolbar {
  display: flex;
  gap: 8px;
  padding: 8px 12px 4px;
  align-items: center;
  flex-shrink: 0;
}

.schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  margin-left: auto;
}

.schedule-filters {
  display: flex;
  gap: 6px;
  padding: 0 12px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
}

.schedule-filters::-webkit-scrollbar {
  display: none;
}

.schedule-filters .poi-cat {
  min-width: 118px;
  flex: 0 0 auto;
}

.schedule-share-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.schedule-share-actions .btn {
  white-space: nowrap;
}

.schedule-section--itinerary .schedule-share-actions {
  gap: 4px;
}

.schedule-section--itinerary .schedule-share-actions .btn {
  padding: 5px 11px;
  font-size: 0.74rem;
  line-height: 1.15;
}

.schedule-conflict-summary {
  margin: 0 12px 6px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 120, 140, 0.55);
  background: linear-gradient(135deg, rgba(80, 0, 24, 0.55) 0%, rgba(40, 0, 18, 0.45) 100%);
  color: #ffc9d4;
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.45;
  flex-shrink: 0;
  box-shadow: 0 2px 14px rgba(255, 40, 90, 0.12);
}

/* Search/filters/conflict stay pinned; section headers stick below them and swap as you scroll. */
.schedule-panel-body {
  --schedule-sticky-top: 118px;
}

.schedule-sticky-stack {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 96%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-site-theme="light"] .schedule-sticky-stack {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.schedule-section--itinerary {
  padding: 0 10px;
  margin-bottom: 10px;
}

.schedule-section--itinerary .schedule-section-head {
  position: sticky;
  top: var(--schedule-sticky-top, 118px);
  z-index: 9;
  margin: 0 0 6px;
  padding: 4px 2px 8px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-site-theme="light"] .schedule-section--itinerary .schedule-section-head {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.schedule-section--itinerary .schedule-section-head .schedule-section-title {
  margin: 0;
}

.schedule-section--allsets {
  margin-bottom: 10px;
  padding: 0 10px 8px;
}

.schedule-section--allsets .schedule-section-title--sticky {
  position: sticky;
  top: var(--schedule-sticky-top, 118px);
  z-index: 9;
  margin: 0 0 8px;
  padding: 8px 2px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

html[data-site-theme="light"] .schedule-section--allsets .schedule-section-title--sticky {
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

.schedule-section {
  margin-bottom: 10px;
}

.schedule-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin: 2px 4px 8px;
}

.schedule-section-title {
  margin: 2px 4px 8px;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.schedule-section--past {
  margin: 4px 10px 16px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-site-theme="light"] .schedule-section--past {
  border-top-color: rgba(0, 0, 0, 0.1);
}

.schedule-past-details {
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

html[data-site-theme="light"] .schedule-past-details {
  border-color: rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
}

.schedule-past-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  list-style: none;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.schedule-past-summary::-webkit-details-marker {
  display: none;
}

.schedule-past-summary::before {
  content: "▸";
  margin-right: 6px;
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.12s ease;
}

.schedule-past-details[open] .schedule-past-summary::before {
  transform: rotate(90deg);
}

.schedule-past-count {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.schedule-past-hint {
  margin: 0 12px 8px;
  font-size: 0.7rem;
  color: var(--muted);
  line-height: 1.4;
}

.schedule-list--past {
  padding: 0 8px 10px;
}

.schedule-item[data-past="true"] {
  opacity: 0.82;
}

.schedule-item[data-past="true"] .schedule-name {
  color: var(--muted);
}

.schedule-panel[data-saved-only="1"] .schedule-section--allsets {
  display: none !important;
}

.footer-install-wrap[hidden] {
  display: none !important;
}

.schedule-section-head .schedule-section-title {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

.schedule-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.schedule-item {
  margin-bottom: 6px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  gap: 5px;
}

.schedule-item[data-selected="true"] {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.schedule-item[data-conflict="true"] {
  border-left: 5px solid #ff1744;
  border-color: rgba(255, 65, 105, 0.75);
  background: linear-gradient(90deg, rgba(120, 0, 40, 0.55) 0%, rgba(40, 8, 28, 0.42) 45%, rgba(255, 255, 255, 0.05) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 80, 120, 0.45) inset,
    0 0 20px rgba(255, 40, 100, 0.18);
}

.schedule-item[data-selected="true"][data-conflict="true"] {
  border-left: 5px solid #ff5252;
  border-color: rgba(255, 82, 130, 0.9);
  background: linear-gradient(90deg, rgba(90, 90, 90, 0.65) 0%, rgba(50, 50, 50, 0.5) 40%, rgba(255, 255, 255, 0.1) 100%);
  box-shadow:
    0 0 0 1px rgba(255, 100, 140, 0.55) inset,
    0 0 24px rgba(255, 45, 120, 0.22);
}

.schedule-item[data-conflict="true"] .schedule-name {
  text-shadow: none;
}

.schedule-conflict-chip {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  margin-bottom: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #fff5f7;
  border: 1px solid rgba(255, 140, 160, 0.85);
  background: linear-gradient(135deg, rgba(255, 50, 90, 0.85) 0%, rgba(200, 0, 60, 0.75) 100%);
  box-shadow: 0 1px 8px rgba(255, 40, 80, 0.35);
}

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

.schedule-name {
  font-size: 0.9rem;
  font-weight: 700;
}

.schedule-meta {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

.schedule-leave {
  font-size: 0.74rem;
  color: var(--muted);
}

.schedule-actions {
  display: flex;
  gap: 6px;
}

.schedule-actions button {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.schedule-actions button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.map-attribution {
  margin: 0;
  padding: 6px 14px calc(8px + var(--safe-bottom));
  font-size: 0.65rem;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0.85;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
  text-align: center;
}

.map-attribution a {
  color: inherit;
}

.map-attribution .footer-cache-version {
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.empty-hint {
  margin: 4px 14px 8px;
  padding: 10px 12px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  font-size: 0.8rem;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
  flex-shrink: 0;
}

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

.leaflet-tooltip.poi-tip {
  background: rgba(18, 8, 32, 0.95);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
}

.sheet-toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  padding: 8px 10px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  flex-shrink: 0;
}

.sheet-toolbar::-webkit-scrollbar {
  display: none;
}

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  scroll-snap-align: start;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #3a3a3a, #2a2a2a);
  border-color: rgba(255, 255, 255, 0.28);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.coord-strip {
  font-size: 0.72rem;
  color: var(--muted);
  padding: 8px 14px 0;
  font-variant-numeric: tabular-nums;
  word-break: break-all;
  flex-shrink: 0;
}

.pin-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px 10px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

.pin-item {
  display: grid;
  grid-template-columns: 8px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  min-height: 56px;
}

.pin-item[data-active="true"] {
  border-color: rgba(0, 245, 255, 0.45);
  background: rgba(0, 245, 255, 0.08);
}

.pin-swatch {
  width: 8px;
  align-self: stretch;
  border-radius: 4px;
  flex-shrink: 0;
}

.pin-meta {
  min-width: 0;
}

.pin-name {
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-ll {
  font-size: 0.72rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pin-actions {
  display: flex;
  flex-direction: row;
  gap: 6px;
}

.pin-actions button {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}

.pin-actions button[data-a="del"] {
  border-color: rgba(255, 80, 100, 0.4);
  color: #ffb1bf;
}

@media (max-width: 380px) {
  .pin-actions {
    flex-direction: column;
    gap: 4px;
  }
  .pin-actions button {
    min-height: 28px;
    padding: 6px 8px;
  }
}

.nav-overlay {
  position: absolute;
  inset: 0;
  z-index: 900;
  display: none;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: radial-gradient(ellipse at center, #1a1a1a 0%, #0a0a0a 70%);
  padding: calc(12px + var(--safe-top)) 16px calc(16px + var(--safe-bottom));
}

.nav-overlay[data-open="true"] {
  display: flex;
}

.nav-overlay-header {
  flex-shrink: 0;
}

.nav-overlay-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  padding-bottom: 4px;
}

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

.nav-top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.nav-debug-toggle {
  min-height: 40px;
  padding: 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.nav-debug-toggle[data-on="true"] {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-refresh-location {
  min-width: 44px;
  min-height: 40px;
  padding: 0 10px;
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
}

.nav-target {
  text-align: center;
  margin-top: 4px;
  flex-shrink: 0;
}

.nav-target h2 {
  margin: 0;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}

.nav-target p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.compass-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 2px 0;
}

.nav-compass-panel {
  flex-shrink: 0;
}

.nav-compass-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  max-width: 380px;
  min-height: min(40vw, 148px);
  padding: 14px 16px;
  margin: 8px auto 0;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.16);
  background: rgba(24, 24, 24, 0.55);
}

.nav-compass-fallback-text {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.45;
  max-width: 320px;
}

.compass-ring {
  width: min(40vw, 148px);
  height: min(40vw, 148px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 40px rgba(255, 255, 255, 0.08), inset 0 0 60px rgba(0, 0, 0, 0.4);
  position: relative;
  background: rgba(24, 24, 24, 0.55);
  transform-origin: 50% 50%;
  transition: transform 0.12s ease-out;
}

.compass-n {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 700;
}

.arrow-wrap {
  position: absolute;
  inset: 18%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform-origin: 50% 50%;
  transition: transform 0.12s ease-out;
}

.arrow {
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-bottom: 48px solid var(--accent);
  filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.35));
}

.nav-stats {
  text-align: center;
  padding: 12px 0 4px;
  flex-shrink: 0;
}

.nav-distance-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.nav-distance {
  font-size: 2rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-bearing {
  font-size: 0.95rem;
  color: var(--muted);
}

.nav-debug-readout {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(24, 24, 24, 0.55);
  color: #d8d8e8;
  font-size: 0.72rem;
  line-height: 1.42;
  white-space: pre-wrap;
  word-break: break-word;
  flex-shrink: 0;
  max-height: min(40vh, 320px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-hint {
  font-size: 0.75rem;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  line-height: 1.4;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(120px + var(--safe-bottom));
  transform: translateX(-50%) translateY(20px);
  z-index: 1200;
  background: rgba(30, 15, 45, 0.96);
  border: 1px solid var(--border);
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 0.85rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  max-width: 90vw;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

dialog.modal {
  border: none;
  border-radius: 16px;
  padding: 0;
  background: #14081f;
  color: var(--text);
  max-width: min(420px, 92vw);
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.55);
}

dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.modal-body {
  padding: 16px 18px 18px;
}

.modal-body h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.modal-body p,
.modal-body label {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.45;
}

.pin-hint {
  font-size: 0.78rem;
  color: var(--accent2);
  margin: 0 0 10px;
  line-height: 1.35;
}

.modal-body input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
  margin-bottom: 12px;
}

.modal-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.user-marker {
  background: transparent;
  border: none;
}

.user-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #e0e0e0;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35), 0 2px 12px rgba(0, 0, 0, 0.5);
}

.pin-marker-inner {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.leaflet-container {
  background: #121212;
}

/* Stage / zone labels — non-interactive, below pins */
.edc-stage-label-wrap {
  pointer-events: none !important;
  background: transparent !important;
  border: none !important;
}

.edc-stage-label {
  display: inline-block;
  max-width: 188px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(210, 205, 220, 0.92);
  background: rgba(22, 18, 32, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.22);
  text-shadow: none;
  opacity: 0.88;
  -webkit-text-stroke: 0;
}

html[data-site-theme="light"] .edc-stage-label {
  color: rgba(55, 48, 68, 0.88);
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.08);
  opacity: 0.92;
}

/* Map pin / POI selection — Navigate opens compass overlay */
.leaflet-popup-nav-shell .leaflet-popup-content-wrapper {
  background: rgba(12, 6, 22, 0.96);
  color: var(--text);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  padding: 0;
}

.leaflet-popup-nav-shell .leaflet-popup-content {
  margin: 10px 12px 12px;
  /* Reserve space so the close button never overlays title text (mobile). */
  padding-right: 26px;
  line-height: 1.35;
}

.leaflet-popup-nav-shell a.leaflet-popup-close-button {
  color: var(--text);
  top: 6px;
  right: 6px;
  padding: 0;
  width: 32px;
  height: 32px;
  line-height: 32px;
  text-align: center;
  font-size: 1.25rem;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}

.leaflet-popup-nav-shell .leaflet-popup-tip {
  background: rgba(12, 6, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: none;
  border-left: none;
}

.map-nav-popup-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.map-nav-popup-sub {
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.map-nav-popup-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}

.map-nav-popup-actions .map-nav-popup-btn {
  flex: 1;
  margin-top: 0;
}

.map-nav-popup-btn {
  width: 100%;
  margin-top: 2px;
}

.pin-actions button[data-a="share"] {
  border-color: rgba(255, 255, 255, 0.16);
  color: #ffb8ec;
}

.nav-mini-map {
  flex: 0 0 auto;
  width: 100%;
  height: clamp(148px, 32vh, 260px);
  min-height: 148px;
  max-height: 280px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 6px 0;
}

.nav-mini-map .leaflet-container {
  border-radius: 12px;
}

.nav-compass-ctrl {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 0 6px;
}

.compass-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.toggle-switch {
  display: inline-flex;
  align-items: center;
}

.toggle-track {
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
  transition: background 0.2s, border-color 0.2s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transition: transform 0.22s ease, background 0.2s;
}

.toggle-input:checked ~ .toggle-switch .toggle-track {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
}

.toggle-input:checked ~ .toggle-switch .toggle-thumb {
  transform: translateX(20px);
  background: var(--accent);
}

.toggle-input:focus-visible ~ .toggle-switch .toggle-track {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

/* ── Schedule: set-times-TBA notice ─────────────────────────────────────── */

.schedule-tba-notice {
  margin: 0 12px 6px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 200, 0, 0.4);
  background: linear-gradient(135deg, rgba(70, 52, 0, 0.5) 0%, rgba(40, 30, 0, 0.4) 100%);
  color: #ffe08a;
  font-size: 0.78rem;
  line-height: 1.45;
  flex-shrink: 0;
}

html[data-site-theme="light"] .schedule-tba-notice {
  color: #5d4a00;
  background: rgba(255, 243, 205, 0.92);
  border-color: rgba(180, 140, 0, 0.45);
  font-weight: 600;
}

/* ── Travel (parking & transit) tab ─────────────────────────────────────── */

.travel-panel-body {
  padding: 12px;
  overflow-y: auto;
}

.travel-when {
  margin: 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}

.travel-intro {
  margin: 0 0 12px;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--muted);
}

.travel-section {
  margin-bottom: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
}

html[data-site-theme="light"] .travel-section {
  border-color: rgba(0, 0, 0, 0.12);
  background: rgba(255, 255, 255, 0.75);
}

.travel-section-title {
  margin: 0 0 8px;
  font-size: 0.88rem;
  font-weight: 700;
}

.travel-steps {
  margin: 0 0 8px;
  padding-left: 20px;
  font-size: 0.82rem;
  line-height: 1.55;
}

.travel-steps li {
  margin-bottom: 6px;
}

.travel-tips {
  margin: 0 0 8px;
  padding-left: 18px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--muted);
  list-style: disc;
}

.travel-tips li {
  margin-bottom: 4px;
}

.travel-map-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}
