/* ============================================================
   DINKLE — stylesheet
   ============================================================ */

:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #52b788;
  --primary-pale: #d8f3dc;
  --accent: #f4a261;
  --accent-dark: #e76f51;
  --bg: #f0fdf4;
  --card-bg: #ffffff;
  --text: #1a3a2a;
  --text-muted: #5a7a68;
  --border: #d1fae5;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,.12);
  --radius: 12px;
  --radius-sm: 8px;
  --visited-bg: #f0fdf4;
  --visited-border: #86efac;
  --visited-text: #15803d;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}

#app { display: flex; flex-direction: column; height: 100%; }

/* ── Beta banner ─────────────────────────────────────────── */
#beta-banner {
  background: #fffbeb;
  border-bottom: 1px solid #fde68a;
  color: #92400e;
  font-size: 12.5px;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
  z-index: 201;
}

.banner-actions { display: flex; gap: 6px; flex-shrink: 0; }

@media (max-width: 480px) {
  /* Hide subtitle — "A Family Guide to Cambridge Parks" */
  .header-top h1 span { display: none; }
  /* Discover button: icon only */
  .discover-label { display: none; }
  .btn-discover { padding: 7px 11px; border-radius: 10px; }
  /* Tighten header padding */
  .header-top { padding: 10px 12px 6px; }
  /* Household label smaller */
  .household-label { font-size: 10px; }
}

/* On small phones, hide the beta banner text — keep just the buttons */
@media (max-width: 430px) {
  #beta-banner { padding: 5px 8px; }
  #beta-banner > span { display: none; }
  .banner-actions { flex: 1; gap: 4px; align-items: center; }
  #btn-banner-dismiss { margin-left: auto; padding-left: 10px !important; }
  .btn-feedback-banner { padding: 4px 7px; font-size: 10.5px; }
}

.chip-set-home {
  background: rgba(255,255,255,.22) !important;
  border-color: rgba(255,255,255,.4) !important;
  color: white !important;
  font-weight: 600 !important;
  animation: pulse-home 2s ease-in-out 3;
}
@keyframes pulse-home {
  0%, 100% { background: rgba(255,255,255,.22); }
  50% { background: rgba(255,255,255,.38); }
}

.banner-link {
  background: none;
  border: none;
  padding: 0;
  color: #92400e;
  font: inherit;
  font-size: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.banner-link:hover { color: #78350f; }

.about-link {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(0,0,0,.3);
  text-underline-offset: 2px;
  cursor: pointer;
}
.about-link:hover { text-decoration-color: rgba(0,0,0,.6); }

.btn-feedback-banner {
  background: #f59e0b;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn-feedback-banner:hover { background: #d97706; }
.btn-missing-park { background: #2d6a4f; }
.btn-missing-park:hover { background: #1b4332; }

/* ── Missing park modal ──────────────────────────────────── */
#missing-park-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#missing-park-overlay.open { display: flex; }

#missing-park-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
  overflow: hidden;
  position: relative;
}

#missing-park-map {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 10px;
  position: relative;
  z-index: 0;
}

/* ── Header ─────────────────────────────────────────────── */
#header {
  background: var(--primary-dark);
  color: white;
  padding: 0;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
}

.header-left { display: flex; flex-direction: column; gap: 2px; }

.header-top h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.header-top h1 span { opacity: .75; font-size: 14px; font-weight: 400; margin-left: 6px; }

.household-label {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  font-weight: 500;
  letter-spacing: .2px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.household-label:hover { color: rgba(255,255,255,.9); }
.household-label.guest { color: rgba(255,255,255,.5); font-style: italic; }

.header-actions { display: flex; gap: 8px; }

.btn-discover {
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background .15s, transform .1s;
}
.btn-discover:hover { background: var(--accent-dark); }
.btn-discover:active { transform: scale(.96); }

.btn-icon {
  background: rgba(255,255,255,.15);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 15px;
  cursor: pointer;
  transition: background .15s;
}
.btn-icon:hover { background: rgba(255,255,255,.25); }
.btn-icon.active {
  background: var(--accent);
  color: white;
}
.btn-near-me { font-size: 17px; }

/* ── View tabs ───────────────────────────────────────────── */
.view-tabs {
  display: flex;
  border-top: 1px solid rgba(255,255,255,.1);
}
.view-tab {
  flex: 1;
  background: none;
  border: none;
  color: rgba(255,255,255,.65);
  padding: 9px 0;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  letter-spacing: .3px;
}
.view-tab.active { color: white; border-bottom-color: var(--accent); }

/* ── Filter bar ──────────────────────────────────────────── */
/* ── Filter bar (compact) ────────────────────────────────── */
#filter-bar {
  background: var(--primary);
  padding: 8px 12px 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex-shrink: 0;
}

/* City filter row — sits above the search row, visually distinct */
.city-filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,.15);
  margin-bottom: 1px;
}
.city-filter-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  margin-right: 2px;
  flex-shrink: 0;
}
.city-btn {
  padding: 3px 11px;
  border-radius: 20px;
  border: 1.5px solid rgba(255,255,255,.35);
  background: transparent;
  color: rgba(255,255,255,.55);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  line-height: 1.5;
}
.city-btn.active {
  background: rgba(255,255,255,.18);
  border-color: rgba(255,255,255,.7);
  color: #fff;
}
.city-btn:hover { background: rgba(255,255,255,.12); }
.city-btn.active:hover { background: rgba(255,255,255,.26); }

/* Compact on scroll: hide meta row only, keep search+button */
#header.compact .filter-bar-meta {
  max-height: 0;
  overflow: hidden;
  padding: 0;
  opacity: 0;
}
.filter-bar-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  transition: max-height .2s, opacity .2s;
  max-height: 40px;
}

.filter-bar-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#search-input {
  flex: 1;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  padding: 7px 12px;
  color: white;
  font-size: 14px;
  outline: none;
  min-width: 0;
}
#search-input::placeholder { color: rgba(255,255,255,.55); }
#search-input:focus { border-color: rgba(255,255,255,.5); background: rgba(255,255,255,.2); }

.btn-filters {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 8px;
  padding: 7px 13px;
  color: white;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-filters.active {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-filters:hover { background: rgba(255,255,255,.25); }
.btn-filters.active:hover { background: var(--accent-dark); }

.filter-badge {
  background: white;
  color: var(--primary-dark);
  border-radius: 10px;
  padding: 1px 6px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.4;
  min-width: 18px;
  text-align: center;
}

.filter-chip {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  color: rgba(255,255,255,.8);
  cursor: pointer;
  user-select: none;
  transition: background .15s, color .15s;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.filter-chip.active {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-color: var(--primary-pale);
  font-weight: 600;
}

.results-count {
  color: rgba(255,255,255,.65);
  font-size: 12px;
  flex: 1;
}

/* ── Filter bottom sheet ─────────────────────────────────── */
#filter-sheet-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 450;
}
#filter-sheet-backdrop.open { display: block; }

#filter-sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  z-index: 451;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(.32,0,.67,0);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0,0,0,.15);
}
#filter-sheet.open {
  transform: translateY(0);
  transition: transform .3s cubic-bezier(.33,1,.68,1);
}

#filter-sheet-handle {
  width: 36px; height: 4px;
  background: #d1d5db;
  border-radius: 2px;
  margin: 12px auto 4px;
  flex-shrink: 0;
}

#filter-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 20px 4px;
}

.sheet-section { margin-bottom: 22px; }

.sheet-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .7px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sheet-seg {
  display: flex;
  gap: 6px;
}
.seg-btn {
  flex: 1;
  background: #f3f4f6;
  border: 1.5px solid transparent;
  border-radius: 9px;
  padding: 9px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  font-family: inherit;
}
.seg-btn.active {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  color: var(--primary-dark);
  font-weight: 700;
}
.seg-btn:not(.active):hover { background: #e9ecef; }

.sheet-select {
  width: 100%;
  background: #f3f4f6;
  border: 1.5px solid #e5e7eb;
  border-radius: 9px;
  padding: 11px 14px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.sheet-select:focus { border-color: var(--primary-light); }

.sheet-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.sheet-chips .filter-chip {
  background: #f3f4f6;
  border-color: #e5e7eb;
  color: var(--text);
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 20px;
}
.sheet-chips .filter-chip.active {
  background: var(--primary-pale);
  border-color: var(--primary-light);
  color: var(--primary-dark);
}

#filter-sheet-footer {
  display: flex;
  gap: 10px;
  padding: 12px 20px 28px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
#filter-sheet-reset {
  background: #f3f4f6;
  color: var(--text);
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
#filter-sheet-reset:hover { background: #e5e7eb; }
#filter-sheet-apply {
  flex: 1;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s;
}
#filter-sheet-apply:hover { background: var(--primary-dark); }

/* ── Views ───────────────────────────────────────────────── */
.view { display: none; flex: 1; overflow: hidden; }
.view.active { display: flex; flex-direction: column; }

/* ── List view ───────────────────────────────────────────── */
#list-view { overflow-y: auto; -webkit-overflow-scrolling: touch; }

#park-list {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Unvisited card */
.park-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}
.park-card:hover { box-shadow: var(--shadow-md); }
.park-card:active { transform: scale(.99); }

/* Visited card — clearly muted with green tint */
.park-card.visited {
  background: var(--visited-bg);
  border-color: var(--visited-border);
  opacity: 0.82;
}
.park-card.visited .card-name { color: var(--visited-text); }
.park-card.visited .card-features,
.park-card.visited .card-neighborhood { color: #6b9e79; }

/* Big checkmark corner badge */
.visited-check-corner {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--visited-text);
  color: white;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 10px 3px 12px;
  border-bottom-left-radius: 10px;
  letter-spacing: .5px;
}

/* Temporarily closed park — bold red banner across the top of the card */
.park-card.park-closed {
  border-color: #fca5a5;
}
.closed-card-banner {
  background: #dc2626;
  color: white;
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 12px;
  margin: -14px -16px 10px -16px;
  letter-spacing: .2px;
  line-height: 1.4;
}
.closed-card-banner a { color: white !important; text-decoration: underline; }

.park-card.highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(244,162,97,.25), var(--shadow-md);
  animation: highlight-pulse 1.5s ease-out;
}

@keyframes highlight-pulse {
  0% { box-shadow: 0 0 0 6px rgba(244,162,97,.5), var(--shadow-md); }
  100% { box-shadow: 0 0 0 3px rgba(244,162,97,.25), var(--shadow-md); }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.3;
}

.card-meta { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.distance-badge {
  background: var(--primary-pale);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.visited-badge {
  background: #dcfce7;
  color: #166534;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

.card-neighborhood { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

.badge-row { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }

.type-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.card-icons { display: flex; gap: 6px; font-size: 14px; margin-bottom: 8px; }

.card-features {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.approx-note { font-size: 11px; color: #9ca3af; margin-top: 4px; }

/* ── Map view ────────────────────────────────────────────── */
#map-view { position: relative; overflow: visible; }
#map { width: 100%; flex: 1; min-height: 0; }

.leaflet-popup-content-wrapper {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow-md) !important;
}
.popup-name { font-weight: 700; font-size: 14px; color: var(--primary-dark); margin-bottom: 3px; }
.popup-neighborhood { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.popup-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.popup-approx { font-size: 11px; color: #9ca3af; margin-bottom: 6px; }
.popup-btn {
  display: block;
  background: var(--primary);
  color: white;
  text-align: center;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  width: 100%;
}

/* ── Detail overlay ──────────────────────────────────────── */
#detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 500;
  display: none;
  align-items: flex-end;
}
#detail-overlay.open { display: flex; }

@media (min-width: 640px) {
  #detail-overlay { align-items: center; justify-content: center; }
}

#detail-panel {
  background: var(--card-bg);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-height: 90vh;
  max-height: 90dvh; /* iOS 15.4+: excludes browser chrome from vh calc */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: slide-up .25s ease-out;
  scroll-behavior: auto; /* prevent animated scroll on open */
}

@media (min-width: 640px) {
  #detail-panel { border-radius: var(--radius); max-width: 580px; max-height: 85vh; }
}

@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card-bg);
  z-index: 10;
}

.detail-header-visited {
  background: #f0fdf4;
  border-bottom-color: #86efac;
}

.detail-title { font-size: 18px; font-weight: 700; color: var(--primary-dark); line-height: 1.3; }
.detail-neighborhood { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.detail-visited-badge {
  display: inline-block;
  margin-top: 6px;
  background: #dcfce7;
  color: #15803d;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
}

.btn-close {
  background: var(--bg);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s;
}
.btn-close:hover { background: var(--border); }

.detail-body { padding: 16px 18px 28px; }

.detail-section { margin-bottom: 18px; }
.detail-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.detail-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.detail-value { font-size: 13px; color: var(--text); font-weight: 500; }

.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

.btn-visit {
  flex: 1;
  min-width: 140px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-visit:hover { background: var(--primary-dark); }
.btn-visit.visited { background: #16a34a; }

.btn-directions {
  flex: 1;
  min-width: 140px;
  background: #dbeafe;
  color: #1e40af;
  border: none;
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: block;
  transition: background .15s;
}
.btn-directions:hover { background: #bfdbfe; }

.visit-date-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--text-muted);
}
.visit-date-row input[type=date] {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  color: var(--text);
  outline: none;
}
.visit-date-row input:focus { border-color: var(--primary-light); }

.notes-area {
  width: 100%;
  min-height: 90px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  resize: vertical;
  outline: none;
  transition: border-color .15s;
}
.notes-area:focus { border-color: var(--primary-light); }

.btn-save-notes {
  margin-top: 8px;
  background: var(--primary-pale);
  color: var(--primary-dark);
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.btn-save-notes:hover { background: #b7e4c7; }
.notes-saved { font-size: 12px; color: var(--primary); margin-left: 8px; opacity: 0; transition: opacity .3s; }
.notes-saved.show { opacity: 1; }

.approx-banner {
  background: #f3f4f6;
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px;
  color: #6b7280;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
}

/* Temporarily closed banner — detail view */
.closed-detail-banner {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 14px;
}
.closed-detail-title {
  color: #b91c1c;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .2px;
  margin-bottom: 4px;
}
.closed-detail-note {
  color: #7f1d1d;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}
.closed-detail-note a { color: #b91c1c !important; text-decoration: underline; font-weight: 600; }
.closed-report-btn {
  background: white;
  color: #b91c1c;
  border: 1px solid #fca5a5;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.closed-report-btn:hover { background: #fee2e2; }
.closed-report-btn:disabled { opacity: .7; cursor: default; }

/* ── Toast ───────────────────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--primary-dark);
  color: white;
  padding: 11px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  z-index: 1000;
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  pointer-events: none;
  white-space: normal;
  max-width: 88vw;
  text-align: center;
}
#toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Empty state ─────────────────────────────────────────── */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ── Print view ──────────────────────────────────────────── */
#print-view { display: none; padding: 24px; }

.print-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 16px;
}
.print-header h1 { font-size: 22px; color: var(--primary-dark); }
.print-header p { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.print-close {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  font-weight: 600;
}

.print-controls { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; }
.btn-print-now {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.print-sort-label { font-size: 13px; color: var(--text-muted); }
.print-sort-select { border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; font-size: 13px; outline: none; }

.print-list { display: flex; flex-direction: column; gap: 0; }
.print-item {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px solid #e5e7eb;
}
.print-checkbox {
  width: 18px; height: 18px;
  border: 2px solid #374151;
  border-radius: 3px;
  margin-top: 2px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}
.print-checkbox.checked { background: #16a34a; border-color: #16a34a; color: white; }
.print-park-name { font-size: 14px; font-weight: 700; color: var(--primary-dark); }
.print-park-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.print-park-features { font-size: 11px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.print-dist { font-size: 12px; color: var(--text-muted); white-space: nowrap; margin-top: 2px; }

/* ── Welcome screen ──────────────────────────────────────── */
#welcome-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 67, 50, 0.7);
  z-index: 900;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#welcome-overlay.open { display: flex; }

#welcome-panel {
  background: white;
  border-radius: 20px;
  padding: 32px 28px 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: slide-up .3s ease-out;
}

.welcome-logo { font-size: 48px; text-align: center; margin-bottom: 12px; }
.welcome-title { font-size: 22px; font-weight: 800; color: var(--primary-dark); text-align: center; margin-bottom: 6px; }
.welcome-sub { font-size: 13px; color: var(--text-muted); text-align: center; margin-bottom: 24px; line-height: 1.5; }

.welcome-section { display: flex; flex-direction: column; gap: 10px; }
.welcome-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; color: var(--text-muted); }

.welcome-input {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.welcome-input:focus { border-color: var(--primary-light); }

.welcome-code {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}

.btn-welcome-primary {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-welcome-primary:hover { background: var(--primary-dark); }

.btn-welcome-secondary {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s;
}
.btn-welcome-secondary:hover { background: #b7e4c7; }

.welcome-divider {
  text-align: center;
  position: relative;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.welcome-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  height: 1px;
  background: var(--border);
}
.welcome-divider span {
  background: white;
  padding: 0 12px;
  position: relative;
}

.welcome-error {
  color: #dc2626;
  font-size: 13px;
  min-height: 18px;
  margin-top: 8px;
  text-align: center;
}

/* ── Feedback modal ──────────────────────────────────────── */
#feedback-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#feedback-overlay.open { display: flex; }

#feedback-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.feedback-title { font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.feedback-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 14px; }

/* ── Dinkle title button ─────────────────────────────────── */
/* ── Park correction link ────────────────────────────────── */
.correction-link {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
}
.correction-link:hover { color: var(--text); }

/* ── Guest nudge ─────────────────────────────────────────── */
.guest-nudge {
  background: #f0fdf4;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.guest-nudge-btn {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  align-self: flex-start;
  transition: background .15s;
}
.guest-nudge-btn:hover { background: var(--primary-dark); }

/* ── Browse guest button ─────────────────────────────────── */
.btn-browse-guest {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 12px 0 0;
  text-align: center;
  width: 100%;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-browse-guest:hover { color: var(--text); }

/* ── Dinkle title button ─────────────────────────────────── */
.btn-dinkle-title {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  cursor: pointer;
  padding: 0;
  letter-spacing: inherit;
}
.btn-dinkle-title:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── What's new modal ───────────────────────────────────── */
#whatsnew-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#whatsnew-overlay.open { display: flex; }
#whatsnew-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
}

/* ── About modal ─────────────────────────────────────────── */
#about-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#about-overlay.open { display: flex; }

#about-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 26px;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
}

.about-body { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }
.about-body p { font-size: 14px; color: var(--text); line-height: 1.6; }
.about-fine { font-size: 12px !important; color: var(--text-muted) !important; }

/* ── Location picker modal ───────────────────────────────── */
#location-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 650;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#location-overlay.open { display: flex; }

#location-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
}

#location-map {
  width: 100%;
  height: 300px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--border);
}

/* ── Household code modal ────────────────────────────────── */
#code-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 600;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#code-overlay.open { display: flex; }

#code-panel {
  background: white;
  border-radius: var(--radius);
  padding: 22px 22px 24px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-md);
  animation: slide-up .2s ease-out;
}

.join-code-display {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: 8px;
  text-align: center;
  color: var(--primary-dark);
  background: var(--primary-pale);
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  margin-top: 12px;
  font-family: ui-monospace, "SF Mono", monospace;
  cursor: pointer;
  user-select: all;
  transition: background .15s;
}
.join-code-display:hover { background: #b7e4c7; }
.join-code-display:active { background: #95d5b2; }

/* ── Utilities ───────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── @media print ────────────────────────────────────────── */
@media print {
  #app > *:not(#print-view) { display: none !important; }
  #print-view { display: block !important; }
  .print-controls { display: none !important; }
  .print-close { display: none !important; }
  body { background: white; }
  @page { margin: 1.5cm; }
}
