/* Explore Northern Michigan. UI chrome over the 3D canvas. System fonts only. */
:root {
  --brand: #2f5d50;        /* pine */
  --brand-ink: #faf6ea;
  --brand-dark: #14303a;
  --brand-paper: #faf6ea;
  --brand-shell: #d9c9a8;
  --brand-gold: #d8a64a;
  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --ink: #23303a;
  --paper: rgba(255, 252, 245, 0.95);
  --glass: rgba(20, 40, 52, 0.5);
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

.app { color: var(--ink); -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
#scene { touch-action: none; cursor: grab; outline: none; opacity: 0; transition: opacity 0.9s ease; }
#scene:active { cursor: grabbing; }
#scene:focus-visible { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85); }
.app.is-ready #scene { opacity: 1; }
.app.is-fallback #scene, .app.is-fallback .compass, .app.is-fallback #btn-reset, .app.is-fallback .labels { display: none; }

/* Season skies: three stacked gradients that cross-fade. */
.sky { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s ease; }
.sky-summer { background: linear-gradient(180deg, #6fb6ea 0%, #a9d6f3 42%, #e3f3fb 100%); }
.sky-fall { background: linear-gradient(180deg, #7fa9cf 0%, #e9c9a0 55%, #fbe9cf 100%); }
.sky-winter { background: linear-gradient(180deg, #8fa5bd 0%, #c9d6e3 50%, #eef3f7 100%); }
.season-summer .sky-summer, .season-fall .sky-fall, .season-winter .sky-winter { opacity: 1; }

/* Top bar: title on the left, tools on the right, wraps on narrow phones. */
.topbar {
  position: absolute; z-index: 5; pointer-events: none;
  top: calc(10px + var(--sat)); left: calc(12px + var(--sal)); right: calc(12px + var(--sar));
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 12px;
}
.title { color: #fff; text-shadow: 0 1px 10px rgba(10, 30, 50, 0.55), 0 0 2px rgba(10, 30, 50, 0.5); }
.title h1 { margin: 0; font-size: clamp(17px, 2.4vw, 23px); font-weight: 700; letter-spacing: 0.01em; line-height: 1.15; }
.title p { margin: 2px 0 0; font-size: clamp(11.5px, 1.5vw, 13.5px); font-weight: 500; opacity: 0.95; letter-spacing: 0.04em; }
.is-fallback .title { color: var(--ink); text-shadow: none; }

.tools { display: flex; gap: 6px; pointer-events: auto; }
.tool, .seasons {
  display: inline-flex; align-items: center; min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px; background: var(--glass); color: #fff;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.tool { gap: 6px; padding: 0 12px; font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer; transition: background 0.2s ease, transform 0.2s ease; }
.tool:hover { background: rgba(20, 40, 52, 0.7); }
.tool:active { transform: scale(0.96); }
.is-fallback .tool, .is-fallback .seasons { background: var(--brand); border-color: transparent; }

/* Season switch: three segments in one pill. */
.seasons { padding: 3px; gap: 2px; }
.season {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: #fff; font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer; transition: background 0.2s ease, color 0.2s ease;
}
.season:hover { background: rgba(255, 255, 255, 0.16); }
.season[aria-pressed="true"] { background: var(--brand-paper); color: var(--brand-dark); }

button:focus-visible, a:focus-visible, h2:focus-visible, select:focus-visible { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px rgba(47, 93, 80, 0.7); }
h2:focus { outline: none; }

/* Embedded mode: quieter chrome. */
.is-embed .title p { display: none; }
.is-embed .title h1 { font-size: 15px; }
.is-embed .tool { min-height: 32px; padding: 0 10px; font-size: 11.5px; }
.is-embed .compass { display: none; }

/* Town and water names, positioned by JS. */
.labels { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.maplabel {
  position: absolute; left: 0; top: 0; white-space: nowrap; will-change: transform;
  font-size: 12px; font-weight: 700; letter-spacing: 0.02em; color: #1d2b33;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 6px rgba(255, 255, 255, 0.9);
}
.maplabel[data-off="1"] { visibility: hidden; }
.maplabel.is-water { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 13.5px; letter-spacing: 0.05em; color: #0f4a6e; text-shadow: 0 0 3px rgba(255, 255, 255, 0.95), 0 0 6px rgba(255, 255, 255, 0.7); }

/* Place pins, positioned by JS with a transform. */
.pins { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; transition: opacity 0.6s ease; }
.pins.is-hidden { opacity: 0; }
.pins.is-hidden .pin { pointer-events: none; }
.pin {
  position: absolute; left: 0; top: 0; margin: -22px 0 0 -22px; padding: 8px; border: 0; background: none;
  display: flex; align-items: center; gap: 2px; cursor: pointer; pointer-events: auto;
  font-family: inherit; color: var(--ink); will-change: transform;
}
.pin[data-off="1"] { visibility: hidden; }
.pin[data-f="0"] { display: none; }
.pin-dot {
  position: relative; flex: none; width: 26px; height: 26px; margin: 1px; border-radius: 50%;
  background: var(--paper); border: 2px solid #fff; box-shadow: 0 3px 10px rgba(10, 30, 50, 0.4);
  display: grid; place-items: center; color: var(--brand); transition: transform 0.2s ease;
}
.pin-dot svg { width: 14px; height: 14px; }
.pin:hover .pin-dot, .pin:focus-visible .pin-dot, .pin.is-active .pin-dot { transform: scale(1.14); }
.pin-label {
  padding: 4px 9px; border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 650;
  white-space: nowrap; box-shadow: 0 2px 8px rgba(10, 30, 50, 0.3);
}
.pin.is-brand { z-index: 2; }
.pin.is-brand[data-nl="0"]:not(.is-active):not(:hover) .pin-label { display: none; }
.pin.is-brand[data-nl="2"] .pin-label { position: absolute; right: calc(100% - 10px); }
.pin.is-brand .pin-dot { width: 32px; height: 32px; margin: -2px; background: var(--brand); color: #fff; }
.pin.is-brand .pin-dot svg { width: 17px; height: 17px; }
.pin.is-brand .pin-label { background: var(--brand); color: var(--brand-ink); font-size: 12.5px; }
.pin.is-brand .pin-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid #fff; opacity: 0;
  animation: pin-pulse 2.4s ease-out infinite;
}
@keyframes pin-pulse { 0% { transform: scale(0.85); opacity: 0.9; } 100% { transform: scale(2.1); opacity: 0; } }
/* Other places: names show on hover, focus or when open, so the map stays clean. */
.pin.is-spot .pin-label { opacity: 0; transform: translateX(-4px); transition: opacity 0.18s ease, transform 0.18s ease; pointer-events: none; font-size: 11.5px; }
.pin.is-spot:hover .pin-label, .pin.is-spot:focus-visible .pin-label, .pin.is-spot.is-active .pin-label { opacity: 1; transform: none; }
.pin.is-spot:hover, .pin.is-active { z-index: 3; }
.pin-dot[data-more]::before {
  content: "+" attr(data-more); position: absolute; top: -8px; right: -11px; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box;
  border-radius: 9px; background: var(--brand-dark); color: #fff; font: 700 10.5px/18px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1.5px #fff;
}

/* Info card: bottom sheet on phones, corner card on larger screens. */
.card {
  position: absolute; z-index: 6; left: calc(12px + var(--sal)); right: calc(12px + var(--sar)); bottom: calc(12px + var(--sab));
  padding: 16px 44px 16px 18px; border-radius: 18px; background: var(--brand-paper); color: var(--brand-dark);
  box-shadow: 0 14px 40px rgba(10, 30, 50, 0.38); user-select: text; -webkit-user-select: text;
  animation: card-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes card-in { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) { .card { left: auto; width: 340px; right: calc(18px + var(--sar)); bottom: calc(18px + var(--sab)); } }
.card-kicker { margin: 0 0 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand); }
.card h2 { margin: 0 0 6px; font-family: var(--serif); font-size: 23px; font-weight: 600; line-height: 1.2; letter-spacing: 0.005em; }
.card p#card-text { margin: 0; font-size: 14.5px; line-height: 1.5; }
.card.is-brand { border-top: 4px solid var(--brand); }
.card-meta { margin: -2px 0 8px; font-size: 13px; font-weight: 600; opacity: 0.72; }
.card-drive { display: inline-block; margin: 0 0 8px; padding: 4px 10px; border-radius: 999px; background: rgba(216, 166, 74, 0.22); color: #6a480c; font-size: 12.5px; font-weight: 700; }
.card p#card-text[hidden], .card-meta[hidden], .card-drive[hidden] { display: none; }
/* Home cards: photo strip, key facts, feature chips. Tall cards scroll inside themselves. */
.card { max-height: min(74%, 620px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
@media (min-width: 640px) { .card { max-height: calc(100% - 100px); } .card.is-brand { width: 380px; } }
.card-media { display: flex; gap: 6px; margin: -4px -30px 12px -4px; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: 12px; scrollbar-width: none; }
.card-media::-webkit-scrollbar { display: none; }
.card-media figure { flex: 0 0 80%; width: 80%; margin: 0; scroll-snap-align: start; }
.card-media img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; background: var(--brand-shell); }
.card-media figure:only-child { flex-basis: 100%; width: 100%; }
.card-media img { max-height: min(36vh, 300px); }
.card:not(.is-brand) .card-media { margin-right: -4px; padding-right: 0; }
.card:not(.is-brand) .card-close { z-index: 1; background: rgba(250, 246, 234, 0.92); box-shadow: 0 1px 6px rgba(10, 30, 50, 0.3); }
.card-media figcaption { display: flex; flex-direction: column; gap: 1px; margin-top: 5px; padding: 0 4px; font-size: 12.5px; font-weight: 600; line-height: 1.3; }
.card-media figcaption small { font-size: 10.5px; font-weight: 500; opacity: 0.66; }
.card-media figcaption a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.card-media img[height="800"] { object-position: 50% 22%; }
.card-note { display: flex; flex-direction: column; gap: 3px; margin: 0 0 10px; padding: 9px 12px; border-radius: 12px; background: rgba(216, 166, 74, 0.16); font-size: 14px; line-height: 1.45; }
.card-note b { font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #6a480c; }
.card-note.is-say { background: rgba(47, 93, 80, 0.09); }
.card-note.is-say b { color: var(--brand); }
.card-note small { font-size: 10.5px; opacity: 0.6; }
.card-note[hidden] { display: none; }
.card-facts { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--brand-dark); }
.card-feats { display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
.card-feats li { padding: 4px 9px; border-radius: 999px; background: rgba(47, 93, 80, 0.1); color: var(--brand); font-size: 12px; font-weight: 650; }
.card-facts[hidden], .card-feats[hidden], .card-media[hidden] { display: none; }
.card.is-brand .card-close { z-index: 1; background: rgba(250, 246, 234, 0.92); box-shadow: 0 1px 6px rgba(10, 30, 50, 0.3); }
.card-close {
  position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: rgba(35, 48, 58, 0.08); color: var(--ink); display: grid; place-items: center; cursor: pointer;
}
.card-close:hover { background: rgba(35, 48, 58, 0.16); }
.card-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.card-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; margin-top: 12px; padding: 0 22px;
  border-radius: 999px; background: var(--brand); color: var(--brand-ink); font-weight: 700; font-size: 15px; text-decoration: none;
  box-shadow: 0 6px 16px rgba(47, 93, 80, 0.35); transition: transform 0.2s ease, filter 0.2s ease;
}
.card-cta:hover { filter: brightness(1.1); transform: translateY(-1px); }
.card-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.card-link { margin-top: 14px; color: var(--brand); font-weight: 700; font-size: 14.5px; text-decoration: underline; text-underline-offset: 3px; }
.card-link[hidden], .card-cta[hidden] { display: none; }
#card-title:focus, #card-title:focus-visible { outline: none; box-shadow: none; }

/* Compass, credit, hint, loader. */
.compass {
  position: absolute; z-index: 2; left: calc(12px + var(--sal)); bottom: calc(12px + var(--sab)); width: 40px; height: 40px; border-radius: 50%;
  background: var(--glass); border: 1px solid rgba(255, 255, 255, 0.4); display: grid; place-items: center; pointer-events: none;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.compass i { position: relative; display: block; width: 100%; height: 100%; }
.compass i::before { content: ""; position: absolute; left: 50%; top: 5px; margin-left: -5px; border: 5px solid transparent; border-top-width: 0; border-bottom: 11px solid #ff8f5e; }
.compass b { position: absolute; left: 0; right: 0; top: 17px; text-align: center; font: 700 11px/1 system-ui, sans-serif; font-style: normal; color: #fff; }
.credit { position: absolute; z-index: 2; left: calc(60px + var(--sal)); bottom: calc(12px + var(--sab)); margin: 0; font-size: 10.5px; color: rgba(20, 40, 52, 0.75); text-shadow: 0 0 3px rgba(255, 255, 255, 0.8); }
.credit a { color: inherit; }
.hint {
  position: absolute; z-index: 2; left: 50%; bottom: calc(64px + var(--sab)); transform: translateX(-50%); margin: 0;
  padding: 7px 14px; border-radius: 999px; background: var(--glass); color: #fff; font-size: 12.5px; font-weight: 550;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity 0.6s ease;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.hint.is-on { opacity: 1; }
.loader {
  position: absolute; inset: 0; z-index: 8; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #fff; font-size: 14px; font-weight: 600; letter-spacing: 0.06em; text-shadow: 0 1px 8px rgba(10, 30, 50, 0.5);
  pointer-events: none; transition: opacity 0.7s ease;
}
.loader-sun { width: 34px; height: 34px; border-radius: 50%; background: #fff2c2; box-shadow: 0 0 0 0 rgba(255, 242, 194, 0.7); animation: sun-pulse 1.6s ease-out infinite; }
@keyframes sun-pulse { to { box-shadow: 0 0 0 26px rgba(255, 242, 194, 0); } }
.app:not(.is-loading) .loader { opacity: 0; }

/* 2D fallback map. */
.fallback { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; padding: calc(64px + var(--sat)) 10px calc(16px + var(--sab)); overflow: auto; }
.fallback-inner { position: relative; height: min(calc(100vh - 130px), 900px); height: min(calc(100dvh - 130px), 900px); aspect-ratio: 680 / 800; max-width: 100%; }
.fallback canvas { display: block; width: 100%; height: 100%; border-radius: 18px; box-shadow: 0 10px 34px rgba(10, 30, 50, 0.25); }
.fallback .pin { margin: 0; transform: translate(-22px, -22px); }
.fallback .pin .pin-dot { width: 20px; height: 20px; }
.fallback .pin .pin-dot svg { width: 11px; height: 11px; }
.fallback-note { margin: 10px 4px 0; font-size: 12.5px; color: #33424c; text-align: center; }
.is-fallback .pin.is-brand .pin-label { display: none; }

/* Guide: the brand coloured button, the panel under the top bar, chips and the place list. */
.tool-guide { background: var(--brand); border-color: rgba(255, 255, 255, 0.55); }
.tool-guide:hover { background: #274e43; }
.tool-guide[aria-expanded="true"] { background: var(--brand-dark); }
.tool-count { margin-left: 2px; padding-left: 8px; border-left: 1px solid rgba(255, 255, 255, 0.45); font-style: normal; font-weight: 600; opacity: 0.9; }
.tool-guide.is-nudge { animation: guide-nudge 1.8s ease-out 5; }
@keyframes guide-nudge { from { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8); } to { box-shadow: 0 0 0 14px rgba(255, 255, 255, 0); } }
.guide {
  position: absolute; z-index: 7; top: 64px; left: calc(12px + var(--sal)); right: calc(12px + var(--sar));
  display: flex; flex-direction: column; max-height: min(66%, 600px); border-radius: 18px; overflow: hidden;
  background: var(--brand-paper); color: var(--brand-dark); box-shadow: 0 14px 40px rgba(10, 30, 50, 0.38);
  animation: card-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@media (min-width: 640px) { .guide { right: auto; width: 350px; max-height: calc(100% - 96px); } }
.guide-head { position: relative; display: flex; align-items: baseline; gap: 10px; padding: 14px 52px 4px 16px; }
.guide-head h2 { margin: 0; font-family: var(--serif); font-size: 22px; font-weight: 600; }
.guide-count { font-size: 12px; font-weight: 600; opacity: 0.6; }
.stay { display: flex; align-items: center; gap: 10px; margin: 6px 14px 2px; padding: 6px 6px 6px 12px; border-radius: 12px; background: rgba(47, 93, 80, 0.1); font-size: 12.5px; font-weight: 700; color: var(--brand); }
.stay span { flex: none; text-transform: uppercase; letter-spacing: 0.08em; font-size: 10.5px; }
.stay select {
  flex: 1; min-width: 0; min-height: 34px; padding: 0 8px; border: 1px solid rgba(20, 48, 58, 0.2); border-radius: 9px; background: #fff;
  color: var(--brand-dark); font: 600 14px/1 inherit; font-family: inherit;
}
/* One row of chips that scrolls sideways, so the list below keeps its room. */
.chips { display: flex; flex-wrap: nowrap; gap: 6px; padding: 8px 14px 10px; overflow-x: auto; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips .chip { flex: none; }
.chip {
  min-height: 32px; padding: 0 12px; border: 1px solid rgba(20, 48, 58, 0.22); border-radius: 999px; background: transparent;
  color: var(--brand-dark); font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer;
}
.chip:hover { background: rgba(47, 93, 80, 0.12); }
.chip[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.guide-list { flex: 1; min-height: 0; margin: 0; padding: 0 6px 4px; list-style: none; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid rgba(20, 48, 58, 0.1); }
.guide-item {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 52px; padding: 7px 10px; border: 0; border-radius: 12px;
  background: none; color: inherit; font-family: inherit; text-align: left; cursor: pointer;
}
.guide-item:hover { background: rgba(47, 93, 80, 0.1); }
.guide-dot { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--brand); box-shadow: 0 0 0 1px rgba(20, 48, 58, 0.14); }
.guide-dot svg { width: 15px; height: 15px; }
.guide-item.is-brand .guide-dot { background: var(--brand); color: #fff; }
.guide-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.guide-name { font-size: 14.5px; font-weight: 650; line-height: 1.25; }
.guide-sub { font-size: 12px; opacity: 0.68; line-height: 1.3; }
.guide-badge, .guide-mins { flex: none; padding: 3px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.guide-badge { background: var(--brand); color: var(--brand-ink); letter-spacing: 0.04em; text-transform: uppercase; font-size: 10px; }
.guide-mins { background: rgba(216, 166, 74, 0.22); color: #6a480c; }
.guide-note { margin: 0; padding: 7px 16px 9px; border-top: 1px solid rgba(20, 48, 58, 0.1); font-size: 11.5px; opacity: 0.66; }
.guide button:focus-visible, .guide select:focus-visible, .card a:focus-visible, .card button:focus-visible { outline-color: var(--brand); box-shadow: none; }

/* Season on the map: places at their best get a gold ring, shut or limited ones fade back. */
.pin[data-s="best"]:not(.is-brand) .pin-dot { box-shadow: 0 0 0 2px var(--brand-gold), 0 3px 10px rgba(10, 30, 50, 0.4); }
.pin[data-s="off"]:not(.is-active) .pin-dot { opacity: 0.5; filter: grayscale(1); }
.card-season { margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: #6a480c; }
.card-season[data-s="off"] { color: #7a4a3a; }
.card-season[hidden] { display: none; }
.guide-flag { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font-style: normal; font-size: 10px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.guide-flag.is-best { background: rgba(216, 166, 74, 0.28); color: #6a480c; }
.guide-flag.is-off { background: rgba(20, 48, 58, 0.1); color: rgba(20, 48, 58, 0.75); }

/* Essentials: smaller, quieter pins. */
.pin.is-need .pin-dot { width: 21px; height: 21px; margin: 3.500px; background: #eef2f3; color: #3f5560; border-width: 1.500px; }
.pin.is-need .pin-dot svg { width: 11px; height: 11px; }

/* A day out: numbered stops, a bar to play or end it. */
.pin[data-n]::before {
  content: attr(data-n); position: absolute; left: 1px; top: -2px; z-index: 1; min-width: 17px; height: 17px; box-sizing: border-box; padding: 0 4px;
  border-radius: 9px; background: #d6246e; color: #fff; font: 700 10.5px/17px system-ui, sans-serif; text-align: center; box-shadow: 0 0 0 1.5px #fff;
}
.has-tour .pin.is-spot .pin-label { opacity: 1; transform: none; }
.tourbar {
  position: absolute; z-index: 4; left: 50%; bottom: calc(14px + var(--sab)); transform: translateX(-50%);
  display: flex; align-items: center; gap: 8px; max-width: calc(100% - 130px); min-height: 44px; padding: 4px 5px 4px 16px; border-radius: 999px;
  background: var(--brand-paper); color: var(--brand-dark); border: 1px solid #fff; box-shadow: 0 8px 24px rgba(10, 30, 50, 0.4);
}
.tourbar-name { font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tourbar-play, .days-play { min-height: 34px; padding: 0 16px; border: 0; border-radius: 999px; background: #d6246e; color: #fff; font: 700 13px/1 inherit; font-family: inherit; cursor: pointer; }
.tourbar-end { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(20, 48, 58, 0.08); color: var(--brand-dark); display: grid; place-items: center; cursor: pointer; }
.tourbar[hidden] { display: none; }
@media (max-width: 900px) { .app.has-card .tourbar { display: none; } }
.has-tour .hint { bottom: calc(70px + var(--sab)); }

/* The flat fallback map has no camera to fly, so no Play. */
.is-fallback .days-play, .is-fallback .tourbar-play { display: none; }

/* Near me: a pill above the compass and a blue dot on the map. */
.near {
  position: absolute; z-index: 4; left: calc(12px + var(--sal)); bottom: calc(60px + var(--sab));
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border: 1px solid rgba(255, 255, 255, 0.4); border-radius: 999px;
  background: var(--glass); color: #fff; font: 600 12.5px/1 inherit; font-family: inherit; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.near[aria-pressed="true"] { background: #2b7de9; border-color: #fff; }
.is-fallback .near { background: var(--brand); }
.me-dot {
  position: absolute; left: 0; top: 0; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; z-index: 4;
  background: #2b7de9; border: 2.500px solid #fff; box-shadow: 0 0 0 0 rgba(43, 125, 233, 0.6), 0 2px 8px rgba(10, 30, 50, 0.5); animation: me-pulse 2s ease-out infinite; pointer-events: none;
}
.me-dot[data-off="1"] { visibility: hidden; }
@keyframes me-pulse { to { box-shadow: 0 0 0 16px rgba(43, 125, 233, 0), 0 2px 8px rgba(10, 30, 50, 0.5); } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Guide: tabs, search, day plans. */
.guide-tabs { display: flex; gap: 4px; margin: 8px 14px 0; padding: 3px; border-radius: 12px; background: rgba(20, 48, 58, 0.08); }
.guide-tab { flex: 1; min-height: 34px; border: 0; border-radius: 9px; background: transparent; color: var(--brand-dark); font: 700 13px/1 inherit; font-family: inherit; cursor: pointer; }
.guide-tab[aria-selected="true"] { background: #fff; box-shadow: 0 1px 4px rgba(10, 30, 50, 0.18); color: var(--brand); }
.guide-pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.guide-pane[hidden] { display: none; }
.guide-find { display: flex; align-items: center; gap: 8px; margin: 8px 14px 0; padding: 0 12px; border: 1px solid rgba(20, 48, 58, 0.2); border-radius: 12px; background: #fff; color: rgba(20, 48, 58, 0.6); }
.guide-find input { flex: 1; min-width: 0; min-height: 38px; border: 0; outline: none; background: transparent; color: var(--brand-dark); font: 500 16px/1.2 inherit; font-family: inherit; user-select: text; -webkit-user-select: text; }
.guide-find:focus-within { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(47, 93, 80, 0.25); }
.guide-empty { padding: 18px 12px; font-size: 13.5px; opacity: 0.7; }
.guide-dot.is-num { background: #d6246e; color: #fff; font: 700 13px/1 system-ui, sans-serif; box-shadow: none; }
.guide-days { overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid rgba(20, 48, 58, 0.1); margin-top: 8px; }
.days-list, .days-steps { margin: 0; padding: 4px 6px 6px; list-style: none; }
.tour-item { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 10px 10px; border: 0; border-radius: 12px; background: none; color: inherit; font-family: inherit; text-align: left; cursor: pointer; }
.tour-item:hover { background: rgba(47, 93, 80, 0.1); }
.tour-item.is-off { opacity: 0.62; }
.tour-name { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.tour-blurb { font-size: 12.5px; line-height: 1.4; opacity: 0.8; }
.tour-meta { font-size: 11.5px; font-weight: 700; color: var(--brand); }
.days-head { padding: 8px 16px 10px; }
.days-back { padding: 4px 0; border: 0; background: none; color: var(--brand); font: 700 12.5px/1 inherit; font-family: inherit; cursor: pointer; }
.days-title { margin: 6px 0 4px; font-family: var(--serif); font-size: 21px; font-weight: 600; }
.days-blurb { margin: 0 0 6px; font-size: 13px; line-height: 1.45; }
.days-meta { margin: 0 0 8px; font-size: 11.5px; font-weight: 700; color: var(--brand); }
.days-warn { margin: 0 0 8px; padding: 6px 10px; border-radius: 10px; background: rgba(216, 166, 74, 0.2); color: #6a480c; font-size: 12px; font-weight: 600; }
@media (max-width: 639px) { .guide { max-height: min(74%, 640px); } }
/* Phones: messages sit above the Near me pill and may wrap. */
@media (max-width: 639px) {
  .hint { bottom: calc(108px + var(--sab)); max-width: calc(100% - 32px); white-space: normal; text-align: center; box-sizing: border-box; }
  .has-tour .hint { bottom: calc(108px + var(--sab)); }
  .tourbar { max-width: calc(100% - 24px); bottom: calc(104px + var(--sab)); }
}

/* Phones: icon only controls so everything fits on one row; chips scroll sideways. */
@media (max-width: 640px) {
  .chips { scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .tool:not(.tool-guide) { padding: 0; width: 38px; justify-content: center; }
  .tool:not(.tool-guide) span, .season span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .season { padding: 0; width: 32px; justify-content: center; }
  .maplabel { font-size: 11px; }
  .maplabel.is-water { font-size: 12px; }
  .credit { font-size: 9.5px; }
}
@media (max-width: 900px) { .app.has-card .hint { display: none; } }

@media (prefers-reduced-motion: reduce) {
  .card, .guide, .pin.is-brand .pin-dot::after, .loader-sun, .tool-guide.is-nudge { animation: none; }
  #scene, .pins, .hint, .loader, .tool, .pin-dot, .card-cta, .sky, .season { transition: none; }
}

/* Touch: gestures on the map (and on pins) drive the camera; buttons never trigger page zoom. */
.pin, .pins, .hint, .labels { touch-action: none; }
.tool, .season, .chip, .guide-item, .guide-tab, .tour-item, .near, .tourbar button, .card button, .card a { touch-action: manipulation; }
