/* Palermo Curiosity Site — main styles */
:root {
  --bg: #0b1d3a;
  --bg-2: #061328;
  --gold: #c9a24a;
  --gold-soft: #b48d3a;
  --porfido: #7a1f2b;
  --crema: #e9dcc1;
  --ink: #f3ead8;
  --muted: rgba(243, 234, 216, 0.62);
  --line: rgba(201, 162, 74, 0.32);
  --pin-arch: #c9a24a;
  --pin-art: #b04a59;
  --pin-hist: #e9dcc1;
  --pin-sci: #9bc6e3;
  --pin-nat: #8fb874;
  --pin-food: #e08d6f;
  --serif: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

[data-mode="day"] {
  --bg: #f5ecd6;
  --bg-2: #ecdfbf;
  --ink: #1d1408;
  --muted: rgba(29, 20, 8, 0.62);
  --line: rgba(122, 31, 43, 0.28);
  --crema: #1d1408;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; width: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

/* === MapLibre canvas — recolor for Arab-Norman aesthetic === */
#three-root {
  position: absolute;
  inset: 0;
}

/* Imperfect organic black vignette — focuses Palermo, fades the rest
   without fully blacking it out so peripheral elements stay readable. */
#three-root::before,
#three-root::after {
  content: "";
  position: absolute;
  inset: -8%;
  pointer-events: none;
  z-index: 6;
}
#three-root::before {
  background:
    radial-gradient(ellipse 50% 54% at 50% 50%, transparent 0%, transparent 42%,
      rgba(0,0,0,0.30) 70%, rgba(0,0,0,0.55) 100%);
  filter: url(#organic-edge);
  mix-blend-mode: multiply;
}
#three-root::after {
  background:
    radial-gradient(ellipse 65% 68% at 48% 53%, transparent 0%, transparent 50%,
      rgba(0,0,0,0.14) 78%, rgba(0,0,0,0.28) 100%);
  filter: url(#organic-edge-2);
  mix-blend-mode: multiply;
  opacity: 0.7;
}
/* Cesium stage fills #three-root */
#three-root .cesium-stage,
#three-root .cesium-viewer,
#three-root .cesium-widget,
#three-root .cesium-widget canvas { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; }
.cesium-viewer-bottom, .cesium-credit-textContainer, .cesium-credit-logoContainer { display: none !important; }

/* === Pin markers === */
.pin-marker {
  cursor: pointer;
  transition: transform .18s cubic-bezier(.2,.8,.2,1), filter .18s, opacity .25s;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.55));
  transform-origin: 50% 100%;
  will-change: transform;
}
.pin-marker:hover { transform: scale(1.28); }
.pin-marker.active { transform: scale(1.5); filter: drop-shadow(0 0 14px var(--gold)) drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
.pin-marker.dim { opacity: 0.18; pointer-events: none; transform: scale(0.85); }
.pin-marker svg { display: block; overflow: visible; }

/* === Arabesque cornice (SVG) === */
.cornice {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  mix-blend-mode: screen;
  opacity: 1;
}
[data-mode="day"] .cornice { mix-blend-mode: multiply; opacity: 0.5; }

/* === Top bar === */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 70px 130px;
  z-index: 20;
  pointer-events: none;
}
@media (max-width: 900px) {
  .topbar { padding: 60px 90px; }
}
.topbar > * { pointer-events: auto; }

.brand {
  display: flex;
  align-items: baseline;
  gap: 14px;
  letter-spacing: 0.02em;
}
.brand .mark {
  width: 26px; height: 26px;
  align-self: center;
}
.brand h1 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(20px, 2.2vw, 30px);
  letter-spacing: 0.03em;
  font-style: italic;
}
.brand .sep {
  width: 18px; height: 1px; background: var(--line); margin: 0 4px;
  align-self: center;
}
.brand small {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

/* === Toggles & pills === */
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: rgba(11, 29, 58, 0.42);
  color: var(--ink);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
[data-mode="day"] .pill { background: rgba(245, 236, 214, 0.5); }
@media (hover: hover) {
  .pill:hover { border-color: var(--gold); color: var(--gold); }
}
.pill.active { border-color: var(--gold); color: var(--gold); background: rgba(201, 162, 74, 0.08); }

.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  background: rgba(11, 29, 58, 0.42);
  backdrop-filter: blur(8px);
}
[data-mode="day"] .lang-toggle { background: rgba(245, 236, 214, 0.5); }
.lang-toggle button {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 8px 14px;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
}
.lang-toggle button.active { color: var(--bg); background: var(--gold); }

.toolbar-right {
  display: flex; gap: 10px; align-items: center;
}

/* === Side panel: filters === */
.filters {
  position: absolute;
  left: 130px;
  top: 160px;
  bottom: 180px;
  z-index: 18;
  display: flex; flex-direction: column; gap: 8px;
  justify-content: center;
}
@media (max-width: 900px) {
  .filters { left: 90px; }
}
.filters .label {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.filter-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px 8px 8px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  background: rgba(11, 29, 58, 0.42);
  color: var(--ink);
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s;
}
[data-mode="day"] .filter-chip { background: rgba(245, 236, 214, 0.5); }
.filter-chip .swatch {
  width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg);
}
.filter-chip .count {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--muted);
  margin-left: auto;
  letter-spacing: 0.1em;
}
@media (hover: hover) {
  .filter-chip:hover { border-color: var(--line); }
}
.filter-chip.active { border-color: var(--gold); }
.filter-chip.dim { opacity: 0.45; }

/* === Right side: tour & geo === */
.aux-stack {
  position: absolute;
  right: 130px;
  top: 160px;
  bottom: 180px;
  z-index: 18;
  display: flex; flex-direction: column; gap: 14px; align-items: flex-end;
  justify-content: center;
}
@media (max-width: 900px) {
  .aux-stack { right: 90px; }
}
.geo-card {
  width: 220px;
  padding: 14px 16px;
  background: rgba(11, 29, 58, 0.55);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.6;
}
[data-mode="day"] .geo-card { background: rgba(245, 236, 214, 0.62); }
.geo-card .geo-title { color: var(--gold); margin-bottom: 6px; }
.geo-card .geo-place {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0.01em;
  margin: 4px 0 6px;
  line-height: 1.15;
}
.geo-card .geo-distance { color: var(--gold); }
.geo-card button {
  margin-top: 8px;
  font: inherit;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 6px 10px;
  cursor: pointer;
  letter-spacing: inherit;
}
.geo-card button:hover { border-color: var(--gold); color: var(--gold); }

/* === Bottom: timeline === */
.timeline {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 56px;
  z-index: 8;
  padding: 14px 22px 16px;
  background: linear-gradient(180deg, rgba(6,17,42,0.0) 0%, rgba(6,17,42,0.85) 38%, rgba(6,17,42,0.95) 100%);
  border-top: 1px solid rgba(201,162,74,0.22);
  border-radius: 6px 6px 0 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0%, #000 8%, #000 92%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.timeline-eras {
  position: relative;
  height: 18px;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}
.timeline-eras span { position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap; }
.timeline-head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}
.timeline-head .yr {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--gold);
  text-transform: none;
  letter-spacing: 0.02em;
}
.timeline-track {
  position: relative;
  height: 38px;
  border-top: 1px solid var(--line);
}
.timeline-track::before, .timeline-track::after {
  content: ""; position: absolute; top: -3px; width: 1px; height: 7px; background: var(--line);
}
.timeline-track::before { left: 0; }
.timeline-track::after { right: 0; }
.timeline-tick {
  position: absolute;
  top: 0;
  width: 1px;
  height: 6px;
  background: var(--gold);
  opacity: 0.6;
  cursor: pointer;
  transform: translateX(-50%);
  transition: height .15s, opacity .15s;
}
.timeline-tick:hover { height: 14px; opacity: 1; }
.timeline-tick.dim { background: var(--muted); opacity: 0.18; }
.timeline-tick.active { background: var(--gold); height: 18px; opacity: 1; }
.timeline-eras { /* legacy override removed below */ }
.timeline-cursor {
  position: absolute;
  top: -6px; bottom: 0;
  width: 2px;
  background: var(--gold);
  pointer-events: none;
  box-shadow: 0 0 14px var(--gold);
}

/* === Modal / curiosity card === */
.scrim {
  position: absolute; inset: 0; z-index: 50;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.55), rgba(0,0,0,0.85));
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  animation: fadeIn .25s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  width: min(960px, 92vw);
  max-height: 86vh;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  position: relative;
  overflow: hidden;
}
.modal::before, .modal::after {
  content: "";
  position: absolute;
  width: 28px; height: 28px;
  border: 1px solid var(--gold);
  pointer-events: none;
}
.modal::before { top: 12px; left: 12px; border-right: 0; border-bottom: 0; }
.modal::after  { bottom: 12px; right: 12px; border-left: 0; border-top: 0; }

.modal .img {
  position: relative;
  background: var(--bg-2);
  overflow: hidden;
  min-height: 360px;
}
.modal .img img {
  width: 100%; height: 100%; object-fit: cover;
  filter: saturate(0.92) contrast(1.05);
}
.modal .img .placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background:
    repeating-linear-gradient(45deg, rgba(201,162,74,.06) 0 12px, transparent 12px 24px),
    radial-gradient(ellipse at center, rgba(201,162,74,.18), transparent 70%),
    var(--bg-2);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: center;
  padding: 20px;
}
.modal .img .placeholder span {
  display: block;
  margin-top: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 22px;
  text-transform: none;
  letter-spacing: 0.01em;
  color: var(--ink);
}
.modal .img .src {
  position: absolute; bottom: 6px; right: 10px; left: auto;
  font-family: var(--mono); font-size: 7px;
  letter-spacing: 0.04em; color: rgba(255,245,216,0.55);
  text-shadow: 0 0 4px rgba(0,0,0,0.85);
  max-width: 60%; text-align: right;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.7); text-shadow: 0 1px 2px rgba(0,0,0,.7);
}

.modal .body {
  padding: 38px 42px;
  display: flex; flex-direction: column; gap: 18px;
  overflow-y: auto;
}
.modal .num {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.34em;
  color: var(--gold);
  text-transform: uppercase;
}
.modal h2 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.05;
  letter-spacing: 0.005em;
  text-wrap: pretty;
}
.modal .meta {
  display: flex; gap: 14px; align-items: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}
.modal .meta .dot { width: 4px; height: 4px; background: var(--line); border-radius: 50%; }
.modal .meta .cat-swatch { width: 8px; height: 8px; transform: rotate(45deg); }
.modal p { font-family: var(--serif); font-size: 19px; line-height: 1.5; text-wrap: pretty; }
.modal .actions {
  margin-top: auto;
  display: flex; flex-wrap: wrap; gap: 10px;
}
.modal .close {
  position: absolute; top: 18px; right: 18px;
  z-index: 2;
  background: transparent; border: 1px solid var(--line); color: var(--ink);
  width: 36px; height: 36px; cursor: pointer;
  display: grid; place-items: center;
  font-family: var(--serif); font-style: italic; font-size: 18px;
  transition: border-color .2s, color .2s;
}
.modal .close:hover { border-color: var(--gold); color: var(--gold); }

.modal .mini-map {
  position: absolute; left: 18px; bottom: 18px;
  width: 160px; height: 110px;
  border-radius: 6px; border: 1px solid rgba(201,162,74,0.5);
  background: #0b1d3a; overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,0.5);
}
.modal .mini-map .mini-tiles {
  position: absolute; left: 0; top: 0; width: 0; height: 0;
  filter: saturate(0.55) brightness(0.62) hue-rotate(-8deg);
}
.modal .mini-map .mini-tile {
  position: absolute; width: 256px; height: 256px; pointer-events: none;
}
.modal .mini-map .mini-pin {
  position: absolute; left: 50%; top: 50%; width: 14px; height: 14px;
  transform: translate(-50%, -50%); pointer-events: none;
}
.modal .mini-map .mini-pin-dot {
  position: absolute; inset: 4px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 8px var(--gold);
}
.modal .mini-map .mini-pin-ring {
  position: absolute; inset: -2px; border-radius: 50%;
  border: 1.5px solid var(--gold); opacity: 0.7;
  animation: minipulse 1.6s ease-out infinite;
}
@keyframes minipulse { 0%{transform:scale(.6);opacity:.9} 100%{transform:scale(2.2);opacity:0} }
.modal .mini-map .mini-attrib {
  position: absolute; right: 4px; bottom: 2px;
  font: 8px var(--mono); color: rgba(255,245,216,0.7);
  text-shadow: 0 0 3px rgba(0,0,0,0.9);
}

/* === Tour mode — cinematic UI: hide auxiliary panels, dim brand === */
#stage.tour-mode .filters,
#stage.tour-mode .aux-stack,
#stage.tour-mode .hint { opacity: 0; pointer-events: none; transition: opacity .8s ease; }
#stage.tour-mode .topbar .brand { opacity: 0.55; transition: opacity .8s ease; }
#stage:not(.tour-mode) .filters,
#stage:not(.tour-mode) .aux-stack,
#stage:not(.tour-mode) .hint { transition: opacity .6s ease; }

/* === Tour controls === */
.tour-bar {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  display: flex; gap: 8px;
  background: rgba(11, 29, 58, 0.78);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  padding: 6px;
}
.tour-bar button {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  background: transparent;
  border: 0;
  color: var(--ink);
  padding: 8px 14px;
  cursor: pointer;
}
.tour-bar button:hover { color: var(--gold); }
.tour-bar button.primary {
  background: var(--gold);
  color: var(--bg);
}

/* === Audio button (lives in topbar) === */
.audio-toggle {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  background: rgba(11, 29, 58, 0.42);
  backdrop-filter: blur(8px);
  color: var(--ink);
  cursor: pointer;
  display: grid; place-items: center;
  transition: border-color .2s, color .2s;
}
.audio-toggle:hover { border-color: var(--gold); color: var(--gold); }
.audio-toggle svg { width: 18px; height: 18px; }
.audio-toggle.on { color: var(--gold); border-color: var(--gold); }

/* === Pin label tooltip === */
.pin-tooltip {
  position: absolute;
  pointer-events: none;
  z-index: 17;
  transform: translate(-50%, -120%);
  background: rgba(11, 29, 58, 0.92);
  border: 1px solid var(--gold);
  padding: 8px 12px;
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
  opacity: 0;
  transition: opacity .15s;
}
.pin-tooltip.show { opacity: 1; }
.pin-tooltip small {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 2px;
}

/* === Loading overlay === */
.loader {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  z-index: 100;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(201,162,74,0.06) 0%, transparent 65%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
  transition: opacity 1.2s cubic-bezier(.2,.7,.2,1);
}
.loader.hide { opacity: 0; pointer-events: none; }

.loader-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: 22px;
  text-align: center;
  padding: 0 20px;
}
.loader-mark {
  width: 88px; height: 88px;
  animation: loaderRotate 14s linear infinite;
  filter: drop-shadow(0 0 14px rgba(201,162,74,0.32));
}
@keyframes loaderRotate { to { transform: rotate(360deg); } }

.loader-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(40px, 6vw, 64px);
  letter-spacing: 0.03em;
  color: var(--gold);
  margin: 0;
  line-height: 1;
}
.loader-tagline {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--muted);
}
.loader-bar {
  position: relative;
  width: min(280px, 70vw);
  height: 1px;
  background: rgba(201,162,74,0.16);
  overflow: hidden;
  margin-top: 4px;
}
.loader-bar > span {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  transform: translateX(-100%);
  animation: loaderSweep 2.6s cubic-bezier(.4,.0,.2,1) infinite;
}
@keyframes loaderSweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.loader-status {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: rgba(243,234,216,0.85);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 24px;
  transition: opacity .6s ease;
}
.loader-status.fade { opacity: 0; }

.loader-status .dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.loader-status .dots .dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold);
  opacity: 0.25;
  animation: dotPulse 1.3s ease-in-out infinite;
}
.loader-status .dots .dot:nth-child(2) { animation-delay: 0.18s; }
.loader-status .dots .dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes dotPulse {
  0%, 100% { opacity: 0.22; transform: translateY(0); }
  50%      { opacity: 1.00; transform: translateY(-3px); }
}

/* === Compass === */
.compass {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 4;
  width: 78vmin; height: 78vmin;
  opacity: 0.07;
}
[data-mode="day"] .compass { opacity: 0.12; }

/* === Helper text — pill at the bottom centre === */
.hint {
  position: absolute;
  left: 50%;
  bottom: 36px;
  transform: translateX(-50%);
  z-index: 17;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
  text-align: center;
  white-space: nowrap;
  background: rgba(11, 29, 58, 0.42);
  border: 1px solid var(--line);
  padding: 11px 20px;
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
}
[data-mode="day"] .hint { background: rgba(245, 236, 214, 0.5); }

/* ===========================================================================
   BottomSheet (generic) — used by mobile drawer + mobile modal
   =========================================================================== */
.bh-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: linear-gradient(180deg, rgba(11,29,58,0.96) 0%, rgba(6,17,42,0.98) 100%);
  border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.45);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  display: flex; flex-direction: column;
  overflow: hidden;
  will-change: transform;
  touch-action: pan-y;
}
.bh-sheet.bh-modal-sheet { z-index: 50; }
.bh-sheet-handle {
  flex: 0 0 auto;
  height: 28px;
  display: grid; place-items: center;
  cursor: grab;
  touch-action: none;
}
.bh-sheet.dragging .bh-sheet-handle { cursor: grabbing; }
.bh-sheet-grabber {
  width: 44px; height: 4px;
  border-radius: 2px;
  background: rgba(201,162,74,0.55);
}
.bh-sheet-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 22px 22px;
  -webkit-overflow-scrolling: touch;
}
.bh-sheet-backdrop {
  position: fixed; inset: 0;
  z-index: 48;
  background: rgba(0,0,0,1);
  pointer-events: auto;
  transition: opacity .25s ease;
}

/* ===========================================================================
   Mobile layout
   =========================================================================== */
html.is-mobile body { font-size: 15px; }

html.is-mobile .topbar {
  padding: 18px 22px;
}
html.is-mobile .brand h1 {
  font-size: 22px;
  letter-spacing: 0.02em;
}
html.is-mobile .brand .sep,
html.is-mobile .brand small { display: none; }
html.is-mobile .toolbar-right { gap: 6px; }
html.is-mobile .audio-toggle { width: 32px; height: 32px; }
html.is-mobile .audio-toggle svg { width: 14px; height: 14px; }
html.is-mobile .pill {
  padding: 7px 10px; font-size: 9px; letter-spacing: 0.18em;
}
html.is-mobile .lang-toggle { font-size: 10px; }
html.is-mobile .lang-toggle button { padding: 6px 10px; }

/* Hint pill repositioned above the drawer's peek area */
html.is-mobile .hint {
  bottom: 110px;
  font-size: 9px;
  letter-spacing: 0.2em;
  padding: 8px 14px;
  white-space: normal;
  text-align: center;
  max-width: calc(100vw - 60px);
}

/* Drawer-specific look (filters + geo card) */
.bh-drawer .drawer-content {
  display: flex; flex-direction: column;
  gap: 18px;
}
.bh-drawer .filters {
  position: static;
  inset: auto;
  height: auto;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}
.bh-drawer .filters .label {
  flex: 1 0 100%;
  margin-bottom: 0;
}
.bh-drawer .filter-chip {
  font-size: 11px;
  padding: 6px 10px 6px 6px;
}
.bh-drawer .geo-card {
  width: 100%;
}
.bh-drawer .aux-stack { display: none; }

/* When drawer is in peek state, hide the deeper content (filters spill out) */
.bh-sheet.bh-snap-peek .bh-sheet-body { overflow: hidden; }

/* Modal sheet on mobile — replaces the desktop scrim */
.bh-modal-sheet .modal-mobile {
  position: relative;
  display: flex; flex-direction: column;
  background: transparent;
  border: 0;
}
.bh-modal-sheet .modal-mobile::before,
.bh-modal-sheet .modal-mobile::after { display: none; }
.bh-modal-sheet .modal-mobile .img {
  width: 100%; aspect-ratio: 16/9; min-height: 180px;
  border-radius: 10px; overflow: hidden;
}
.bh-modal-sheet .modal-mobile .body {
  padding: 18px 4px 6px;
}
.bh-modal-sheet .modal-mobile .body h2 {
  font-size: clamp(24px, 6vw, 32px);
}
.bh-modal-sheet .modal-mobile .body p {
  font-size: 17px;
}
.bh-modal-sheet .modal-mobile .mini-map {
  position: relative;
  margin-top: 14px;
  width: 100%;
  height: 140px;
  left: auto; bottom: auto;
}
.bh-modal-sheet .modal-mobile .close {
  top: -2px; right: 0;
}


