/* TASUED Campus World: UI chrome for the 3D "toy diorama island".
   Art direction: docs/3D_ART_DIRECTION.md. No external fonts or images. */

:root {
  --ink: #2B2D42;
  --ink-2: #5A5C78;
  --ink-3: #8C8EA8;
  --paper: #FFFDF8;
  --glass: rgba(255, 255, 255, 0.86);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --line: rgba(43, 45, 66, 0.09);
  --shadow: 0 10px 30px -8px rgba(60, 60, 140, 0.28), 0 2px 6px rgba(60, 60, 140, 0.10);
  --shadow-pop: 0 18px 40px -10px rgba(60, 60, 140, 0.38), 0 3px 8px rgba(60, 60, 140, 0.12);
  --r-xl: 22px;
  --r-lg: 16px;
  --r-md: 12px;
  --pill: 999px;

  --sky: #5EC4FF;
  --sky-2: #D6F3FF;
  --lime: #A6E35A;
  --mint: #7FE3B4;
  --coral: #FF6F5E;
  --coral-2: #FF8A5B;
  --sun: #FFD23F;
  --cream: #FFF1D6;
  --focus: #4D7CFF;

  --k-academic: #7B5CFF;
  --k-admin: #FF4FA3;
  --k-hostel: #FFB000;
  --k-food: #FF6B2C;
  --k-shop: #F28C28;
  --k-sport: #18C27A;
  --k-worship: #22C3E6;
  --k-gate: #FF3B5C;
  --k-health: #FF5A5A;
  --k-library: #4D7CFF;
  --k-other: #2B2D42;

  --drawer-w: 340px;
  --gap: 16px;
  --top-h: 56px;
  --sheet-peek: 96px;

  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Quicksand", system-ui, -apple-system, "Segoe UI", "Ubuntu", "Cantarell", "Noto Sans", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "DejaVu Sans Mono", monospace;
  --ease: cubic-bezier(.2, .9, .25, 1.15);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

.reference-launch { position: fixed; z-index: 25; left: var(--gap); bottom: max(var(--gap), env(safe-area-inset-bottom)); font-size: 11px; color: var(--ink-2); }
.campus-start { position: fixed; z-index: 10; top: calc(var(--gap) * 2 + var(--top-h)); left: var(--gap); display: grid; justify-items: start; gap: 8px; max-width: calc(100vw - var(--drawer-w) - var(--gap) * 3); padding: 12px; border-radius: var(--r-xl); }
.campus-start__places { display: flex; flex-wrap: wrap; gap: 6px; }
.campus-start__row { display: flex; align-items: center; gap: 6px; width: 100%; min-width: 0; }
.campus-start__select { flex: 1; min-width: 0; width: 150px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--pill); padding: 8px 10px; background: rgba(255,255,255,.8); color: var(--ink); font: inherit; font-size: 12px; font-weight: 700; }
.campus-start__row .pill-btn { flex: none; }
.campus-start .pill-btn { font-size: 12px; }
.campus-start__note { font-size: 10px; color: var(--ink-2); }
.campus-start button:disabled { opacity: .5; cursor: wait; }
body[data-state="loading"] .campus-start { visibility: hidden; }
@media (max-width: 760px) {
  .campus-start { max-width: calc(100vw - var(--gap) * 2); padding: 8px; gap: 6px; }
  .campus-start .pill-btn { min-height: 36px; padding: 6px 10px; font-size: 11px; }
  .campus-start__note { font-size: 9px; }
}
.reference { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 20px; border: 1px solid var(--line); border-radius: var(--r-xl); color: var(--ink); box-shadow: var(--shadow-pop); overflow: auto; }
.reference::backdrop { background: rgba(25, 32, 56, .55); }
.reference__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.reference__head h2 { font-size: 20px; margin: 0; }
.reference p { font-size: 13px; line-height: 1.5; }
.reference__privacy { color: var(--ink-2); }
.reference__frame { height: min(55dvh, 540px); min-height: 180px; border-radius: var(--r-md); overflow: hidden; background: var(--sky-2); }
.reference__frame iframe { width: 100%; height: 100%; border: 0; display: block; }
/* Walking is desktop-only: hide every walk entry point on phones / touch-first devices. */
body[data-walk="off"] .explore-dock,
body[data-walk="off"] .walkhint,
body[data-walk="off"] [data-action="start-walk"],
body[data-walk="off"] [data-action="card-walk"],
body[data-walk="off"] [data-action="help-start"][data-value="walk"] { display: none !important; }
@media (max-width: 760px) {
  .reference-launch { bottom: calc(var(--sheet-peek) + 12px); }
  body[data-drawer="open"] .reference-launch { bottom: calc(min(62vh, 560px) + 12px); }
  .reference { padding: 14px; }
  .reference__head { align-items: flex-start; }
  .card__actions { gap: 6px; }
  .card__actions .pill-btn { flex: 1 1 auto; justify-content: center; min-height: 40px; }
  .campus-start__places .pill-btn { flex: 1 1 auto; }
}

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Sky shows instantly, before WebGL, and behind any transparent canvas. */
  background: linear-gradient(180deg, #5EC4FF 0%, #9ADBFF 48%, #D6F3FF 100%);
  overscroll-behavior: none;
}

body[data-time="sunset"] { background: linear-gradient(180deg, #FF8F7A 0%, #FFB48A 50%, #FFD7A0 100%); }

button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
svg { display: block; }
[hidden] { display: none !important; }

.sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--pill);
  background: var(--ink); color: #fff; font-weight: 800; text-decoration: none;
  transition: top .2s var(--ease-out);
}
.skip:focus { top: 12px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* ---------- 3D viewport (engine owns contents) ---------- */

#viewport {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  touch-action: none;
  outline: none;
}
#viewport > canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  outline: none;
}
#viewport > canvas:focus-visible { box-shadow: inset 0 0 0 4px rgba(77, 124, 255, .55); }

/* Soft vignette that lifts chrome edges without dimming the world centre */
body::after {
  content: "";
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 62%, rgba(43, 45, 110, .10) 100%);
}

/* ---------- Glass surface ---------- */

.glass {
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, .7);
  box-shadow: var(--shadow);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-strong); }
}

/* ---------- Buttons ---------- */

.icon-btn {
  display: inline-grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: var(--pill);
  background: transparent;
  color: var(--ink);
  transition: background .18s, transform .25s var(--ease), color .18s;
}
.icon-btn svg, .seg__btn svg, .search svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}
.icon-btn svg .fill, .seg__btn svg .fill { fill: currentColor; stroke: none; }
.icon-btn:hover { background: rgba(43, 45, 66, .07); }
.icon-btn:active { transform: scale(.88); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: #fff; }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm svg { width: 18px; height: 18px; }

.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 0; border-radius: var(--pill);
  background: rgba(43, 45, 66, .07);
  font-weight: 800; font-size: 14px;
  transition: transform .25s var(--ease), background .18s, box-shadow .18s;
}
.pill-btn:hover { background: rgba(43, 45, 66, .12); }
.pill-btn:active { transform: scale(.94); }
.pill-btn--primary {
  background: var(--coral); color: #fff;
  box-shadow: 0 6px 14px -6px rgba(255, 111, 94, .9), inset 0 -3px 0 rgba(0, 0, 0, .12);
}
.pill-btn--primary:hover { background: #FF5C49; }

/* ---------- Brand chip (top-left) ---------- */

.brand {
  position: fixed; z-index: 10;
  top: var(--gap); left: var(--gap);
  display: flex; align-items: center; gap: 10px;
  height: var(--top-h); padding: 0 18px 0 8px;
  border-radius: var(--pill);
  animation: pop-in .6s var(--ease) both;
}
.brand__mark {
  width: 40px; height: 40px;
  animation: bob 3.2s ease-in-out infinite;
}
.brand__text { display: grid; line-height: 1.05; }
.brand__text strong { font-size: 18px; font-weight: 900; letter-spacing: .02em; }
.brand__text span { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.brand__text em {
  font-style: normal; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em;
  margin-left: 4px; padding: 1px 6px; border-radius: var(--pill);
  background: var(--sun); color: var(--ink);
}

/* ---------- Control pill (top-right) ---------- */

.controls {
  position: fixed; z-index: 10;
  top: var(--gap); right: var(--gap);
  display: flex; align-items: center; gap: 4px;
  height: var(--top-h); padding: 0 8px;
  border-radius: var(--pill);
  animation: pop-in .6s .08s var(--ease) both;
}
.controls__sep { width: 1px; height: 24px; margin: 0 4px; background: var(--line); }

.seg {
  position: relative;
  display: flex; padding: 3px; gap: 2px;
  border-radius: var(--pill);
  background: rgba(43, 45, 66, .07);
}
.seg__btn {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px 0 10px;
  border: 0; border-radius: var(--pill);
  background: transparent;
  font-weight: 800; font-size: 14px;
  color: var(--ink-2);
  transition: color .2s, background .25s var(--ease-out), box-shadow .25s;
}
.seg__btn svg { width: 20px; height: 20px; }
.seg__btn[aria-checked="true"] {
  background: #fff; color: var(--ink);
  box-shadow: 0 3px 10px -3px rgba(60, 60, 140, .35);
}
.seg__btn[data-value="walk"][aria-checked="true"] { background: var(--sun); }

[data-action="time"] .ico-sunset { display: none; }
body[data-time="sunset"] [data-action="time"] .ico-day { display: none; }
body[data-time="sunset"] [data-action="time"] .ico-sunset { display: block; }
[data-action="time"] .sun { color: #FFB000; }
[data-action="time"] svg { color: var(--ink); }
[data-action="time"] .sun { fill: #FFC21A; }
[data-action="time"] .dusk { fill: #FF8F7A; }
[data-action="time"][aria-pressed="true"] { background: #FFE3D2; color: var(--ink); }

[data-action="labels"][aria-pressed="true"] { background: var(--ink); color: #fff; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 12px;
  border: 0; border-radius: var(--pill);
  background: rgba(43, 45, 66, .07);
  font-size: 12.5px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  transition: background .2s, transform .25s var(--ease);
}
.chip-btn:active { transform: scale(.92); }
.chip-btn__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 3px rgba(127, 227, 180, .35);
}
.chip-btn[aria-pressed="true"] { background: #EEE8FF; }
.chip-btn[aria-pressed="true"] .chip-btn__dot {
  background: linear-gradient(135deg, #7B5CFF, #FF4FA3);
  box-shadow: 0 0 0 3px rgba(123, 92, 255, .25);
}

[data-action="export"].is-busy svg { animation: nudge 0.9s ease-in-out infinite; }

/* ---------- Camera stack (bottom-right, left of drawer) ---------- */

.camstack {
  position: fixed; z-index: 10;
  right: calc(var(--drawer-w) + var(--gap) * 2);
  bottom: var(--gap);
  display: grid; gap: 2px; padding: 6px;
  border-radius: 26px;
  transition: right .45s var(--ease-out);
  animation: pop-in .6s .16s var(--ease) both;
}
body[data-drawer="closed"] .camstack { right: var(--gap); }
.icon-btn--home { background: var(--coral); color: #fff; margin-top: 4px; }
.icon-btn--home:hover { background: #FF5C49; }

/* ---------- Walk hint ---------- */

.walkhint {
  position: fixed; z-index: 10;
  left: 50%; bottom: var(--gap);
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px 8px 10px;
  border-radius: var(--pill);
  font-size: 13px; font-weight: 800; color: var(--ink-2);
  transform: translate(-50%, 140%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s var(--ease), opacity .3s;
}
body[data-mode="walk"] .walkhint { transform: translate(-50%, 0); opacity: 1; }
body[data-drawer="open"] .walkhint { left: calc(50% - var(--drawer-w) / 2); }
.keys { display: inline-flex; gap: 3px; margin-left: 6px; }
kbd {
  display: inline-grid; place-items: center;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 7px;
  background: #fff; color: var(--ink);
  font-family: var(--font); font-size: 11.5px; font-weight: 900;
  box-shadow: inset 0 -2px 0 rgba(43, 45, 66, .15), 0 0 0 1px var(--line);
}

/* ---------- Place card (bottom-left) ---------- */

.card {
  position: fixed; z-index: 12;
  left: var(--gap); bottom: var(--gap);
  width: min(380px, calc(100vw - var(--gap) * 2));
  padding: 16px 16px 14px;
  border-radius: var(--r-xl);
  --kc: var(--k-other);
  animation: card-in .24s var(--ease) both;
}
.card__head { display: flex; align-items: flex-start; gap: 12px; }
.card__glyph {
  flex: none; display: grid; place-items: center;
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--kc); color: #fff;
  box-shadow: 0 8px 16px -8px var(--kc), inset 0 -3px 0 rgba(0, 0, 0, .14);
  transform: rotate(-4deg);
}
.card__glyph svg { width: 26px; height: 26px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.card__titles { flex: 1; min-width: 0; }
.card__kind {
  margin: 2px 0 2px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
  color: var(--kc);
}
.card__title {
  margin: 0; font-size: 20px; line-height: 1.15; font-weight: 900; letter-spacing: -.01em;
  overflow-wrap: anywhere; outline: none;
}
.card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.card__desc {
  margin: 10px 0 0; font-size: 14px; line-height: 1.5; color: var(--ink-2);
  max-height: 7.5em; overflow: auto;
}
.card__desc:empty { display: none; }
.card__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }
.card__tournav {
  display: inline-flex; align-items: center; gap: 2px; margin-left: auto;
  font-size: 13px; font-weight: 900; color: var(--ink-2);
}

/* ---------- Badges ---------- */

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px 0 7px;
  border-radius: var(--pill);
  font-size: 11px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--surveyed { background: #DDF8EA; color: #0E9A5C; }
.badge--osm { background: #E1ECFF; color: #2E5FE0; }
.badge--modeled { background: #EEE8FF; color: #6B48F0; }
.badge--unverified { background: #FFF1D1; color: #B87400; }
.badge--plain { background: rgba(43, 45, 66, .07); color: var(--ink-2); }
.badge--plain::before { display: none; }

/* ---------- Drawer ---------- */

.drawer {
  position: fixed; z-index: 11;
  top: calc(var(--gap) * 2 + var(--top-h) - 4px);
  right: var(--gap);
  bottom: var(--gap);
  width: var(--drawer-w);
  display: flex; flex-direction: column;
  border-radius: var(--r-xl);
  overflow: hidden;
  transition: transform .24s var(--ease-out), opacity .18s;
  animation: slide-in .7s .2s var(--ease-out) both;
}
body[data-drawer="closed"] .drawer {
  transform: translateX(calc(100% + var(--gap) * 2));
  opacity: 0; pointer-events: none;
  visibility: hidden;
  transition: transform .18s var(--ease-out), opacity .16s, visibility 0s .18s;
}
.drawer__grip { display: none; }

.tabs {
  display: flex; gap: 4px;
  margin: 12px 12px 0; padding: 4px;
  border-radius: var(--pill);
  background: rgba(43, 45, 66, .06);
}
.tab {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; border: 0; border-radius: var(--pill);
  background: transparent;
  font-weight: 900; font-size: 14px; color: var(--ink-2);
  transition: background .2s, color .2s, box-shadow .2s;
}
.tab[aria-selected="true"] { background: #fff; color: var(--ink); box-shadow: 0 3px 10px -4px rgba(60, 60, 140, .4); }
.tab__count {
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--pill);
  display: inline-grid; place-items: center;
  background: rgba(43, 45, 66, .08); font-size: 11.5px;
}
.tab[aria-selected="true"] .tab__count { background: var(--coral); color: #fff; }

.panel {
  flex: 1; min-height: 0;
  display: flex; flex-direction: column;
  padding: 12px 12px 0;
}

.search {
  display: flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 14px;
  border-radius: var(--pill);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .2s;
}
.search:focus-within { box-shadow: inset 0 0 0 2.5px var(--focus); }
.search svg { width: 20px; height: 20px; color: var(--ink-3); flex: none; }
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  font-weight: 700; font-size: 15px;
}
.search input::placeholder { color: var(--ink-3); }
.search input::-webkit-search-cancel-button { cursor: pointer; }

.filters {
  display: flex; gap: 6px;
  margin: 10px -12px 0; padding: 2px 12px 6px;
  overflow-x: auto; scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.filter {
  flex: none;
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px 0 8px;
  border: 0; border-radius: var(--pill);
  background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line);
  font-size: 13px; font-weight: 800; text-transform: capitalize;
  transition: transform .2s var(--ease), background .2s, color .2s, box-shadow .2s;
}
.filter:active { transform: scale(.93); }
.filter__dot { width: 12px; height: 12px; border-radius: 50%; background: var(--kc, var(--ink)); }
.filter[aria-pressed="true"] { background: var(--kc, var(--ink)); color: #fff; box-shadow: 0 5px 12px -6px var(--kc, var(--ink)); }
.filter[aria-pressed="true"] .filter__dot { background: #fff; }

.places, .tours {
  flex: 1; min-height: 0;
  list-style: none; margin: 6px -12px 0; padding: 0 8px 12px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: rgba(43, 45, 66, .2) transparent;
}

.place {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; margin: 2px 0;
  border: 0; border-radius: var(--r-lg);
  background: transparent; text-align: left;
  --kc: var(--k-other);
  transition: background .18s, transform .25s var(--ease);
}
.place:hover { background: rgba(255, 255, 255, .85); }
.place:active { transform: scale(.98); }
.place[aria-current="true"] { background: #fff; box-shadow: inset 0 0 0 2px var(--kc), 0 6px 16px -10px var(--kc); }
.place__pin {
  flex: none; position: relative;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50% 50% 50% 12px;
  transform: rotate(-45deg);
  background: var(--kc);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14), 0 5px 10px -5px var(--kc);
}
.place__pin svg { width: 20px; height: 20px; transform: rotate(45deg); fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.place:hover .place__pin { animation: wiggle .5s var(--ease); }
.place__body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.place__name {
  font-size: 15px; font-weight: 800; line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place__meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; font-weight: 700; color: var(--ink-3); text-transform: capitalize; }
.place__meta .badge { height: 19px; font-size: 10px; padding: 0 7px 0 6px; }

.tour {
  display: block; width: 100%; margin: 4px 0;
  padding: 14px; border: 0; border-radius: var(--r-lg);
  background: #fff; text-align: left;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .25s var(--ease), box-shadow .2s;
}
.tour:hover { box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.tour:active { transform: scale(.98); }
.tour[aria-current="true"] { box-shadow: inset 0 0 0 2.5px var(--coral), var(--shadow); }
.tour__top { display: flex; align-items: center; gap: 10px; }
.tour__num {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 12px;
  background: linear-gradient(135deg, var(--coral), #FFB04A);
  color: #fff; font-weight: 900; font-size: 15px;
  transform: rotate(-5deg);
}
.tour__name { font-weight: 900; font-size: 15.5px; }
.tour__desc { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.tour__stops { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.tour__stop {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--kc, var(--ink));
  box-shadow: 0 0 0 2px #fff;
}
.tour__stop.is-here { outline: 2.5px solid var(--ink); outline-offset: 1px; }

.empty {
  margin: 14px 4px; padding: 16px;
  border-radius: var(--r-lg);
  background: repeating-linear-gradient(-45deg, rgba(166, 227, 90, .16) 0 10px, rgba(166, 227, 90, .06) 10px 20px);
  font-size: 13.5px; line-height: 1.5; color: var(--ink-2);
}
.empty p { margin: 0 0 4px; }
.empty strong { color: var(--ink); }

.drawer__foot {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 248, .6);
  font-size: 11.5px; line-height: 1.45; color: var(--ink-3);
}
.legend summary {
  cursor: pointer; font-weight: 800; color: var(--ink-2); font-size: 12.5px;
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.legend summary::-webkit-details-marker { display: none; }
.legend summary::before {
  content: "?"; display: inline-grid; place-items: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--sun); color: var(--ink); font-weight: 900; font-size: 11px;
}
.legend ul { list-style: none; margin: 8px 0 4px; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend .badge { flex: none; }
.honesty { margin: 8px 0 0; }

/* ---------- Toast ---------- */

.toast {
  position: fixed; z-index: 20;
  pointer-events: none;
  left: 50%; top: calc(var(--gap) + var(--top-h) + 14px);
  max-width: min(440px, calc(100vw - 32px));
  padding: 10px 18px 10px 14px;
  border-radius: var(--pill);
  display: flex; align-items: center; gap: 10px;
  font-size: 13.5px; font-weight: 800;
  transform: translateX(-50%);
  animation: toast-in .45s var(--ease) both;
}
body[data-drawer="open"] .toast { left: calc(50% - var(--drawer-w) / 2); }
.toast::before {
  content: ""; flex: none; width: 10px; height: 10px; border-radius: 50%;
  background: var(--mint); box-shadow: 0 0 0 4px rgba(127, 227, 180, .35);
}
.toast[data-level="error"]::before { background: var(--k-gate); box-shadow: 0 0 0 4px rgba(255, 59, 92, .25); }
.toast[data-level="busy"]::before { background: var(--sky); animation: pulse 1s ease-in-out infinite; }

/* ---------- Loading overlay ---------- */

.loading {
  position: fixed; inset: 0; z-index: 30;
  display: grid; place-items: center;
  background:
    radial-gradient(60% 50% at 50% 40%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, #5EC4FF 0%, #9ADBFF 50%, #D6F3FF 100%);
  transition: opacity .6s ease, visibility 0s .6s;
}
.loading.is-done { opacity: 0; visibility: hidden; pointer-events: none; }
.loading__card { display: grid; justify-items: center; text-align: center; padding: 24px; }
.loading__island { width: 200px; height: 150px; overflow: visible; }
.li-float { animation: float 2.8s ease-in-out infinite; transform-origin: 80px 60px; }
.li-shadow { fill: rgba(60, 60, 140, .18); animation: shadow 2.8s ease-in-out infinite; transform-origin: 80px 108px; }
.li-skirt { fill: #C98B5E; }
.li-top { fill: #A6E35A; stroke: #E9B98A; stroke-width: 2; }
.li-wall { fill: #FFF1D6; }
.li-roof { fill: #FF6F5E; }
.li-roof2 { fill: #FFB04A; }
.li-tree { fill: #49C46A; }
.li-tree2 { fill: #8BDB4F; }
.li-trunk { fill: #A8693F; }
.li-pin { fill: #7B5CFF; animation: pin-drop 2.8s var(--ease) infinite; transform-origin: 80px 29px; }
.loading__title { margin: 14px 0 4px; font-size: 22px; font-weight: 900; color: #fff; text-shadow: 0 2px 0 rgba(43, 45, 110, .18); }
.loading__text { margin: 0; min-height: 1.4em; font-size: 14px; font-weight: 700; color: rgba(43, 45, 66, .75); }
.loading__bar {
  width: 220px; height: 10px; margin-top: 14px;
  border-radius: var(--pill); background: rgba(255, 255, 255, .55); overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(43, 45, 110, .15);
}
.loading__bar span {
  display: block; height: 100%; width: 30%;
  border-radius: inherit;
  background: linear-gradient(90deg, #FF6F5E, #FFB04A, #A6E35A);
  transition: width .35s var(--ease-out);
}
.loading:not([data-progress]) .loading__bar span { animation: indeterminate 1.4s ease-in-out infinite; }
.loading[data-level="error"] .loading__title { color: #fff; }
.loading[data-level="error"] .li-float, .loading[data-level="error"] .li-pin { animation-play-state: paused; }
.loading[data-level="error"] .loading__bar { display: none; }
.loading__retry { margin-top: 16px; }

.nojs {
  position: fixed; inset: auto 16px 16px; z-index: 50;
  padding: 14px 18px; border-radius: var(--r-lg);
  background: #fff; font-weight: 700; box-shadow: var(--shadow);
}

/* While loading, hide chrome so the island reveal is clean */
body[data-state="loading"] .brand,
body[data-state="loading"] .controls,
body[data-state="loading"] .camstack,
body[data-state="loading"] .drawer { visibility: hidden; }

/* ---------- Animations ---------- */

@keyframes pop-in { from { opacity: 0; transform: translateY(-10px) scale(.92); } }
@keyframes slide-in { from { opacity: 0; transform: translateX(30px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(24px) scale(.96); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -10px) scale(.95); } }
@keyframes bob { 50% { transform: translateY(-2px); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes shadow { 50% { transform: scaleX(.86); opacity: .7; } }
@keyframes pin-drop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes wiggle { 30% { transform: rotate(-55deg) scale(1.08); } 65% { transform: rotate(-38deg) scale(1.04); } }
@keyframes pulse { 50% { transform: scale(.7); opacity: .6; } }
@keyframes nudge { 50% { transform: translateY(3px); } }
@keyframes indeterminate { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* ---------- Responsive: bottom sheet ---------- */

@media (max-width: 1100px) {
  :root { --drawer-w: 310px; }
  .seg__btn span { display: none; }
  .seg__btn { padding: 0 10px; }
}

@media (max-width: 760px) {
  :root { --gap: 10px; --top-h: 50px; }

  .brand { padding: 0 12px 0 6px; gap: 6px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__text strong { font-size: 15px; }
  .brand__text span { display: none; }

  .controls { padding: 0 4px; gap: 0; }
  .controls__sep { margin: 0 2px; }
  .icon-btn { width: 38px; height: 38px; }
  .seg__btn { height: 34px; }
  .chip-btn { padding: 0 9px; }
  [data-quality-label] { display: none; }
  .controls [data-action="drawer"] { display: none; }

  .drawer {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: min(62vh, 560px);
    border-radius: 26px 26px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: none;
    transform: translateY(0);
  }
  body[data-drawer="closed"] .drawer {
    transform: translateY(calc(100% - var(--sheet-peek)));
    opacity: 1; visibility: visible; pointer-events: auto;
  }
  body[data-drawer="closed"] .drawer .panel,
  body[data-drawer="closed"] .drawer .drawer__foot { visibility: hidden; }
  .drawer__grip {
    display: grid; place-items: center;
    width: 100%; height: 22px; padding: 0;
    border: 0; background: transparent;
  }
  .drawer__grip span { width: 44px; height: 5px; border-radius: var(--pill); background: rgba(43, 45, 66, .22); }
  .tabs { margin-top: 2px; }

  .camstack {
    right: var(--gap);
    bottom: calc(var(--sheet-peek) + var(--gap));
    grid-auto-flow: row;
  }
  body[data-drawer="open"] .camstack,
  body[data-drawer="open"] .walkhint { opacity: 0; pointer-events: none; }
  body[data-drawer="closed"] .camstack { right: var(--gap); }

  .card {
    left: var(--gap); right: var(--gap); width: auto;
    bottom: calc(var(--sheet-peek) + var(--gap));
    z-index: 13;
    max-height: calc(100dvh - var(--top-h) - var(--sheet-peek) - var(--gap) * 4);
  }
  body[data-drawer="closed"] .card { right: calc(var(--gap) * 2 + 38px); }
  body[data-drawer="open"] .card { bottom: calc(min(62vh, 560px) + var(--gap)); }

  .walkhint, body[data-drawer="open"] .walkhint { left: 50%; bottom: calc(var(--sheet-peek) + var(--gap)); }
  .walkhint .keys:nth-of-type(n+2), .walkhint { font-size: 12px; }
  body[data-mode="walk"] .card ~ .walkhint { display: none; }
  .toast, body[data-drawer="open"] .toast { left: 50%; }
}

@media (max-height: 560px) and (min-width: 761px) {
  .camstack { grid-auto-flow: column; }
}

/* ---------- Motion & contrast preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media (prefers-contrast: more) {
  :root { --glass: #fff; --line: rgba(43, 45, 66, .35); --ink-2: #2B2D42; --ink-3: #44465E; }
  .glass { border-color: var(--ink); }
}

@media (forced-colors: active) {
  .glass { border: 1px solid CanvasText; }
  .seg__btn[aria-checked="true"], .icon-btn[aria-pressed="true"], .filter[aria-pressed="true"] { outline: 2px solid Highlight; }
}

/* ---------- Model studio ---------- */

.studio-intro {
  padding: 12px 14px; border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(123, 92, 255, .10), rgba(255, 79, 163, .08));
  font-size: 13px; line-height: 1.45; color: var(--ink-2);
}
.studio-intro p { margin: 0; }
.studio-intro p + p { margin-top: 4px; }
.studio-intro strong { color: var(--ink); }

.models {
  flex: 1; min-height: 0;
  list-style: none; margin: 10px -12px 0; padding: 0 12px 8px;
  overflow-y: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start;
  scrollbar-width: thin;
}
.model {
  display: flex; flex-direction: column; width: 100%; height: 100%;
  padding: 0; border: 0; border-radius: var(--r-lg); overflow: hidden;
  background: #fff; text-align: left;
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .25s var(--ease), box-shadow .2s;
}
.model:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1.5px var(--line), var(--shadow); }
.model:active { transform: scale(.97); }
.model[aria-current="true"] { box-shadow: inset 0 0 0 3px var(--k-academic), var(--shadow); }
.model__thumb {
  position: relative; display: block; aspect-ratio: 3 / 2;
  background: linear-gradient(180deg, #9ADBFF, #D6F3FF);
  overflow: hidden;
}
.model__thumb img, .model__thumb svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.model__thumb::after {
  content: "Photo"; position: absolute; left: 6px; top: 6px;
  padding: 2px 7px; border-radius: var(--pill);
  background: rgba(43, 45, 66, .72); color: #fff;
  font-size: 9.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase;
}
.model__thumb[data-art]::after { content: "Illustration"; }
.model__body { display: grid; gap: 6px; padding: 9px 10px 11px; }
.model__name { font-size: 14px; font-weight: 900; line-height: 1.2; }
.model__body .badge { justify-self: start; height: 19px; font-size: 9.5px; padding: 0 7px 0 6px; }

.badge--placement { background: #FFE3E8; color: #D02447; }
.badge--approx { background: #FFF1D1; color: #B87400; }

.credits {
  margin: 4px 0 10px; font-size: 11px; line-height: 1.45; color: var(--ink-3);
}
.credits a, .studio__credit a { color: var(--k-library); font-weight: 800; }

.studio-banner {
  position: fixed; z-index: 10;
  left: 50%; top: var(--gap);
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 4px; border-radius: var(--pill);
  font-weight: 900; font-size: 15px;
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  transition: transform .2s var(--ease), opacity .2s;
}
.studio-banner__dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: linear-gradient(135deg, #7B5CFF, #FF4FA3);
  box-shadow: 0 0 0 4px rgba(123, 92, 255, .2);
}
.studio-banner__sub { font-size: 12px; font-weight: 800; color: var(--ink-3); }
body[data-view="studio"] .studio-banner { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
body[data-view="studio"][data-drawer="open"] .studio-banner { left: calc(50% - var(--drawer-w) / 2); }

.card--studio { --kc: var(--k-academic); width: min(400px, calc(100vw - var(--gap) * 2)); }
.studio-banner .pill-btn { min-height: 44px; white-space: nowrap; }
.studio-banner [aria-expanded="true"] { background: var(--ink); color: white; }
.card--studio .card__head { position: sticky; top: -16px; z-index: 1; background: var(--glass, #fffdf8); padding: 12px 0; margin-top: -12px; }
.studio-info-close { flex: none; min-width: 44px; min-height: 44px; }
.studio__photo {
  margin: 8px -4px 12px; border-radius: 14px; overflow: hidden;
  aspect-ratio: 3 / 1.25; background: linear-gradient(180deg, #9ADBFF, #D6F3FF);
}
.studio__photo:empty { display: none; }
.studio__photo img, .studio__photo svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.studio__credit { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
.studio__credit:empty { display: none; }
.card--studio .pill-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; margin-left: -4px; }

body[data-view="studio"] #placecard,
body[data-view="studio"] .walkhint,
body[data-view="studio"] .seg { display: none !important; }
body[data-view="studio"] .controls__sep:first-of-type { display: none; }

@media (max-width: 760px) {
  .models { grid-template-columns: 1fr 1fr; }
  .studio-banner { top: calc(var(--gap) * 2 + var(--top-h)); height: 40px; font-size: 13px; }
  .studio-banner__sub { display: none; }
  body[data-view="studio"][data-drawer="open"] .studio-banner { left: 50%; }
  .card--studio { left: var(--gap); right: var(--gap); width: auto; bottom: calc(var(--sheet-peek) + var(--gap)); z-index: 13; }
  body[data-drawer="open"] .card--studio { bottom: calc(min(62vh, 560px) + var(--gap)); }
  .studio__photo { aspect-ratio: 3 / 1; }
}
@media (max-width: 420px) {
  .card--studio .studio__photo { display: none; }
}

.attribution { margin: 6px 0 0; font-size: 10.5px; }
.attribution a { color: inherit; font-weight: 800; text-decoration-color: rgba(43, 45, 66, .3); }
.attribution a:hover { color: var(--ink); }

/* ===================================================================
   Additions on top of the original chrome (2D/3D, void, evidence).
   =================================================================== */

/* Bright void behind the transparent renderer (no sky disc, no fog). */
html, body {
  background: radial-gradient(120% 95% at 50% 46%, #FBF8FF 0%, #EEEDFD 45%, #D9DEFA 100%) fixed;
}
body[data-time="sunset"] {
  background: radial-gradient(120% 95% at 50% 46%, #FFF4EA 0%, #FBDCD2 50%, #F6C9C0 100%) fixed;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .8) 1.2px, transparent 1.6px);
  background-size: 24px 24px;
  opacity: 0; transition: opacity .5s;
}
body[data-mapview="2d"]::before { opacity: 1; }
#viewport { z-index: 1; background: transparent; }

/* 2D / 3D segment inside the original control pill */
.seg--view { background: linear-gradient(135deg, rgba(123, 92, 255, .12), rgba(77, 124, 255, .12)); }
.seg--view .seg__btn { padding: 0 13px; font-weight: 900; letter-spacing: .02em; }
.seg--view .seg__btn[aria-checked="true"] { color: #fff; background: linear-gradient(135deg, #7B5CFF, #FF4FA3); box-shadow: 0 4px 12px -4px rgba(123, 92, 255, .8); }
body[data-mapview="2d"] .seg--view .seg__btn[aria-checked="true"] { background: linear-gradient(135deg, #2BB0FF, #4D7CFF); box-shadow: 0 4px 12px -4px rgba(77, 124, 255, .8); }
.seg--view .seg__txt { display: inline !important; }
body[data-mapview="2d"] [data-action="time"],
body[data-mapview="2d"] [data-action="quality"] { display: none; }

/* Source colours (match engine palette) */
.sw { flex: none; display: inline-block; width: 16px; height: 11px; border-radius: 3px; vertical-align: -1px; }
.sw--osm { background: #FF7A5C; box-shadow: inset 0 0 0 1.5px #D9533F; }
.sw--ml { background: #F6C35B; outline: 1.5px dashed #C99A2E; outline-offset: -1.5px; }
.sw--crop { height: 0; border-top: 2.5px dashed #8C7BD6; border-radius: 0; }
.srckey { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 8px 0 0; font-weight: 800; color: var(--ink-2); }
.srckey span { display: inline-flex; align-items: center; gap: 6px; }
.badge--ml { background: #FFF1D1; color: #9A6E0E; }

/* Building / reference facts on the original place card */
.facts {
  display: grid; grid-template-columns: auto 1fr;
  margin: 12px 0 0; border-radius: 14px; overflow: hidden;
  background: rgba(43, 45, 66, .04); font-size: 13px;
}
.facts dt, .facts dd { margin: 0; padding: 7px 10px; border-top: 1px solid var(--line); }
.facts dt:first-of-type, .facts dt:first-of-type + dd { border-top: 0; }
.facts dt { font-weight: 800; color: var(--ink-3); white-space: nowrap; }
.facts dd { font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.facts .unknown { color: var(--ink-3); font-style: italic; font-weight: 700; }
.card__links { margin: 8px 0 0; display: grid; gap: 4px; font-size: 12px; font-weight: 800; }
.card__links .source-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 32px; padding: 4px 12px; border-radius: var(--pill); background: rgba(43,45,66,.05); color: var(--k-library); text-decoration: none; }
.card__links .source-row span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card__links .source-row:hover { background: rgba(43,45,66,.09); }
.card__links .source-row:focus-visible { outline: 2px solid var(--k-library); outline-offset: 2px; }
.map-menu .campus-start__row, .map-menu .navigation-tools, .map-menu .campus-start__places { gap: 8px; }
.map-menu .pill-btn { min-height: 40px; }
.card[data-ref="true"] [data-action="card-fly"], .card[data-ref="true"] [data-action="card-walk"], .card[data-footprint="true"] [data-action="card-walk"] { display: none; }
.card { max-height: calc(100vh - var(--top-h) - var(--gap) * 3); overflow: auto; }
@media (max-width: 760px) {
  .card { max-height: calc(100dvh - var(--top-h) - var(--sheet-peek) - var(--gap) * 4); overscroll-behavior: contain; }
  #panel-models { overflow-y: auto; overscroll-behavior: contain; }
}

/* Reference catalogue inside the Models tab */
#panel-models { overflow-y: auto; overscroll-behavior: contain; }
#panel-models .models { flex: none; overflow: visible; }
.subhead { margin: 14px 2px 2px; font-size: 11.5px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.catalog { list-style: none; margin: 4px -4px 0; padding: 0; }
.catalog .place { padding: 8px; }
.catalog .place__pin { width: 32px; height: 32px; background: #fff; box-shadow: inset 0 0 0 2px var(--kc); }
.catalog .place__pin svg { width: 16px; height: 16px; stroke: var(--kc); }
.catalog .place__name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 14px; }

/* Keep the game and gate shortcuts visible on phones. Details remain scrollable. */
@media (max-width: 760px) {
  .card {
    max-height: min(32vh, 280px);
    max-height: min(32dvh, 280px);
    animation: none;
    right: calc(var(--gap) + 54px);
    bottom: calc(var(--sheet-peek) + var(--gap) + 44px);
    padding: 12px;
    overscroll-behavior: contain;
  }
  .card__title { font-size: 18px; }
  .facts { font-size: 11px; }
  .facts dt, .facts dd { padding: 5px 7px; }
  body[data-drawer="open"] .card { visibility: hidden; pointer-events: none; }
}

/* Usability pass: keep the map central and explain each control in place. */
.campus-start { width: 350px; }
.campus-start__heading { display: flex; align-items: center; justify-content: space-between; width: 100%; gap: 12px; }
.campus-start__heading strong { font-size: 17px; }
.campus-start__heading .pill-btn { background: var(--cream); }
.navigation-details { width: 100%; }
.navigation-details > summary { cursor: pointer; font-weight: 800; font-size: 12px; padding: 8px 0; }
.navigation-details[open] > :not(summary) { margin-top: 7px; }
.navigation-tools { display: flex; padding: 3px; gap: 4px; border-radius: var(--pill); background: rgba(43,45,66,.07); }
.navigation-tools .pill-btn { flex: 1; background: transparent; box-shadow: none; }
.navigation-tools [aria-pressed="true"] { background: var(--ink); color: white; }
.navigation-tools button:disabled { cursor: default; opacity: .55; }
.navigation-hint { font-size: 12px; line-height: 1.5; color: var(--ink-2); margin: 0; }
.help-launch { position: fixed; z-index: 25; left: var(--gap); bottom: max(var(--gap),env(safe-area-inset-bottom)); display: flex; gap: 4px; padding: 4px; border-radius: var(--pill); }
.help-launch .pill-btn { min-height: 36px; font-size: 12px; }
.help-launch #googleReferenceButton { font-size: 11px; color: var(--ink-2); }
.controls-help { width: min(780px,calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: clamp(18px,4vw,32px); border: 0; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: var(--shadow-pop); overflow: auto; overscroll-behavior: contain; }
.controls-help::backdrop { background: rgba(25,32,56,.65); }
.help-head { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.help-head h2 { margin: 0; font-size: clamp(28px,5vw,38px); letter-spacing: -.035em; }
.help-eyebrow { margin: 0 0 6px; color: var(--ink-2); font-size: 13px; font-weight: 700; }
.controls-help p { line-height: 1.65; font-size: 14px; }
#helpIntro { max-width: 62ch; color: var(--ink-2); }
.help-steps { margin: 24px 0; padding-left: 26px; display: grid; gap: 16px; }
.help-steps li { padding-left: 8px; }
.help-steps li::marker { color: var(--k-academic); font-weight: 900; }
.help-steps strong { display: block; margin-bottom: 4px; font-size: 16px; }
.help-steps span { display: block; color: var(--ink-2); font-size: 14px; line-height: 1.6; }
.help-actions { display: flex; gap: 8px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 24px; }
.help-actions .pill-btn { min-height: 44px; }
.help-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 28px; }
.help-columns h3 { font-size: 16px; margin: 24px 0 12px; }
.help-keys { display: grid; grid-template-columns: 125px 1fr; margin: 0; gap: 12px 10px; font-size: 12px; line-height: 1.6; }
.help-keys dt { font-weight: 800; }
.help-keys dd { margin: 0; color: var(--ink-2); }
.help-keys kbd { min-width: 21px; padding: 0 4px; }
.help-footnote { padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-2); }
body[data-state="loading"] .help-launch { visibility: hidden; }
body[data-mode="orbit"][data-navigation-tool="pan"] #viewport canvas { cursor: grab; }
body[data-mode="orbit"][data-navigation-tool="pan"] #viewport canvas:active { cursor: grabbing; }
@media (min-width: 761px) {
  .navigation-details > summary { display: none; }
  .card:not(.card--studio) { bottom: 70px; width: 350px; max-height: max(130px,calc(100dvh - var(--navigation-bottom,360px) - 86px)); }
  .card--studio { bottom: 70px; max-height: calc(100dvh - 155px); }
}
@media (max-width: 1100px) {
  .controls [data-action="mode"] span { display: inline; font-size: 11px; }
  .controls [data-action="mode"] svg { display: none; }
}
@media (max-width: 760px) {
  .campus-start { width: min(360px,calc(100vw - 20px)); max-height: calc(100dvh - 230px); overflow: auto; }
  .campus-start__heading strong { font-size: 15px; }
  .campus-start__heading .pill-btn { min-height: 36px; }
  .navigation-details > summary { min-height: 36px; }
  .help-launch { bottom: calc(var(--sheet-peek) + 10px); max-width: calc(100vw - 75px); }
  .help-launch .pill-btn { padding: 6px 10px; min-height: 40px; }
  .help-launch kbd { display: none; }
  body[data-drawer="open"] .help-launch { bottom: calc(min(62vh,560px) + 10px); }
  .help-columns { grid-template-columns: 1fr; gap: 0; }
  .help-head .pill-btn { min-height: 40px; flex: none; }
  .controls-help { max-height: calc(100dvh - 20px); }
  .help-keys { grid-template-columns: 120px 1fr; }
  .controls { top: 64px; left: var(--gap); right: var(--gap); justify-content: center; height: 46px; }
  .campus-start { top: 120px; }
  .controls [data-action="mode"] span { display: inline; }
  .brand { height: 44px; }
  .card { bottom: calc(var(--sheet-peek) + 60px); }
}
@media (max-width: 380px) {
  .controls .controls__sep { display: none; }
  .controls .seg { padding: 2px; gap: 0; }
  .controls .seg__btn, .controls .seg--view .seg__btn { padding: 0 7px; }
  .controls .icon-btn { width: 30px; }
  .controls .chip-btn { padding: 0 7px; }
}
@media (max-height: 600px) and (min-width: 761px) {
  .campus-start { max-height: calc(100dvh - 170px); overflow: auto; }
  .card:not(.card--studio) { left: 380px; width: min(320px,calc(100vw - 450px)); max-height: calc(100dvh - 170px); }
}

/* Map-first layout: retain the campus palette, reveal tools on request. */
.map-launchers { position: fixed; top: var(--gap); right: var(--gap); z-index: 26; display: flex; gap: 10px; }
.map-launchers button { height: var(--top-h); border-radius: var(--pill); padding: 0 20px; display: flex; align-items: center; gap: 12px; font-size: 14px; font-weight: 800; }
.find-place { min-width: 200px; text-align: left; }
.find-place svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.map-menu, .map-info { position: fixed; z-index: 28; right: var(--gap); top: calc(var(--top-h) + var(--gap) * 2); width: min(360px,calc(100vw - var(--gap) * 2)); max-height: calc(100dvh - var(--top-h) - var(--gap) * 3); overflow-y: auto; overscroll-behavior: contain; padding: 18px; border-radius: 24px; }
.menu-heading, .drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.menu-heading { margin-bottom: 12px; font-size: 18px; }
.map-menu .controls { position: static; width: 100%; height: auto; display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 16px; border-bottom: 1px solid var(--line); border-radius: 0; box-shadow: none; animation: none; transform: none; }
.map-menu .controls__sep { display: none; }
.map-menu .controls .icon-btn, .map-menu .controls .chip-btn { width: auto; padding: 0 10px; min-height: 40px; gap: 6px; border-radius: var(--pill); background: rgba(43,45,66,.05); font-size: 12px; }
.map-menu .controls [data-action="time"]::after { content: 'Lighting'; }
.map-menu .controls [data-action="labels"]::after { content: 'All labels'; }
.map-menu .controls [data-action="export"]::after { content: 'Export 3D'; }
.map-menu .controls [data-action="drawer"] { display: inline-flex; }
.map-menu .controls [data-action="drawer"]::after { content: 'Places & tours'; }
.map-menu [data-quality-label] { display: inline; }
.map-menu .controls [aria-pressed="true"] { background: var(--ink); color: white; }
.map-menu .campus-start { position: static; width: 100%; max-height: none; padding: 16px 0; border: 0; box-shadow: none; overflow: visible; animation: none; }
.map-menu .campus-start__heading strong { font-size: 14px; }
.map-menu .navigation-details > summary { display: list-item; min-height: 44px; padding: 14px 0 8px; }
.menu-camera, .menu-support { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.menu-support { border-top: 1px solid var(--line); padding-top: 12px; }
.explore-dock { position: fixed; z-index: 12; bottom: max(30px,env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); border-radius: var(--pill); padding: 5px; }
.explore-dock .seg__btn { min-width: 86px; min-height: 40px; }
.camstack { bottom: 34px; }
.drawer-heading { padding: 4px 12px; font-size: 15px; flex-shrink: 0; }
.drawer__grip, .tab__count { display: none; }
.map-credit { position: fixed; bottom: 4px; left: var(--gap); z-index: 24; display: flex; align-items: center; gap: 4px; color: var(--ink-2); font-size: 10px; background: rgba(255,253,248,.82); border-radius: 6px; padding: 0 6px; }
.map-credit a { color: inherit; }
.map-credit button { background: none; border: none; min-width: 30px; min-height: 26px; }
.map-info { font-size: 12px; line-height: 1.55; }
.place-details > summary { padding: 12px 0 0; font-size: 12px; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.card:not(.card--studio), .card--studio { left: var(--gap); bottom: 38px; width: min(350px,calc(100vw - var(--gap) * 2)); max-height: calc(100dvh - 140px); }
.walkhint { bottom: 98px; }
body[data-view="studio"] .explore-dock { display: none; }
body[data-state="loading"] .map-launchers, body[data-state="loading"] .explore-dock { visibility: hidden; }
@media (max-width: 760px) {
  .map-launchers { gap: 6px; }
  .map-launchers button { height: 44px; padding: 0 12px; gap: 7px; font-size: 12px; }
  .find-place { min-width: 0; }
  .brand { padding: 0 10px 0 6px; }
  .brand__mark { width: 28px; }
  .map-menu, .map-info { top: 64px; max-height: calc(100dvh - 84px); }
  body[data-drawer="closed"] .drawer { transform: translateY(100%); visibility: hidden; pointer-events: none; }
  body[data-drawer="closed"] .camstack, .camstack { bottom: 36px; }
  body[data-drawer="open"] .explore-dock { visibility: hidden; }
  .card:not(.card--studio), .card--studio { bottom: 96px; max-height: calc(100dvh - 172px); }
  .map-menu .controls { justify-content: flex-start; }
  .explore-dock .seg__btn { min-width: 74px; }
  .walkhint, body[data-drawer="open"] .walkhint { bottom: 96px; }
  .studio-banner { height: auto; gap: 4px; max-width: calc(100vw - var(--gap) * 2); }
  .studio-banner .pill-btn { padding-inline: 12px; font-size: 12px; }
  body[data-view="studio"] .toast { top: calc(var(--gap) * 2 + var(--top-h) + 64px); }
  .card--studio, body[data-drawer="open"] .card--studio { bottom: 36px; max-height: min(48dvh, calc(100dvh - 142px)); }
}
@media (max-width: 360px) {
  .brand__mark { display: none; }
  .brand { padding: 0 10px; }
  .map-launchers button { padding: 0 10px; }
  .find-place svg { width: 16px; }
}
