/**
 * The Fallback v2 - Components
 * Modals, location cards, forms, and other reusable components
 */

/* ═══════════════════════════════════════════════════════════════════════════
   MODALS
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: var(--color-backdrop);
  z-index: var(--z-modal-backdrop);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-backdrop.visible {
  opacity: 1;
  visibility: visible;
}

.modal {
  position: fixed;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-slow);
}

.modal.visible {
  opacity: 1;
  visibility: visible;
}

/* Bottom sheet modal (mobile) */
.modal-sheet {
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 90vh;
  background: var(--color-surface);
  border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  transform: translateY(100%);
  display: flex;
  flex-direction: column;
}

.modal-sheet.visible {
  transform: translateY(0);
}

.modal-sheet .modal-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: var(--space-4) auto var(--space-2);
  flex-shrink: 0;
}

.modal-sheet .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4) var(--space-4);
  flex-shrink: 0;
}

.modal-sheet .modal-title {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
}

.modal-sheet .modal-subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.modal-sheet .modal-close {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-surface-alt);
  border-radius: 50%;
}

.modal-sheet .modal-close svg {
  width: 18px;
  height: 18px;
  stroke: var(--color-text);
}

.modal-sheet .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-4);
  -webkit-overflow-scrolling: touch;
}

.modal-sheet .modal-footer {
  padding: var(--space-4);
  flex-shrink: 0;
}

/* Center modal (desktop/dialogs) */
.modal-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.95);
  width: 90%;
  max-width: 400px;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-center.visible {
  transform: translate(-50%, -50%) scale(1);
}

.modal-center .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5);
  flex-shrink: 0;
}

.modal-center .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 0 var(--space-5) var(--space-5);
}

.modal-center .modal-footer {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-5);
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOCATION CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.location-card {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.location-card:hover {
  box-shadow: var(--shadow-md);
}

.location-card:active {
  transform: scale(0.98);
}

.location-card.selected {
  box-shadow: 0 0 0 2px var(--color-primary);
  background: var(--color-primary-muted);
}

.location-card-image {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
}

.location-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.location-card-content {
  flex: 1;
  min-width: 0;
}

.location-card-name {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.location-card-address {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.location-card-topline {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-2);
}

.location-card-cost {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  flex-shrink: 0;
}

.location-card-typeline {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 2px;
}
.location-card-status {
  color: var(--color-primary);
  font-weight: var(--font-medium);
}

.location-card-rating {
  font-size: var(--text-sm);
  margin-top: var(--space-1);
  color: var(--color-accent);
  letter-spacing: 1px;
}
.location-card-rating .muted {
  color: var(--color-border);
}

.location-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.location-card-tag {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-sm);
}

.location-card-tag.cost {
  background: var(--color-success-light);
  color: var(--color-success);
}

.location-card-tag.amenity {
  background: var(--color-info-light);
  color: var(--color-info);
}

.location-card-tag.requirement {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

/* ═══════════════════════════════════════════════════════════════════════════
   FORM COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group {
  margin-bottom: var(--space-4);
}

.form-row {
  display: flex;
  gap: var(--space-3);
}

.form-row > * {
  flex: 1;
}

/* Toggle chips (for amenities) */
.toggle-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.toggle-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  background: var(--color-surface-alt);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.toggle-chip:hover {
  background: var(--color-border);
}

.toggle-chip.active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.toggle-chip input {
  display: none;
}

/* Route preview */
.route-preview {
  background: var(--color-surface-alt);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.route-preview-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
}

.route-preview-stats {
  display: flex;
  gap: var(--space-6);
}

.route-preview-stat {
  text-align: left;
}

.route-preview-stat-value {
  font-size: var(--text-2xl);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.route-preview-stat-value.accent {
  color: var(--color-accent);
}

.route-preview-stat-label {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Backup options */
.backup-options {
  background: var(--color-accent-muted);
  border: 1px solid rgba(201, 164, 92, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.backup-options-title {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--color-accent);
  margin-bottom: var(--space-3);
}

.backup-options-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.backup-option {
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
}

.backup-option-name {
  font-weight: var(--font-medium);
  color: var(--color-text);
}

.backup-option-distance {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════════════════════════════════ */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: var(--space-4);
}

.empty-state-title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-6);
  max-width: 280px;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TOASTS / NOTIFICATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  bottom: calc(var(--nav-height-mobile) + var(--space-4));
  left: var(--space-4);
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  padding: var(--space-4);
  background: var(--color-text);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  box-shadow: var(--shadow-xl);
  animation: slideUp var(--transition-slow) ease;
  pointer-events: auto;
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-error);
}

/* ═══════════════════════════════════════════════════════════════════════════
   OFFLINE BANNER
   ═══════════════════════════════════════════════════════════════════════════ */

#offline-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: var(--space-3) var(--space-4);
  padding-top: calc(var(--space-3) + var(--safe-top));
  background: var(--color-warning);
  color: white;
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  text-align: center;
  z-index: var(--z-toast);
  display: none;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEAFLET MAP OVERRIDES
   ═══════════════════════════════════════════════════════════════════════════ */

.leaflet-container {
  font-family: var(--font-family);
}

.leaflet-control-attribution {
  font-size: 10px !important;
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-lg) !important;
}

.leaflet-popup-content {
  margin: var(--space-3) !important;
  font-size: var(--text-sm) !important;
}

/* Custom marker styles */
.custom-marker {
  display: flex;
  align-items: center;
  justify-content: center;
}

.marker-pin {
  width: 28px;
  height: 28px;
  background: var(--color-marker-default);
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

.marker-pin.selected {
  transform: scale(1.3);
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.marker-pin.current {
  background: var(--color-marker-current);
}

.marker-pin.backup {
  background: var(--color-marker-backup);
}

/* Transient marker shown when a Discover POI's detail panel is open. Gold
   accent matches the FAB / drag-pin family so the user reads it as
   "currently inspecting" rather than "saved location". Slightly larger
   than the default entry pin so it stands out on busy map views. */
.marker-pin.discover {
  background: var(--color-accent);
  border-color: white;
  width: 32px;
  height: 32px;
}

/* Teal result markers for every POI in the current Discover results.
   Smaller than the gold "selected" marker so when both are visible the
   selected one stands out. Click → opens the detail panel for that POI. */
.marker-pin.discover-result {
  background: #7FC3A5;
  border: 2px solid white;
  width: 18px;
  height: 18px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.marker-pin.discover-result:hover {
  transform: scale(1.25);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

/* Discover marker clusters (Hiking only). Teal-on-white badge with the
   child count, matching the .discover-result pin palette. The wrap class
   strips Leaflet.markercluster's default styling so our pill stands alone. */
.discover-cluster-wrap { background: transparent; border: none; }
.discover-cluster {
  width: 36px; height: 36px;
  background: #7FC3A5;
  color: white;
  border: 2px solid white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 12px/1 var(--font-display, 'Poppins', sans-serif);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s ease;
}
.leaflet-marker-icon:hover .discover-cluster { transform: scale(1.1); }

/* Custom popup styles — Mapbox GL JS */
.custom-popup .mapboxgl-popup-content {
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  min-width: 200px;
}

.custom-popup .mapboxgl-popup-tip {
  border-top-color: white;
  border-bottom-color: white;
}

.custom-popup .mapboxgl-popup-close-button {
  font-size: 18px;
  padding: 4px 8px;
  color: var(--color-text-muted);
}

/* User-location marker (blue dot + pulsing ring) */
.user-location-marker {
  position: relative;
  width: 36px;
  height: 36px;
  pointer-events: none;
}
.user-location-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  background: #3498db;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.user-location-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  background: rgba(52, 152, 219, 0.18);
  border: 1px solid rgba(52, 152, 219, 0.6);
  border-radius: 50%;
}

.marker-popup {
  padding: var(--space-4);
}

.marker-popup-name {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.marker-popup-status {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
}

.marker-popup-cost {
  font-size: var(--text-base);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.marker-popup-btn {
  display: block;
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.marker-popup-btn:hover {
  background: var(--color-primary-light);
}

/* ═══════════════════════════════════════════════════════════════════════════
   DISCOVER DETAIL PANEL
   Sub-elements rendered inside #discover-detail-content. Wraps Wikipedia
   summary + OSM tag fields for a single Discover POI.
   ═══════════════════════════════════════════════════════════════════════════ */

.dd-hero {
  width: calc(100% + var(--space-4) * 2);
  margin: calc(var(--space-4) * -1) calc(var(--space-4) * -1) var(--space-4);
  height: 180px;
  background-size: cover;
  background-position: center;
  background-color: var(--color-surface-alt);
  position: relative;
}
.dd-hero.fallback {
  background: linear-gradient(135deg, #5a8c75 0%, var(--color-primary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  opacity: 0.9;
  color: rgba(255,255,255,0.7);
}
.dd-hero-pill {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255,255,255,0.95);
  color: var(--color-primary);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dd-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  margin-bottom: 4px;
}
.dd-subline {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.dd-description {
  font-size: 14px;
  line-height: 1.55;
  color: var(--color-text);
  margin-bottom: 6px;
}
.dd-wiki-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.dd-wiki-attribution {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 4px;
  margin-bottom: 16px;
}
.dd-empty-blurb {
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.5;
}
.dd-empty-blurb strong {
  color: var(--color-text);
  display: block;
  margin-bottom: 4px;
}
.dd-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
}
.dd-fact {
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}
.dd-fact-label {
  font-size: 10px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dd-fact-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-top: 2px;
}
.dd-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.dd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 18px;
}
.dd-badge {
  font-size: 11px;
  font-weight: 500;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  padding: 4px 9px;
  border-radius: var(--radius-sm);
}
.dd-badge.warn    { background: rgba(245,158,11,0.15); color: #92400e; }
.dd-badge.unknown { background: rgba(0,0,0,0.06);       color: var(--color-text-muted); }
.dd-info-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-top: 0.5px solid var(--color-border);
  font-size: 13px;
  color: var(--color-text);
}
.dd-info-row:last-of-type { border-bottom: 0.5px solid var(--color-border); }
.dd-info-row .dd-ico {
  flex-shrink: 0;
  width: 16px;
  color: var(--color-text-muted);
  text-align: center;
}
.dd-info-row .dd-info-content { flex: 1; word-break: break-word; }
.dd-info-row .dd-info-content .dd-info-label {
  color: var(--color-text-muted);
  margin-right: 4px;
}
.dd-info-row a { color: var(--color-primary); text-decoration: none; word-break: break-all; }
/* Site Open / Closed / Unknown statuses inside the subline block. */
.dd-status {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}
.dd-status.open    { color: #15803d; }   /* green-700 */
.dd-status.closed  { color: #b91c1c; }   /* red-700 */
.dd-status.unknown { color: var(--color-text-muted); font-weight: 500; }
/* Sections (Fees, Directions) inserted between Amenities and info rows. */
.dd-section {
  margin: 14px 0 4px;
}
.dd-section-heading {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 6px;
}
.dd-section-body {
  font-size: 13px;
  color: var(--color-text);
  line-height: 1.4;
}
.dd-section-body.dd-unknown,
.dd-na {
  color: var(--color-text-muted);
  font-style: italic;
}

/* Active Alerts section — amber-tinted callout that surfaces above the
   description so users see closures/construction/fire restrictions before
   anything else. Source: fs.usda.gov page alerts block. */
.dd-section.dd-section-alert {
  background: #fef3c7;        /* amber-100 */
  border-left: 4px solid #d97706;  /* amber-600 */
  border-radius: 6px;
  padding: 10px 12px;
  margin: 12px 0;
}
.dd-section.dd-section-alert .dd-section-heading {
  color: #92400e;             /* amber-800 */
  margin-bottom: 4px;
}
.dd-alert-list {
  margin: 0;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.5;
}
.dd-alert-list li {
  margin-bottom: 2px;
}
.dd-alert-list a {
  color: #92400e;
  text-decoration: underline;
}
.dd-alert-list a:hover {
  color: #78350f;
}

/* "Last verified" subline — slightly muted so it doesn't compete with
   the distance/region lines but still readable for freshness scanning. */
.dd-verified-line {
  font-size: 12px;
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
}

/* Stale-data disclaimer — amber call-to-action surfaced below the status
   line when the data is >9 months old OR a recreation-season boundary
   has been crossed since the last update. */
.dd-stale-notice {
  background: #fef3c7;        /* amber-100 */
  border-left: 4px solid #d97706;
  border-radius: 6px;
  padding: 8px 12px;
  margin: 10px 0;
  font-size: 12.5px;
  color: #78350f;
  line-height: 1.45;
}
.dd-stale-notice a {
  color: #78350f;
  text-decoration: underline;
  font-weight: 600;
}
/* Show-more toggle (description + Fees + Directions). */
.dd-show-more {
  color: var(--color-primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.dd-show-more:hover { text-decoration: underline; }
.dd-loading {
  font-size: 12px;
  color: var(--color-text-muted);
  font-style: italic;
  padding: 8px 0 16px;
}
.dd-ridb-credit {
  font-size: 10px;
  color: var(--color-text-muted);
  font-style: italic;
  margin-top: 12px;
  padding-top: 8px;
  border-top: 0.5px solid var(--color-border);
}

/* Footer "Look up" row — Google + Wikipedia search launchers. Sits above
   the action buttons. Each pill is 1 tap → external browser. */
.dd-lookup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 0.5px solid var(--color-border);
}
.dd-lookup-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-right: 2px;
}
.dd-lookup-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  text-decoration: none;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.dd-lookup-btn:hover {
  background: var(--color-surface-alt);
  border-color: var(--color-text-muted);
}
.dd-lookup-btn svg { display: block; }
.dd-wiki-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 700;
  font-size: 14px;
  color: var(--color-text);
  line-height: 1;
}
.dd-footer-actions {
  display: flex;
  gap: 8px;
}
/* Footer holds two stacked rows (lookup + actions). Override the side-panel
   default which lays children out flat. */
#discover-detail-footer.side-panel-footer {
  display: block;
}

/* ═══════════════════════════════════════════════════════════════════════════
   DROPDOWN SELECT
   ═══════════════════════════════════════════════════════════════════════════ */

.dropdown {
  position: relative;
}

.dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface-alt);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-trigger:focus {
  outline: none;
  background: var(--color-surface);
  box-shadow: 0 0 0 2px var(--color-primary-muted);
}

.dropdown-trigger svg {
  width: 16px;
  height: 16px;
  stroke: var(--color-text-muted);
  transition: transform var(--transition-fast);
}

.dropdown.open .dropdown-trigger svg {
  transform: rotate(180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: var(--space-1);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition-fast);
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--color-surface-alt);
}

.dropdown-item.selected {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-weight: var(--font-medium);
}

/* ═══════════════════════════════════════════════════════════════════════════
   STAR RATING
   ═══════════════════════════════════════════════════════════════════════════ */

.star-rating {
  display: flex;
  gap: var(--space-1);
}

.star {
  font-size: 24px;
  color: var(--color-border);
  cursor: pointer;
  transition: color var(--transition-fast), transform var(--transition-fast);
}

.star:hover {
  transform: scale(1.1);
}

.star.active {
  color: var(--color-accent);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SKELETON LOADING
   ═══════════════════════════════════════════════════════════════════════════ */

.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-alt) 25%,
    var(--color-border-light) 50%,
    var(--color-surface-alt) 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: var(--radius-sm);
}

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  height: 88px;
  margin-bottom: var(--space-3);
  border-radius: var(--radius-lg);
}

.skeleton-text {
  height: 16px;
  margin-bottom: var(--space-2);
}

.skeleton-text.short {
  width: 60%;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRIPS / JOURNEY COMPONENTS
   ═══════════════════════════════════════════════════════════════════════════ */

/* Fuel bar (trips view header) */
.fuel-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(88, 111, 107, 0.08);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.15s;
}
.fuel-bar:hover { background: rgba(88, 111, 107, 0.14); }
.fuel-bar-icon { font-size: 14px; }
.fuel-bar-text { flex: 1; }
.fuel-bar-edit { color: var(--color-primary); font-weight: 600; font-size: 11px; }

/* Journey menu item button */
.jmenu-item {
  display: block;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  text-align: left;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.12s;
}
.jmenu-item:hover { background: rgba(127, 195, 165, 0.12); }

/* Leg drag-and-drop item */
.leg-item { transition: opacity 0.15s; }
.leg-item.drag-over { background: rgba(127, 195, 165, 0.08); border-radius: 8px; }

/* Search results dropdown (leg modal from/to fields) */
.search-results-dropdown {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: 4px;
  background: var(--color-surface);
  box-shadow: var(--shadow-md);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JOURNEY DETAIL PANEL
   Full-screen sliding panel overlaying trips view
   ═══════════════════════════════════════════════════════════════════════════ */

.side-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 700;
  background: var(--color-bg, #f2f0eb);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* Animate in from right */
  animation: slideInRight 0.22s ease;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* Desktop: panel sits alongside sidebar */
@media (min-width: 641px) {
  .side-panel {
    left: 64px; /* sidebar width */
    max-width: 420px;
    border-right: 1px solid var(--color-border);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOCATION DETAIL PANEL
   Bottom sheet that slides up when viewing a location
   ═══════════════════════════════════════════════════════════════════════════ */

.location-detail-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 650;
  background: var(--color-surface, white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  pointer-events: none;
}
.location-detail-panel.open {
  transform: translateY(0);
  pointer-events: auto;
}

.location-detail-resize {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 12px auto 4px;
  flex-shrink: 0;
}
.location-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border-light, #e5e7eb);
}
.location-detail-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  -webkit-overflow-scrolling: touch;
}
.location-detail-footer {
  padding: 12px 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--color-border-light, #e5e7eb);
}

/* Desktop: position beside sidebar */
@media (min-width: 641px) {
  .location-detail-panel {
    left: 64px;
    max-width: 380px;
    border-radius: 0 16px 16px 0;
    top: auto;
    bottom: 0;
    max-height: 70vh;
    transform: translateX(-100%);
  }
  .location-detail-panel.open {
    transform: translateX(0);
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAP FAB (floating action button on saved view)
   ═══════════════════════════════════════════════════════════════════════════ */

.map-fab {
  position: absolute;
  bottom: 200px;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--color-primary, #163F2E);
  color: white;
  border: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 500;
  transition: transform 0.15s, box-shadow 0.15s;
}
.map-fab:active { transform: scale(0.94); }

/* ═══════════════════════════════════════════════════════════════════════════
   LOCATION LIST SHEET (saved view)
   ═══════════════════════════════════════════════════════════════════════════ */

.location-list-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-surface, white);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
  max-height: 50vh;
  display: flex;
  flex-direction: column;
  z-index: 400;
}
.sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border, #e5e7eb);
  border-radius: 2px;
  margin: 10px auto 6px;
  flex-shrink: 0;
}
.sheet-header {
  padding: 0 16px 10px;
  flex-shrink: 0;
}
.entries-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
  -webkit-overflow-scrolling: touch;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAP CONTAINER (saved view)
   ═══════════════════════════════════════════════════════════════════════════ */

.map-container {
  position: relative;
  flex: 1;
  height: 100%;
}
.map-container #map {
  position: absolute;
  inset: 0;
}
.map-header {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 500;
}
.map-search-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: white;
  border-radius: 12px;
  padding: 8px 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}
.map-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  color: var(--color-text, #1f2937);
}
.map-locate-btn {
  flex-shrink: 0;
  color: var(--color-text-muted, #6b7280);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SETTINGS VIEW
   ═══════════════════════════════════════════════════════════════════════════ */

.settings-section {
  background: var(--color-surface, white);
  border-radius: var(--radius-lg, 12px);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}
.settings-item { padding: 4px 0; }
.settings-item-label { font-size: 12px; color: var(--color-text-muted); margin-bottom: 2px; }
.settings-item-value { font-size: 15px; font-weight: 600; color: var(--color-text); }
.settings-item-subvalue { font-size: 12px; color: var(--color-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL OVERRIDES FOR TRIPS MODALS
   Make modal-sheet taller on mobile for leg form
   ═══════════════════════════════════════════════════════════════════════════ */

#modal-leg.modal-sheet {
  max-height: 95vh;
}
#modal-leg .modal-body {
  padding-bottom: 8px;
}

/* Trips view header — stack header-row and fuel-bar vertically */
.trips-view-header {
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-3);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JOURNEY CARDS — Trips list
   ═══════════════════════════════════════════════════════════════════════════ */

.journey-section {
  margin-bottom: var(--space-4);
}

.journey-section-title {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  padding: 0 var(--space-2) var(--space-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.journey-card {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}
.journey-card:hover {
  background: var(--color-surface-alt);
}
.journey-card.pinned {
  border-left: 3px solid var(--color-primary);
  background: rgba(127, 195, 165, 0.04);
}
.journey-card.pinned:hover {
  background: rgba(127, 195, 165, 0.08);
}

.jcard-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  gap: 12px;
}

.jcard-info {
  min-width: 0;
  flex: 1;
}

.jcard-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}

.jcard-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.jcard-price {
  text-align: right;
  flex-shrink: 0;
}

.jcard-price-val {
  font-size: 18px;
  font-weight: 600;
  color: #7FC3A5;
  line-height: 1;
}

.jcard-price-lbl {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.jcard-budgets {
  display: flex;
  gap: 6px;
}

.bp {
  flex: 1;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.bp.muted {
  background: var(--color-surface-alt);
}
.bp.accent {
  background: #7FC3A5;
}
.bp-v {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.bp.accent .bp-v {
  color: white;
}
.bp-l {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.bp.accent .bp-l {
  color: rgba(255, 255, 255, 0.85);
}

/* ═══════════════════════════════════════════════════════════════════════════
   JOURNEY DETAIL HEADER
   ═══════════════════════════════════════════════════════════════════════════ */

.detail-panel-hd {
  padding: var(--space-3) var(--space-4) var(--space-4);
  border-bottom: 0.5px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
}

.detail-back-row {
  margin-bottom: var(--space-2);
}

.detail-back-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  cursor: pointer;
  padding: 4px 0;
}

.detail-panel-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.detail-journey-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  flex: 1;
  min-width: 0;
  word-wrap: break-word;
}

.detail-actions {
  display: flex;
  gap: var(--space-1);
  align-items: center;
  flex-shrink: 0;
}

.detail-share-btn,
.detail-more-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: background var(--transition-fast);
}
.detail-share-btn:hover,
.detail-more-btn:hover {
  background: var(--color-surface-alt);
}
.detail-more-btn {
  font-size: 20px;
  line-height: 1;
}

.detail-menu-wrap {
  position: relative;
}

.detail-journey-meta {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: 4px;
  margin-bottom: var(--space-3);
}

.detail-cost-row {
  display: flex;
  gap: var(--space-2);
}

.detail-cost-card {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  text-align: center;
}
.detail-cost-card.muted { background: var(--color-surface-alt); }
.detail-cost-card.accent { background: #7FC3A5; }
.detail-cost-label {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-bottom: 2px;
}
.detail-cost-card.accent .detail-cost-label {
  color: rgba(255, 255, 255, 0.85);
}
.detail-cost-value {
  font-size: 17px;
  font-weight: 600;
  color: var(--color-text);
}
.detail-cost-card.accent .detail-cost-value {
  color: white;
}

/* ═══════════════════════════════════════════════════════════════════════════
   MAPS PICKER MODAL BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.maps-picker-btn {
  width: 100%;
  padding: 14px;
  text-align: left;
  margin-bottom: 8px;
  font-size: var(--text-base);
}
.maps-picker-btn:last-child {
  margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   TRIP STATUS SUMMARY CARD (Explore view)
   v2 styling — cream/white surfaces with teal accents (not dark green)
   ═══════════════════════════════════════════════════════════════════════════ */

.trip-status-card {
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* Empty state (no active journey) */
.trip-status-card .ts-empty {
  text-align: center;
  padding: var(--space-4) var(--space-2);
}
.ts-empty-title {
  font-size: var(--text-base);
  font-weight: var(--font-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.ts-empty-sub {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* Journey chooser (shown when no current journey but journeys exist) */
.ts-chooser-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ts-chooser-item {
  background: var(--color-surface-alt);
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.ts-chooser-item:hover {
  background: rgba(127, 195, 165, 0.10);
  border-color: var(--color-primary);
}
.ts-chooser-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-primary);
}
.ts-chooser-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Header row: journey name + "Current" pill */
.ts-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.ts-journey-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.25;
}
.ts-meta {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.ts-current-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(127, 195, 165, 0.15);
  border-radius: var(--radius-full);
  padding: 4px 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition-fast);
}
.ts-current-pill:hover {
  background: rgba(127, 195, 165, 0.25);
}
.ts-current-pill > span:last-child {
  font-size: 11px;
  font-weight: 600;
  color: #1D9E75;
}
.ts-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7FC3A5;
  flex-shrink: 0;
  display: inline-block;
}

/* Status block — "Currently at" / "En route to" (light teal background) */
.ts-block {
  border-radius: var(--radius-md);
  padding: 12px 14px;
}
.ts-block-light {
  background: rgba(127, 195, 165, 0.10);
}
.ts-block-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
}
.ts-block-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  margin-left: 16px;
  line-height: 1.3;
}
.ts-block-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-left: 16px;
  margin-top: 4px;
}

/* Status block — "Next destination" (forest green with share icon) */
.ts-block-dark {
  background: var(--color-primary);
  color: white;
  position: relative;
}
.ts-share-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  transition: background var(--transition-fast);
}
.ts-share-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}
.ts-block-label-inv {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.ts-block-name-inv {
  font-size: 16px;
  font-weight: 600;
  color: white;
  line-height: 1.25;
  padding-right: 40px; /* leave room for share button */
}
.ts-stats-inv {
  display: flex;
  gap: 20px;
  margin-top: 10px;
}
.ts-stat-v {
  font-size: 20px;
  font-weight: 600;
  color: white;
  line-height: 1;
}
.ts-stat-l {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 3px;
}

/* Cost row — Est. Spent / Remaining / Total */
.ts-cost-row {
  display: flex;
  gap: 6px;
}
.ts-cost {
  flex: 1;
  padding: 8px;
  border-radius: var(--radius-sm);
  text-align: center;
}
.ts-cost.muted {
  background: var(--color-surface-alt);
}
.ts-cost.accent {
  background: #7FC3A5;
}
.ts-cost-v {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.ts-cost.accent .ts-cost-v {
  color: white;
}
.ts-cost-l {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 1px;
}
.ts-cost.accent .ts-cost-l {
  color: rgba(255, 255, 255, 0.85);
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOCATIONS FILTER PANEL
   ═══════════════════════════════════════════════════════════════════════════ */

.loc-search-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}
.loc-search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  padding: 0 10px;
  height: 36px;
  color: var(--color-text-muted);
}
.loc-search input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 14px;
  outline: none;
  color: var(--color-text);
}
.loc-filter-btn {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 0.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.loc-filter-btn.active {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  border-color: var(--color-primary);
}
#loc-filter-clear {
  color: var(--color-text-muted);
}
#loc-filter-clear:hover {
  background: var(--color-surface-alt);
}
.loc-filter-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.loc-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 0 0;
  align-items: center;
}
.loc-active-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: var(--color-primary-muted);
  color: var(--color-primary);
  font-size: 12px;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}
.loc-active-chip .x {
  opacity: 0.6;
  margin-left: 2px;
}
.loc-active-clear {
  padding: 3px 8px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: transparent;
  border: none;
  cursor: pointer;
}

.loc-filter-panel {
  background: var(--color-surface-alt);
  border-top: 0.5px solid var(--color-border);
  border-bottom: 0.5px solid var(--color-border);
  padding: 14px 16px;
  margin: 10px -16px 0;
}
.loc-filter-section + .loc-filter-section {
  margin-top: 14px;
}
.loc-filter-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}
.loc-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.loc-chip {
  padding: 6px 12px;
  background: var(--color-surface);
  border: 0.5px solid var(--color-border);
  border-radius: 999px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
}
.loc-chip:hover {
  background: var(--color-surface-alt);
}
.loc-chip.active {
  background: var(--color-primary-muted);
  color: var(--color-primary);
  border-color: var(--color-primary);
  font-weight: 500;
}
.loc-filter-select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 0.5px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 13px;
  color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SWIPE-TO-DELETE (mobile Locations list)
   ═══════════════════════════════════════════════════════════════════════════ */

.location-swipe-row {
  position: relative;
  overflow: hidden;
  transition: max-height 200ms ease, opacity 200ms ease;
  max-height: 400px;
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-3);
  touch-action: pan-y;
}
.location-swipe-row.removing {
  max-height: 0;
  opacity: 0;
  margin: 0 !important;
}
.location-swipe-row .location-card {
  position: relative;
  z-index: 2;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0.24, 1);
  background: var(--color-surface);
  margin-bottom: 0;
}
.location-swipe-row.revealed .location-card {
  transform: translateX(-92px);
}
.location-swipe-delete {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #dc2626;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.location-swipe-row.revealed .location-swipe-delete {
  opacity: 1;
  pointer-events: auto;
}
.location-swipe-delete svg { stroke: #fff; }

/* Desktop: no swipe — hide the action button, ensure card never slides */
@media (min-width: 768px) {
  .location-swipe-delete { display: none; }
  .location-swipe-row .location-card { transform: none !important; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PHOTOS (add modal + lightbox)
   ═══════════════════════════════════════════════════════════════════════════ */

.photo-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.photo-wrap {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  cursor: pointer;
}
.photo-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.photo-add-btn {
  width: 72px;
  height: 72px;
  border: 2px dashed var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-size: 24px;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.photo-add-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: zoom-out;
}
.photo-lightbox.visible { display: flex; }
.photo-lightbox img {
  max-width: 95vw;
  max-height: 95vh;
  object-fit: contain;
}

/* Amenity chip internal layout (icon + label) */
.toggle-chip .tc-icon {
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}
.toggle-chip .tc-icon svg {
  vertical-align: middle;
}

/* ═══════════════════════════════════════════════════════════════════════════
   LEG SWIPE ACTIONS (mobile: swipe-left delete, swipe-right edit)
   ═══════════════════════════════════════════════════════════════════════════ */

.leg-swipe-row {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  touch-action: pan-y;
}
.leg-swipe-row .leg-item {
  position: relative;
  z-index: 2;
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0.24, 1);
  background: var(--color-surface);
}
.leg-swipe-row.revealed .leg-item { transform: translateX(-92px); }
.leg-swipe-row.revealed-edit .leg-item { transform: translateX(92px); }

.leg-swipe-delete,
.leg-swipe-edit {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.leg-swipe-delete { right: 0; background: #dc2626; }
.leg-swipe-edit   { left: 0;  background: var(--color-primary); }
.leg-swipe-delete svg, .leg-swipe-edit svg { stroke: #fff; }
.leg-swipe-row.revealed .leg-swipe-delete { opacity: 1; pointer-events: auto; }
.leg-swipe-row.revealed-edit .leg-swipe-edit { opacity: 1; pointer-events: auto; }

/* Desktop: no swipe; inline trash + edit icons are visible and clickable */
@media (min-width: 768px) {
  .leg-swipe-delete, .leg-swipe-edit { display: none; }
  .leg-swipe-row .leg-item { transform: none !important; }
}

/* Hide desktop-only edit/trash on mobile */
@media (max-width: 767px) {
  .desktop-only { display: none !important; }
}

/* Swipe-right edit button on location rows */
.location-swipe-edit {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  z-index: 1;
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.location-swipe-edit svg { stroke: #fff; }
.location-swipe-row.revealed-edit .location-card { transform: translateX(92px); }
.location-swipe-row.revealed-edit .location-swipe-edit { opacity: 1; pointer-events: auto; }

@media (min-width: 768px) {
  .location-swipe-edit { display: none; }
}

/* Desktop: Add/Edit Location modal opens as a right-side drawer over the Locations panel,
   leaving the map accessible so the user can drag the pin. */
@media (min-width: 768px) {
  #modal-add-location.modal-sheet {
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: 420px;
    max-width: 90vw;
    max-height: 100vh;
    border-radius: 0;
    transform: translateX(-100%);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: var(--z-modal);
    pointer-events: auto;
  }
  #modal-add-location.modal-sheet.visible {
    transform: translateX(0);
    pointer-events: auto;
  }
  #modal-add-location .modal-handle { display: none; }
  #modal-add-location .modal-body {
    flex: 1;
    overflow-y: auto;
    pointer-events: auto;
  }
}

/* When Add/Edit Location drawer is open, hide the dimming backdrop
   so the map remains interactive (drag pin, zoom, etc.) */
body.add-location-drawer-open .modal-backdrop { display: none !important; pointer-events: none !important; }

/* Hide the map popup Edit/View Details button while the edit drawer is open */
body.add-location-drawer-open .map-popup-edit-btn,
body.add-location-drawer-open .leaflet-popup,
body.add-location-drawer-open .leaflet-popup-pane { display: none !important; }

/* Edit Location modal — keep these mobile overrides */
@media (max-width: 767px) {
  /* Hide the bottom nav while editing so it doesn't cover the Save Location
     footer (nav z-index 300 > drawer z-index 40). User exits via the modal X. */
  body.add-location-drawer-open #bottom-nav { display: none !important; }
  /* Strip old modal-sheet sizing for the edit modal — layout.css unified
     drawer rules drive positioning and height. */
  #modal-add-location.modal-sheet {
    max-height: none;
    background: var(--color-surface);
  }
  /* Hide the default 4px pill div — the drawer-grabber inserted by JS is the
     real control. */
  #modal-add-location > .modal-handle:not(.drawer-grabber) { display: none; }
  #modal-add-location .modal-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Pin the footer inside the drawer so Save Location stays visible at
     every snap and above the safe-area inset. */
  #modal-add-location .modal-footer {
    flex-shrink: 0;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-4) + var(--safe-bottom));
    background: var(--color-surface);
    border-top: 0.5px solid var(--color-border);
  }
}


/* ═══════════════════════════════════════════════════════════════════════
   DISCOVER — Banner + tile grid (Explore page entry point)
   Design: fallback-design-system mockup-concept1-explore.html
   ═══════════════════════════════════════════════════════════════════════ */

/* Dark forest-green banner that wraps the eyebrow / title / subtitle / tile
   grid. Gold concentric rings in the upper-right corner via the deco div. */
.discover-banner {
  background: #1a2e26;
  border-radius: 16px;
  padding: 18px 18px 16px;
  margin: var(--space-4) 0 0;
  position: relative;
  overflow: hidden;
}
.discover-banner-deco {
  position: absolute;
  top: -28px;
  right: -28px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: 2px solid rgba(201,164,92,0.18);
  pointer-events: none;
}
.discover-banner-deco::after {
  content: '';
  position: absolute;
  top: 22px;
  right: 22px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 2px solid rgba(201,164,92,0.10);
}
.discover-banner-content {
  position: relative;
  z-index: 1;
}
.discover-banner-eyebrow {
  font-size: 10px;
  font-weight: 700;
  color: #c9a45c;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.discover-banner-title {
  font-family: var(--font-display, 'Poppins', sans-serif);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}
.discover-banner-sub {
  font-size: 12.5px;
  color: rgba(255,255,255,0.62);
  line-height: 1.4;
  margin-bottom: 14px;
}

.discover-tile-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
  /* No outer padding — banner padding handles spacing. */
}
.discover-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  background: var(--color-surface);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
  min-height: 100px;
  text-align: center;
}
.discover-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  border-color: rgba(201,164,92,0.5);
}
.discover-tile:active { transform: translateY(0); }
.discover-tile-icon {
  width: 48px;
  height: 48px;
  object-fit: contain;
  pointer-events: none;
}
.discover-tile-label {
  font-family: var(--font-display, inherit);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
}
.discover-tile.top-picks {
  grid-column: 1 / -1;
  border-color: #c9a45c;
  background: linear-gradient(180deg, rgba(201,164,92,0.12) 0%, var(--color-surface) 60%);
}
.discover-tile.top-picks .discover-tile-label { color: var(--color-primary); }

/* Desktop: same 2-column layout as mobile (Top Picks spanning the top, two
   columns of icons below) — per user request. */
@media (min-width: 768px) {
  .discover-tile-grid { grid-template-columns: repeat(2, 1fr); }
  .discover-tile.top-picks { grid-column: 1 / -1; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DISCOVER — List panel (covers .explore-left when open)
   Design: mockup-concept2-discover.html
   ═══════════════════════════════════════════════════════════════════════ */

/* The panel matches .explore-left's exact width so it slots in cleanly
   when explore-left is hidden. On mobile it goes full-screen (position:fixed
   via .explore-backup-panel mobile rules). */
.discover-list-panel {
  width: 380px;
  max-width: 40vw;
  min-width: 0;
  flex-shrink: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: explore-backup-slide-in 200ms ease-out;
  z-index: 6;
}

/* ── Hero header ────────────────────────────────────────────────────── */
.disc-hero {
  background: linear-gradient(160deg, #1a3d2d, #2d5a47);
  padding: 18px 20px 20px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.disc-hero::after {
  content: '';
  position: absolute;
  top: -30px; right: -30px;
  width: 140px; height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.06);
  pointer-events: none;
}
/* Top row of the dark hero: back-button on the left, refresh icon on
   the right. Replaces the old standalone .disc-back-btn block — the
   bottom-margin moved to .disc-hero-top so the row keeps its spacing. */
.disc-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 8px;
}
.disc-back-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.disc-refresh-btn {
  width: 32px; height: 32px;
  background: rgba(255,255,255,0.12);
  border: none;
  border-radius: 9px;
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease, transform 200ms ease;
  flex-shrink: 0;
}
.disc-refresh-btn:hover { background: rgba(255,255,255,0.22); }
.disc-refresh-btn:active { transform: rotate(180deg); }
.disc-back-arr {
  width: 26px; height: 26px;
  background: rgba(255,255,255,0.12);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.disc-hero-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.disc-hero-icon {
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.disc-hero-icon img {
  width: 36px; height: 36px;
  object-fit: contain;
  /* Show the icon in its natural colors (dark line drawing) — the
     translucent-white pill behind it provides enough contrast on the
     dark hero. The previous brightness(0) invert(1) filter was making
     the icon a pure-white silhouette that washed out against the box. */
}
.disc-hero-titles { display: flex; flex-direction: column; }
.disc-hero-title {
  font-family: 'Poppins', var(--font-display, sans-serif);
  font-size: 22px;
  font-weight: 700;
  color: white;
  line-height: 1.1;
}
.disc-hero-count {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  margin-top: 2px;
}

/* ── Mode selector (segmented control in hero) ─────────────────────── */
/* Shape from the screenshot: horizontal segment group with filled active.
   Colors from the mockup: dark green (#2d5a47) active, gold (#c9a45c) for
   the pin/drop-pin active state. */
.disc-mode-seg {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  background: rgba(0,0,0,0.25);
  border-radius: 9999px;
  padding: 3px;
}
.disc-mode-btn {
  flex: 1;
  padding: 7px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.65);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
  text-align: center;
}
.disc-mode-btn:hover { color: rgba(255,255,255,0.9); }
.disc-mode-btn.active {
  background: white;
  color: #2d5a47;
}
.disc-mode-btn.active[data-mode="pin"] {
  background: #c9a45c;
  color: #1a1f1e;
}

/* Divider between the location-mode pill row and the category-pill row
   below it. Subtle gold-tinted line on the dark hero. */
.disc-hero-divider {
  height: 1px;
  background: rgba(201,164,92,0.22);
  margin: 12px 0 10px;
}

/* Category pill row inside the modal hero — matches the design's
   `.cat-pills` from concept1-explore.html. Lets the user switch
   categories without backing out to the Explore tile grid. */
.disc-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.disc-cat-pill {
  background: rgba(255,255,255,0.10);
  border: none;
  border-radius: 9999px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
  white-space: nowrap;
}
.disc-cat-pill:hover { background: rgba(255,255,255,0.18); }
.disc-cat-pill.active {
  background: #c9a45c;
  color: #1a1f1e;
}

/* ── Pin-active amber strip ─────────────────────────────────────────── */
.disc-pin-strip {
  background: rgba(201,164,92,0.12);
  border-top: 1px solid rgba(201,164,92,0.28);
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.disc-pin-dot {
  width: 24px; height: 24px;
  background: #c9a45c;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.disc-pin-text {
  flex: 1;
  font-size: 12px;
  color: #5a6360;
  line-height: 1.4;
}
.disc-pin-text strong { color: #1a1f1e; }
.disc-pin-clear {
  background: none; border: none;
  font-size: 14px; color: #8b9a91;
  cursor: pointer; padding: 2px 4px;
}
.disc-pin-refresh {
  background: rgba(201,164,92,0.2);
  border: 1px solid rgba(201,164,92,0.4);
  border-radius: 999px;
  font-size: 13px; line-height: 1;
  width: 26px; height: 26px;
  color: #1a1f1e;
  cursor: pointer; padding: 0;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background 120ms ease, transform 200ms ease;
}
.disc-pin-refresh:hover { background: rgba(201,164,92,0.3); }
.disc-pin-refresh:active { transform: rotate(180deg); }

/* ── City-entry picker (drop-pin sub-panel) ─────────────────────────── */
#discover-anchor-picker {
  padding: 12px 20px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.dd-anchor-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 14px;
}
.dd-anchor-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.dd-anchor-divider {
  font-size: 11px; color: var(--color-text-muted);
  text-align: center; margin: 8px 0 10px;
}

/* ── Search bar ─────────────────────────────────────────────────────── */
.disc-search-wrap {
  padding: 10px 20px;
  border-bottom: 1px solid #e8e4dc;
  flex-shrink: 0;
}
.disc-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f8f6f2;
  border-radius: 10px;
  padding: 8px 12px;
}
.disc-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-size: 13px;
  color: #1a1f1e;
}
.disc-search-input::placeholder { color: #8b9a91; }

/* ── Distance row ───────────────────────────────────────────────────── */
.disc-dist-row {
  padding: 8px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.disc-dist-label { font-size: 11px; color: #8b9a91; }
.disc-dist-badge {
  background: #f8f6f2;
  border-radius: 9999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #2d5a47;
}

/* ── Results list ───────────────────────────────────────────────────── */
.disc-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Card tile — matches mockup r-tile style */
.disc-r-tile {
  display: flex;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 14px;
  align-items: center;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.disc-r-tile:hover {
  border-color: #2d5a47;
  box-shadow: 0 2px 10px rgba(45,90,71,0.08);
}
.disc-r-thumb {
  width: 52px; height: 52px;
  border-radius: 10px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Light cream background matches the PNG's own tile background so the
     icon reads cleanly. Each category-tinted left edge creates the
     mockup's "category color" feel without fighting the PNG. */
  background: #f8f6f2;
  border-left: 3px solid #2d5a47;
}
.disc-r-thumb img {
  width: 44px; height: 44px;
  object-fit: contain;
}
/* Per-category accent colour on the thumbnail's left edge. Mirrors the
   gradient palette but without overlaying the icon. */
.disc-r-thumb[data-cat="camping"]    { border-left-color: #3d7a5f; }
.disc-r-thumb[data-cat="hiking"]     { border-left-color: #5a7a50; }
.disc-r-thumb[data-cat="natural"]    { border-left-color: #4a8a65; }
.disc-r-thumb[data-cat="cultural"]   { border-left-color: #7b5ea7; }
.disc-r-thumb[data-cat="historical"] { border-left-color: #b87c3a; }
.disc-r-thumb[data-cat="quirky"]     { border-left-color: #3a7ab8; }
.disc-r-thumb[data-cat="top-picks"]  { border-left-color: #c9a45c; }
.disc-r-body { flex: 1; min-width: 0; }
.disc-r-name {
  font-family: 'Poppins', var(--font-display, sans-serif);
  font-size: 13px;
  font-weight: 600;
  color: #1a1f1e;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.disc-r-meta { font-size: 11px; color: #8b9a91; margin-top: 2px; }
.disc-r-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.disc-r-tag {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 8px;
  line-height: 1.5;
}
.disc-r-tag.green  { background: #e8f5e9; color: #2d5a47; }
.disc-r-tag.amber  { background: #fff3e0; color: #e65100; }
.disc-r-tag.blue   { background: #e3f2fd; color: #1565c0; }
.disc-r-tag.purple { background: #f3e5f5; color: #6a1b9a; }
.disc-r-chevron {
  font-size: 20px;
  color: #e8e4dc;
  margin-left: auto;
  flex-shrink: 0;
  line-height: 1;
}
/* saved state: ✓ check replaces chevron */
.disc-r-tile.saved .disc-r-chevron { display: none; }
.disc-r-saved-badge {
  font-size: 11px;
  font-weight: 600;
  color: #2d5a47;
  flex-shrink: 0;
}

/* ── Show more ──────────────────────────────────────────────────────── */
.disc-more-wrap {
  padding: 8px 20px 20px;
  flex-shrink: 0;
}
.disc-show-more {
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 1px solid #e8e4dc;
  border-radius: 10px;
  font-size: 13px;
  color: #2d5a47;
  font-weight: 500;
  cursor: pointer;
  transition: background 120ms ease;
}
.disc-show-more:hover { background: #f8f6f2; }

/* Stars (OTM ratings) */
.discover-stars {
  color: #c9a45c;
  font-size: 11px;
  letter-spacing: 0.5px;
}

/* ── Hero card (Top Picks) ──────────────────────────────────────────── */
.discover-card.hero {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid #e8e4dc;
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.discover-card.hero:hover {
  border-color: #2d5a47;
  box-shadow: 0 4px 14px rgba(45,90,71,0.1);
}
.discover-hero-image {
  width: 100%; height: 140px;
  background-position: center; background-size: cover;
  background-color: rgba(0,0,0,0.04);
}
.discover-hero-image.fallback {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(45,90,71,0.12), rgba(201,164,92,0.12));
}
.discover-hero-image.fallback img {
  width: 52px; height: 52px; opacity: 0.6; object-fit: contain;
}
.discover-card.hero .discover-card-content { padding: 10px 14px 4px; }
.discover-card-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.discover-card.hero .discover-card-name { flex: 1; font-size: 14px; font-weight: 600; }
.discover-cat-badge {
  font-size: 9px; font-weight: 700; padding: 2px 7px;
  background: rgba(45,90,71,0.08); color: #2d5a47;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.04em;
}
.discover-card.hero .discover-card-meta {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: #8b9a91;
}
.discover-card.hero .discover-card-actions {
  padding: 0 14px 12px; display: flex; justify-content: flex-end;
}

/* ── Detail panel photo gallery ─────────────────────────────────────── */
.dd-photo-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.dd-photo {
  position: relative; height: 160px;
  background-position: center; background-size: cover;
  background-color: rgba(0,0,0,0.04); border-radius: 12px;
}
@media (max-width: 480px) {
  .dd-photo-row { grid-template-columns: 1fr; }
  .dd-photo { height: 180px; }
}

/* ═══════════════════════════════════════════════════════════════════════
   DISCOVER — Body-class stacking rules
   ═══════════════════════════════════════════════════════════════════════ */

/* On ALL viewports: when the Discover list is open, hide the Explore panel
   so the list panel covers that slot cleanly. */
body.discover-list-open .explore-left { display: none !important; }

/* When detail opens, also hide the list panel (they share the slot). */
body.discover-detail-open .explore-left  { display: none !important; }
body.discover-detail-open #modal-discover { display: none !important; }

/* Hide Discover panels when Add-Location form is open. */
body.add-location-drawer-open #modal-discover,
body.add-location-drawer-open #discover-detail-panel { display: none !important; }

/* ─── Mobile-only stacking ─────────────────────────────────────────── */
@media (max-width: 767px) {
  /* The base mobile drawer rules in layout.css now include #modal-discover
     (position:fixed; bottom:0; top:auto; height:calc(100vh - 48px); plus
     the half-snap default transform and the snap-rule overrides). Only
     panel-specific tweaks live here. */

  /* Disable the desktop slide-in animation on mobile — it sets
     transform:translateX which fights the drawer's translateY snap
     animation. Without this, the panel briefly jumps to full on open and
     can't be dragged until the animation finishes. */
  .discover-list-panel { animation: none !important; }

  /* Hero header stays pinned at the drawer top — its own scroll surface
     is the results list below. Without flex-shrink:0 the hero collapses
     when the body scrolls, hiding the back button and pills. */
  .discover-list-panel .disc-hero { flex-shrink: 0; }
  /* Results list takes remaining height and scrolls; its parent flex
     column needs min-height:0 so the inner scroll actually activates. */
  .discover-list-panel #discover-list {
    flex: 1; min-height: 0; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    /* Bottom nav (z 300) overlays ~72px+safe-area at the drawer's bottom;
       pad so trailing results scroll above it. */
    padding-bottom: calc(var(--nav-height-mobile) + var(--space-4));
  }
  body.discover-list-open #locations-panel,
  body.discover-list-open #location-detail-panel,
  body.discover-list-open #trips-list-panel,
  body.discover-list-open #explore-backup-panel { display: none !important; }

  body.discover-detail-open #locations-panel,
  body.discover-detail-open #location-detail-panel,
  body.discover-detail-open #trips-list-panel,
  body.discover-detail-open #explore-backup-panel { display: none !important; }

  body.add-location-drawer-open #locations-panel,
  body.add-location-drawer-open #location-detail-panel,
  body.add-location-drawer-open #trips-list-panel,
  body.add-location-drawer-open #explore-backup-panel,
  body.add-location-drawer-open .explore-left { display: none !important; }

  /* Tile grid */
  .discover-tile { min-height: 90px; padding: 14px 8px; }
  .discover-tile-icon { width: 40px; height: 40px; }
  /* Mode selector: smaller text on narrow screens */
  .disc-mode-btn { font-size: 11px; padding: 6px 8px; }
  /* Hero title slightly smaller */
  .disc-hero-title { font-size: 19px; }
  /* Bottom nav hides during Add Location */
  body.add-location-drawer-open #bottom-nav { display: none !important; }
}
