:root {
  color-scheme: dark;
  --ink: #10171b;
  --ink-soft: #151b1f;
  --panel: rgba(20, 25, 28, .96);
  --player: rgba(31, 34, 36, .98);
  --paper: #f5f3ee;
  --muted: #aaaead;
  --gold: #caa978;
  --gold-light: #dfbd87;
  --line: rgba(219, 225, 225, .15);
  --green: #78a66c;
  --serif: Baskerville, "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Inter, "Noto Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: #090e11; scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: #090e11; color: var(--paper); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
button, select, input { font: inherit; }
button { color: inherit; }
button, a, select, input { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid #f5cb8d; outline-offset: 2px; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.guide-app {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: clip;
  background: radial-gradient(circle at 14% 23%, rgba(112, 134, 141, .06), transparent 22%), var(--ink);
  box-shadow: 0 0 80px rgba(0,0,0,.7);
}

/* Hero */
.hero { position: relative; height: 228px; overflow: hidden; background: #11191e; }
.hero-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 46%; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(7,12,15,.23), transparent 55%), linear-gradient(180deg, rgba(7,12,15,.03) 35%, rgba(10,16,20,.28) 68%, var(--ink) 100%); pointer-events: none; }
.top-tools { position: absolute; z-index: 4; inset: 16px 18px auto; height: 48px; display: flex; align-items: flex-start; }
.round-control { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(12,17,20,.67); box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.round-control svg { width: 16px; height: 16px; }
.menu-button { cursor: pointer; padding: 0; }
.language-control { position: relative; display: flex; align-items: center; gap: 5px; margin: 5px 50px 0 auto; color: rgba(255,255,255,.96); font-size: 10px; text-shadow: 0 1px 8px #000; }
.language-control > svg:first-child { width: 15px; height: 15px; }
.language-control .chevron { width: 10px; height: 10px; }
.language-control select { max-width: 90px; padding: 0 12px 0 0; border: 0; appearance: none; background: transparent; color: inherit; cursor: pointer; }
.language-control select option { color: #111; }
.offline-control { position: absolute; top: 0; right: 0; display: grid; justify-items: center; gap: 3px; padding: 0; border: 0; background: transparent; color: rgba(255,255,255,.94); font-size: 8px; cursor: pointer; text-shadow: 0 1px 8px #000; }
.download-ring { position: relative; }
.download-ring i { position: absolute; right: -2px; bottom: -1px; width: 8px; height: 8px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: white; font-size: 5px; font-style: normal; box-shadow: 0 0 0 1px rgba(16,23,27,.8); }
.download-ring i[hidden] { display: none; }
.offline-control.is-saving .download-ring svg { animation: offlinePulse .9s ease-in-out infinite alternate; }
.offline-control.is-ready .download-ring { border-color: rgba(120,166,108,.9); }
@keyframes offlinePulse { to { transform: translateY(2px); opacity: .55; } }
.hero-copy { position: absolute; z-index: 3; left: 18px; right: 15px; top: 108px; }
.hero-copy h1 { margin: 0; color: #fff; font-family: var(--serif); font-size: clamp(48px, 13vw, 56px); font-weight: 400; letter-spacing: -.055em; line-height: .87; text-shadow: 0 2px 18px rgba(0,0,0,.32); }
.hero-copy h1 span { display: block; }
.hero-copy p { margin: 10px 0 0; color: #b8bbba; font-size: 13px; letter-spacing: .005em; }

/* Dimensional model */
.model-stage { position: relative; height: 275px; overflow: hidden; background: var(--ink); isolation: isolate; touch-action: pan-y; }
.model-stage::after { content: ""; position: absolute; z-index: 2; inset: auto 0 0; height: 62px; background: linear-gradient(180deg, transparent, var(--ink)); pointer-events: none; }
.model-orbit { position: absolute; z-index: 1; inset: -28px -4px auto; width: calc(100% + 8px); transform-origin: 51% 54%; transform: perspective(850px) rotateX(var(--model-tilt, 1.5deg)) rotateY(var(--model-turn, 0deg)) scale(var(--model-scale, .96)); transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .35s ease, filter .35s ease; will-change: transform; }
.monument-model { display: block; width: 100%; height: auto; transform-origin: 50% 50%; user-select: none; -webkit-user-drag: none; }
.model-stage.is-dragging { cursor: grabbing; }
.model-stage.is-model { cursor: grab; }
.model-stage.is-map .model-orbit { opacity: 0; transform: perspective(850px) rotateX(8deg) scale(.84); pointer-events: none; }
.model-stage.is-model .model-orbit { opacity: 1; }
.plan-map { position: absolute; z-index: 2; inset: 0; opacity: 0; transform: scale(.96); transition: opacity .35s ease, transform .45s ease; pointer-events: none; }
.plan-map svg { width: 100%; height: 100%; }
.plan-map text { fill: rgba(234,225,210,.72); stroke: none; font-family: var(--sans); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.plan-portico { fill: #493a2d; stroke: #ba9564; stroke-width: 3; }
.plan-columns { fill: none; stroke: rgba(224,193,142,.62); stroke-width: 3; }
.plan-rotunda { fill: url(#planCore); stroke: #d0ad77; stroke-width: 3; }
.plan-core { fill: #211d19; stroke: rgba(231,201,151,.75); stroke-width: 2; }
.plan-oculus { fill: #10171b; stroke: var(--gold-light); stroke-width: 2; }
.plan-niches { fill: none; stroke: rgba(223,189,135,.55); stroke-width: 6; }
.model-stage.is-map .plan-map { opacity: 1; transform: scale(1); }
.route-path { position: absolute; z-index: 3; inset: 0; width: 100%; height: 100%; pointer-events: none; transition: opacity .3s ease; }
.route-path path { fill: none; stroke: rgba(255,255,255,.92); stroke-width: 1.7; stroke-dasharray: 4 4; filter: drop-shadow(0 1px 2px #000); }
.model-stage.is-model .route-path { opacity: .94; }
.model-stage.is-map .route-path { opacity: 0; }
.route-pins { position: absolute; z-index: 5; inset: 0; }
.map-pin { position: absolute; width: 25px; height: 30px; display: grid; place-items: center; padding: 0 0 4px; border: 1px solid rgba(42,31,18,.48); border-radius: 52% 52% 52% 8px; transform: translate(-50%,-50%) rotate(-45deg); background: linear-gradient(150deg,#e0c18d,#b9935f); color: #11171a; box-shadow: 0 4px 10px rgba(0,0,0,.4), inset 0 1px rgba(255,255,255,.42); cursor: pointer; }
.map-pin span { transform: rotate(45deg); font-family: var(--serif); font-size: 12px; font-weight: 700; }
.map-pin.is-active { width: 29px; height: 34px; background: #efd39e; box-shadow: 0 0 0 3px rgba(213,179,125,.18), 0 5px 14px #000; }
.map-pin.is-complete span::after { content: "✓"; position: absolute; margin: -4px 0 0 1px; font-family: var(--sans); font-size: 6px; }
.map-pin.is-pulsing { animation: pinPulse .75s ease-in-out 2; }
@keyframes pinPulse { 50% { box-shadow: 0 0 0 10px rgba(226,190,134,.16), 0 5px 16px #000; } }
.model-hint { position: absolute; z-index: 6; left: 14px; bottom: 12px; margin: 0; padding: 5px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 20px; background: rgba(11,17,20,.68); color: rgba(239,239,234,.74); font-size: 7px; letter-spacing: .025em; pointer-events: none; }
.model-toolbar { position: absolute; z-index: 6; top: 24px; right: 21px; bottom: 23px; display: flex; flex-direction: column; justify-content: space-between; }
.model-toolbar button { display: grid; justify-items: center; gap: 4px; padding: 0; border: 0; background: transparent; color: rgba(242,243,240,.88); font-size: 8px; cursor: pointer; text-shadow: 0 2px 8px #000; }
.model-toolbar button span { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.24); border-radius: 50%; background: rgba(15,21,25,.7); box-shadow: 0 4px 14px rgba(0,0,0,.24); }
.model-toolbar button svg { width: 18px; height: 18px; }
.model-toolbar button b { font-weight: 400; line-height: 1.15; }
.model-toolbar button.is-active span { border-color: rgba(219,184,132,.72); color: var(--gold-light); background: rgba(30,27,23,.8); }

/* Route */
.route-section { position: relative; z-index: 8; padding: 0 11px; background: var(--ink); }
.route-heading { height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.route-heading-copy { min-width: 0; display: flex; align-items: center; gap: 10px; }
.route-heading-copy > svg { flex: 0 0 auto; width: 25px; height: 25px; color: var(--gold-light); }
.route-heading h2 { margin: 0; font-family: var(--serif); font-size: 20.5px; font-weight: 400; line-height: .9; letter-spacing: -.02em; }
.route-heading p { margin: 5px 0 0; color: var(--muted); font-size: 10px; white-space: nowrap; }
.route-heading p i { padding: 0 3px; font-style: normal; }
.start-button { flex: 0 0 auto; min-width: 171px; height: 40px; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 0 16px; border: 0; border-radius: 15px; background: linear-gradient(145deg,#dec08d,#ba9665); color: #12191d; box-shadow: 0 8px 22px rgba(0,0,0,.24), inset 0 1px rgba(255,255,255,.44); margin-right: 10px; font-size: 14px; cursor: pointer; }
.start-button svg { width: 16px; height: 16px; fill: currentColor; stroke: none; }
.start-button:hover { filter: brightness(1.05); }
.stops-card { height: 191px; overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: 11px; background: rgba(17,23,26,.84); scrollbar-width: thin; scrollbar-color: rgba(202,169,120,.55) transparent; }
.stop-row { width: 100%; min-height: 34px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto 17px; align-items: center; gap: 8px; padding: 0 12px; border: 0; border-bottom: 1px solid rgba(255,255,255,.075); background: transparent; color: var(--paper); text-align: left; cursor: pointer; }
.stop-row:last-child { border-bottom: 0; }
.stop-row.is-expanded { min-height: 88px; grid-template-columns: 76px 25px minmax(0,1fr) 35px 36px; gap: 8px; padding: 8px; }
.stop-thumbnail { width: 76px; height: 71px; object-fit: cover; border-radius: 8px; box-shadow: 0 3px 10px rgba(0,0,0,.28); background: #25201b; }
.stop-thumbnail.is-portrait, .audio-player > img.is-portrait { object-fit: contain; }
.stop-number { width: 21px; height: 25px; display: grid; place-items: center; padding-bottom: 3px; border-radius: 52% 52% 52% 8px; transform: rotate(-45deg); background: linear-gradient(145deg,#ddbd87,#b89461); color: #101619; font-family: var(--serif); font-size: 11px; font-weight: 700; }
.stop-number span { transform: rotate(45deg); }
.stop-info { min-width: 0; display: grid; align-content: center; }
.stop-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 15px; font-weight: 400; letter-spacing: -.01em; }
.stop-row.is-expanded .stop-info strong { font-size: 17px; }
.stop-info small { color: var(--muted); font-size: 8px; white-space: nowrap; }
.stop-info p { display: none; margin: 6px 0 0; color: #aeb1b0; font-size: 9px; line-height: 1.35; }
.stop-row.is-expanded .stop-info p { display: block; }
.waveform { display: inline-flex; align-items: center; gap: 1px; margin-left: 5px; color: var(--gold-light); vertical-align: middle; }
.waveform i { width: 1.5px; height: 6px; display: block; background: currentColor; }
.waveform i:nth-child(2), .waveform i:nth-child(5) { height: 3px; }
.waveform i:nth-child(3) { height: 8px; }
.row-duration { color: var(--muted); font-size: 8px; }
.row-play { width: 34px; height: 34px; display: none; place-items: center; border: 1.5px solid var(--gold-light); border-radius: 50%; background: transparent; color: var(--gold-light); }
.stop-row.is-expanded .row-play { display: grid; }
.row-play svg { width: 17px; height: 17px; fill: currentColor; stroke: none; }
.row-state { width: 14px; height: 14px; color: var(--muted); }

/* Persistent player */
.audio-player { position: sticky; z-index: 20; bottom: max(7px, env(safe-area-inset-bottom)); min-height: 79px; display: grid; grid-template-columns: 58px minmax(0,1fr) auto; align-items: center; gap: 10px; margin: 6px -5px 7px; padding: 11px 12px 8px; border: 1px solid rgba(255,255,255,.15); border-radius: 14px; background: linear-gradient(140deg,rgba(36,38,39,.98),rgba(27,29,30,.99)); box-shadow: 0 13px 30px rgba(0,0,0,.44), inset 0 1px rgba(255,255,255,.03); }
.player-grab { position: absolute; top: 6px; left: 50%; width: 27px; height: 3px; border-radius: 4px; transform: translateX(-50%); background: #7d7f80; }
.audio-player > img { width: 58px; height: 58px; object-fit: cover; border-radius: 7px; background: #25201b; }
.player-copy { min-width: 0; display: grid; }
.player-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 15px; font-weight: 400; }
.player-copy > span { color: #b7b8b7; font-size: 8px; }
.progress-track { display: block; height: 11px; margin: 2px 0 -1px; }
.progress-track input { width: 100%; height: 2px; margin: 5px 0 0; display: block; appearance: none; border-radius: 2px; background: linear-gradient(to right,var(--gold-light) 0 0%,#777 0% 100%); }
.progress-track input::-webkit-slider-thumb { width: 7px; height: 7px; appearance: none; border: 0; border-radius: 50%; background: var(--gold-light); }
.progress-track input::-moz-range-thumb { width: 7px; height: 7px; border: 0; border-radius: 50%; background: var(--gold-light); }
.player-times { display: flex; justify-content: space-between; }
.player-times time { color: #9fa1a1; font-size: 7px; }
.player-actions { display: flex; align-items: center; gap: 7px; }
.player-actions button { width: 31px; height: 31px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--paper); cursor: pointer; }
.player-actions button:disabled { opacity: .35; cursor: default; }
.player-actions button svg { width: 26px; height: 26px; }
.player-actions button text { fill: currentColor; stroke: none; font-family: var(--sans); font-size: 7px; text-anchor: middle; }
.player-actions .main-play { width: 39px; height: 39px; border-radius: 50%; background: linear-gradient(145deg,#dbba83,#b9905a); color: #101619; box-shadow: inset 0 1px rgba(255,255,255,.34); }
.main-play svg { width: 19px !important; height: 19px !important; }
.main-play .play-symbol { display: block; fill: currentColor; stroke: none; }
.main-play .pause-symbol { display: none; stroke-width: 3.3; }
.main-play.is-playing .play-symbol { display: none; }
.main-play.is-playing .pause-symbol { display: block; }
#guideAudio { display: none; }

/* Practical information */
.practical { padding: 0 11px 22px; background: var(--ink); }
.practical h2 { display: flex; align-items: center; gap: 9px; margin: 0 6px 5px; font-family: var(--serif); font-size: 16px; font-weight: 400; }
.practical h2 svg { width: 17px; height: 17px; color: #c6c7c5; }
.practical-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.practical-grid > div { min-width: 0; display: grid; grid-template-columns: 22px minmax(0,1fr); gap: 5px; padding: 0 6px; border-right: 1px solid rgba(255,255,255,.13); }
.practical-grid > div:first-child { padding-left: 0; }
.practical-grid > div:last-child { padding-right: 0; border-right: 0; }
.practical-grid svg { width: 20px; height: 20px; color: var(--gold-light); }
.practical-grid p { min-width: 0; margin: 0; display: grid; align-content: start; color: #b0b2b1; font-size: 7px; line-height: 1.4; }
.practical-grid strong { color: var(--gold-light); font-size: 7px; font-weight: 500; line-height: 1.2; }
.practical-grid span, .practical-grid small { overflow-wrap: anywhere; }
.practical-grid small { color: #929595; font-size: 7px; }
.plan-button { width: 100%; height: 32px; display: flex; align-items: center; justify-content: space-between; margin-top: 4px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: rgba(18,24,27,.7); color: #aeb1b1; font-size: 8px; cursor: pointer; }
.plan-button svg { width: 14px; height: 14px; transition: transform .2s ease; }
.plan-button[aria-expanded="true"] svg { transform: rotate(90deg); }
.plan-details { padding: 9px 12px 2px; color: #aeb1b1; font-size: 8px; line-height: 1.5; }
.media-credits { margin: 9px 6px 0; color: #7f8382; font-size: 7px; line-height: 1.5; }
.media-credits a { color: #b89a6b; text-decoration: underline; text-underline-offset: 2px; }

/* Drawer and toast */
.menu-drawer { position: fixed; z-index: 60; top: 0; bottom: 0; left: max(0px,calc(50% - 215px)); width: min(82vw,320px); padding: 70px 25px 25px; background: rgba(16,23,27,.985); box-shadow: 25px 0 70px rgba(0,0,0,.55); }
.menu-drawer[hidden], .drawer-scrim[hidden], .toast[hidden], .plan-details[hidden] { display: none; }
.menu-drawer > button:first-child { position: absolute; top: 17px; right: 18px; border: 0; background: transparent; color: white; font-size: 30px; cursor: pointer; }
.menu-drawer strong { display: block; margin-bottom: 28px; font-family: var(--serif); font-size: 27px; font-weight: 400; }
.menu-drawer a, .menu-drawer > button:last-child { width: 100%; display: block; padding: 15px 0; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: #d8d9d6; text-align: left; text-decoration: none; cursor: pointer; }
.drawer-scrim { position: fixed; z-index: 50; inset: 0; background: rgba(0,0,0,.58); }
.toast { position: fixed; z-index: 80; left: 50%; bottom: max(20px,env(safe-area-inset-bottom)); width: min(calc(100% - 32px),398px); padding: 11px 15px; border: 1px solid rgba(219,185,134,.36); border-radius: 10px; transform: translateX(-50%); background: #24282a; color: #f1eee7; box-shadow: 0 12px 32px rgba(0,0,0,.5); font-size: 11px; line-height: 1.35; text-align: center; }

/* Keep compact artwork while providing dependable mobile touch targets. */
.round-control { position: relative; width: 44px; height: 44px; margin: -8px; border: 0; background: transparent; box-shadow: none; }
.round-control::before { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(255,255,255,.3); border-radius: 50%; background: rgba(12,17,20,.67); box-shadow: 0 4px 14px rgba(0,0,0,.28); }
.round-control svg { position: relative; }
.language-control select { min-height: 44px; margin: -15px 0; padding-top: 15px; padding-bottom: 15px; }
.offline-control { min-width: 44px; min-height: 44px; }
.map-pin::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; }
.model-toolbar button { min-width: 44px; min-height: 44px; }
.start-button { height: 44px; }
.stop-row { min-height: 44px; }
.player-actions button { width: 44px; height: 44px; }
.player-actions .main-play { width: 48px; height: 48px; }
.progress-track { height: 24px; margin: -4px 0 -8px; }
.progress-track input { height: 24px; margin: 0; padding: 0; background-position: center; background-repeat: no-repeat; background-size: 100% 2px; }
.plan-button { height: 44px; }
.menu-drawer > button:first-child { min-width: 44px; min-height: 44px; }

@media (max-width: 370px) {
  .hero-copy h1 { font-size: 46px; }
  .start-button { min-width: 148px; padding: 0 12px; font-size: 12px; }
  .route-heading h2 { font-size: 19px; }
  .route-heading p { font-size: 9px; }
  .stop-row.is-expanded { grid-template-columns: 65px 23px minmax(0,1fr) 31px 14px; gap: 6px; }
  .stop-thumbnail { width: 65px; height: 66px; }
  .player-copy strong { font-size: 13px; }
  .player-actions { gap: 3px; }
  .practical-grid { grid-template-columns: repeat(2,1fr); row-gap: 12px; }
  .practical-grid > div:nth-child(2) { border-right: 0; }
}

@media (min-width: 700px) {
  body { padding: 24px 0; }
  .guide-app { border-radius: 24px; }
}

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