:root {
  color-scheme: dark;
  --ink: #0f1c24;
  --glass: rgba(14, 28, 38, .88);
  --border: rgba(235, 232, 219, .23);
  --warm: #fff6e8;
  --gold: #ebc68a;
  --muted: #c8d0d2;
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Arial, sans-serif;
  color: var(--warm);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, #stage:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
button:disabled { opacity: .45; cursor: default; }
img { display: block; }
#tour, #stage, #stage img, #stage canvas, #hotspots, .vignette { position: absolute; inset: 0; }
#tour { isolation: isolate; overflow: hidden; }
#stage { touch-action: none; cursor: grab; overflow: hidden; background: #142c34; }
#stage[data-dragging] { cursor: grabbing; }
#stage img, #stage canvas { width: 100%; height: 100%; }
#poster { object-fit: cover; background: var(--ink); }
[data-ready="false"] #stage canvas { visibility: hidden; }
.vignette {
  pointer-events: none;
  background:
    radial-gradient(ellipse at left bottom, #06141d90, transparent 43%),
    radial-gradient(ellipse at right bottom, #06141d4f, transparent 32%),
    linear-gradient(180deg, #08141d28 0%, transparent 16%, transparent 84%, #07141e35 100%);
}
.glass { background: var(--glass); border: 1px solid var(--border); box-shadow: 0 12px 36px #05121833; backdrop-filter: blur(14px); }
.topbar {
  position: absolute; top: max(20px, env(safe-area-inset-top)); left: max(22px, env(safe-area-inset-left));
  right: max(22px, env(safe-area-inset-right)); display: flex; justify-content: space-between;
  align-items: start; pointer-events: none; gap: 12px;
}
.topbar > * { pointer-events: auto; }
.brand {
  position: relative; isolation: isolate; flex: 0 0 auto;
  display: flex; align-items: center; gap: 12px; min-height: 58px;
  padding: 6px 18px 6px 9px; text-align: left;
  border: 1px solid #a7cdd257; border-radius: 14px 5px 14px 5px;
  background: radial-gradient(ellipse at top left, #37798470, transparent 72%), linear-gradient(116deg, #102d39f0, #081821f5 80%);
  backdrop-filter: blur(16px) saturate(135%);
  box-shadow: 0 8px 30px #05172258, inset 0 1px #e4ffff16, inset 0 -1px #63adc427;
  transition: box-shadow 180ms ease, border-color 180ms ease;
}
.brand::before, .brand::after { content: ''; position: absolute; pointer-events: none; }
.brand::before {
  top: -1px; left: 14px; width: 60%; height: 1px;
  background: linear-gradient(90deg, #ffdda3, #ebc68a42 57%, transparent);
}
.brand::after {
  right: 4px; bottom: 5px; width: 15px; height: 9px;
  border-right: 1px solid #a0d9e697; border-bottom: 1px solid #a0d9e659;
  border-bottom-right-radius: 7px;
}
.brand:hover, .brand:focus-visible {
  border-color: #e7ca96b3;
  box-shadow: 0 8px 30px #05172265, 0 0 18px #69c7e044, inset 0 1px #e4ffff29;
}
.brand-dial {
  position: relative; display: grid; place-items: center; flex: none; width: 44px; aspect-ratio: 1;
  border-radius: 50%; border: 1px solid #aadce478;
  background: radial-gradient(circle, #3a74894b 30%, #071d29b3 32% 52%, #102e3c 53%);
  box-shadow: inset 0 0 0 3px #071b2499, 0 0 13px #8adcff22;
}
.brand-dial::before {
  content: ''; position: absolute; inset: 4px; border-radius: inherit;
  background: conic-gradient(from -3deg, #f7d392 0 6deg, transparent 6deg),
    repeating-conic-gradient(from -1deg, #b4dfe9a1 0 2deg, transparent 2deg 30deg);
  mask: radial-gradient(circle, transparent 60%, #000 62%);
}
.brand-dial::after {
  content: ''; position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #f7f4dc;
  box-shadow: 0 0 0 1px #091b25;
}
.brand-needle {
  width: 26%; height: 56%; rotate: var(--brand-heading, 0deg);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  background: linear-gradient(#ffe5ab, #d2a468 49%, #b3d9e4 50%, #407b91);
}
.brand-type { display: grid; gap: 3px; }
.brand-firm { line-height: 1; font-size: .66rem; font-weight: 800; letter-spacing: .17em; color: #f2cf94; }
.brand-name { font-size: 1.65rem; line-height: 1.02; font-weight: 650; letter-spacing: -.045em; white-space: nowrap; }
.brand-name span { color: #bceaf2; font-variant-numeric: tabular-nums; font-weight: 550; }
.toolbar { padding: 0 14px; height: 43px; display: inline-flex; align-items: center; gap: 8px; border-radius: 11px; font-size: 13px; font-weight: 700; white-space: nowrap; }
button:not(.pin):hover { border-color: #ebc68a99; }
button[aria-expanded="true"] { border-color: #ebc68ab0; }
#hotspots { pointer-events: none; }
.pin {
  position: absolute; left: var(--pin-x); top: var(--pin-y); transform: translate(-50%, -100%);
  padding: 0 0 17px; border: 0; background: transparent; pointer-events: auto;
  color: var(--warm); text-align: center; white-space: nowrap; filter: drop-shadow(0 3px 8px #0d1a24a6);
  -webkit-tap-highlight-color: transparent;
}
.pin::before, .pin::after { content: ''; display: block; position: absolute; background: var(--gold); left: 50%; }
.pin::before { width: 1px; height: 18px; bottom: 2px; }
.pin::after { width: 6px; height: 6px; bottom: 0; transform: translateX(-2.5px) rotate(45deg); }
.pin-chip {
  min-height: 34px; padding: 0 10px; display: flex; align-items: center; justify-content: center; gap: 7px;
  background: #10232cdb; border: 1px solid #e3bd7f8c; border-radius: 8px;
  font-weight: 680; font-size: clamp(11px, .94vw, 15px); transform: rotate(var(--angle));
  transition: transform 180ms ease, background-color 130ms ease;
}
.pin:hover .pin-chip, .pin:focus-visible .pin-chip { transform: rotate(0) translateY(-2px); }
.pin[data-direction="next"] .pin-chip { background: var(--gold); color: #101c25; }
.pin-small { display: none; }
.pin-glyph { color: var(--gold); }
.pin[data-direction="next"] .pin-glyph { color: #21292b; }
#feature-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.feature-pin {
  position: absolute; z-index: 1; transform: translate(-50%, -100%); white-space: nowrap;
  display: grid; justify-items: center; gap: 7px; border: 0; padding: 0 0 9px; background: none;
  filter: drop-shadow(1px 6px 7px #211a15b3);
}
.feature-sign { display: grid; gap: 2px; font-family: Arial, sans-serif; line-height: 1; text-align: center; }
.feature-sign strong, .feature-sign small {
  color: #f2cd84; background: linear-gradient(#fff4ce 8%, #f4d389 36%, #c28a45 57%, #ffe4a7 79%, #d59b56);
  background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 1px #5d3b1a);
}
.feature-sign strong { font-size: clamp(22px, 3.2vw, 49px); font-weight: 900; letter-spacing: .105em; }
.feature-sign small { font-size: clamp(10px, 1.5vw, 19px); font-weight: 900; letter-spacing: .32em; }
.feature-glyph {
  display: block; position: relative; width: clamp(32px, 4.6vw, 70px); aspect-ratio: 1;
  transform: rotate(-45deg); border-radius: 50% 50% 50% 5%;
  background: conic-gradient(from -6deg, #71451f, #edbc70, #fff6ca, #c38c43, #ffe8ac, #875822, #71451f);
  box-shadow: inset 0 0 0 1px #ffe3a8, inset 0 0 11px #74491e;
  mask-image: radial-gradient(circle, transparent 29%, #000 31%);
}
.feature-glyph::after { content: ''; position: absolute; inset: 20%; border-radius: 50%; box-shadow: 0 0 0 2px #634019, 0 0 0 3px #ffdf9d; }
.feature-caption {
  position: absolute; top: calc(100% + 1px); padding: 5px 10px; border-radius: 6px;
  background: #192431de; color: #ffe4b3; font-size: 11px; font-weight: 700; letter-spacing: .035em;
  border: 1px solid #e4b97870;
}
.feature-pin[data-kind="new"] .feature-sign { display: none; }
.feature-pin[data-kind="new"] .feature-glyph { width: clamp(21px, 3vw, 42px); }
.feature-pin[data-kind="new"] .feature-caption { display: none; }
.feature-pin[data-kind="landmark"] .feature-glyph { width: clamp(28px, 3.25vw, 54px); }
.project-points {
  position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); display: flex; align-items: stretch; gap: 5px; padding: 5px;
  border-radius: 14px; z-index: 1;
}
.project-point {
  position: relative; min-height: 52px; display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px;
  text-align: left; white-space: nowrap; background: #d0e2e00a; border: 1px solid #d7ddd02e;
  border-radius: 9px; transition: background 170ms, border-color 170ms, color 170ms;
}
.project-point img { width: 56px; height: 38px; border-radius: 5px; object-fit: cover; }
.project-point strong, .project-point small { display: block; }
.project-point strong { font-size: 13px; }
.project-point small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.project-point[aria-current="true"] { border-color: #edbe78c4; background: #e1b77724; }
.project-point[aria-current="true"] strong, .point-arrow { color: var(--gold); }
.project-point-new { border-color: #eac68285; background: linear-gradient(125deg,#55402295,#48322143); }
.project-point-new strong { color: #ffe5b2; }
.point-arrow { margin-left: 3px; }
.bottom-ui {
  position: absolute; bottom: max(22px, env(safe-area-inset-bottom)); left: max(23px, env(safe-area-inset-left));
  right: max(23px, env(safe-area-inset-right)); display: flex; justify-content: space-between;
  align-items: end; pointer-events: none; gap: 8px;
}
.now { min-width: 0; }
.chapter { font-size: 12px; color: var(--gold); margin: 0 0 4px; font-weight: 800; letter-spacing: .06em; }
h1 { font: clamp(25px, 3vw, 44px)/1.03 Georgia, 'Times New Roman', serif; margin: 0 0 13px; font-weight: normal; text-shadow: 0 2px 22px #07141e; }
.scene-tools, .actions { display: flex; align-items: center; gap: 8px; }
.scene-tools button, .actions button { pointer-events: auto; }
#hint { font-size: 12px; color: var(--muted); text-shadow: 0 1px 6px #06141f; }
.icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 11px; font-size: 22px; }
.icon[aria-pressed="false"] { color: var(--muted); opacity: .73; }
.drawer, .angle-drawer {
  position: absolute; z-index: 2; border-radius: 16px; padding: 13px; overflow: auto;
  overscroll-behavior: contain; scrollbar-color: #a0835b transparent;
  animation: drawer-in 200ms ease both;
}
.drawer {
  top: max(73px, calc(env(safe-area-inset-top) + 56px)); right: max(22px, env(safe-area-inset-right));
  width: min(360px, calc(100vw - 28px)); max-height: calc(100% - 92px);
}
.drawer-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer h2, .angle-drawer h2 { font: 25px/1.1 Georgia, 'Times New Roman', serif; margin: 0 0 0 4px; }
.icon-close { background: transparent; border: 1px solid var(--border); width: 33px; height: 33px; }
.route-map { height: auto; width: 100%; margin-bottom: 9px; border-radius: 8px; }
#stop-list { display: grid; gap: 5px; }
.stop, .angle { border: 1px solid #adb7b32b; background: #d0e2e00a; border-radius: 9px; text-align: left; }
.stop { display: grid; grid-template-columns: 66px 1fr 20px; align-items: center; gap: 9px; width: 100%; min-height: 55px; padding: 4px 8px 4px 5px; }
.stop img { width: 66px; height: 42px; border-radius: 5px; object-fit: cover; }
.stop-label, .angle span { font-size: 13px; font-weight: 700; }
.stop-desc { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.stop-number { color: var(--gold); font-size: 12px; font-weight: 700; }
.stop[aria-current="true"], .angle[aria-current="true"] { border-color: #e5c085a1; background: #e5c08514; }
.view-mode { font-size: 11px; background: none; padding: 9px 2px 3px; border: 0; color: var(--muted); }
.view-mode:hover, .view-mode[aria-pressed="true"] { color: var(--gold); }
.angle-drawer {
  bottom: max(115px, calc(env(safe-area-inset-bottom) + 104px)); left: max(18px, env(safe-area-inset-left));
  right: max(18px, env(safe-area-inset-right)); max-width: 1170px; margin-inline: auto;
}
@media (max-width: 1000px) {
  .project-points { bottom: max(114px, calc(env(safe-area-inset-bottom) + 102px)); }
  .angle-drawer { z-index: 3; }
}
#angle-list { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 7px; scrollbar-color: #b99b6d transparent; }
.angle { flex: 0 0 154px; padding: 5px; }
.angle img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.angle span { display: block; font-size: 11px; margin: 5px 3px 2px; }
.notice, .skip { position: absolute; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; border-radius: 25px; padding: 10px 16px; font-size: 13px; white-space: nowrap; }
.notice { top: 50%; z-index: 3; }
.skip { top: max(22px, env(safe-area-inset-top)); }
.spinner { border: 1px solid #fff5; border-top-color: var(--gold); border-radius: 50%; width: 13px; height: 13px; animation: spin 700ms linear infinite; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drawer-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 610px) {
  .topbar { left: 13px; right: 13px; top: max(13px, env(safe-area-inset-top)); gap: 6px; }
  .brand { gap: 7px; min-height: 46px; padding: 5px 11px 5px 6px; border-radius: 11px 4px 11px 4px; }
  .brand-dial { width: 32px; }
  .brand-dial::before { inset: 3px; }
  .brand-firm { font-size: .55rem; }
  .brand-name { font-size: 1.15rem; }
  .drawer { right: 13px; top: max(66px, calc(env(safe-area-inset-top) + 52px)); }
  .bottom-ui { left: 13px; right: 13px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .actions { gap: 5px; }
  #hint { display: none; }
  .pin-chip { min-height: 34px; border-radius: 6px; padding: 0 8px; }
  .pin[data-chapter-pin="true"] .pin-chip { width: 36px; height: 36px; border-radius: 50%; padding: 0; transform: none; font-size: 13px; }
  .pin[data-chapter-pin="true"] .pin-label, .pin[data-chapter-pin="true"] .pin-glyph { display: none; }
  .pin-small { display: inline; }
  .skip { top: max(70px, calc(env(safe-area-inset-top) + 60px)); }
  .project-points { left: 13px; right: 13px; bottom: max(118px, calc(env(safe-area-inset-bottom) + 106px)); transform: none; }
  .project-point { flex: 1; min-width: 0; min-height: 51px; padding: 4px 5px; gap: 4px; }
  .project-point img { width: 28px; height: 33px; }
  .project-point strong { font-size: 12px; }
  .project-point small { font-size: 10px; }
  .point-arrow { display: none; }
}
@media (max-width: 370px) {
  .brand { gap: 5px; padding-inline: 5px 7px; }
  .brand-dial { width: 24px; }
  .brand-firm { letter-spacing: .09em; }
  .brand-name { font-size: .93rem; }
  .brand::after { display: none; }
}
@media (max-width: 403px) { .project-point img { display: none; } .project-point { justify-content: center; text-align: center; } }
@media (max-width: 370px) { .zoom { display: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
