:root {
  --ink: #f4f7f2;
  --muted: rgba(244, 247, 242, .82);
  --glass: rgba(15, 20, 18, .9);
  --solid: #121a16;
  --glass-line: rgba(255, 255, 255, .18);
  --accent: #a3e635;
  --accent-ink: #14200a;
  --water: #7dd3fc;
  --pin: #ffffff;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --r: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --strip-h: 78px;
  --side: clamp(320px, 36vw, 560px);
  --card-w: clamp(300px, 27vw, 380px);   /* map and caption card over the photo on wide screens */
  --card-map-h: clamp(220px, 40vh, 340px);
  --map-h: max(170px, 27vh);           /* map band under the photo on tall screens */
  --dock-h: 0px;                        /* measured in tour.js */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0f1412; color: var(--ink); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; }
.btn svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.panel { background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; min-width: 48px; padding: 0 16px;
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: 999px; box-shadow: var(--shadow); cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-weight: 650; font-size: 17px; line-height: 1.1; white-space: nowrap; }
.btn.icon { padding: 0; }
.btn.big { min-height: 56px; padding: 0 22px; font-size: 18px; border-radius: 16px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.primary.next svg, #dNext svg { fill: none; stroke: currentColor; stroke-width: 2.6; }
.btn:hover { filter: brightness(1.12); }
.btn[disabled] { opacity: .4; pointer-events: none; }
.btn:focus-visible, .pin:focus-visible, .shot:focus-visible, .spot:focus-visible, .mini:focus-visible, .menu button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Map */
.map { position: fixed; inset: 0; background: #0f1412; }
.leaflet-container { background: #0f1412; font: inherit; }
/* Tiles (512 px) overlap by a pixel so fractional zoom leaves no hairline seams between them */
/* No tile overlap: Leaflet 1.9 hides seams by adding tile edges (mix-blend-mode: plus-lighter); overlapping them shows white lines */
.credit { position: absolute; z-index: 400; left: 6px; bottom: 4px; margin: 0; padding: 1px 6px; border-radius: 4px; background: rgba(15, 20, 18, .6); color: rgba(255, 255, 255, .8); font-size: 10px; pointer-events: none; }
.leaflet-control-zoom { border: 0 !important; margin: 0 calc(12px + var(--safe-r)) calc(var(--strip-h) + 24px + var(--safe-b)) 0 !important; }
.leaflet-control-zoom a { width: 48px !important; height: 48px !important; line-height: 48px !important; background: var(--glass) !important; color: var(--ink) !important;
  border: 1px solid var(--glass-line) !important; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); font-size: 24px !important; }
.leaflet-control-zoom a:first-child { border-radius: 12px 12px 0 0 !important; }
.leaflet-control-zoom a:last-child { border-radius: 0 0 12px 12px !important; }
.leaflet-control-attribution { background: rgba(15, 20, 18, .6) !important; color: var(--muted) !important; font-size: 10px; }
.scale { margin: 0 0 calc(var(--strip-h) + 16px + var(--safe-b)) calc(12px + var(--safe-l)) !important; display: flex; align-items: center; gap: 8px; padding: 6px 10px;
  border-radius: 10px; background: rgba(15, 20, 18, .82); color: var(--ink); font-size: 14px; font-weight: 700; pointer-events: none; }
.scale i { display: block; height: 8px; border: 2.5px solid var(--ink); border-top: 0; }

.head { position: fixed; z-index: 500; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); width: min(440px, calc(100vw - 24px)); padding: 16px 18px 14px; }
.head h1 { margin: 0; font-size: 24px; line-height: 1.2; letter-spacing: -.01em; }
.head .facts { margin: 6px 0 0; font-size: 16px; color: var(--muted); line-height: 1.4; }
.head #where { margin-top: 2px; }
.head #where:empty { display: none; }
.head .btn.big { margin-top: 14px; width: 100%; }
.head .or { margin: 10px 0 0; font-size: 15px; color: var(--muted); line-height: 1.35; }
.head .or:empty { display: none; }
.legend { position: fixed; z-index: 500; left: calc(12px + var(--safe-l)); bottom: calc(var(--strip-h) + 62px + var(--safe-b)); margin: 0; padding: 7px 12px; font-size: 14px; font-weight: 600;
  display: flex; align-items: center; gap: 8px; border-radius: 12px; pointer-events: none; }
.lg-line { width: 22px; height: 0; border-top: 2.5px solid #fff; }
.lg-dot { width: 14px; height: 14px; border-radius: 50%; border: 2.5px solid #fff; background: #0f1412; margin-left: 8px; }

.pin { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(15, 20, 18, .9); color: var(--ink);
  border: 2.5px solid var(--pin); box-shadow: 0 2px 10px rgba(0, 0, 0, .5); font-weight: 800; font-size: 14px; cursor: pointer;
  padding: 0; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-align: center;   /* a button's default padding pushes 2 digits off-centre */
  transition: transform .15s ease, background .15s ease; }
.pin:hover, .pin.hot { transform: scale(1.18); background: var(--accent); color: var(--accent-ink); border-color: #fff; }
.pin.seen { border-color: var(--accent); }
.pin.here { background: #ef4444; color: #fff; border-color: #fff; transform: scale(1.15); }
.pins-small .pin { width: 28px; height: 28px; font-size: 12px; border-width: 2px; }
.pins-dots .pin { width: 16px; height: 16px; font-size: 0; border-width: 2px; }
.pins-dots .pin.seen { background: var(--accent); }
.pins-dots .pin.here { background: #ef4444; width: 20px; height: 20px; }
.pin-wrap { background: none; border: 0; display: grid; place-items: center; }   /* 44 px hit area round every pin */
.leaflet-tooltip.peek { padding: 0; border: 1px solid var(--glass-line); border-radius: 12px; overflow: hidden; background: #0f1412; color: var(--ink); box-shadow: var(--shadow); }
.leaflet-tooltip.peek img { display: block; width: 200px; height: 100px; object-fit: cover; }
.leaflet-tooltip.peek span { display: block; padding: 6px 10px; font-size: 13px; font-weight: 600; }
.leaflet-tooltip.peek::before { display: none; }
/* Place names on the map */
.place-wrap { background: none; border: 0; }
.place { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 5px; border-radius: 999px; background: rgba(12, 17, 15, .86); color: #fff;
  font-size: 13px; font-weight: 700; white-space: nowrap; transform: translate(-13px, -50%); box-shadow: 0 1px 6px rgba(0, 0, 0, .5); pointer-events: none; }
.place svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.place.k-water svg { color: var(--water); }
.place.k-high svg { color: #fdba74; }
.place.k-road, .place.k-highway, .place.k-track { background: rgba(12, 17, 15, .72); font-weight: 600; }
.place.k-road svg, .place.k-highway svg, .place.k-track svg { color: #fde68a; }
.place.k-mark { background: #fff; color: #111; }
path.road { stroke: #fde68a; stroke-opacity: .85; fill: none; }
path.track { stroke: #fef3c7; stroke-opacity: .6; stroke-dasharray: 4 5; fill: none; }
path.cone { fill: rgba(255, 255, 255, .3); stroke: #fff; stroke-width: 1.5; }
path.here { filter: drop-shadow(0 0 4px rgba(0, 0, 0, .8)); }
path.route { stroke: #fff; stroke-width: 3; stroke-dasharray: 2 8; stroke-linecap: round; fill: none; opacity: .9; }
path.ring { stroke: #fff; stroke-width: 1.5; stroke-dasharray: 6 6; fill: none; opacity: .85; }
.ring-lbl { font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; white-space: nowrap; transform: translate(-50%, -50%); pointer-events: none; }

/* Photo strip */
.strip { position: fixed; z-index: 500; left: 0; right: 0; bottom: 0; height: calc(var(--strip-h) + var(--safe-b)); gap: 6px !important; padding: 8px calc(12px + var(--safe-r)) calc(10px + var(--safe-b)) calc(12px + var(--safe-l));
  display: flex; gap: 10px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-width: none;
  background: linear-gradient(to top, rgba(10, 14, 12, .9), rgba(10, 14, 12, 0)); }
.strip::-webkit-scrollbar { display: none; }
.shot { position: relative; flex: 1 1 0; min-width: 44px; max-width: 104px; height: auto; aspect-ratio: 16 / 9; align-self: center; padding: 0; border: 2px solid rgba(255, 255, 255, .5); border-radius: 8px; overflow: hidden;
  background: #222; cursor: pointer; scroll-snap-align: start; box-shadow: var(--shadow); transition: transform .15s ease, border-color .15s ease; }
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot b { position: absolute; left: 4px; top: 4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: rgba(15, 20, 18, .88); font-size: 11px; line-height: 1; display: grid; place-items: center; }
.shot:hover, .shot.hot { transform: translateY(-3px); border-color: var(--accent); }
.shot.seen b { background: var(--accent); color: var(--accent-ink); }

/* 360 viewer */
.viewer { position: fixed; inset: 0; z-index: 1000; background: #000; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; overflow: hidden; }
.viewer.dragging { cursor: grabbing; }
.viewer[hidden] { display: none; }
.viewer canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer canvas#pano, .viewer canvas.lines, .viewer .spots { transition: opacity .6s cubic-bezier(.4, 0, .2, 1); }   /* fade in; out + in = 1.2 s, as tour.js FADE_OUT and tour-fly.js MOVE_S */
.viewer.swap canvas#pano { opacity: .35; }
.viewer.dim canvas#pano, .viewer.dim canvas.lines, .viewer.dim .spots { opacity: 0; transition: opacity .6s cubic-bezier(.4, 0, .2, 1); }   /* fade out between photos */
.viewer canvas.lines { z-index: 1; pointer-events: none; }
.viewer canvas.fly { z-index: 2; opacity: 0; cursor: default; }   /* a flight between photos (tour-fly.js), over the names */
.viewer.flying .spots, .viewer.flying canvas.lines, .viewer.flying .hint, .viewer.flying .better, .viewer.flying .loading { visibility: hidden; }
.v-top { position: absolute; z-index: 4; top: calc(12px + var(--safe-t)); left: calc(12px + var(--safe-l)); right: 12px; display: flex; align-items: flex-start; gap: 10px; pointer-events: none; }
.v-top > * { pointer-events: auto; }
.v-info { display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; min-height: 48px; min-width: 0; flex: 0 1 auto; pointer-events: none !important; }
.v-words b { overflow: hidden; text-overflow: ellipsis; }
.v-words { display: flex; flex-direction: column; min-width: 0; }
.v-words b { font-size: 17px; white-space: nowrap; }
.v-words span { font-size: 15px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-words span:empty { display: none; }
.rose { position: relative; flex: none; width: 44px; height: 44px; padding: 0; border-radius: 50%; background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .5); cursor: pointer; pointer-events: auto; }
.rose:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.better { position: absolute; z-index: 4; left: 50%; top: calc(72px + var(--safe-t)); transform: translateX(-50%); background: #fff; color: #111; border-color: #fff; max-width: calc(100% - 24px); }
.better[hidden] { display: none; }
.better span { overflow: hidden; text-overflow: ellipsis; }
.needle { position: absolute; inset: 0; }
.needle b { position: absolute; left: 50%; top: 1px; transform: translateX(-50%); font-size: 13px; font-weight: 900; color: #ff6b5b; }
.needle i { position: absolute; left: 50%; top: 17px; width: 2px; height: 20px; margin-left: -1px; background: rgba(255, 255, 255, .7); border-radius: 1px; }
.v-tools { margin-left: auto; display: flex; gap: 8px; }
.menu { position: absolute; z-index: 6; top: calc(68px + var(--safe-t)); right: 12px; min-width: 240px; padding: 6px; display: flex; flex-direction: column; }
.menu[hidden] { display: none; }
.menu button { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 17px; font-weight: 600; cursor: pointer; }
.menu button:hover { background: rgba(255, 255, 255, .1); }
.menu button i { width: 24px; height: 24px; flex: none; border-radius: 6px; border: 2px solid rgba(255, 255, 255, .7); display: grid; place-items: center; }
.menu button[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
.menu button[aria-checked="true"] i::after { content: ""; width: 10px; height: 6px; border: solid var(--accent-ink); border-width: 0 0 3px 3px; transform: translateY(-1px) rotate(-45deg); }
.menu hr { width: 100%; border: 0; border-top: 1px solid var(--glass-line); margin: 4px 0; }
.menu [hidden] { display: none; }
.mini { position: absolute; z-index: 3; left: calc(12px + var(--safe-l)); bottom: 80px; width: 200px; height: 200px; border-radius: 16px; overflow: hidden;
  border: 2px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow); cursor: pointer; background: #0f1412; display: none; }
.mini::after { content: "Show map"; position: absolute; z-index: 500; right: 6px; top: 6px; padding: 3px 10px; border-radius: 999px; background: rgba(15, 20, 18, .85); font-size: 13px; font-weight: 700; pointer-events: none; }
.mini .leaflet-container { cursor: pointer; }
.mini .leaflet-control-container { display: none; }
.v-pad { position: absolute; z-index: 3; left: calc(12px + var(--safe-l)); right: 12px; bottom: 14px; display: flex; gap: 8px; pointer-events: none; }
.v-pad > * { pointer-events: auto; }
.v-pad .gap { flex: 1; pointer-events: none; }
.v-pad .btn { width: 52px; height: 52px; }
/* Points of interest, neighbour photos and the tapped spot in the 360 */
.spots { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.spot { position: absolute; left: 0; top: 0; pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 0; background: none; border: 0; cursor: pointer;
  transform: translate(-50%, -50%); will-change: transform; }
.spot i { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 15px; color: var(--accent-ink);
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .55); transition: transform .15s ease; }
.spot span { padding: 3px 9px; border-radius: 999px; background: rgba(15, 20, 18, .85); font-size: 13px; font-weight: 650; white-space: nowrap; }
.spot:hover i { transform: scale(1.12); }
.spot .stem, .spot .foot { display: none; }
.spot.ground { gap: 0; }
.spot.ground span { margin-top: 3px; }
.spot.ground .stem { display: block; width: 2px; height: 64px; background: rgba(255, 255, 255, .92); box-shadow: 0 0 3px rgba(0, 0, 0, .7); }
.spot.ground .foot { display: block; width: 10px; height: 10px; margin-top: -2px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; box-shadow: 0 0 4px rgba(0, 0, 0, .7); }
.lbl { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; pointer-events: none; will-change: transform; }
.lbl span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 7px; border-radius: 999px; background: rgba(12, 17, 15, .9); color: #fff; font-size: 15px; font-weight: 700;
  white-space: nowrap; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.lbl span svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lbl em { font-style: normal; font-weight: 600; color: var(--muted); }
.lbl s { display: block; width: 2px; background: rgba(255, 255, 255, .85); box-shadow: 0 0 3px rgba(0, 0, 0, .8); text-decoration: none; }
.lbl u { display: block; width: 10px; height: 10px; margin-top: -1px; border-radius: 50%; background: #fff; border: 2px solid rgba(0, 0, 0, .6); text-decoration: none; }
.lbl.k-water span svg { color: var(--water); }
.lbl.k-high span svg { color: #fdba74; }
.lbl.k-road span svg, .lbl.k-highway span svg, .lbl.k-track span svg { color: #fde68a; }
.lbl.k-town span { background: rgba(12, 17, 15, .7); font-size: 14px; font-weight: 600; }
.lbl.k-mark span { background: #fff; color: #111; }
.lbl.k-mark span em { color: #333; }
.lbl.k-mark u { background: #ef4444; border-color: #fff; width: 14px; height: 14px; }
.lbl.focus span { outline: 3px solid var(--accent); }
.hint { position: absolute; z-index: 3; left: 50%; bottom: 80px; transform: translateX(-50%); margin: 0; padding: 8px 18px 8px 12px; border-radius: 999px; background: rgba(12, 17, 15, .88);
  display: flex; align-items: center; gap: 10px; pointer-events: none; white-space: nowrap; box-shadow: var(--shadow); }
.hint[hidden] { display: none; }
.hint b { font-size: 17px; }
.hint > span:last-child { display: none; }
.hint .hand { width: 32px; height: 32px; flex: none; animation: swipe 1.8s ease-in-out infinite; }
.hint .hand svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
@keyframes swipe { 0%, 100% { transform: translateX(-8px) rotate(-10deg); } 50% { transform: translateX(8px) rotate(10deg); } }
.loading { position: absolute; z-index: 4; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; }
.loading span { display: block; width: 100%; height: 100%; border-radius: 50%; border: 4px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.fail { position: fixed; z-index: 2000; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 90vw; margin: 0; padding: 16px 20px; border-radius: var(--r); background: var(--glass); text-align: center; }
.toast { position: fixed; z-index: 2000; left: 50%; top: calc(16px + var(--safe-t)); transform: translateX(-50%); margin: 0; padding: 12px 18px; border-radius: 14px; background: #fff; color: #111; font-weight: 650; box-shadow: var(--shadow); }
.toast[hidden] { display: none; }

/* Caption and main buttons while a photo is open */
.dock { position: fixed; z-index: 1100; left: 0; right: 0; bottom: 0; border-radius: 0; border-width: 1px 0 0; background: var(--solid); -webkit-backdrop-filter: none; backdrop-filter: none;
  padding: 14px calc(16px + var(--safe-r)) calc(14px + var(--safe-b)) calc(16px + var(--safe-l)); display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.dock[hidden] { display: none; }
.d-text { flex: 1 1 300px; min-width: 0; }
.d-step { margin: 0; font-size: 15px; font-weight: 700; color: var(--accent); }
.d-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.btn.small { min-height: 44px; padding: 0 12px; font-size: 15px; box-shadow: none; }
.btn.small svg { width: 20px; height: 20px; }
.btn.small[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small[hidden] { display: none; }
.dock p#dMore { margin: 4px 0 0; font-size: 15px; line-height: 1.35; color: var(--muted); }
.dock p#dMore:empty { display: none; }
.dock h2 { margin: 2px 0 0; font-size: 22px; line-height: 1.2; }
.dock p#dText { margin: 4px 0 0; font-size: 17px; line-height: 1.4; color: var(--muted); }
.dock p#dText:empty { display: none; }
.d-buttons { flex: 1 1 280px; display: flex; gap: 10px; }
.d-buttons .btn { flex: 1; }
.d-buttons #dNext { flex: 1.6; }
.d-buttons .btn[hidden] { display: none; }

/* Photo open: the map moves under the photo (tall screens) or beside it (wide screens) and follows the view */
body.viewing .head, body.viewing .strip, body.viewing .legend { display: none; }
body.viewing .viewer { inset: 0 0 calc(var(--map-h) + var(--dock-h) + 8px) 0; }
body.viewing #map { top: auto; left: 10px; right: 10px; height: var(--map-h); bottom: calc(var(--dock-h) + 8px); z-index: 900; border-radius: 16px; overflow: hidden;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .45); }
body.viewing .leaflet-control-zoom { margin: 0 calc(10px + var(--safe-r)) 10px 0 !important; }
body.viewing .leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; }
body.viewing .scale { margin: 0 0 10px 10px !important; }
@media (orientation: landscape) and (min-width: 760px) {
  /* Wide screens: the photo fills the screen; the map, caption and buttons float in one card at the bottom right */
  body.viewing .viewer { inset: 0; }
  body.viewing #map { z-index: 1050; top: auto; left: auto; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b) + var(--dock-h)); width: var(--card-w);
    height: var(--card-map-h); border: 0; border-radius: 18px 18px 0 0; overflow: hidden; box-shadow: 0 10px 34px rgba(0, 0, 0, .45); }
  body.viewing .dock { left: auto; right: calc(16px + var(--safe-r)); bottom: calc(16px + var(--safe-b)); width: var(--card-w); border: 0;
    border-radius: 0 0 18px 18px; padding: 12px 14px 14px; gap: 8px 10px; box-shadow: 0 14px 34px rgba(0, 0, 0, .45); }
  body.viewing .dock h2 { font-size: 18px; }
  body.viewing .dock p#dText { font-size: 15px; line-height: 1.35; }
  body.viewing .dock p#dMore { font-size: 13px; }
  body.viewing .d-text, body.viewing .d-buttons { flex: 1 1 100%; }
  body.viewing .d-buttons .btn { min-height: 48px; font-size: 16px; }
  body.viewing .v-pad { right: calc(var(--card-w) + 32px + var(--safe-r)); }
  body.viewing .leaflet-control-zoom a { width: 36px !important; height: 36px !important; line-height: 36px !important; }
}
body.viewing.photo-only .viewer { inset: 0 0 var(--dock-h) 0; }
body.viewing.photo-only #map { visibility: hidden; }
body.viewing.photo-only .dock { left: 0; width: auto; }
body.viewing.photo-only .mini { display: block; }
body.viewing.photo-only .hint { display: none; }
body.viewing.photo-only .v-pad { left: calc(224px + var(--safe-l)); }

@media (max-width: 640px) {
  :root { --strip-h: 70px; font-size: 16px; }
  .head { padding: 12px 14px; right: calc(12px + var(--safe-r)); width: auto; }
  .head h1 { font-size: 21px; }
  .head .facts { font-size: 15px; }
  .shot { min-width: 64px; }   /* phones: too small to tap below this, so the strip scrolls */
  .legend { display: none; }
  .v-tools .btn span { display: none; }
  .v-tools .btn { padding: 0; width: 48px; }
  #close { padding: 0 12px 0 8px; gap: 4px; }
  .v-top { gap: 8px; }
  .v-info { padding: 5px 10px 5px 5px; gap: 7px; }
  .v-words b { font-size: 15px; }
  .v-words span { font-size: 13px; }
  .rose { width: 34px; height: 34px; }
  .needle b { font-size: 11px; }
  .needle i { top: 13px; height: 15px; }
  .hint b { font-size: 16px; }
  .hint { bottom: 76px; }
  body.viewing .place.k-track, body.viewing .place.k-road, body.viewing .place.k-highway { display: none; }
  .mini { width: 140px; height: 140px; }
  body.viewing.photo-only .v-pad { left: calc(164px + var(--safe-l)); }
  .dock { padding-top: 12px; gap: 10px; }
  .dock h2 { font-size: 20px; }
  .dock p#dText { font-size: 16px; }
  .d-step { font-size: 14px; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .v-tools .btn span { display: none; }
  .v-tools .btn { padding: 0; width: 48px; }
  #close { padding: 0 12px 0 8px; gap: 4px; }
  .v-words span { display: none; }
  .d-buttons .btn { white-space: nowrap; padding: 0 12px; }
  .d-step { font-size: 13px; }
  body.viewing .place.k-track, body.viewing .place.k-road, body.viewing .place.k-highway { display: none; }
  .head { width: min(340px, 45vw); padding: 12px 14px; }
  .head h1 { font-size: 20px; }
  .head .facts { font-size: 14px; }
  .head .or, .legend { display: none; }
  .head .btn.big { margin-top: 10px; }
  .dock { padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
  .dock h2 { font-size: 18px; }
  .dock p#dText { font-size: 15px; }
  .btn.big { min-height: 48px; }
  .head { max-height: calc(100vh - 24px); overflow: auto; }
}
/* Touch screens: the main buttons taller (older adults tap most accurately on targets of 14 mm or more) */
@media (pointer: coarse) { .d-buttons .btn { min-height: 60px; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } .hint .hand { animation: none; } }

/* Dams: outline on the map (highlighted while its photo is open), and the photo full screen */
path.water-area { fill: rgba(56, 152, 236, .28); stroke: #7cc4ff; }
path.water-area.lit { fill: rgba(56, 152, 236, .55); stroke: #fff; stroke-width: 3; }
.place.tap, .lbl.tap span { pointer-events: auto; cursor: pointer; }
.lbl.tap span { outline: 2px solid rgba(124, 196, 255, .9); outline-offset: 1px; }
.photo { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: rgba(5, 8, 7, .94); }
.photo[hidden] { display: none; }
.photo img { flex: 1; min-height: 0; width: 100%; object-fit: contain; }
.photo-bar { display: flex; align-items: center; gap: 14px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); color: #fff; }
.photo-bar > div { flex: 1; min-width: 0; }
.photo-bar b { display: block; font-size: 18px; }
.photo-bar p { margin: 4px 0 0; font-size: 15px; color: rgba(255, 255, 255, .8); }
.photo-bar .btn { min-height: 52px; padding: 0 22px; font-size: 17px; }

/* Fit: whole property again */
.btn.fit { min-height: 44px; margin-top: 8px; padding: 0 16px; font-size: 15px; font-weight: 700; }
.place.k-town { font-size: 15px; background: rgba(12, 17, 15, .9); }

/* Dam on the big map: a small water drop, no text (its outline is drawn too; tap either for its photo) */
.dam-pin { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #2f8fe0; border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, .55); cursor: pointer; }
.dam-pin svg { width: 12px; height: 12px; fill: #fff; stroke: none; }
.dam-pin:hover, .dam-pin.lit { background: #fff; }
.dam-pin:hover svg, .dam-pin.lit svg { fill: #2f8fe0; }

/* The map beside an open photo: smaller pins and drops; names (roads, high ground, towns) only with More detail */
body.viewing #map .pin { width: 22px; height: 22px; font-size: 10px; border-width: 2px; }
body.viewing #map .pin.here { width: 26px; height: 26px; }
body.viewing #map .dam-pin { width: 16px; height: 16px; border-width: 1.5px; }
body.viewing #map .dam-pin svg { width: 9px; height: 9px; }
body.viewing #map:not(.more) .place-wrap .place:not(.k-mark) { display: none; }
.more-btn { display: none; }
body.viewing .more-btn { display: inline-flex; min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 700; }

/* Small map beside a photo: compact controls in one column on the right, a small scale at the bottom left */
body.viewing #map .leaflet-control-zoom { margin: 0 8px 8px 0 !important; box-shadow: none; }
body.viewing #map .leaflet-control-zoom a { width: 32px !important; height: 32px !important; line-height: 32px !important; font-size: 18px !important; }
body.viewing #map .btn.fit { min-height: 32px; height: 32px; margin: 0 8px 6px 0; padding: 0 10px; font-size: 13px; box-shadow: none; }
body.viewing #map .more-btn { min-height: 32px; height: 32px; margin: 8px 8px 0 0; padding: 0 10px; font-size: 13px; box-shadow: none; }
body.viewing #map .scale { margin: 0 0 8px 8px !important; padding: 3px 7px; gap: 5px; font-size: 11px; }
body.viewing #map .scale i { height: 5px; border-width: 2px; }
body.viewing #map .credit { font-size: 8px; padding: 0 4px; left: auto; right: 48px; bottom: 2px; }

/* Thumbnails share the width so every one is on screen; badges shrink with them */
.strip { justify-content: center; }
.shot b { min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; left: 3px; top: 3px; }

/* In the 360: photo pin stems and dots, then names (dams), then the pins' numbers and distances on top */
#tags { z-index: 3; }
#spotTops { z-index: 4; }
.spot.base { pointer-events: none; }
.spot.base i, .spot.base span { visibility: hidden; }
.spot.top .stem, .spot.top .foot { visibility: hidden; }

/* Dam slideshow */
.photo-bar #phPrev, .photo-bar #phNext { width: 52px; padding: 0; }
.photo-bar #phPrev[hidden], .photo-bar #phNext[hidden] { display: none; }
.ph-step { display: block; font-size: 14px; font-weight: 700; color: var(--accent); }

/* Footnote under a dam's words */
.photo-bar small { display: block; margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, .6); }
/* Towns: a white flag on a tall pin in the 360, and a white label on the map */
.lbl.k-town span { background: #fff; color: #142018; border-color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .45); }
.lbl.k-town span em { color: #4b5a4f; }
.lbl.k-town span svg { color: #3f7d1e; }
.place.k-town { background: #fff; color: #142018; box-shadow: 0 2px 8px rgba(0, 0, 0, .5); }
.place.k-town svg { color: #3f7d1e; }

/* Town card on hover (tap on touch screens) */
.leaflet-tooltip.town-tip { padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #fff; color: #142018; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); white-space: normal; }
.leaflet-tooltip.town-tip::before { display: none; }
.town-card { width: 280px; }
.town-card img { display: block; width: 100%; height: 150px; object-fit: cover; }
.town-card > div { padding: 10px 12px 12px; }
.town-card b { display: block; font-size: 17px; }
.town-card .tc-dist { display: block; margin-top: 2px; font-size: 14px; font-weight: 700; color: #3f7d1e; }
.town-card p { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: #3a463e; }
.town-card small { display: block; margin-top: 6px; font-size: 10px; color: #7a857d; }
.place.k-town.tap { pointer-events: auto; cursor: pointer; }
.btn.towns-btn { margin-top: 6px; }

/* Zoomed well out: the property as one soft shape; pins, dams, trails, fences and small names hidden */
.towns-view .pin-wrap, .towns-view .dam-pin, .towns-view path.track, .towns-view path.fence, .towns-view path.water-area,
.towns-view .place:not(.k-town):not(.k-highway) { display: none; }
.towns-view path.prop-fill { fill-opacity: .32; }
/* Highways: a rounded name badge */
.place.k-highway { background: #ffc53d; color: #2a1d00; font-weight: 800; box-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.place.k-highway svg { color: #2a1d00; }
/* Towns on the map: a dot on the spot, the name and how far by road */
.place.k-town { gap: 6px; padding: 4px 10px 4px 6px; }
.place.k-town b { font-size: 14px; }
.place.k-town em { font-style: normal; font-size: 12px; font-weight: 600; color: #4b5a4f; }
.place.k-town .town-dot { width: 10px; height: 10px; border-radius: 50%; background: #3f7d1e; border: 2px solid #fff; box-shadow: 0 0 0 1px #3f7d1e; flex: none; }
/* Route to each town: amber with a soft glow */
path.route-core { filter: drop-shadow(0 0 4px rgba(255, 197, 61, .55)); }
/* All photo spots (360): the further photos as small, faint rings with no stem */
.spot.far i { width: 20px; height: 20px; font-size: 10px; border-width: 2px; opacity: .75; background: rgba(15, 20, 18, .55); color: #fff; }
.spot.far span, .spot.far .stem, .spot.far .foot { display: none; }
