#panel {
  top:max(18px,env(safe-area-inset-top)); left:max(18px,env(safe-area-inset-left)); right:auto;
  width:min(340px,calc(100vw - 36px)); max-height:calc(100dvh - 36px - env(safe-area-inset-bottom));
  border-radius:16px; background:#121314e0; backdrop-filter:blur(.7px);
}
#panel.collapsed { width:min(340px,calc(100vw - 36px)); }
#panelHead { padding:8px 10px 8px 14px; }
#togglePanel { background:var(--ui-secondary); }
#panelBody { padding:10px; }
#destinations { display:grid; gap:8px; }
.destinationCategory, .destinationFloor { border-radius:9px; }
.destinationCategory > summary, .destinationFloor > summary {
  display:flex; align-items:center; justify-content:space-between; gap:6px;
  min-height:44px; padding:6px 10px; color:var(--ui-accent); border-radius:9px;
  background:var(--ui-secondary); list-style:none; cursor:pointer;
}
#destinations summary::-webkit-details-marker { display:none; }
#destinations summary::after {
  content:""; flex:none; width:7px; height:7px; border-right:1.5px solid currentColor;
  border-bottom:1.5px solid currentColor; transform:rotate(45deg); transition:transform 220ms;
}
#destinations details[open] > summary::after { transform:rotate(225deg); }
#destinations summary:hover { background:var(--ui-hover); color:var(--ui-primary); }
.destinationFloor { margin:6px 0 0 10px; }
.destinationFloor summary { background:#292c2eb0; font-size:14px; }
#destinations .dest {
  display:grid; gap:2px; margin-top:4px; padding:7px 10px; border-radius:8px;
  background:var(--ui-secondary); color:var(--ui-text); transition:background-color 180ms,color 180ms;
}
#destinations .dest::before { content:none; }
#destinations .dest small { color:var(--ui-muted); font-size:11px; }
#destinations .dest:hover, #destinations .dest[aria-current="location"] { background:var(--ui-hover); color:var(--ui-primary); }
#destinations .dest:hover small, #destinations .dest[aria-current="location"] small { color:var(--ui-primary); }
#goEntrance { margin-top:10px; color:var(--ui-text); background:var(--ui-secondary); border-color:var(--ui-border); }
#goEntrance:hover { color:var(--ui-primary); background:var(--ui-hover); }
#tourHud { position:fixed; inset:0; z-index:11; pointer-events:none; }
#mapControls, #compassControls { position:absolute; display:grid; justify-items:end; gap:10px; }
#mapControls { top:max(18px,env(safe-area-inset-top)); right:max(18px,env(safe-area-inset-right)); }
#mapActions { display:flex; gap:10px; }
#compassControls { bottom:max(24px,env(safe-area-inset-bottom)); right:max(24px,env(safe-area-inset-right)); gap:6px; justify-items:center; }
.hudButton, #mapMobile {
  pointer-events:auto; display:grid; place-items:center; padding:0; color:var(--ui-accent);
  background:#121314e0; border:1px solid var(--ui-border); border-radius:10px;
  backdrop-filter:blur(.7px); transition:background-color 180ms,color 180ms;
}
.hudButton { width:44px; height:44px; }
.hudButton:hover, #mapMobile:hover { background:var(--ui-hover); color:var(--ui-primary); }
.tourLogout {
  width:auto; padding-inline:13px; border-radius:14px;
  font-size:14px; font-weight:650; box-shadow:inset 0 1px #faeec824;
}
.tourLogout:active:not(:disabled) { background:var(--ui-accent); color:var(--ui-primary); box-shadow:none; }
.settings .tourLogout { display:none; justify-self:start; }
#tourGuide { width:34px; height:34px; border-radius:50%; }
#mapDesktop { width:260px; background:#121314e0; border:1px solid var(--ui-border); border-radius:10px; }
#mapDesktop svg, #mapMobile svg, #compass svg, #tourDialog[data-panel=map] .dialogBody svg { width:100%; display:block; }
#mapMobile { width:min(140px,38vw); aspect-ratio:1; border-radius:50%; }
#compass { width:76px; }
.mapDefinitions { position:absolute; }
.mapWalls { fill:none; stroke:var(--ui-accent); stroke-width:.85; stroke-linecap:round; }
.mapDefinitions path { vector-effect:non-scaling-stroke; }
.mapMarker { fill:var(--ui-accent); stroke:var(--ui-primary); stroke-width:.8; }
.mapSector { fill:var(--ui-accent); fill-opacity:.18; stroke:var(--ui-accent); stroke-opacity:.55; stroke-width:.6; }
#tourDialog[data-panel=map] { width:min(560px,calc(100vw - 28px)); }
.fullMapFloor { color:var(--ui-muted); margin:0; }
.mapLeader { fill:none; stroke:var(--ui-accent); stroke-width:.6; stroke-dasharray:1.7 1.7; }
.mapLabel { fill:var(--ui-accent); font-size:8px; paint-order:stroke; stroke:var(--ui-primary); stroke-width:1.8; }
.settings { display:grid; gap:9px; }
.settings label {
  display:flex; align-items:center; justify-content:space-between; min-height:44px;
  padding:4px 12px; border-radius:9px; background:var(--ui-secondary); cursor:pointer;
}
.settings input {
  appearance:none; -webkit-appearance:none; display:flex; align-items:center;
  box-sizing:border-box; flex:none; width:38px; height:22px; margin:0;
  border:1px solid #777; border-radius:11px; background:#454748;
  cursor:pointer; transition:background-color 180ms,border-color 180ms;
}
.settings input::before {
  content:""; width:14px; height:14px; margin-left:3px; border-radius:50%;
  background:#fff; transition:transform 180ms,background-color 180ms;
}
.settings input:checked { background:#FAEEC8; border-color:#FAEEC8; }
.settings input:checked::before { transform:translateX(16px); background:#121314; }
.settings input:focus-visible { outline:2px solid var(--ui-accent); outline-offset:3px; }
@media(prefers-reduced-motion:reduce) { .settings input,.settings input::before { transition:none; } }
#tourDialog[data-panel=guide] { width:min(450px,calc(100vw - 28px)); }
.guideSections { display:grid; gap:12px; }
.guideSections h3 { color:var(--ui-accent); margin:0 0 4px; font-size:16px; }
.guideSections p { margin:0; font-size:15px; }
.guideTag {
  display:inline-grid; place-items:center; width:24px; height:24px; margin-right:7px;
  border:1px solid currentColor; border-radius:50%; font-size:8px; vertical-align:middle;
}
#stick { background:#12131477; border-color:var(--ui-border); }
#knob { background:#faeec899; border-color:var(--ui-accent); }
#screenFade { background:var(--ui-primary); }
#loadingScreen { background:var(--ui-primary); }
.loadingContent p, #feedback { color:var(--ui-text); }
#feedback { background:#121314e0; border-color:var(--ui-border); }
.retry { color:var(--ui-accent); background:var(--ui-secondary); border-color:var(--ui-border); }
.retry:hover { background:var(--ui-hover); color:var(--ui-primary); }
@media (pointer:coarse) {
  #panel {
    top:max(10px,env(safe-area-inset-top)); left:max(10px,env(safe-area-inset-left));
    width:min(340px,calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right)));
    max-height:calc(100dvh - 155px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }
  #panel.collapsed { width:min(220px,calc(100vw - min(140px,38vw) - 32px - env(safe-area-inset-left) - env(safe-area-inset-right))); }
  #panelHead { gap:5px; padding:5px 5px 5px 9px; }
  #panelHead .brand strong { font-size:13px; }
  #mapControls { top:max(10px,env(safe-area-inset-top)); right:max(10px,env(safe-area-inset-right)); }
  #mapActions .tourLogout { display:none; }
  .settings .tourLogout { display:grid; }
  #compassControls { bottom:max(16px,env(safe-area-inset-bottom)); right:max(16px,env(safe-area-inset-right)); }
  #compass { width:58px; }
  #tourHud.navigationOpen #mapControls { display:none; }
}
@media (prefers-reduced-motion:reduce) {
  #destinations summary::after, .hudButton, #mapMobile { transition:none; }
}

.languageToggle {
  display:inline-flex; align-items:center; justify-content:center; gap:3px;
  min-width:44px; height:44px; flex:none; padding:0 4px; pointer-events:auto;
  border:1px solid var(--ui-border); border-radius:999px;
  background:#121314e0; color:var(--ui-accent); font-size:9px; font-weight:700;
}
.languageToggle svg { width:16px; height:16px; flex:none; }
.languageToggle span { white-space:nowrap; }
.languageToggle:hover { background:var(--ui-hover); color:var(--ui-primary); }
#tourLanguage {
  position:absolute; bottom:max(24px,env(safe-area-inset-bottom));
  right:calc(max(24px,env(safe-area-inset-right)) + 86px);
}
.dialogHeading .languageToggle { min-width:36px; height:36px; padding-inline:5px; }
.dialogHeading .languageToggle svg { width:14px; height:14px; }
.studioSignature {
  display:flex; align-items:center; gap:8px; width:max-content; max-width:100%;
  color:var(--ui-text); text-align:left; text-shadow:0 1px 5px #000, 0 0 7px #000;
}
.studioCube {
  display:grid; place-items:center; width:27px; height:27px; flex:none;
  border:1px solid #faeec880; border-radius:50%; background:#121314b8; color:var(--ui-accent);
}
.studioCube svg { width:15px; height:15px; }
.studioNames { display:grid; justify-items:start; }
.studioLabel { color:var(--ui-accent); font-size:10px; font-weight:650; line-height:1.2; }
.studioNames a {
  display:inline-flex; gap:5px; align-items:center; min-height:17px;
  color:inherit; font-size:11px; font-weight:500; text-decoration:none; pointer-events:auto;
}
.studioNames a:hover { color:var(--ui-accent); text-decoration:underline; }
.studioNames a:focus-visible { outline:2px solid var(--ui-accent); outline-offset:2px; border-radius:2px; }
.linkedinMark {
  display:inline-grid; place-items:center; width:12px; height:12px; flex:none;
  background:var(--ui-accent); color:var(--ui-primary); border-radius:2px;
  font-size:9px; line-height:1; font-weight:800; text-shadow:none;
}
.desktopSignature {
  position:absolute; left:max(24px,env(safe-area-inset-left)); bottom:max(20px,env(safe-area-inset-bottom));
  pointer-events:none;
}
.studioLogo { display:block; width:39px; height:39px; object-fit:contain; margin:0 0 6px; }
.guideCredits { padding-top:12px; border-top:1px solid #faeec830; }
.guideCredits .studioNames a { min-height:23px; }

@media (max-width:850px), (pointer:coarse) {
  .desktopSignature { display:none; }
  #tourLanguage {
    bottom:max(16px,env(safe-area-inset-bottom));
    right:calc(max(16px,env(safe-area-inset-right)) + 86px);
  }
}
#tutorial p { max-width:410px; margin-inline:auto; padding-inline:8px; }
#tutorial .mobileInstruction p { max-width:250px; }

@media (min-width:851px) and (pointer:fine) {
  #panel:not(.collapsed) {
    max-height:calc(100dvh - max(18px,env(safe-area-inset-top)) - max(20px,env(safe-area-inset-bottom)) - 104px);
  }
}
