:root {
  --brand: #174f31;
  --brand-strong: #103d25;
  --brand-soft: #e3f0e7;
  --brand-faint: #f1f7f2;
  --accent: #d9a11e;
  --accent-soft: #fff3cf;
  --visited: #21834c;
  --planned: #c48908;
  --favorite: #b9485c;
  --bonus: #286c9e;
  --danger: #b63535;
  --ink: #17231c;
  --muted: #647169;
  --muted-2: #879189;
  --line: #dce3dc;
  --line-strong: #c8d2ca;
  --surface: #ffffff;
  --surface-2: #f7f9f6;
  --surface-3: #eef3ee;
  --background: #f2f5f0;
  --shadow-sm: 0 2px 10px rgba(20, 48, 31, .07);
  --shadow-md: 0 12px 35px rgba(20, 48, 31, .13);
  --shadow-lg: 0 25px 70px rgba(10, 35, 21, .24);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --max-width: 1180px;
  --header-h: 68px;
  --nav-h: 74px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

html[data-theme="dark"] {
  --brand: #73ca94;
  --brand-strong: #99ddb0;
  --brand-soft: #1c3a28;
  --brand-faint: #152a1e;
  --accent: #edbd4a;
  --accent-soft: #493b15;
  --visited: #62bf84;
  --planned: #e7b83d;
  --favorite: #ef7c91;
  --bonus: #66a9d6;
  --danger: #ef6c6c;
  --ink: #eef5ef;
  --muted: #aebbb1;
  --muted-2: #87968a;
  --line: #304038;
  --line-strong: #43544a;
  --surface: #17221b;
  --surface-2: #1c2921;
  --surface-3: #25342b;
  --background: #101713;
  --shadow-sm: 0 2px 12px rgba(0,0,0,.2);
  --shadow-md: 0 12px 38px rgba(0,0,0,.28);
  --shadow-lg: 0 25px 70px rgba(0,0,0,.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; background: var(--background); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--brand-soft) 74%, transparent) 0, transparent 32rem),
    var(--background);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  padding-bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px);
  -webkit-font-smoothing: antialiased;
}
body.sheet-open { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 70%, transparent); outline-offset: 2px; }
a { color: var(--brand); }
svg { display: block; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon-button svg, button svg, a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.offline-banner, .file-banner {
  position: sticky;
  z-index: 110;
  top: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--ink) 88%, #7a5500);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  font-size: 13px;
  text-align: center;
}
.offline-banner svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.file-banner { background: var(--brand-soft); border-color: var(--line); }
.file-banner button { border: 0; padding: 0; background: none; color: var(--brand); text-decoration: underline; font-weight: 700; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 60;
  height: calc(var(--header-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: color-mix(in srgb, var(--background) 84%, transparent);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
body:has(.offline-banner:not([hidden])) .app-header,
body:has(.file-banner:not([hidden])) .app-header { top: 34px; }
.header-inner { max-width: var(--max-width); height: var(--header-h); margin: 0 auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 11px; border: 0; background: transparent; padding: 3px; cursor: pointer; text-align: left; }
.brand-mark { width: 39px; height: 39px; border-radius: 13px 13px 16px 10px; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); color: white; display: grid; place-items: center; font-size: 13px; font-weight: 900; letter-spacing: .06em; box-shadow: var(--shadow-sm); transform: rotate(-2deg); }
html[data-theme="dark"] .brand-mark { color: #0d2516; }
.brand strong { display: block; font-size: 16px; line-height: 1.1; letter-spacing: -.02em; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; letter-spacing: .03em; }
.header-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.icon-button:hover { border-color: var(--line-strong); background: var(--surface-2); }
.location-button.active { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }

.app-main { max-width: var(--max-width); margin: 0 auto; padding: 24px 20px 36px; }
.page { display: none; animation: page-in .25s ease-out; }
.page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.hero-card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 320px;
  padding: clamp(26px, 5vw, 54px);
  border-radius: 30px;
  color: #fff;
  background:
    radial-gradient(circle at 85% 8%, rgba(255,255,255,.17) 0 4rem, transparent 4.1rem),
    radial-gradient(circle at 73% 120%, rgba(216, 167, 52, .36) 0 19rem, transparent 19.2rem),
    linear-gradient(135deg, #0e3c25, #1d6840 72%, #2a7448);
  box-shadow: 0 24px 60px rgba(17, 69, 41, .18);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}
.hero-card::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .13; background-image: linear-gradient(30deg, transparent 48%, #fff 49%, #fff 50%, transparent 51%), linear-gradient(150deg, transparent 48%, #fff 49%, #fff 50%, transparent 51%); background-size: 44px 76px; mask-image: linear-gradient(90deg, transparent 25%, #000); }
.hero-copy { max-width: 680px; }
.eyebrow { margin: 0 0 7px; color: var(--brand); font-size: 12px; line-height: 1.2; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.hero-card .eyebrow { color: #bde3c8; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: clamp(32px, 5vw, 54px); line-height: 1.02; letter-spacing: -.05em; }
h2 { margin: 0; font-size: clamp(22px, 3vw, 29px); line-height: 1.12; letter-spacing: -.035em; }
h3 { margin: 0; font-size: 18px; line-height: 1.2; letter-spacing: -.02em; }
.hero-copy > p:not(.eyebrow) { max-width: 590px; margin: 18px 0 0; color: rgba(255,255,255,.82); font-size: 17px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.primary-button, .secondary-button, .danger-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 14px;
  padding: 10px 16px;
  border: 1px solid transparent;
  font-weight: 750;
  cursor: pointer;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.primary-button { background: var(--brand); color: white; box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 25%, transparent); }
.primary-button:hover, .primary-button:active { background: var(--brand-strong); transform: translateY(-1px); }
.hero-card .primary-button { background: white; color: #174f31; box-shadow: 0 8px 25px rgba(0,0,0,.13); }
.hero-card .secondary-button { border-color: rgba(255,255,255,.35); background: rgba(255,255,255,.08); color: white; }
.secondary-button { background: var(--surface); border-color: var(--line); color: var(--ink); }
.secondary-button:hover { background: var(--surface-2); border-color: var(--line-strong); }
.danger-button { background: color-mix(in srgb, var(--danger) 11%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); color: var(--danger); }
.primary-button.small, .secondary-button.small { min-height: 40px; padding: 8px 13px; font-size: 14px; }
button[disabled] { opacity: .48; cursor: not-allowed; transform: none !important; }

.progress-orbit { position: relative; flex: 0 0 auto; width: 180px; height: 180px; display: grid; place-items: center; }
.progress-orbit::before { content: ""; position: absolute; inset: 20px; border-radius: 50%; background: rgba(255,255,255,.09); box-shadow: inset 0 0 0 1px rgba(255,255,255,.12); }
.progress-orbit svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.progress-track, .progress-value { fill: none; stroke-width: 10; }
.progress-track { stroke: rgba(255,255,255,.16); }
.progress-value { stroke: #f0bd3e; stroke-linecap: round; stroke-dasharray: 364.42; stroke-dashoffset: 364.42; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 7px rgba(240,189,62,.35)); }
.progress-center { position: relative; text-align: center; z-index: 1; }
.progress-center strong { display: block; font-size: 38px; line-height: 1; letter-spacing: -.05em; }
.progress-center span { display: block; margin-top: 7px; color: rgba(255,255,255,.74); font-size: 12px; font-weight: 700; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; margin: 16px 0 34px; }
.stat-card { min-height: 112px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); display: flex; align-items: flex-start; gap: 13px; }
.stat-icon { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.stat-icon svg { width: 20px; height: 20px; }
.stat-copy strong { display: block; font-size: 25px; line-height: 1.1; letter-spacing: -.04em; }
.stat-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.stat-copy small { display: block; margin-top: 3px; color: var(--muted-2); font-size: 11px; }

.section-block { margin: 34px 0; }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.text-button { border: 0; background: none; color: var(--brand); padding: 7px 0; display: inline-flex; align-items: center; gap: 4px; font-weight: 750; cursor: pointer; white-space: nowrap; }
.text-button svg { width: 16px; height: 16px; }
.danger-text { color: var(--danger); }
.region-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.region-card { padding: 15px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; text-align: left; }
.region-card:hover { border-color: var(--line-strong); }
.region-card-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.region-card strong { font-size: 14px; }
.region-card span { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.progress-bar { height: 7px; margin-top: 11px; overflow: hidden; border-radius: 99px; background: var(--surface-3); }
.progress-bar > i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 55%, var(--accent))); transition: width .45s ease; }
.region-card.complete { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); background: var(--brand-faint); }
.region-card.complete .progress-bar > i { background: var(--accent); }

.parks-heading { align-items: center; }
.view-switch { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.view-switch button { width: 36px; height: 32px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.view-switch button.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }
.view-switch svg { width: 17px; height: 17px; }
.search-row { display: flex; gap: 10px; }
.search-box { min-height: 49px; flex: 1; display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); box-shadow: var(--shadow-sm); }
.search-box:focus-within { border-color: color-mix(in srgb, var(--brand) 55%, var(--line)); box-shadow: 0 0 0 3px var(--brand-soft); }
.search-box > svg { width: 19px; height: 19px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 2; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 16px; }
.search-box input::placeholder { color: var(--muted-2); }
.clear-search { width: 31px; height: 31px; border: 0; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; cursor: pointer; }
.clear-search svg { width: 15px; height: 15px; }
.filter-button { position: relative; min-width: 98px; min-height: 49px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 750; cursor: pointer; box-shadow: var(--shadow-sm); }
.filter-button b { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--brand); color: white; font-size: 11px; line-height: 19px; }
.quick-filters { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: 13px -2px 0; padding: 2px; }
.quick-filters::-webkit-scrollbar { display: none; }
.filter-chip { min-height: 36px; white-space: nowrap; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 7px 12px; color: var(--muted); font-size: 13px; font-weight: 700; cursor: pointer; }
.filter-chip.active { background: var(--brand); color: white; border-color: var(--brand); }
.results-summary { min-height: 34px; padding: 13px 2px 6px; color: var(--muted); font-size: 13px; display: flex; justify-content: space-between; gap: 10px; }
.results-summary strong { color: var(--ink); }
.park-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.park-card { position: relative; min-width: 0; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.park-card:hover { transform: translateY(-2px); border-color: var(--line-strong); box-shadow: var(--shadow-md); }
.park-card.visited { border-color: color-mix(in srgb, var(--visited) 28%, var(--line)); }
.park-card.planned:not(.visited) { border-color: color-mix(in srgb, var(--planned) 35%, var(--line)); }
.park-card.transition { border-style: dashed; border-color: color-mix(in srgb, var(--bonus) 60%, var(--line)); }
.park-status-button { position: absolute; z-index: 2; top: 14px; right: 14px; width: 39px; height: 39px; border: 2px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: transparent; display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); }
.park-status-button svg { width: 21px; height: 21px; stroke-width: 2.4; }
.park-status-button.checked { background: var(--visited); border-color: var(--visited); color: white; }
.park-card-main { width: 100%; min-height: 188px; border: 0; background: transparent; padding: 18px 61px 17px 18px; text-align: left; cursor: pointer; color: inherit; }
.park-card .park-kicker { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .07em; }
.kicker-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2); }
.bonus-pill, .transition-pill, .status-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 3px 7px; font-size: 10px; line-height: 1.2; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.bonus-pill, .transition-pill { color: var(--bonus); background: color-mix(in srgb, var(--bonus) 12%, var(--surface)); }
.park-card h3 { padding-right: 4px; font-size: 20px; }
.park-card-summary { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin: 8px 0 13px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.park-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.meta-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 25px; border-radius: 8px; padding: 4px 7px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 650; }
.meta-chip svg { width: 13px; height: 13px; }
.meta-chip.distance { color: var(--brand); background: var(--brand-soft); }
.card-flags { position: absolute; right: 15px; bottom: 15px; display: flex; flex-direction: column; gap: 5px; }
.card-flag { width: 25px; height: 25px; border-radius: 8px; display: grid; place-items: center; }
.card-flag svg { width: 14px; height: 14px; }
.card-flag.favorite { background: color-mix(in srgb, var(--favorite) 13%, var(--surface)); color: var(--favorite); }
.card-flag.planned { background: var(--accent-soft); color: var(--planned); }
.park-list.compact { display: block; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.park-list.compact .park-card { display: flex; align-items: center; min-height: 67px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.park-list.compact .park-card:last-child { border-bottom: 0; }
.park-list.compact .park-card:hover { transform: none; background: var(--surface-2); }
.park-list.compact .park-status-button { position: static; flex: 0 0 auto; margin-left: 13px; width: 34px; height: 34px; }
.park-list.compact .park-card-main { min-height: 67px; padding: 11px 48px 11px 12px; }
.park-list.compact .park-kicker { margin: 4px 0 0; text-transform: none; letter-spacing: 0; font-size: 11px; }
.park-list.compact h3 { font-size: 15px; }
.park-list.compact .park-card-summary, .park-list.compact .park-meta, .park-list.compact .kicker-dot, .park-list.compact .bonus-pill, .park-list.compact .transition-pill, .park-list.compact .park-operating-name { display: none; }
.park-list.compact .card-flags { right: 12px; bottom: auto; top: 50%; transform: translateY(-50%); flex-direction: row; }

.empty-state { margin: 25px 0; padding: 45px 20px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--surface); text-align: center; }
.empty-icon { width: 58px; height: 58px; margin: 0 auto 16px; border-radius: 20px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; }
.empty-icon svg { width: 28px; height: 28px; }
.empty-state p { max-width: 460px; margin: 8px auto 20px; color: var(--muted); }

.page-title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin: 10px 0 22px; }
.page-title-row h1 { font-size: clamp(30px, 5vw, 48px); }
.page-title-row p:not(.eyebrow) { margin: 8px 0 0; color: var(--muted); }
.map-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 13px; margin-bottom: 12px; }
.segmented-control { display: inline-flex; gap: 3px; padding: 3px; overflow-x: auto; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); box-shadow: var(--shadow-sm); }
.segmented-control button { min-height: 34px; border: 0; border-radius: 10px; padding: 6px 12px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 750; white-space: nowrap; cursor: pointer; }
.segmented-control button.active { background: var(--brand); color: white; }
.switch-label { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.switch-label input { position: absolute; opacity: 0; pointer-events: none; }
.switch { position: relative; width: 41px; height: 23px; border-radius: 99px; background: var(--line-strong); transition: background .2s; }
.switch::after { content: ""; position: absolute; width: 19px; height: 19px; top: 2px; left: 2px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,.2); transition: transform .2s; }
.switch-label input:checked + .switch { background: var(--brand); }
.switch-label input:checked + .switch::after { transform: translateX(18px); }
.map-shell { position: relative; overflow: hidden; width: 100%; aspect-ratio: 2047 / 1832; border: 1px solid var(--line); border-radius: 24px; background: #ece8df; box-shadow: var(--shadow-md); }
.park-map { display: block; width: 100%; height: 100%; aspect-ratio: 2047 / 1832; user-select: none; touch-action: none; cursor: grab; background: #ece8df; }
.park-map.dragging { cursor: grabbing; }
.map-paper { fill: #ece8df; }
.topo-map-image { pointer-events: none; image-rendering: auto; }
.map-image-vignette { fill: none; stroke: rgba(53, 48, 39, .18); stroke-width: 3; vector-effect: non-scaling-stroke; pointer-events: none; }
[data-theme="dark"] .topo-map-image { filter: brightness(.78) saturate(.78) contrast(1.08); }
.map-pin { cursor: pointer; outline: none; }
.map-pin .pin-hit { fill: transparent; pointer-events: all; }
.map-pin .pin-halo { fill: rgba(255,255,255,.94); stroke: #42524a; stroke-width: 6; vector-effect: non-scaling-stroke; filter: drop-shadow(0 4px 5px rgba(0,0,0,.34)); }
.map-pin .pin-core { fill: #56625d; stroke: rgba(255,255,255,.85); stroke-width: 2; vector-effect: non-scaling-stroke; }
.map-pin.visited .pin-halo { stroke: var(--visited); }
.map-pin.visited .pin-core { fill: var(--visited); }
.map-pin.planned:not(.visited) .pin-halo { stroke: var(--planned); }
.map-pin.planned:not(.visited) .pin-core { fill: var(--planned); }
.map-pin.transition .pin-halo { stroke: var(--bonus); stroke-dasharray: 9 6; }
.map-pin.transition:not(.visited):not(.planned) .pin-core { fill: var(--bonus); }
.map-pin.selected .pin-halo { stroke-width: 10; filter: drop-shadow(0 0 12px color-mix(in srgb, var(--accent) 85%, transparent)); }
.map-pin .pin-check { fill: none; stroke: white; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.map-pin:focus-visible .pin-halo { stroke: var(--accent); stroke-width: 10; }
.user-location .user-halo { fill: color-mix(in srgb, var(--bonus) 24%, transparent); }
.user-location .user-dot { fill: var(--bonus); stroke: white; stroke-width: 5; vector-effect: non-scaling-stroke; }
.map-controls { position: absolute; top: 14px; right: 14px; display: grid; gap: 5px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 91%, transparent); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); }
.map-controls button { width: 38px; height: 38px; border: 0; border-radius: 10px; background: transparent; display: grid; place-items: center; cursor: pointer; }
.map-controls button:hover { background: var(--surface-3); }
.map-legend { position: absolute; left: 14px; bottom: 14px; display: flex; flex-wrap: wrap; gap: 10px 13px; max-width: calc(100% - 28px); padding: 9px 12px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface) 91%, transparent); box-shadow: var(--shadow-sm); backdrop-filter: blur(8px); color: var(--muted); font-size: 11px; font-weight: 700; }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.legend-dot.visited { background: var(--visited); }.legend-dot.planned { background: var(--planned); }.legend-dot.transition { background: var(--bonus); }
.map-selection { margin-top: 12px; }
.map-selection-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.map-selection-icon { width: 42px; height: 42px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: 0 0 auto; }
.map-selection-icon svg { width: 22px; height: 22px; }
.map-selection-copy { min-width: 0; flex: 1; }
.map-selection-copy strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.map-selection-copy span { color: var(--muted); font-size: 12px; }
.map-selection-actions { display: flex; gap: 7px; }
.map-selection-actions button { min-height: 37px; }
.map-region-block { margin-bottom: 0; }

/* Multi-stop trip planner */
.route-planner-section { margin-top: 24px; }
.route-empty {
  display: grid;
  grid-template-columns: 52px minmax(0,1fr) auto;
  align-items: center;
  gap: 15px;
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 82%, var(--brand-faint));
}
.route-empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 17px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
}
.route-empty-icon svg { width: 27px; height: 27px; }
.route-empty strong { display: block; margin-bottom: 3px; }
.route-empty p { margin: 0; color: var(--muted); font-size: 13px; }
.route-empty em { color: var(--ink); font-style: normal; font-weight: 750; }
.route-summary-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(130deg, var(--brand-faint), var(--surface));
  box-shadow: var(--shadow-sm);
}
.route-summary-card > div:first-child { min-width: 0; }
.route-summary-card strong { display: block; font-size: 17px; }
.route-summary-card span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.route-summary-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.route-limit-note {
  margin: 9px 2px 0;
  padding: 9px 12px;
  border-radius: 11px;
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--ink) 84%, #745300);
  font-size: 12px;
}
.route-stop-list { display: grid; gap: 8px; margin-top: 11px; }
.route-stop {
  display: grid;
  grid-template-columns: 38px minmax(0,1fr) 40px auto;
  align-items: center;
  gap: 9px;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.route-stop-number {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-size: 13px;
  font-weight: 850;
  box-shadow: 0 5px 13px color-mix(in srgb, var(--brand) 20%, transparent);
}
.route-stop-copy {
  min-width: 0;
  padding: 7px 5px;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.route-stop-copy strong,
.route-stop-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.route-stop-copy strong { font-size: 14px; }
.route-stop-copy small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.route-apple {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--brand);
  text-decoration: none;
}
.route-apple:hover { background: var(--brand-soft); }
.route-apple svg { width: 18px; height: 18px; }
.route-order-buttons { display: flex; align-items: center; gap: 4px; }
.route-order-buttons button {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.route-order-buttons button:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-3); }
.route-order-buttons button:disabled { opacity: .32; cursor: default; }
.route-order-buttons button[data-action="route-remove"] { color: var(--danger); }
.route-order-buttons button svg { width: 15px; height: 15px; }
.route-order-buttons button[data-action="route-up"] svg { transform: rotate(-90deg); }
.route-order-buttons button[data-action="route-down"] svg { transform: rotate(90deg); }
.route-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 3px 0;
}
.route-footer > span { color: var(--muted); font-size: 11px; text-align: right; }

.journal-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.journal-stat { padding: 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
.journal-stat strong { display: block; font-size: 27px; line-height: 1.1; letter-spacing: -.04em; }
.journal-stat span { color: var(--muted); font-size: 12px; }
.journal-toolbar { display: flex; gap: 10px; margin: 18px 0; }
.journal-toolbar select { min-width: 155px; padding: 0 36px 0 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.journal-timeline { position: relative; }
.timeline-month { margin: 26px 0 12px; color: var(--muted); font-size: 12px; font-weight: 850; text-transform: uppercase; letter-spacing: .1em; }
.timeline-entry { position: relative; display: grid; grid-template-columns: 68px minmax(0,1fr); gap: 14px; margin-bottom: 10px; }
.timeline-date { padding-top: 14px; color: var(--muted); text-align: right; font-size: 12px; font-weight: 750; }
.timeline-date strong { display: block; color: var(--ink); font-size: 20px; line-height: 1; }
.timeline-card { position: relative; padding: 15px 48px 15px 17px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; }
.timeline-card::before { content: ""; position: absolute; left: -22px; top: 21px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 3px solid var(--background); box-shadow: 0 0 0 1px var(--line); }
.timeline-entry:not(:last-child) .timeline-card::after { content: ""; position: absolute; left: -18px; top: 33px; bottom: -25px; width: 1px; background: var(--line); }
.timeline-card h3 { font-size: 16px; }
.timeline-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; white-space: pre-wrap; }
.timeline-card .timeline-location { margin-top: 3px; color: var(--muted-2); font-size: 11px; }
.timeline-edit { position: absolute; right: 10px; top: 10px; width: 32px; height: 32px; border: 0; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; cursor: pointer; }
.timeline-edit svg { width: 15px; height: 15px; }
.checked-only-group { margin-top: 32px; }
.checked-only-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 9px; }
.checked-only-card { padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; }
.checked-only-card span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 700; }
.checked-only-card small { color: var(--muted); white-space: nowrap; }

.badge-total { min-width: 88px; padding: 11px 14px; border-radius: 15px; background: var(--brand-soft); color: var(--brand); text-align: center; }
.badge-total strong { display: block; font-size: 24px; line-height: 1; }
.badge-total span { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.next-badge-card { margin-bottom: 22px; }
.next-badge-inner { position: relative; overflow: hidden; display: flex; align-items: center; gap: 17px; padding: 20px; border: 1px solid color-mix(in srgb, var(--accent) 38%, var(--line)); border-radius: 20px; background: linear-gradient(130deg, var(--accent-soft), var(--surface)); box-shadow: var(--shadow-sm); }
.next-badge-icon { width: 66px; height: 66px; flex: 0 0 auto; border-radius: 22px; background: var(--accent); color: #422e00; display: grid; place-items: center; transform: rotate(-4deg); }
.next-badge-icon svg { width: 34px; height: 34px; }
.next-badge-copy { flex: 1; min-width: 0; }
.next-badge-copy p { margin: 5px 0 10px; color: var(--muted); font-size: 13px; }
.next-badge-copy .progress-bar { background: color-mix(in srgb, var(--accent) 16%, var(--surface)); }
.next-badge-copy .progress-bar > i { background: var(--accent); }
.next-badge-progress { min-width: 55px; color: var(--planned); font-weight: 850; text-align: right; }
.badge-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.badge-card { position: relative; overflow: hidden; min-height: 205px; padding: 19px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); box-shadow: var(--shadow-sm); }
.badge-card.unlocked { border-color: color-mix(in srgb, var(--accent) 42%, var(--line)); background: linear-gradient(145deg, color-mix(in srgb, var(--accent-soft) 45%, var(--surface)), var(--surface)); }
.badge-card.locked { opacity: .72; }
.badge-icon { width: 54px; height: 54px; margin-bottom: 15px; border-radius: 18px; background: var(--surface-3); color: var(--muted); display: grid; place-items: center; }
.badge-card.unlocked .badge-icon { background: var(--accent); color: #493200; box-shadow: 0 9px 20px color-mix(in srgb, var(--accent) 25%, transparent); transform: rotate(-3deg); }
.badge-icon svg { width: 28px; height: 28px; }
.badge-card p { margin: 7px 0 12px; color: var(--muted); font-size: 12px; }
.badge-card .progress-bar { height: 6px; }
.badge-progress-label { margin-top: 7px; display: flex; justify-content: space-between; color: var(--muted-2); font-size: 10px; font-weight: 700; }
.badge-unlocked-label { position: absolute; right: 14px; top: 14px; color: var(--planned); font-size: 10px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }

.bottom-nav {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: max(10px, var(--safe-bottom));
  transform: translateX(-50%);
  width: min(94%, 660px);
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid color-mix(in srgb, var(--line) 90%, transparent);
  border-radius: 23px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: 0 16px 50px rgba(20, 45, 30, .2);
  backdrop-filter: blur(20px) saturate(1.3);
  -webkit-backdrop-filter: blur(20px) saturate(1.3);
}
.bottom-nav button { border: 0; border-radius: 16px; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 10px; font-weight: 750; cursor: pointer; }
.bottom-nav button.active { background: var(--brand-soft); color: var(--brand); }
.bottom-nav svg { width: 22px; height: 22px; }

.sheet-scrim { position: fixed; z-index: 120; inset: 0; background: rgba(5,15,9,.5); backdrop-filter: blur(2px); animation: fade-in .18s ease; }
.bottom-sheet { position: fixed; z-index: 130; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, 820px); max-height: min(92vh, 920px); max-height: min(92dvh, 920px); overflow: hidden; border: 1px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; background: var(--surface); box-shadow: var(--shadow-lg); animation: sheet-in .26s cubic-bezier(.2,.8,.2,1); padding-bottom: var(--safe-bottom); }
.bottom-sheet[hidden], .modal[hidden], .photo-viewer[hidden], .sheet-scrim[hidden] { display: none; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes sheet-in { from { transform: translate(-50%, 100%); } }
.sheet-handle { width: 44px; height: 5px; margin: 9px auto 3px; border-radius: 99px; background: var(--line-strong); }
.sheet-close { position: absolute; z-index: 3; right: 15px; top: 16px; width: 39px; height: 39px; border: 1px solid var(--line); border-radius: 13px; background: color-mix(in srgb, var(--surface) 92%, transparent); display: grid; place-items: center; cursor: pointer; }
.sheet-close.inline { position: static; flex: 0 0 auto; }
.sheet-header { padding: 10px 23px 17px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.sheet-content { max-height: calc(min(92vh, 920px) - 25px); max-height: calc(min(92dvh, 920px) - 25px); overflow-y: auto; overscroll-behavior: contain; padding: 17px 23px calc(26px + var(--safe-bottom)); }
.filter-sheet .sheet-content { max-height: calc(min(92dvh, 920px) - 170px); }
.settings-sheet .sheet-content { max-height: calc(min(92dvh, 920px) - 95px); }
.sheet-footer { min-height: 70px; padding: 10px 20px calc(10px + var(--safe-bottom)); border-top: 1px solid var(--line); background: var(--surface); display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.park-sheet-hero { margin: -17px -23px 0; padding: 28px 64px 24px 23px; background: linear-gradient(140deg, var(--brand-faint), var(--surface)); border-bottom: 1px solid var(--line); }
.park-sheet-hero .park-number { color: var(--brand); font-size: 11px; font-weight: 850; text-transform: uppercase; letter-spacing: .09em; }
.park-sheet-hero h2 { margin-top: 7px; font-size: clamp(27px, 5vw, 38px); }
.park-sheet-hero p { margin: 8px 0 0; color: var(--muted); }
.park-status-actions { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 15px 0 20px; }
.status-action { min-height: 54px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12px; font-weight: 750; cursor: pointer; }
.status-action svg { width: 18px; height: 18px; }
.status-action.active.visited { background: color-mix(in srgb, var(--visited) 12%, var(--surface)); color: var(--visited); border-color: color-mix(in srgb, var(--visited) 35%, var(--line)); }
.status-action.active.favorite { background: color-mix(in srgb, var(--favorite) 12%, var(--surface)); color: var(--favorite); border-color: color-mix(in srgb, var(--favorite) 35%, var(--line)); }
.status-action.active.planned { background: var(--accent-soft); color: var(--planned); border-color: color-mix(in srgb, var(--planned) 35%, var(--line)); }
.park-overview { margin: 0 0 18px; color: var(--muted); font-size: 15px; line-height: 1.6; }
.chip-cloud { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 20px; }
.detail-chip { border-radius: 99px; padding: 6px 9px; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 700; }
.quick-actions-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 18px 0 26px; }
.quick-action { min-height: 66px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); text-decoration: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 750; cursor: pointer; text-align: center; }
.quick-action:hover { background: var(--surface-2); }
.quick-action svg { width: 21px; height: 21px; color: var(--brand); }
.detail-section { padding: 22px 0; border-top: 1px solid var(--line); }
.detail-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.detail-section-heading h3 { font-size: 18px; }
.detail-section-heading span { color: var(--muted); font-size: 12px; }
.rating-row { display: flex; gap: 4px; }
.rating-star { width: 38px; height: 38px; border: 0; background: transparent; color: var(--line-strong); padding: 5px; cursor: pointer; }
.rating-star svg { width: 100%; height: 100%; fill: currentColor; stroke: currentColor; }
.rating-star.active { color: var(--accent); }
.notes-area { width: 100%; min-height: 125px; resize: vertical; padding: 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--ink); outline: 0; line-height: 1.5; }
.notes-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.save-indicator { min-height: 17px; margin-top: 6px; color: var(--muted-2); font-size: 11px; text-align: right; }
.visit-list { display: grid; gap: 8px; }
.visit-item { position: relative; padding: 12px 44px 12px 13px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); cursor: pointer; }
.visit-item strong { display: block; font-size: 13px; }
.visit-item p { margin: 5px 0 0; color: var(--muted); font-size: 12px; white-space: pre-wrap; }
.visit-item button { position: absolute; right: 8px; top: 8px; width: 31px; height: 31px; border: 0; border-radius: 9px; background: var(--surface); display: grid; place-items: center; cursor: pointer; }
.visit-item button svg { width: 14px; height: 14px; }
.no-detail-data { padding: 16px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 13px; text-align: center; }
.photo-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.photo-tile { position: relative; aspect-ratio: 1; overflow: hidden; border: 0; border-radius: 12px; padding: 0; background: var(--surface-3); cursor: pointer; }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; }
.photo-tile .photo-delete { position: absolute; right: 5px; top: 5px; width: 28px; height: 28px; border: 0; border-radius: 9px; background: rgba(0,0,0,.62); color: white; display: grid; place-items: center; }
.photo-tile .photo-delete svg { width: 14px; height: 14px; }
.add-photo-tile { aspect-ratio: 1; border: 1px dashed var(--line-strong); border-radius: 12px; background: var(--surface-2); color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; font-size: 11px; font-weight: 750; cursor: pointer; }
.add-photo-tile svg { width: 24px; height: 24px; color: var(--brand); }
.location-privacy { margin: 13px 0 0; color: var(--muted-2); font-size: 11px; }

.filter-group { padding: 18px 0; border-bottom: 1px solid var(--line); }
.filter-group:first-child { padding-top: 0; }
.filter-group:last-child { border-bottom: 0; }
.filter-group h3 { margin-bottom: 11px; font-size: 14px; }
.filter-options { display: flex; flex-wrap: wrap; gap: 7px; }
.option-chip { min-height: 38px; border: 1px solid var(--line); border-radius: 99px; background: var(--surface); padding: 8px 12px; color: var(--muted); font-size: 12px; font-weight: 700; cursor: pointer; }
.option-chip.active { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }
.option-chip.active::before { content: "✓ "; }
.filter-select { width: 100%; min-height: 46px; padding: 9px 38px 9px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); color: var(--ink); }

.settings-profile { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 17px; background: var(--brand-faint); }
.settings-avatar { width: 48px; height: 48px; border-radius: 16px; background: var(--brand); color: white; display: grid; place-items: center; font-weight: 900; }
.settings-profile label { flex: 1; }
.settings-profile span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; font-weight: 750; }
.settings-profile input { width: 100%; border: 0; border-bottom: 1px solid var(--line-strong); background: transparent; color: var(--ink); padding: 3px 0 6px; outline: 0; }
.settings-section { padding: 22px 0; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-section h3 { margin-bottom: 11px; font-size: 14px; }
.theme-options { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
.theme-option { min-height: 45px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface); display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 750; cursor: pointer; }
.theme-option.active { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); }
.settings-list { overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--surface); }
.settings-row { width: 100%; min-height: 54px; padding: 10px 13px; border: 0; border-bottom: 1px solid var(--line); background: transparent; display: flex; align-items: center; gap: 11px; color: var(--ink); text-align: left; cursor: pointer; }
.settings-row:last-child { border-bottom: 0; }
.settings-row:hover { background: var(--surface-2); }
.settings-row-icon { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 11px; background: var(--surface-3); color: var(--brand); display: grid; place-items: center; }
.settings-row-icon svg { width: 17px; height: 17px; }
.settings-row-copy { min-width: 0; flex: 1; }
.settings-row-copy strong { display: block; font-size: 13px; }
.settings-row-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.settings-row > svg { width: 16px; height: 16px; color: var(--muted-2); }
.settings-row.danger { color: var(--danger); }
.settings-row.danger .settings-row-icon { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.about-box { padding: 14px; border-radius: 14px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.55; }
.about-box strong { color: var(--ink); }
.about-box a { font-weight: 750; }
.storage-meter { margin-top: 9px; }
.storage-meter .progress-bar > i { background: var(--bonus); }

.modal { position: fixed; z-index: 170; inset: 0; padding: max(18px, var(--safe-top)) 16px max(18px, var(--safe-bottom)); background: rgba(5,15,9,.55); backdrop-filter: blur(4px); display: grid; place-items: center; animation: fade-in .18s ease; }
.modal-card { width: min(100%, 560px); max-height: 90vh; max-height: 90dvh; overflow-y: auto; border: 1px solid var(--line); border-radius: 23px; background: var(--surface); box-shadow: var(--shadow-lg); padding: 21px; }
.modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; margin-bottom: 18px; }
.field { display: block; margin: 14px 0; }
.field > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 12px; font-weight: 750; }
.field em { font-weight: 500; }
.field input, .field select, .field textarea { width: 100%; min-height: 47px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--ink); outline: 0; }
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.modal-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 21px; }
.modal-actions > span { flex: 1; }
.install-steps { list-style: none; display: grid; gap: 14px; padding: 0; margin: 8px 0 18px; }
.install-steps li { display: flex; align-items: flex-start; gap: 12px; }
.install-steps li > span { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 10px; background: var(--brand); color: white; display: grid; place-items: center; font-weight: 850; }
.install-steps svg { display: inline; width: 17px; height: 17px; vertical-align: middle; }
.notice-box { padding: 13px; border: 1px solid color-mix(in srgb, var(--brand) 25%, var(--line)); border-radius: 13px; background: var(--brand-faint); color: var(--muted); font-size: 12px; }

.photo-viewer { position: fixed; z-index: 190; inset: 0; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(60px, calc(var(--safe-top) + 50px)) 15px max(50px, var(--safe-bottom)); }
.photo-viewer img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); object-fit: contain; border-radius: 10px; }
.photo-viewer-close { position: absolute; right: 17px; top: max(17px, var(--safe-top)); width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.25); border-radius: 13px; background: rgba(255,255,255,.1); color: white; display: grid; place-items: center; }
#photoViewerCaption { margin-top: 13px; color: rgba(255,255,255,.76); font-size: 13px; text-align: center; }

.toast-region { position: fixed; z-index: 220; left: 50%; bottom: calc(var(--nav-h) + var(--safe-bottom) + 24px); transform: translateX(-50%); width: min(calc(100% - 28px), 480px); display: grid; gap: 7px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--surface) 95%, transparent); box-shadow: var(--shadow-md); color: var(--ink); font-size: 13px; font-weight: 650; text-align: center; backdrop-filter: blur(10px); animation: toast-in .25s ease, toast-out .25s ease 3.2s forwards; }
.toast.success { border-color: color-mix(in srgb, var(--visited) 35%, var(--line)); }
.toast.error { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(7px); } }
.noscript { margin: 30px; padding: 20px; background: #fee; color: #700; border-radius: 12px; }

@media (max-width: 840px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .region-progress { grid-template-columns: repeat(2,1fr); }
  .badge-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 680px) {
  :root { --header-h: 60px; --nav-h: 68px; }
  body { font-size: 15px; }
  .header-inner { padding: 0 14px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 12px; }
  .brand strong { font-size: 14px; }.brand small { font-size: 10px; }
  .icon-button { width: 38px; height: 38px; border-radius: 12px; }
  .app-main { padding: 15px 12px 24px; }
  .hero-card { min-height: auto; padding: 25px 21px 23px; border-radius: 24px; align-items: flex-start; }
  .hero-card::before { opacity: .08; }
  .hero-copy { min-width: 0; }
  .hero-copy h1 { font-size: clamp(30px, 10vw, 43px); }
  .hero-copy > p:not(.eyebrow) { font-size: 14px; margin-top: 13px; padding-right: 92px; }
  .hero-actions { margin-top: 20px; padding-right: 80px; }
  .hero-actions .primary-button, .hero-actions .secondary-button { min-height: 42px; padding: 8px 11px; font-size: 12px; }
  .progress-orbit { position: absolute; right: -7px; bottom: -4px; width: 142px; height: 142px; opacity: .96; }
  .progress-center strong { font-size: 31px; }.progress-center span { font-size: 10px; }
  .stats-grid { gap: 8px; margin: 10px 0 28px; }
  .stat-card { min-height: 95px; padding: 13px 11px; gap: 9px; }
  .stat-icon { width: 34px; height: 34px; border-radius: 11px; }.stat-copy strong { font-size: 21px; }.stat-copy span { font-size: 11px; }
  .section-block { margin: 28px 0; }
  .section-heading { margin-bottom: 13px; }
  .section-heading h2 { font-size: 23px; }
  .region-progress { gap: 8px; }
  .region-card { padding: 12px; }
  .region-card strong { font-size: 12px; }
  .search-row { gap: 7px; }
  .filter-button { min-width: 51px; padding: 0 12px; }
  .filter-button span { display: none; }
  .park-list { grid-template-columns: 1fr; gap: 9px; }
  .park-card-main { min-height: 172px; }
  .results-summary { font-size: 12px; }
  .page-title-row { align-items: flex-start; margin-top: 3px; }
  .page-title-row h1 { font-size: 33px; }
  .page-title-row .primary-button span, .page-title-row .secondary-button span { display: none; }
  .map-toolbar { align-items: flex-start; flex-direction: column; }
  .segmented-control { max-width: 100%; }
  .map-shell { border-radius: 19px; }
  .map-controls { top: 8px; right: 8px; }
  .map-controls button { width: 34px; height: 34px; }
  .map-legend { right: 14px; font-size: 10px; }
  .map-selection-card { gap: 10px; padding: 12px; }
  .map-selection-actions .secondary-button { padding: 7px 9px; }
  .map-selection-actions .secondary-button span { display: none; }
  .route-empty { grid-template-columns: 45px minmax(0,1fr); padding: 14px; }
  .route-empty-icon { width: 45px; height: 45px; border-radius: 14px; }
  .route-empty .secondary-button { grid-column: 1 / -1; width: 100%; }
  .route-summary-card { align-items: stretch; flex-direction: column; gap: 12px; padding: 14px; }
  .route-summary-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .route-summary-actions button { width: 100%; }
  .route-stop { grid-template-columns: 34px minmax(0,1fr) 36px; gap: 6px; padding: 8px; }
  .route-stop-number { width: 31px; height: 31px; font-size: 12px; }
  .route-stop-copy { padding-inline: 3px; }
  .route-apple { width: 34px; height: 34px; }
  .route-order-buttons { grid-column: 2 / -1; justify-content: flex-end; padding-top: 2px; }
  .route-order-buttons button { width: 34px; height: 30px; }
  .route-footer { align-items: flex-start; }
  .route-footer > span { max-width: 60%; }
  .journal-stats { gap: 8px; }
  .journal-stat { padding: 13px 11px; }.journal-stat strong { font-size: 22px; }
  .journal-toolbar { flex-direction: column; }
  .journal-toolbar select { min-height: 45px; }
  .timeline-entry { grid-template-columns: 47px minmax(0,1fr); gap: 10px; }
  .timeline-date strong { font-size: 17px; }
  .timeline-card::before { left: -17px; }.timeline-entry:not(:last-child) .timeline-card::after { left: -13px; }
  .checked-only-grid { grid-template-columns: 1fr; }
  .badge-grid { gap: 8px; }.badge-card { min-height: 195px; padding: 15px; }.badge-icon { width: 48px; height: 48px; }
  .next-badge-inner { padding: 15px; gap: 12px; }.next-badge-icon { width: 54px; height: 54px; border-radius: 18px; }.next-badge-progress { display: none; }
  .bottom-nav { width: calc(100% - 18px); bottom: max(6px, var(--safe-bottom)); border-radius: 20px; padding: 6px; }
  .bottom-sheet { border-radius: 23px 23px 0 0; }
  .sheet-header { padding: 8px 16px 14px; }
  .sheet-content { padding: 14px 16px calc(23px + var(--safe-bottom)); }
  .park-sheet-hero { margin: -14px -16px 0; padding: 26px 55px 21px 16px; }
  .park-status-actions { gap: 5px; }.status-action { min-height: 50px; flex-direction: column; gap: 2px; font-size: 10px; }
  .quick-actions-grid { gap: 6px; }.quick-action { min-height: 63px; }
  .photo-grid { grid-template-columns: repeat(3,1fr); }
  .modal { padding: 10px; align-items: end; }
  .modal-card { width: 100%; max-height: 94dvh; border-radius: 22px 22px 12px 12px; padding: 17px; }
  .modal-actions { flex-wrap: wrap; }.modal-actions .primary-button, .modal-actions .secondary-button { flex: 1; }
}

@media (max-width: 390px) {
  .hero-copy > p:not(.eyebrow) { padding-right: 62px; }
  .hero-actions { padding-right: 54px; }
  .hero-actions .secondary-button { display: none; }
  .progress-orbit { right: -23px; width: 135px; height: 135px; }
  .region-progress { grid-template-columns: 1fr; }
  .badge-grid { grid-template-columns: 1fr; }
  .badge-card { min-height: 175px; }
}

@media (min-width: 1000px) {
  .app-main { padding-top: 32px; }
  .bottom-nav { bottom: 18px; }
  .park-sheet { width: min(100%, 900px); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

@media print {
  .app-header, .bottom-nav, .hero-actions, .search-row, .quick-filters, .view-switch, .text-button, .header-actions { display: none !important; }
  body { padding: 0; background: white; color: black; }
  .app-main { max-width: none; padding: 0; }
  .hero-card { min-height: auto; color: black; background: white; border: 2px solid #222; box-shadow: none; }
  .progress-track { stroke: #ddd; }.progress-value { stroke: #333; }
  .park-list { grid-template-columns: repeat(2,1fr); }
  .park-card { break-inside: avoid; box-shadow: none; }
}

/* Icons outside interactive buttons use the same outlined visual language. */
.stat-icon svg,
.map-selection-icon svg,
.empty-icon svg,
.badge-icon svg,
.next-badge-icon svg,
.settings-row-icon svg,
.route-empty-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}


/* v5 inherited topographic-map and naming refinements */
.section-note { margin: 5px 0 0; max-width: 620px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.map-roster-note { color: var(--muted); font-size: 12px; font-weight: 700; text-align: right; }
.map-source-note { margin: 10px 3px 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.map-source-note strong { color: var(--ink); }
.park-operating-name { margin: -2px 0 8px; color: var(--bonus); font-size: 11px; font-weight: 700; }
.name-history, .region-clarifier { margin: 13px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 1.45; }
.name-history strong { display: block; margin-bottom: 3px; color: var(--ink); }
.region-clarifier strong { color: var(--ink); }
.region-clarifier span { opacity: .82; }
.park-sheet-hero.transition { background: linear-gradient(135deg, color-mix(in srgb, var(--bonus) 78%, #163f35), color-mix(in srgb, var(--brand) 75%, #233a2d)); }
@media (max-width: 700px) {
  .map-toolbar { gap: 8px; }
  .map-roster-note { text-align: left; font-size: 11px; }
  .map-legend { left: 8px; bottom: 8px; gap: 6px 9px; padding: 7px 9px; font-size: 9px; }
  .map-source-note { font-size: 10px; }
}

/* v5 live Park Finder map */
.park-heading-actions { display: flex; align-items: center; gap: 9px; }
.finder-mode-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--surface) 70%, transparent);
}
.finder-mode-switch button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  padding: 7px 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.finder-mode-switch button svg { width: 16px; height: 16px; }
.finder-mode-switch button.active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: var(--shadow-sm);
}

.map-page-title { align-items: flex-start; margin-bottom: 17px; }
.map-page-title > div { max-width: 770px; }
.map-page-title > div > p:last-child { margin-top: 8px; color: var(--muted); }
.map-finder-bar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.map-search-box { width: 100%; }
.map-quick-filters { margin-top: 11px; }
.map-results-summary { padding-top: 11px; }
.map-finder-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(292px, 340px);
  gap: 14px;
  align-items: stretch;
}
.interactive-map-frame {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  background: #e5e8e1;
  box-shadow: var(--shadow-md);
  isolation: isolate;
}
.leaflet-map {
  width: 100%;
  height: clamp(520px, 68vh, 730px);
  min-height: 520px;
  background: #e8ece7;
  color: #17231c;
  z-index: 0;
}
.leaflet-container { font-family: inherit; }
.leaflet-container a { color: #174f31; }
.leaflet-container .leaflet-control-attribution {
  max-width: min(72vw, 640px);
  padding: 2px 6px;
  background: rgba(255,255,255,.86);
  color: #4e5a52;
  font-size: 9px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.leaflet-container .leaflet-control-attribution a { color: #255a3b; }
.leaflet-bar {
  overflow: hidden;
  border: 1px solid rgba(56,72,62,.24) !important;
  border-radius: 13px !important;
  box-shadow: 0 6px 20px rgba(20,48,31,.16) !important;
}
.leaflet-bar a,
.leaflet-bar a:hover {
  width: 39px !important;
  height: 39px !important;
  line-height: 39px !important;
  border-bottom-color: rgba(56,72,62,.16) !important;
  background: rgba(255,255,255,.94) !important;
  color: #173e28 !important;
}
.leaflet-control-scale-line {
  border-color: rgba(24,46,31,.7) !important;
  background: rgba(255,255,255,.72) !important;
  color: #23372a !important;
  font-size: 9px !important;
}

.map-action-stack {
  position: absolute;
  z-index: 550;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(56,72,62,.22);
  border-radius: 14px;
  background: rgba(255,255,255,.93);
  box-shadow: 0 8px 24px rgba(20,48,31,.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.map-action-stack button {
  width: 39px;
  height: 39px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #234933;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.map-action-stack button:hover,
.map-action-stack button:focus-visible { background: #eaf2ec; }
.map-action-stack svg { width: 19px; height: 19px; }

.map-layer-panel {
  position: absolute;
  z-index: 650;
  top: 14px;
  left: 70px;
  width: min(290px, calc(100% - 86px));
  overflow: hidden;
  border: 1px solid rgba(44,65,52,.22);
  border-radius: 17px;
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  box-shadow: 0 18px 48px rgba(18,44,28,.26);
  backdrop-filter: blur(14px) saturate(1.08);
  -webkit-backdrop-filter: blur(14px) saturate(1.08);
}
.map-layer-panel-head {
  min-height: 47px;
  padding: 8px 9px 8px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.map-layer-panel-head strong { font-size: 13px; }
.map-layer-panel-head button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 10px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.map-layer-panel > button[data-action="set-map-layer"] {
  width: 100%;
  min-height: 64px;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 58px minmax(0,1fr) 20px;
  align-items: center;
  gap: 11px;
  text-align: left;
  cursor: pointer;
}
.map-layer-panel > button:last-child { border-bottom: 0; }
.map-layer-panel > button:hover { background: var(--surface-2); }
.map-layer-panel > button.active { background: var(--brand-faint); }
.map-layer-panel > button:disabled { opacity: .45; cursor: not-allowed; }
.map-layer-panel > button > span:nth-child(2) { min-width: 0; }
.map-layer-panel > button strong,
.map-layer-panel > button small { display: block; }
.map-layer-panel > button strong { font-size: 12px; }
.map-layer-panel > button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.map-layer-panel > button i {
  width: 18px;
  height: 18px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
}
.map-layer-panel > button.active i {
  border: 5px solid var(--brand);
  background: var(--surface);
}
.layer-preview {
  width: 58px;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(36,56,43,.18);
  border-radius: 9px;
  background-color: #dbe6dc;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.38);
}
.layer-preview.road {
  background:
    linear-gradient(28deg, transparent 45%, #f8c789 46% 50%, transparent 51%),
    linear-gradient(152deg, transparent 45%, #fff 46% 51%, transparent 52%),
    linear-gradient(#d9e9d6 0 46%, #c7dce7 47% 55%, #e6e1d1 56%);
}
.layer-preview.terrain {
  background:
    repeating-radial-gradient(ellipse at 72% 32%, transparent 0 5px, rgba(130,91,47,.35) 6px 7px, transparent 8px 12px),
    linear-gradient(135deg, #b9d6a6, #ece1b7 46%, #a8c88e);
}
.layer-preview.minimal {
  background:
    linear-gradient(35deg, transparent 46%, #d9ad83 47% 49%, transparent 50%),
    linear-gradient(145deg, transparent 47%, #b9d5df 48% 51%, transparent 52%),
    #f5f3ed;
}
.layer-preview.historic {
  background-image: url("assets/arkansas-usgs-webmercator.jpg");
  background-size: cover;
  background-position: 50% 48%;
  filter: saturate(.72) sepia(.08);
}

.map-offline-notice {
  position: absolute;
  z-index: 540;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 160px);
  min-height: 39px;
  padding: 8px 12px;
  border: 1px solid rgba(143,101,20,.28);
  border-radius: 12px;
  background: rgba(255,245,209,.94);
  color: #674b0d;
  box-shadow: 0 7px 22px rgba(40,34,15,.13);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 750;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.map-offline-notice svg { width: 16px; height: 16px; }

.leaflet-map-legend {
  z-index: 520;
  left: 12px;
  right: auto;
  bottom: 12px;
  max-width: calc(100% - 160px);
  padding: 8px 10px;
  border-color: rgba(53,70,59,.18);
  background: rgba(255,255,255,.9);
  color: #4c5a51;
  box-shadow: 0 5px 18px rgba(23,48,32,.14);
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.92);
  box-shadow: 0 0 0 1px rgba(42,56,47,.32);
}
.legend-dot.visited { background: #21834c; }
.legend-dot.planned { background: #c48908; }
.legend-dot.unvisited { background: #59655e; }
.legend-dot.transition { background: #286c9e; outline: 1px dashed #286c9e; outline-offset: 2px; }

.map-results-panel {
  height: clamp(520px, 68vh, 730px);
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.map-results-panel-head {
  min-height: 51px;
  padding: 9px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}
.map-results-panel-head strong { color: var(--ink); font-size: 16px; }
.map-results-panel-head .text-button { font-size: 12px; }
.map-results-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  flex: 1;
}
.map-result-row {
  position: relative;
  min-height: 78px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  display: grid;
  grid-template-columns: minmax(0,1fr) 44px;
  align-items: stretch;
}
.map-result-row:last-child { border-bottom: 0; }
.map-result-row:hover { background: var(--surface-2); }
.map-result-row.selected {
  background: var(--brand-faint);
  box-shadow: inset 4px 0 0 var(--brand);
}
.map-result-row.visited { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--visited) 70%, transparent); }
.map-result-row.selected.visited { box-shadow: inset 4px 0 0 var(--visited); }
.map-result-main {
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px 5px 10px 12px;
  display: grid;
  grid-template-columns: 30px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  text-align: left;
  cursor: pointer;
}
.map-result-marker {
  width: 27px;
  height: 27px;
  border: 3px solid white;
  border-radius: 50%;
  background: #59655e;
  color: white;
  box-shadow: 0 0 0 1px rgba(41,56,47,.3), 0 3px 9px rgba(30,47,36,.18);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 900;
}
.map-result-marker.visited { background: var(--visited); }
.map-result-marker.planned:not(.visited) { background: var(--planned); }
.map-result-marker.transition { outline: 2px dashed var(--bonus); outline-offset: 2px; }
.map-result-copy { min-width: 0; }
.map-result-copy strong,
.map-result-copy small,
.map-result-copy em { display: block; }
.map-result-copy strong { overflow: hidden; color: var(--ink); font-size: 12px; line-height: 1.25; text-overflow: ellipsis; }
.map-result-copy small { margin-top: 3px; overflow: hidden; color: var(--muted); font-size: 10px; white-space: nowrap; text-overflow: ellipsis; }
.map-result-copy em { margin-top: 4px; color: var(--brand); font-size: 10px; font-style: normal; font-weight: 750; }
.map-result-check {
  align-self: center;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.map-result-check.checked { border-color: var(--visited); background: var(--visited); color: white; }
.map-result-check svg { width: 18px; height: 18px; }
.map-results-empty {
  min-height: 260px;
  padding: 24px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.map-results-empty > svg { width: 34px; height: 34px; color: var(--brand); }
.map-results-empty strong { color: var(--ink); }
.map-results-empty span { font-size: 12px; }

.leaflet-park-icon-shell,
.park-cluster-shell { border: 0 !important; background: transparent !important; }
.leaflet-park-pin {
  position: relative;
  width: 42px;
  height: 50px;
  display: block;
  transform-origin: 50% 90%;
  filter: drop-shadow(0 5px 5px rgba(24,43,31,.3));
  transition: transform .16s ease, filter .16s ease;
}
.leaflet-park-pin::after {
  content: "";
  position: absolute;
  z-index: 0;
  left: 17px;
  bottom: 4px;
  width: 8px;
  height: 17px;
  border-radius: 2px 2px 7px 7px;
  background: #58655d;
  transform: rotate(0deg);
}
.leaflet-pin-core {
  position: absolute;
  z-index: 1;
  top: 2px;
  left: 4px;
  width: 34px;
  height: 34px;
  border: 4px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: #58655d;
  color: white;
  box-shadow: 0 0 0 1px rgba(35,49,40,.32), inset 0 0 0 1px rgba(255,255,255,.18);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 950;
}
.leaflet-park-pin.visited::after,
.leaflet-park-pin.visited .leaflet-pin-core { background: var(--visited); }
.leaflet-park-pin.planned:not(.visited)::after,
.leaflet-park-pin.planned:not(.visited) .leaflet-pin-core { background: var(--planned); }
.leaflet-park-pin.transition .leaflet-pin-core { outline: 2px dashed var(--bonus); outline-offset: 2px; }
.leaflet-park-pin.transition:not(.visited):not(.planned)::after,
.leaflet-park-pin.transition:not(.visited):not(.planned) .leaflet-pin-core { background: var(--bonus); }
.leaflet-park-pin.selected { transform: translateY(-3px) scale(1.22); filter: drop-shadow(0 7px 8px rgba(24,43,31,.37)); }
.leaflet-park-pin.selected .leaflet-pin-core { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 72%, white), 0 4px 13px rgba(24,43,31,.38); }
.leaflet-pin-favorite {
  position: absolute;
  z-index: 3;
  top: -3px;
  right: 0;
  width: 18px;
  height: 18px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--favorite);
  color: white;
  display: grid;
  place-items: center;
  font-size: 9px;
  line-height: 1;
}
.park-cluster {
  width: 58px;
  height: 58px;
  border: 4px solid rgba(255,255,255,.96);
  border-radius: 50%;
  background: #475b50;
  color: white;
  box-shadow: 0 0 0 2px rgba(36,55,43,.24), 0 7px 18px rgba(24,43,31,.32);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.park-cluster strong { font-size: 17px; }
.park-cluster small { margin-top: 4px; font-size: 8px; font-weight: 750; opacity: .86; }
.park-cluster.complete { background: var(--visited); }
.park-cluster.has-planned { background: color-mix(in srgb, var(--planned) 78%, #50451d); }
.park-name-tooltip {
  border: 0 !important;
  border-radius: 9px !important;
  background: rgba(25,38,29,.94) !important;
  color: white !important;
  box-shadow: 0 6px 18px rgba(10,25,15,.26) !important;
  font-size: 11px !important;
  font-weight: 750 !important;
}
.park-name-tooltip::before { border-top-color: rgba(25,38,29,.94) !important; }

.park-popup-shell .leaflet-popup-content-wrapper {
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 16px 42px rgba(17,38,24,.3);
}
.park-popup-shell .leaflet-popup-tip { background: var(--surface); }
.park-popup-shell .leaflet-popup-content { margin: 14px 15px 13px; }
.park-popup-shell .leaflet-popup-close-button { top: 5px !important; right: 6px !important; color: var(--muted) !important; font-size: 22px !important; }
.park-map-popup { padding-right: 12px; }
.park-map-popup-kicker,
.park-map-popup-status { display: block; color: var(--muted); font-size: 10px; }
.park-map-popup-kicker { margin-bottom: 4px; text-transform: uppercase; letter-spacing: .04em; font-weight: 750; }
.park-map-popup > strong { display: block; padding-right: 7px; font-size: 15px; line-height: 1.25; }
.park-map-popup-status { margin-top: 5px; color: var(--brand); font-weight: 750; }
.park-map-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 11px; }
.park-map-popup-actions button {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  padding: 6px 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}
.park-map-popup-actions button:last-child { border-color: var(--brand); background: var(--brand); color: white; }
.park-map-popup-actions svg { width: 14px; height: 14px; }

.map-selection { margin-top: 13px; }
.map-selection-detailed { padding: 13px 14px; }
.map-selection-detailed .map-selection-icon.visited { background: color-mix(in srgb, var(--visited) 15%, var(--surface)); color: var(--visited); }
.map-selection-detailed .map-selection-icon.planned { background: var(--accent-soft); color: var(--planned); }
.map-selection-copy small { display: block; margin-top: 4px; color: var(--brand); font-size: 10px; font-weight: 750; }
.map-selection-actions { align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.map-selection-actions .secondary-button.active { border-color: color-mix(in srgb, var(--planned) 50%, var(--line)); background: var(--accent-soft); color: var(--planned); }
.map-directions-button { text-decoration: none; }

.leaflet-map.fallback-mode {
  height: auto;
  min-height: 480px;
  overflow: auto;
  background: #ece8df;
}
.fallback-map-svg { display: block; width: 100%; height: auto; min-height: 480px; background: #ece8df; }
.leaflet-fallback-banner {
  position: sticky;
  z-index: 3;
  top: 0;
  width: 100%;
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid rgba(94,78,48,.22);
  background: rgba(255,248,226,.95);
  color: #6a5221;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 11px;
  font-weight: 750;
}
.leaflet-fallback-banner svg { width: 16px; height: 16px; }
.fallback-map-pin { cursor: pointer; outline: none; }
.fallback-map-pin .fallback-pin-hit { fill: transparent; }
.fallback-map-pin .fallback-pin-ring { fill: rgba(255,255,255,.96); stroke: #4d5a53; stroke-width: 4; vector-effect: non-scaling-stroke; filter: drop-shadow(0 4px 5px rgba(0,0,0,.3)); }
.fallback-map-pin .fallback-pin-core { fill: #59655e; }
.fallback-map-pin.visited .fallback-pin-ring { stroke: var(--visited); }
.fallback-map-pin.visited .fallback-pin-core { fill: var(--visited); }
.fallback-map-pin.planned:not(.visited) .fallback-pin-ring { stroke: var(--planned); }
.fallback-map-pin.planned:not(.visited) .fallback-pin-core { fill: var(--planned); }
.fallback-map-pin.transition .fallback-pin-ring { stroke: var(--bonus); stroke-dasharray: 8 5; }
.fallback-map-pin.transition:not(.visited):not(.planned) .fallback-pin-core { fill: var(--bonus); }
.fallback-map-pin.selected .fallback-pin-ring { stroke-width: 8; stroke: var(--accent); }
.fallback-map-pin path { fill: none; stroke: white; stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.fallback-map-pin:focus-visible .fallback-pin-ring { stroke: var(--accent); stroke-width: 8; }

.filter-collapsible {
  border-bottom: 1px solid var(--line);
}
.filter-collapsible > summary {
  min-height: 55px;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}
.filter-collapsible > summary::-webkit-details-marker { display: none; }
.filter-summary-meta { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; }
.filter-summary-meta svg { width: 16px; height: 16px; transition: transform .18s ease; }
.filter-collapsible[open] .filter-summary-meta svg { transform: rotate(90deg); }
.filter-collapsible > .filter-options { padding: 0 0 17px; }
.filter-status-group { padding-bottom: 16px; }

@media (max-width: 1020px) {
  .map-finder-layout { grid-template-columns: minmax(0, 1fr) 300px; }
  .map-result-main { grid-template-columns: 27px minmax(0,1fr); padding-left: 9px; gap: 7px; }
  .map-result-copy strong { font-size: 11px; }
}

@media (max-width: 860px) {
  .map-finder-layout { grid-template-columns: 1fr; }
  .leaflet-map,
  .map-results-panel { height: min(66dvh, 650px); min-height: 480px; }
  .map-results-panel { height: auto; min-height: 0; max-height: 340px; }
  .map-results-list { max-height: 285px; }
  .map-result-row { min-height: 72px; }
  .map-result-copy strong { font-size: 12px; }
}

@media (max-width: 680px) {
  .parks-heading { align-items: flex-start; }
  .park-heading-actions { flex-direction: column; align-items: flex-end; gap: 6px; }
  .finder-mode-switch button { min-height: 32px; padding: 6px 9px; }
  .finder-mode-switch button span { display: inline; }
  .map-page-title { gap: 10px; }
  .map-page-title > div > p:last-child { font-size: 12px; }
  .map-finder-bar {
    grid-template-columns: auto minmax(0,1fr) 51px;
    gap: 7px;
  }
  .map-finder-bar .finder-mode-switch button { width: 37px; padding: 6px; }
  .map-finder-bar .finder-mode-switch button span { display: none; }
  .map-search-box { min-height: 47px; }
  .map-results-summary { font-size: 11px; }
  .interactive-map-frame { border-radius: 18px; }
  .leaflet-map { height: min(64dvh, 590px); min-height: 450px; }
  .map-action-stack { top: 9px; left: 9px; padding: 4px; border-radius: 12px; }
  .map-action-stack button { width: 36px; height: 36px; }
  .map-layer-panel { top: 9px; left: 57px; width: min(285px, calc(100% - 66px)); }
  .map-offline-notice { top: 9px; max-width: calc(100% - 125px); font-size: 9px; }
  .leaflet-map-legend { left: 8px; bottom: 8px; max-width: calc(100% - 105px); gap: 5px 8px; padding: 6px 8px; font-size: 8px; }
  .leaflet-container .leaflet-control-attribution { max-width: 78vw; font-size: 7px; }
  .map-selection-card { align-items: flex-start; flex-wrap: wrap; }
  .map-selection-copy { padding-top: 2px; }
  .map-selection-copy strong { white-space: normal; }
  .map-selection-actions { width: 100%; display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 5px; }
  .map-selection-actions .primary-button,
  .map-selection-actions .secondary-button { width: 100%; min-height: 38px; padding: 6px; font-size: 10px; }
  .map-selection-actions .secondary-button span { display: inline; }
  .map-selection-actions svg { width: 15px; height: 15px; }
  .map-results-panel { max-height: 315px; border-radius: 17px; }
  .map-results-list { max-height: 265px; }
  .filter-collapsible > summary { min-height: 52px; }
}

@media (max-width: 460px) {
  .park-heading-actions { gap: 5px; }
  .parks-heading .view-switch { display: none; }
  .map-page-title .secondary-button { flex: 0 0 auto; }
  .map-finder-bar { grid-template-columns: 78px minmax(0,1fr) 50px; }
  .map-finder-bar .finder-mode-switch { width: 78px; }
  .map-finder-bar .finder-mode-switch button { flex: 1; }
  .map-layer-panel > button[data-action="set-map-layer"] { min-height: 59px; grid-template-columns: 52px minmax(0,1fr) 18px; }
  .layer-preview { width: 52px; height: 38px; }
  .map-selection-actions { grid-template-columns: 1fr 1fr; }
  .leaflet-map { min-height: 430px; }
  .leaflet-map-legend span:nth-child(4) { display: none; }
}

@media print {
  .map-finder-bar, .map-quick-filters, .map-action-stack, .map-layer-panel, .map-results-panel, .map-selection-actions { display: none !important; }
  .map-finder-layout { display: block; }
  .leaflet-map { height: 620px; min-height: 620px; }
}

/* The packaged fallback stays useful even when the Leaflet library itself cannot load. */
.leaflet-map.fallback-mode + .map-action-stack,
.leaflet-map.fallback-mode ~ .map-layer-panel,
.leaflet-map.fallback-mode ~ .map-offline-notice { display: none !important; }

/* Private server synchronization */
.sync-banner {
  position: sticky;
  z-index: 111;
  top: 0;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 7px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 36%, var(--line));
  background: var(--accent-soft);
  color: color-mix(in srgb, var(--ink) 88%, #7a5500);
  font-size: 13px;
  text-align: center;
}
.sync-banner svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.sync-banner[data-sync-state="error"] { background: color-mix(in srgb, var(--danger) 11%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 28%, var(--line)); color: var(--danger); }
body:has(.sync-banner:not([hidden])) .app-header { top: 34px; }

.sync-status-button { position: relative; width: auto; min-width: 42px; padding: 0 10px; display: flex; grid-template: none; align-items: center; justify-content: center; gap: 6px; }
.sync-status-label { max-width: 60px; overflow: hidden; font-size: 10px; font-weight: 800; line-height: 1; white-space: nowrap; }
.sync-status-button::after { content: ""; position: absolute; right: 5px; top: 5px; width: 7px; height: 7px; border: 2px solid var(--surface); border-radius: 50%; background: var(--muted-2); }
.sync-status-button[data-sync-state="synced"] { color: var(--brand); background: var(--brand-soft); border-color: color-mix(in srgb, var(--brand) 32%, var(--line)); }
.sync-status-button[data-sync-state="synced"]::after { background: var(--visited); }
.sync-status-button[data-sync-state="saving"], .sync-status-button[data-sync-state="syncing"], .sync-status-button[data-sync-state="connecting"] { color: color-mix(in srgb, var(--accent) 76%, var(--ink)); background: var(--accent-soft); }
.sync-status-button[data-sync-state="saving"]::after, .sync-status-button[data-sync-state="syncing"]::after, .sync-status-button[data-sync-state="connecting"]::after { background: var(--accent); animation: sync-pulse 1.25s ease-in-out infinite; }
.sync-status-button[data-sync-state="login"]::after { background: var(--accent); }
.sync-status-button[data-sync-state="offline"]::after { background: var(--muted-2); }
.sync-status-button[data-sync-state="error"] { color: var(--danger); background: color-mix(in srgb, var(--danger) 8%, var(--surface)); }
.sync-status-button[data-sync-state="error"]::after { background: var(--danger); }
@keyframes sync-pulse { 0%,100% { opacity: .45; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.12); } }

.sync-settings-status { margin-bottom: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 15px; background: var(--surface-2); display: flex; align-items: center; gap: 11px; }
.sync-status-orb { width: 39px; height: 39px; flex: 0 0 auto; border-radius: 13px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.sync-status-orb svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.9; }
.sync-settings-status > span:last-child { min-width: 0; }
.sync-settings-status strong { display: block; font-size: 13px; }
.sync-settings-status small { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.sync-settings-status[data-sync-state="error"] .sync-status-orb { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
.sync-settings-status[data-sync-state="offline"] .sync-status-orb { color: var(--muted); background: var(--surface-3); }
.sync-settings-status[data-sync-state="saving"] .sync-status-orb, .sync-settings-status[data-sync-state="syncing"] .sync-status-orb { color: color-mix(in srgb, var(--accent) 76%, var(--ink)); background: var(--accent-soft); }
.sync-privacy-note { margin: 9px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.sync-privacy-note code { padding: 1px 4px; border-radius: 5px; background: var(--surface-3); color: var(--ink); }

.sync-login-card { position: relative; overflow: hidden; }
.sync-login-card::before { content: ""; position: absolute; width: 220px; height: 220px; right: -95px; top: -100px; border-radius: 50%; background: radial-gradient(circle, var(--brand-soft), transparent 68%); pointer-events: none; }
.sync-login-mark { width: 58px; height: 58px; margin-bottom: 15px; border-radius: 20px; display: grid; place-items: center; background: linear-gradient(145deg, var(--brand), var(--brand-strong)); color: white; box-shadow: var(--shadow-md); }
.sync-login-mark svg { width: 29px; height: 29px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.sync-login-copy { margin: -5px 0 12px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sync-login-error { min-height: 19px; margin: 5px 2px 0; color: var(--danger); font-size: 12px; font-weight: 700; }
.sync-login-note { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; line-height: 1.5; }
.sync-login-modal .primary-button svg { width: 17px; height: 17px; }

@media (max-width: 680px) {
  .sync-status-button { width: 38px; min-width: 38px; height: 38px; padding: 0; }
  .sync-status-label { display: none; }
  .sync-login-card { padding: 20px 17px; }
  .sync-login-modal .modal-actions { align-items: stretch; flex-wrap: wrap; }
  .sync-login-modal .modal-actions > span { display: none; }
  .sync-login-modal .modal-actions button { flex: 1 1 100%; justify-content: center; }
}
