/* Only the front window is painted. The underlying view keeps its state. */
html body [data-pt-suspended], html body [data-pt-suspended] * {
  visibility:hidden!important; pointer-events:none!important;
}
html body dialog.pt-window-host {
  position:fixed!important; inset:0!important; margin:0!important; padding:0!important;
  width:100vw!important; max-width:none!important;
  height:var(--pt-viewport-height,100dvh)!important; max-height:none!important;
  border:0!important; border-radius:0!important; overflow:hidden!important;
  background:transparent!important; box-shadow:none!important; backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
}
html body dialog.pt-window-host::backdrop { background:transparent!important; backdrop-filter:none!important; }
html body #cookiePreferences { background:transparent!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
html body #cookiePreferences > div { background:rgba(var(--pt-surface-rgb),var(--pt-glass-opacity))!important; border-radius:18px!important; backdrop-filter:var(--pt-glass-filter)!important; -webkit-backdrop-filter:var(--pt-glass-filter)!important; }

/* An explicit bounded grid prevents a tall image from sizing the whole dialog. */
html body #lightbox {
  --photo-box-height:min(var(--pt-photo-natural-height,760px),calc(var(--pt-viewport-height,100dvh) - var(--pt-safe-top,0px) - var(--pt-safe-bottom,0px) - 32px));
  position:fixed!important; inset:var(--pt-safe-top,0px) 0 var(--pt-safe-bottom,0px)!important;
  width:max-content!important; max-width:calc(100vw - 24px)!important;
  height:auto!important; max-height:var(--photo-box-height)!important;
  margin:auto!important; padding:0!important; overflow:hidden!important;
}
html body #lightbox .lightbox-inner {
  display:grid!important; grid-template-rows:minmax(0,1fr) auto!important;
  width:min(900px,calc(100vw - 24px))!important;
  height:var(--photo-box-height)!important; max-height:var(--photo-box-height)!important;
  min-height:0!important; overflow:hidden!important;
}
html body #lightbox .lightbox-main {
  position:relative!important; display:grid!important; place-items:center!important;
  height:100%!important; min-height:0!important; max-height:100%!important;
  box-sizing:border-box!important; padding:44px 36px 44px!important; overflow:hidden!important;
}
html body #lightbox .lightbox-main img {
  display:block!important; width:100%!important; height:100%!important;
  min-width:0!important; min-height:0!important; max-width:100%!important; max-height:100%!important;
  object-fit:contain!important; margin:0!important;
}
html body #lightbox .lb-close { top:8px!important; right:8px!important; z-index:5!important; }
html body #lightbox .lb-nav { z-index:4!important; }
html body #lightbox .lb-caption { margin:0!important; max-height:32px; overflow:auto; padding:5px 8px!important; background:transparent!important; }
html body #lightbox .lb-caption:empty { display:none!important; }
html body #lightbox .lightbox-thumbs { box-sizing:border-box!important; max-height:68px!important; min-height:0!important; padding:8px!important; overflow-y:hidden!important; }
html body #lightbox .lightbox-thumbs .t { width:48px!important; height:48px!important; min-width:48px!important; }

/* Category is represented by its existing icon before the title. */
html body .custom-modern-saved-popup .saved-popup-header-left {
  display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important;
  align-items:center!important; gap:6px!important;
}
html body .custom-modern-saved-popup .saved-popup-type-pill {
  order:-1!important; width:20px!important; height:20px!important; min-width:20px!important;
  padding:0!important; background:none!important; border:0!important;
}
html body .custom-modern-saved-popup .saved-popup-type-pill > span { display:none!important; }
html body .custom-modern-saved-popup .saved-popup-type-pill-icon { width:18px!important; height:18px!important; filter:none!important; }
html body #placeDetailsModal .place-details-card { padding:16px!important; }
html body #placeDetailsModal .place-details-header { padding:0 0 10px!important; margin:0 0 10px!important; }
html body #placeDetailsModal .place-details-badge { font-size:10px!important; padding:3px 7px!important; }
html body #placeDetailsModal .place-details-stats-grid { gap:6px!important; margin-bottom:10px!important; }
html body #placeDetailsModal .place-details-stat-card { padding:8px!important; min-height:0!important; gap:4px!important; border-radius:9px!important; }
html body #placeDetailsModal .place-details-stat-label { font-size:9px!important; letter-spacing:0!important; }
html body #placeDetailsModal .place-details-stat-val { font-size:18px!important; }
html body #placeDetailsModal .place-details-gpx-substats { padding:7px!important; font-size:11px!important; }
html body #placeDetailsModal .place-details-desc-section { padding:12px!important; margin:0!important; }
html body #placeDetailsModal .place-details-section-label { font-size:10px!important; margin-bottom:8px!important; }
html body #placeDetailsModal .place-details-desc-content { font-size:13px!important; line-height:1.5!important; }

/* The card shows a short preview; the details window keeps the entire text. */
html body .custom-modern-saved-popup .saved-popup-desc-wrap { overflow:hidden!important; padding:9px 11px!important; }
html body .custom-modern-saved-popup .saved-popup-desc {
  display:-webkit-box!important; -webkit-box-orient:vertical!important;
  -webkit-line-clamp:4; line-clamp:4;
  overflow:hidden!important; text-overflow:ellipsis!important; white-space:normal!important; margin:0!important;
}
html body .custom-modern-saved-popup .saved-popup-desc-wrap:focus-visible {
  outline:2px solid #14b8a6; outline-offset:2px;
}

@media (max-width:768px), (max-height:500px) and (max-width:1024px) {
  html body #lightbox { --photo-box-height:min(var(--pt-photo-natural-height,640px),calc(var(--pt-viewport-height,100dvh) - var(--pt-safe-top,0px) - var(--pt-safe-bottom,0px) - 32px)); }
  html body #mobilePlaceSurface .leaflet-popup-content-wrapper { border-radius:18px!important; overflow:hidden!important; }
  html body #mobilePlaceSurface .leaflet-popup-content { padding:0!important; overscroll-behavior:none!important; }
  html body #mobilePlaceSurface .saved-popup-card { padding:0!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important; }
  html body #mobilePlaceSurface .saved-popup-top-bar {
    position:sticky!important; top:0!important; margin:0!important; padding:8px 10px!important;
    min-height:0!important; z-index:20!important; background:rgb(var(--pt-surface-rgb))!important;
    border-bottom-width:2px!important; transition:none!important;
  }
  html body #mobilePlaceSurface .saved-popup-card.sparse .saved-popup-top-bar { display:grid!important; grid-template-columns:minmax(0,1fr) auto!important; }
  html body #mobilePlaceSurface .saved-popup-card.sparse .saved-popup-header-left { display:flex!important; }
  html body #mobilePlaceSurface .saved-popup-card.sparse .saved-popup-header-right { grid-column:auto!important; grid-row:auto!important; }
  html body #mobilePlaceSurface .saved-popup-title { font-size:16px!important; padding:0!important; line-height:1.3!important; }
  html body #mobilePlaceSurface .saved-popup-weather-pill { height:26px!important; padding:0 6px!important; font-size:10px!important; }
  html body #mobilePlaceSurface .saved-popup-header-right { gap:2px!important; max-width:none!important; flex-wrap:nowrap!important; }
  html body #mobilePlaceSurface .saved-popup-header-left { display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important; align-items:center!important; gap:6px!important; }
  html body #mobilePlaceSurface .saved-popup-grid { padding:8px 10px 10px!important; gap:7px!important; }
  html body #mobilePlaceSurface .saved-popup-info-col { gap:7px!important; }
  html body #mobilePlaceSurface .saved-popup-stats-grid { padding:6px 8px!important; gap:4px!important; border-radius:8px!important; }
  html body #mobilePlaceSurface .saved-popup-stat-label { font-size:8px!important; letter-spacing:0!important; }
  html body #mobilePlaceSurface .saved-popup-stat-val { font-size:13px!important; line-height:1.25!important; }
  html body #mobilePlaceSurface :is(.saved-popup-btn,.saved-popup-memory-btn) { min-height:32px!important; height:32px!important; padding:5px 6px!important; font-size:10px!important; }
  html body #mobilePlaceSurface :is(.saved-popup-btn,.saved-popup-memory-btn) svg { width:13px!important; height:13px!important; }
  html body #mobilePlaceSurface .saved-popup-desc-wrap { padding:8px!important; max-height:72px!important; overflow:hidden!important; }
  html body #mobilePlaceSurface .saved-popup-desc { display:-webkit-box!important; -webkit-box-orient:vertical; -webkit-line-clamp:3; overflow:hidden!important; font-size:12px!important; line-height:1.45!important; }
  html body #mobilePlaceSurface .saved-popup-mini-elevation-wrap { padding:7px 8px!important; }
  html body #mobilePlaceSurface .saved-popup-mini-elevation-canvas { height:26px!important; }
  html body #mobilePlaceSurface .saved-popup-mini-elevation-footer { font-size:9px!important; }
  html body #mobilePlaceSurface .saved-popup-media-col .carousel { --phone-photo-height:clamp(130px,19dvh,170px)!important; }
  html body #mobilePlaceSurface .saved-popup-media-col .carousel:has(.carousel-thumbs) { grid-template-rows:var(--phone-photo-height) 42px!important; height:calc(var(--phone-photo-height) + 42px)!important; }
  html body #mobilePlaceSurface .saved-popup-media-col .carousel-thumbs { height:42px!important; min-height:42px!important; max-height:42px!important; padding:4px 6px!important; }
  html body #mobilePlaceSurface .saved-popup-media-col .carousel-thumbs .t { width:40px!important; min-width:40px!important; height:34px!important; min-height:34px!important; max-height:34px!important; }
  html body #mobilePlaceSurface :is(.saved-popup-minimap-col,.saved-popup-minimap-canvas) { height:100px!important; min-height:100px!important; max-height:100px!important; }
  /* Move only the primary map credits to the phone edge, below the navigation. */
  html body #map > .leaflet-control-container > .leaflet-bottom.leaflet-right { bottom:0!important; }
  html body #map > .leaflet-control-container > .leaflet-bottom.leaflet-right .leaflet-control-attribution {
    margin:0!important; max-width:100vw!important; font-size:8px!important; line-height:1.3!important;
    padding:2px 4px!important; white-space:normal!important;
  }
}
@media (orientation:landscape) and (max-height:500px) and (max-width:1024px) {
  html body #mobilePlaceSurface .custom-modern-saved-popup { top:var(--pt-header-height)!important; }
}

/* The route view owns the full profile; the portrait place card stays concise. */
html body #interactiveElevationOverlay .interactive-stats-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
html body #interactiveElevationOverlay .interactive-altitude-range {
  grid-column:1 / -1; display:flex; justify-content:space-between; gap:8px;
  padding:5px 8px; color:var(--text-medium); font-size:11px;
}
html body #interactiveElevationOverlay #interactiveDistance { color:#38bdf8; }
html body #interactiveElevationOverlay #interactiveElevation { color:#10b981; }
html body #interactiveElevationOverlay #interactiveDuration { color:#fbbf24; }
html body #interactiveElevationOverlay .interactive-map-tool-group[hidden] { display:none!important; }
@media (max-width:768px) and (orientation:portrait) {
  html body #placeDetailsModal .place-details-card { padding:12px!important; gap:8px!important; }
  html body #placeDetailsModal .place-details-header { padding-bottom:8px!important; margin:0!important; gap:8px!important; }
  html body #placeDetailsModal .place-details-header-info { gap:7px!important; }
  html body #placeDetailsModal .place-details-title { font-size:17px!important; }
  html body #placeDetailsModal .weather-badge,
  html body #placeDetailsModal .place-details-section-label,
  html body #mobilePlaceSurface .saved-popup-mini-elevation-wrap { display:none!important; }
  html body #placeDetailsModal .place-details-body { gap:8px!important; padding:0!important; min-height:0!important; }
  html body #placeDetailsModal .place-details-stats-grid { margin:0!important; gap:5px!important; }
  html body #placeDetailsModal .place-details-stat-card { padding:7px!important; gap:3px!important; }
  html body #placeDetailsModal .place-details-stat-label svg { width:10px!important; height:10px!important; }
  html body #placeDetailsModal .place-details-stat-val { font-size:16px!important; }
  html body #placeDetailsModal .place-details-gpx-substats { padding:5px 7px!important; font-size:10px!important; }
  html body #placeDetailsModal .place-details-desc-section { padding:9px!important; gap:0!important; border-radius:10px!important; }
  html body #placeDetailsModal .place-details-desc-content { line-height:1.45!important; }
  html body #interactiveElevationOverlay { padding:12px!important; }
  html body #interactiveElevationOverlay .interactive-elevation-window {
    height:min(560px,calc(var(--pt-viewport-height,100dvh) - var(--pt-safe-top,0px) - var(--pt-safe-bottom,0px) - 24px))!important;
  }
  html body #interactiveElevationOverlay .interactive-elevation-header { padding:8px 10px!important; }
  html body #interactiveElevationOverlay .interactive-elevation-title { font-size:16px!important; }
  html body #interactiveElevationOverlay .interactive-elevation-content { padding:9px!important; gap:7px!important; }
  html body #interactiveElevationOverlay .interactive-stats-grid { gap:5px!important; }
  html body #interactiveElevationOverlay .interactive-stat-item { padding:6px!important; border-radius:8px!important; }
  html body #interactiveElevationOverlay .interactive-stat-label { font-size:9px!important; line-height:1.2!important; margin-bottom:3px!important; }
  html body #interactiveElevationOverlay .interactive-stat-value { font-size:15px!important; line-height:1.3!important; }
  html body #interactiveElevationOverlay .interactive-altitude-range { padding:2px 5px!important; font-size:10px!important; }
  html body #interactiveElevationOverlay .interactive-map-container { flex:1 0 150px!important; min-height:150px!important; }
  html body #interactiveElevationOverlay .interactive-elevation-chart-container { flex:0 0 156px!important; height:156px!important; border-radius:10px!important; }
  html body #interactiveElevationOverlay .interactive-map-toolbar { top:7px!important; right:7px!important; gap:5px!important; }
  html body #interactiveElevationOverlay .interactive-map-tool-btn { width:30px!important; height:30px!important; min-height:30px!important; }
  html body #interactiveElevationOverlay .interactive-map-tool-btn.compass-btn { width:auto!important; min-width:40px!important; }
  html body #interactiveElevationOverlay .elevation-info-tooltip { padding:5px 7px!important; font-size:10px!important; }
}

/* One glass surface per window, without solid frames or nested photo panels. */
html body :is(dialog,#weatherModal,#legalModal,#placesOverviewOverlay,#placesListOverlay,#interactiveElevationOverlay) :is(
  .modal-body,.settings-body,.settings-section,.share-modal-body,.place-details-body,
  .weather-modal-body,.legal-modal-body,.places-overview-content,.places-list-content,
  .interactive-elevation-header,.interactive-elevation-content,.lightbox-main,.lightbox-thumbs,
  .profile-header,.profile-body,.journal-header,.journal-content
) { background:transparent!important; }
html body :is(#map,#mobilePlaceSurface) .custom-modern-saved-popup :is(
  .leaflet-popup-content,.saved-popup-grid,.saved-popup-media-col,.saved-popup-info-col,
  .carousel,.carousel-main,.carousel-thumbs
) { background:transparent!important; }
html body #mobilePlaceSurface .custom-modern-saved-popup .leaflet-popup-content-wrapper {
  background:rgba(var(--pt-surface-rgb),var(--pt-glass-opacity))!important;
  backdrop-filter:var(--pt-glass-filter)!important; -webkit-backdrop-filter:var(--pt-glass-filter)!important;
}
html body #mobilePlaceSurface .custom-modern-saved-popup .saved-popup-card {
  background:transparent!important; box-shadow:none!important; backdrop-filter:none!important; -webkit-backdrop-filter:none!important;
}
html body #mobilePlaceSurface .custom-modern-saved-popup .saved-popup-top-bar {
  background:rgba(var(--pt-surface-rgb),.72)!important;
}
html body #mobilePlaceSurface .custom-modern-saved-popup .saved-popup-card.sparse:not(.shared-place-card) .saved-popup-header-left {
  display:flex!important; grid-column:1!important; grid-row:1!important;
}
html body #mobilePlaceSurface .custom-modern-saved-popup .saved-popup-card.sparse:not(.shared-place-card) .saved-popup-header-right {
  grid-column:2!important; grid-row:1!important;
}
/* Tablet and desktop share one dock, one timer and one calm transition. */
html.side-dock-layout body #sidebar.sidebar {
  position:fixed!important; display:block!important; visibility:visible!important; opacity:1!important;
  right:0!important; left:auto!important; top:var(--pt-header-height,64px)!important; bottom:0!important;
  pointer-events:auto!important; z-index:1000!important;
  width:var(--sidebar-current-width,340px)!important; height:auto!important; max-height:none!important;
  transform:none!important; padding:16px 18px 20px!important; border-radius:0!important;
  overflow-x:hidden!important; overflow-y:auto!important;
  transition:width .68s cubic-bezier(.22,1,.36,1),padding .68s cubic-bezier(.22,1,.36,1),box-shadow .68s ease!important;
}
html.side-dock-layout body #sidebar.sidebar.collapsed { width:68px!important; padding:14px 10px 18px!important; }
html.side-dock-layout body #sidebar .mobile-menu-heading { display:none!important; }
html.side-dock-layout body #backdrop { display:none!important; }
html.side-dock-layout body #sidebar :is(.add-btn,#inspireBtn,.filter-btn,.sidebar-settings button) {
  transition:width .68s cubic-bezier(.22,1,.36,1),padding .68s cubic-bezier(.22,1,.36,1),height .68s cubic-bezier(.22,1,.36,1),background-color .22s ease!important;
}
html.side-dock-layout body #sidebar :is(.add-btn,#inspireBtn,.sidebar-settings button),
html.side-dock-layout body #sidebar:not(.collapsed) .filter-btn { overflow:hidden!important; }
html.side-dock-layout body #sidebar :is(.section-title > span,.add-btn > span,#inspireBtn > span,.filter-btn > span > span,.total-markers-label,.sidebar-settings button > span) {
  display:inline-block!important; max-width:260px; opacity:1; overflow:hidden; white-space:nowrap;
  transition:opacity .22s ease,max-width .55s cubic-bezier(.22,1,.36,1)!important;
}
html.side-dock-layout body #sidebar.collapsed :is(.section-title > span,.add-btn > span,#inspireBtn > span,.filter-btn > span > span,.total-markers-label,.sidebar-settings button > span) {
  opacity:0; max-width:0; pointer-events:none;
}
@media (prefers-reduced-motion:reduce) {
  html.side-dock-layout body #sidebar.sidebar,
  html.side-dock-layout body #sidebar * { transition:none!important; }
}

/* The icon and title share a single row, including sparse desktop cards. */
html body :is(#map,#mobilePlaceSurface) .custom-modern-saved-popup .saved-popup-card.sparse:not(.shared-place-card) .saved-popup-header-left {
  display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important;
  align-items:center!important; grid-column:1!important; grid-row:1!important;
}
html body :is(#map,#mobilePlaceSurface) .custom-modern-saved-popup .saved-popup-card.sparse:not(.shared-place-card) .saved-popup-header-right {
  grid-column:2!important; grid-row:1!important;
}
html body :is(#map,#mobilePlaceSurface) .custom-modern-saved-popup .saved-popup-type-pill { flex:0 0 20px!important; }
html.side-dock-layout body .main-container { top:0!important; height:var(--pt-viewport-height,100dvh)!important; padding-bottom:0!important; }
html.side-dock-layout body #map { top:0!important; height:100%!important; }
html.side-dock-layout body .main-container .map-container { height:100%!important; min-height:0!important; }
html.side-dock-layout body .mobile-nav { display:none!important; }
html.side-dock-layout body #profileBtnDesktop { display:flex!important; }
@media (min-width:700px) and (max-width:768px) and (min-height:501px) {
  html.side-dock-layout body .custom-modern-saved-popup .leaflet-popup-content {
    width:min(420px,calc(100vw - var(--sidebar-current-width,340px) - 28px))!important;
    max-width:calc(100vw - var(--sidebar-current-width,340px) - 28px)!important;
  }
}

html.side-dock-layout body .header .header-right .userbox { display:flex!important; }
html.side-dock-layout body #sidebar #addNewMarkerBtn { display:flex!important; }

html.side-dock-layout body #sidebar .filter-buttons { display:flex!important; flex-direction:column!important; gap:8px!important; }
html.side-dock-layout body #sidebar:not(.collapsed) .filter-buttons .filter-btn { width:100%!important; }

/* Floating counters need their own paint area outside the compact button. */
html.side-dock-layout body #sidebar.collapsed .filter-btn { overflow:visible!important; }
html.side-dock-layout body #sidebar.collapsed .filter-btn .btn-count {
  display:block!important; top:-4px!important; right:-4px!important;
  width:auto!important; min-width:19px!important; max-width:none!important;
  height:18px!important; padding:2px 4px!important; box-sizing:border-box!important;
  font-size:9.5px!important; line-height:14px!important; font-weight:600!important;
  white-space:nowrap!important; overflow:visible!important;
}

/* Photo and text columns follow the card width, rather than fixed media widths. */
html.side-dock-layout body #map .custom-modern-saved-popup .leaflet-popup-content {
  max-height:calc(var(--pt-popup-available-height,100dvh - 88px) - 16px)!important;
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-media-col {
  width:100%!important; min-width:0!important; max-width:100%!important;
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-minimap-col {
  height:260px!important; min-height:0!important; max-height:260px!important; align-self:start!important;
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-minimap-canvas {
  height:100%!important; min-height:0!important; max-height:100%!important;
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-info-col {
  container-type:inline-size; container-name:placeinfo;
}
@container placeinfo (max-width:480px) {
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-actions-wrap:has(.saved-popup-memory-btn) {
    grid-template-columns:minmax(0,1fr)!important;
  }
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-grid.no-gpx.has-photo {
  grid-template-columns:minmax(0,.85fr) minmax(0,1.6fr)!important;
  grid-template-areas:"media info"!important;
}
html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-card.sparse.has-photo .saved-popup-grid {
  grid-template-columns:minmax(0,1fr)!important; grid-template-areas:"media" "info"!important;
}
@container popupcard (max-width:740px) {
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-minimap-col { height:180px!important; }
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-grid.has-gpx.has-photo {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    grid-template-areas:"media minimap" "info info"!important;
  }
}
@container popupcard (max-width:480px) {
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-grid.has-photo.no-gpx {
    grid-template-columns:minmax(0,1fr)!important; grid-template-areas:"media" "info"!important;
  }
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-grid.has-photo.has-gpx {
    grid-template-columns:minmax(0,1fr)!important; grid-template-areas:"media" "minimap" "info"!important;
  }
  html.side-dock-layout body #map .custom-modern-saved-popup .saved-popup-grid.no-photo.has-gpx {
    grid-template-columns:minmax(0,1fr)!important; grid-template-areas:"minimap" "info"!important;
  }
}
