@font-face {
  font-family: "DSHS Display";
  src: url("/assets/fonts/roboto-black-latin.woff2") format("woff2");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --theme-hue: 268;
  --theme-deep: hsl(var(--theme-hue) 42% 9%);
  --theme-surface: hsl(var(--theme-hue) 39% 15%);
  --theme-raised: hsl(var(--theme-hue) 38% 22%);
  --theme-soft: hsl(var(--theme-hue) 40% 32%);
  --theme-glow: hsl(var(--theme-hue) 95% 72% / .5);
  --navy-950: var(--theme-deep);
  --navy-900: var(--theme-surface);
  --navy-800: var(--theme-raised);
  --blue: hsl(var(--theme-hue) 82% 69%);
  --cyan: hsl(var(--theme-hue) 96% 80%);
  --mint: hsl(var(--theme-hue) 93% 76%);
  --amber: hsl(var(--theme-hue) 96% 80%);
  --red: hsl(var(--theme-hue) 88% 80%);
  --white: #fbf8ff;
  --muted: #c0b8cd;
  --glass: hsl(var(--theme-hue) 39% 15% /  .78);
  --glass-strong: hsl(var(--theme-hue) 42% 11% /  .93);
  --line: rgba(255, 255, 255, .14);
  --shadow: 0 22px 70px rgba(0, 0, 0, .36);
  font-family: Inter, Pretendard, "Noto Sans KR", "Apple SD Gothic Neo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--navy-950); }
body { color: var(--white); }
button, input, select { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
[hidden] { display: none !important; }

.app { position: relative; width: 100%; height: 100%; isolation: isolate; background: radial-gradient(circle at 50% 45%, var(--theme-raised), var(--navy-950)); }
.pano-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.pano-canvas.is-dragging { cursor: grabbing; }
.hotspot-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, hsl(var(--theme-hue) 42% 5% / .62), transparent 25%, transparent 58%, hsl(var(--theme-hue) 42% 5% / .7)), radial-gradient(circle at center, transparent 48%, hsl(var(--theme-hue) 42% 5% / .26)); }

.topbar { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: max(18px, env(safe-area-inset-top)) 26px 14px; }
.brand { display: flex; align-items: center; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 16px; letter-spacing: .08em; }
.brand-copy small { color: var(--muted); font-size: 9px; font-weight: 650; letter-spacing: .18em; }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .admin-button { min-height: 42px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(18px); box-shadow: 0 10px 30px rgba(0,0,0,.16); cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover, .admin-button:hover { border-color: hsl(var(--theme-hue) 92% 75% / .54); background: hsl(var(--theme-hue) 39% 24% /  .88); transform: translateY(-1px); }
.icon-button { display: grid; place-items: center; width: 42px; padding: 0; border-radius: 50%; }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.admin-button { padding: 0 16px; border-radius: 999px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.admin-button.is-active { border-color: hsl(var(--theme-hue) 92% 75% / .6); color: var(--mint); }

.eyebrow { display: block; color: var(--cyan); font-size: 10px; font-weight: 800; letter-spacing: .17em; }
.viewer-tools { position: absolute; z-index: 8; right: 26px; bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px)); display: grid; gap: 7px; }
.tool-button { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; background: var(--glass); backdrop-filter: blur(16px); font-size: 20px; cursor: pointer; }
.tool-button:hover { background: hsl(var(--theme-hue) 39% 27% / .87); border-color: hsl(var(--theme-hue) 92% 75% / .5); }
.music-toggle[aria-pressed="true"] { border-color: hsl(var(--theme-hue) 92% 75% / .72); color: var(--cyan); box-shadow: 0 0 16px hsl(var(--theme-hue) 92% 75% / .18); }
.music-credit { margin: 18px 0 0; color: var(--muted); font-size: .82rem; line-height: 1.7; }
.music-credit a { color: var(--cyan); text-decoration: underline; text-underline-offset: 3px; }
.about-list > div { align-items: center; }
.about-list .creators-button { padding: 0; min-height: 24px; line-height: 1.5; letter-spacing: .04em; text-align: left; }
#elevator-exit { width: 100%; margin-top: 16px; font-size: 14px; }
.elevator-enter { grid-column: 1 / -1; }
.plan-lane { position: absolute; left: 0; right: 0; border-bottom: 1px solid rgba(255,255,255,.1); pointer-events: none; }
.plan-lane > strong { position: absolute; top: 12px; left: 20px; color: var(--muted); font-size: 14px; }
.plan-node { position: absolute; transform: translate(-50%,-50%); width: 32px; height: 32px; border: 2px solid var(--cyan); border-radius: 50%; background: var(--theme-soft); color: #fff; font-size: 12px; font-weight: 700; cursor: pointer; z-index: 2; }
.plan-node.type-elevator-landing,.plan-node.type-elevator-cab { background: #68479f; border-color: #b8a0dc; }
.plan-node.type-stairs { background: #b18bdc; border-color: #dcc4f7; color: #15101f; }
.plan-node.type-entrance { background:var(--blue); border-color:var(--cyan); color:var(--theme-deep); }
.plan-node:hover,.plan-node:focus-visible,.plan-node.is-current { outline: 3px solid var(--cyan); outline-offset: 4px; }
.graph-edge.is-elevator { stroke: #8566b5; stroke-dasharray: 5 8; opacity: .4; }
.plan-legend { margin: 0; color: var(--muted); font-size: 14px; }
.plan-legend span:first-child { color: var(--cyan); }
.plan-legend span:last-child { color: var(--cyan); }
.graph-empty { margin: 40px; font-size: 18px; }
.adjacent-node-caption { position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 14px; color: var(--white); pointer-events: none; }
.plan-node.type-hall { background: var(--cyan); border-color: var(--white); color: var(--theme-deep); }
.outdoor-plan .adjacent-node.type-hall { background: var(--cyan); border-color: var(--white); color: var(--theme-deep); }
#upload-new-node { margin: 10px 0; }
.annotation-panel { position: absolute; z-index: 21; top: 90px; right: 26px; width: min(360px, calc(100vw - 32px)); padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: hsl(var(--theme-hue) 39% 15% / .9); backdrop-filter: blur(16px); }
.annotation-header { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; justify-content: space-between; }
.annotation-header h2 { margin: 0; font-size: 13px; letter-spacing: .08em; color: var(--cyan); }
.annotation-header button { background: none; border: 0; color: var(--muted); padding: 6px 0; font: inherit; font-size: 14px; cursor: pointer; }
#annotation-body { max-height: 40vh; overflow: auto; }
.annotation-location { font-size: 13px; color: var(--muted); }
.annotation-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.7; font-size: 16px; }
#annotation-form label { display: block; margin: 12px 0; font-size: 14px; }
#annotation-input { width: 100%; resize: vertical; min-height: 110px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; color: white; background: var(--theme-deep); font: inherit; font-size: 16px; }
.annotation-actions { display: flex; gap: 10px; justify-content: flex-end; margin: 12px 0; }
#annotation-status { font-size: 14px; color: var(--cyan); }
.app .elevator-panel { top: auto; bottom: 28px; left: 24px; right: auto; transform: none; }
.admin-mode .elevator-panel { bottom: 145px; }
@media(max-width:640px) {
  .annotation-panel { top: 80px; right: 12px; padding: 12px; width: min(320px,calc(100vw - 24px)); }
  #annotation-body { max-height: 28vh; }
  .app .elevator-panel { bottom: 12px; left: 12px; width: 200px; }
  .admin-mode .elevator-panel { bottom: 175px; }
  .admin-button { display: block; width: auto; min-width: 60px; padding: 8px; color: var(--muted); border-radius: 999px; font-size: 12px; }
  .admin-button::after { content: none; }
  .admin-mode .viewer-tools { display: grid; bottom: 180px; }
}
.tour-menu-wrap { position: relative; }
.tour-menu { position: absolute; right: calc(100% + 12px); bottom: 0; width: 190px; padding: 6px; border: 1px solid var(--line); border-radius: 16px; background: var(--theme-surface); box-shadow: var(--shadow); }
.tour-menu button { display: block; width: 100%; padding: 13px 14px; border: 0; border-radius: 10px; text-align: left; background: transparent; color: var(--white); font: inherit; font-size: 1rem; cursor: pointer; }
.tour-menu button:hover, .tour-menu button:focus-visible { background: hsl(var(--theme-hue) 92% 75% / .12); }
.greeting-letter p { font-size: 1rem; line-height: 1.9; word-break: keep-all; overflow-wrap: anywhere; margin: 24px 0; }
.greeting-letter .greeting-signature { text-align: right; color: var(--white); font-weight: 700; }
.site-stats { margin: 24px 0; }
.site-stats div { padding: 18px 0; border-bottom: 1px solid var(--line); }
.site-stats dt { color: var(--muted); font-size: .875rem; }
.site-stats dd { margin: 8px 0 0; font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.modal .stats-note { font-size: .875rem; }

.hotspot { position: absolute; width: 72px; padding: 0; border: 0; background: none; pointer-events: auto; cursor: pointer; filter: drop-shadow(0 8px 13px rgba(0,0,0,.48)); transform-origin: center; }
.hotspot-icon { position: relative; display: grid; place-items: center; width: 58px; height: 58px; margin: auto; border: 1px solid rgba(255,255,255,.72); border-radius: 50%; background: hsl(var(--theme-hue) 39% 25% /  .68); backdrop-filter: blur(6px); transform: perspective(90px) rotateX(56deg); transition: transform .18s, background .18s; }
.hotspot-icon::before { content: ""; position: absolute; inset: 7px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .5); border-radius: 50%; }
.hotspot-icon i { width: 15px; height: 15px; border-top: 3px solid white; border-right: 3px solid white; transform: rotate(-45deg) translate(-2px, 2px); }
.hotspot:hover .hotspot-icon, .hotspot:focus-visible .hotspot-icon { background: hsl(var(--theme-hue) 45% 45% /  .85); transform: perspective(90px) rotateX(56deg) scale(1.12); }
.hotspot-elevator .hotspot-icon { border-color: hsl(var(--theme-hue) 92% 75% / .9); }
.hotspot-elevator .hotspot-icon::before { border-color: hsl(var(--theme-hue) 92% 75% / .68); }
.hotspot-stairs .hotspot-icon { border-color: hsl(var(--theme-hue) 92% 75% / .86); }
.cursor-arrow { position: absolute; z-index: 5; display: grid; justify-items: center; gap: 5px; pointer-events: none; transform: translate(-50%, -55%); filter: drop-shadow(0 9px 15px rgba(0,0,0,.6)); }
.cursor-arrow-icon { display: grid; place-items: center; width: 78px; height: 78px; border: 2px solid rgba(255,255,255,.9); border-radius: 50%; background: hsl(var(--theme-hue) 41% 25% / .65); box-shadow: 0 0 0 7px hsl(var(--theme-hue) 92% 75% / .14), inset 0 0 17px hsl(var(--theme-hue) 92% 75% / .24); backdrop-filter: blur(5px); transform: perspective(100px) rotateX(52deg); }
.cursor-arrow-icon i { width: 25px; height: 25px; border-top: 5px solid white; border-right: 5px solid white; transform: rotate(-45deg) translate(-3px, 3px); }
.cursor-arrow-hint { display: none; padding: 6px 10px; border-radius: 99px; background: rgba(11,12,22,.8); color: white; font-size: 13px; white-space: nowrap; }
.cursor-arrow.is-touch .cursor-arrow-hint { display: block; }
.placing-arrow .cursor-arrow { display: none; }

.modal-x { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.05); color: var(--muted); font-size: 22px; cursor: pointer; }

.elevator-panel { position: absolute; z-index: 9; top: 50%; right: max(28px, 7vw); width: 238px; padding: 20px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .35); border-radius: 20px; background: linear-gradient(145deg, hsl(var(--theme-hue) 39% 18% / .94), hsl(var(--theme-hue) 39% 10% / .94)); box-shadow: 0 24px 70px rgba(0,0,0,.5); transform: translateY(-50%); }
.elevator-display { display: flex; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid rgba(255,255,255,.08); border-radius: 10px; background: var(--theme-deep); color: var(--amber); }
.elevator-display span { font-size: 9px; letter-spacing: .18em; }
.elevator-display strong { font: 700 26px/1 ui-monospace, monospace; }
.elevator-panel p { margin: 15px 0 12px; color: var(--muted); font-size: 11px; text-align: center; }
.elevator-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.elevator-buttons button { aspect-ratio: 1; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; background: radial-gradient(circle at 35% 28%, var(--theme-soft), var(--theme-surface) 62%, var(--theme-deep)); color: white; font-size: 18px; font-weight: 800; cursor: pointer; }
.elevator-buttons button:hover { border-color: var(--amber); color: var(--amber); box-shadow: inset 0 0 16px hsl(var(--theme-hue) 92% 75% / .16), 0 0 16px hsl(var(--theme-hue) 92% 75% / .13); }

.loading { position: absolute; z-index: 60; inset: 0; display: grid; place-content: center; justify-items: center; gap: 12px; background: hsl(var(--theme-hue) 39% 10% / .76); backdrop-filter: blur(8px); transition: opacity .3s; }
.loading.is-hidden { opacity: 0; pointer-events: none; }
.loading span { width: 35px; height: 35px; border: 2px solid rgba(255,255,255,.16); border-top-color: var(--cyan); border-radius: 50%; animation: spin .8s linear infinite; }
.loading p { margin: 0; color: var(--muted); font-size: 12px; letter-spacing: .08em; }
@keyframes spin { to { transform: rotate(360deg); } }

.welcome { position: fixed; z-index: 100; inset: 0; overflow: hidden; isolation: isolate; background: #030105; transition: opacity .75s ease, transform 1.15s cubic-bezier(.22,1,.36,1); }
.welcome.is-entered { opacity: 0; transform: scale(1.045); pointer-events: none; }
.opening-canvas, .opening-aura { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.opening-aura { z-index: 1; opacity: .65; background: radial-gradient(ellipse at 50% 43%, rgba(127,64,199,.13), transparent 53%), linear-gradient(180deg, transparent 65%, #030105); }
.opening-emblem { position: absolute; z-index: 2; left: 50%; top: 29%; width: min(520px, 76vw); height: auto; overflow: visible; opacity: 0; transform: translate(-50%, -50%); pointer-events: none; filter: drop-shadow(0 0 8px #bc85ff) drop-shadow(0 0 30px #8140db); }
.opening-emblem path { stroke: #e9d4ff; stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; fill: rgba(185,130,255,.12); }
.is-opening .opening-emblem { animation: opening-solgae 2.8s 3.95s both; }
.is-opening .opening-wing { stroke-dasharray: 1; animation: opening-wing-draw .75s 3.95s both; }
.is-opening .opening-tail { stroke-dasharray: 1; animation: opening-wing-draw .65s 4.05s both; }
.welcome-center { position: absolute; z-index: 3; left: 50%; top: 51%; display: grid; justify-items: center; width: min(1000px, calc(100vw - 40px)); text-align: center; transform: translate(-50%, -50%); }
.welcome h1 { margin: 0; color: #fcf8ff; font-family: "DSHS Display", "Arial Black", sans-serif; font-size: clamp(42px, 7.5vw, 96px); font-weight: 900; line-height: 1.05; letter-spacing: -.035em; word-spacing: .08em; white-space: nowrap; text-shadow: 0 0 42px rgba(194,143,255,.17); }
.welcome-rule { width: 62px; height: 1px; margin-top: 25px; background: linear-gradient(90deg, transparent, #c7a4ef, transparent); box-shadow: 0 0 16px rgba(186,129,255,.4); }
.welcome-action-slot { display: grid; place-items: center; min-height: 58px; margin-top: 30px; }
.welcome-action-slot > * { grid-area: 1 / 1; }
.welcome-loader { width: 42px; height: 42px; border: 4px solid rgba(255,255,255,.16); border-top-color: var(--cyan); border-right-color: var(--cyan); border-radius: 50%; animation: spin .82s linear infinite; box-shadow: 0 0 18px hsl(var(--theme-hue) 92% 75% / .12); }
.welcome-start { display: flex; align-items: center; justify-content: space-between; gap: 38px; min-width: 190px; height: 54px; padding: 5px 6px 5px 25px; border: 1px solid rgba(214,186,248,.3); border-radius: 999px; background: rgba(32,19,49,.55); color: #fff; backdrop-filter: blur(18px); box-shadow: 0 12px 45px rgba(86,35,151,.12), inset 0 1px 0 rgba(255,255,255,.05); font-size: 15px; font-weight: 550; cursor: pointer; animation: welcome-button-in .48s cubic-bezier(.22,1,.36,1) both; transition: border-color .22s, background .22s, transform .22s, box-shadow .22s; }
.welcome-start-arrow { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--theme-deep); font-size: 21px; font-weight: 450; transition: color .22s, background .22s, transform .22s; }
.welcome-start:hover { border-color: rgba(255,255,255,.72); background: hsl(var(--theme-hue) 39% 24% / .68); box-shadow: 0 19px 48px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.13); transform: translateY(-2px); }
.welcome-start:hover .welcome-start-arrow { background: var(--cyan); transform: translateX(2px); }
.welcome-start:active { transform: translateY(0) scale(.985); }
@keyframes welcome-button-in { from { opacity: 0; transform: translateY(9px) scale(.97); } }
.is-opening .welcome-center { animation: opening-title-in 1.2s 4.8s cubic-bezier(.16,1,.3,1) both; }
.is-opening .welcome-action-slot { animation: opening-action-in .75s 5.8s ease both; }
.is-opening .welcome-creators { animation: opening-action-in .6s 5.95s ease both; }
.welcome-error { max-width: 340px; margin: 16px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
@keyframes opening-title-in { from { opacity: 0; filter: blur(16px); transform: translate(-50%, calc(-50% + 12px)) scale(1.12); } to { opacity: 1; filter: blur(0); transform: translate(-50%, -50%) scale(1); } }
@keyframes opening-action-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes opening-wing-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes opening-solgae { 0% { opacity: 0; transform: translate(-50%, -18%) scale(.8); filter: blur(6px) drop-shadow(0 0 20px #8140db); } 18% { opacity: .78; transform: translate(-50%, -38%) scale(.98); filter: blur(0) drop-shadow(0 0 9px #d8b8ff) drop-shadow(0 0 35px #8140db); } 42% { opacity: .6; transform: translate(-50%, -50%) scale(1); } 68% { opacity: .26; filter: blur(.5px) drop-shadow(0 0 22px #8140db); } 100% { opacity: 0; transform: translate(-50%, -58%) scale(1.12); filter: blur(9px) drop-shadow(0 0 32px #8140db); } }
@media (prefers-reduced-motion: reduce) {
  .opening-emblem { animation: none !important; }
  .welcome, .welcome-center, .welcome-start { animation: none !important; transition: none !important; }
}

.modal { width: min(680px, calc(100vw - 28px)); max-height: calc(100vh - 32px); padding: 30px; overflow: auto; border: 1px solid var(--line); border-radius: 24px; background: var(--theme-surface); color: var(--white); box-shadow: var(--shadow); }
.modal::backdrop { background: hsl(var(--theme-hue) 42% 5% / .7); backdrop-filter: blur(8px); }
.creators-button { border: 0; padding: 12px 8px; background: transparent; color: var(--muted); font: inherit; font-size: .875rem; letter-spacing: .08em; cursor: pointer; }
.creators-button:hover { color: #fff; }
.welcome-creators { position: absolute; bottom: max(28px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); white-space: nowrap; }
.creators-modal { width: min(520px, calc(100vw - 28px)); }
.creators-modal h2 { margin-top: 16px; padding-right: 18px; font-size: clamp(22px, 5vw, 30px); letter-spacing: .025em; }
.creators-list { list-style: none; margin: 28px 0 0; padding: 0; }
.creators-list li { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 15px 0; border-bottom: 1px solid var(--line); font-size: 1rem; font-weight: 400; }
.creators-list strong { font-weight: 800; }
.creator-role { margin-left: auto; color: var(--cyan); font-size: .875rem; }
.creators-modal .creators-recruit { margin: 26px 0 0; color: var(--cyan); font-size: 1rem; }
.creators-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 22px 0 0; padding: 5px; border: 1px solid var(--line); border-radius: 15px; background: var(--theme-deep); }
.creators-tabs button { display: grid; place-content: center; gap: 4px; min-height: 64px; border: 1px solid transparent; border-radius: 11px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.creators-tabs button strong { font-size: 15px; }
.creators-tabs button small { font-size: 10px; letter-spacing: .02em; }
.creators-tabs button[aria-selected="true"] { border-color: var(--line); background: var(--theme-raised); color: var(--white); }
.creators-tabs button:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.creators-modal [role="tabpanel"][hidden] { display: none; }
.creators-modal #creators-generation-2 { display: grid; min-height: 245px; place-items: center; text-align: center; }
.creators-modal #creators-generation-2[hidden] { display: none; }
.creators-modal #creators-generation-2 .creators-recruit { margin: 0; padding: 16px; font-size: clamp(16px,4vw,21px); font-weight: 650; }
#site-info-dialog .site-stats { margin: 18px 0 0; }
#site-info-dialog .site-stats div:last-child { border-bottom: 0; padding-bottom: 0; }
.greeting-modal { max-height: min(78vh, 740px); }
@media (max-width: 600px) { .top-actions .creators-button { max-width: 105px; padding: 8px 4px; font-size: .875rem; letter-spacing: 0; } }
.modal[open] { animation: modal-in .22s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
#login-dialog[open] { transform: translateY(28px); animation: login-modal-in .22s ease-out; }
@keyframes login-modal-in {
  from { opacity: 0; transform: translateY(40px) scale(.98); }
  to { opacity: 1; transform: translateY(28px) scale(1); }
}
.modal-x { position: absolute; right: 18px; top: 18px; }
.modal h2 { margin: 9px 0 14px; font-size: 30px; }
.modal p { color: var(--muted); line-height: 1.65; }
.modal-lead { margin: 0 0 22px; }
.compact-modal { width: min(430px, calc(100vw - 28px)); }
#login-form .primary-button { margin-top: 30px; }
.about-modal { width: min(620px, calc(100vw - 28px)); }
.about-list { display: grid; gap: 1px; margin: 26px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.about-list div { display: grid; grid-template-columns: 110px 1fr; gap: 16px; padding: 13px 15px; background: var(--theme-raised); }
.about-list dt { color: var(--cyan); font-size: 11px; font-weight: 800; }
.about-list dd { margin: 0; color: var(--white); font-size: 13px; }
.modal label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; font-weight: 650; }
.modal input, .modal select { width: 100%; min-height: 45px; padding: 0 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 10px; background: var(--theme-deep); color: white; }
.modal input[type=file] { padding: 11px; }
.modal small { color: var(--muted); font-size: 10px; font-weight: 500; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 17px; margin-top: 22px; }
.span-2 { grid-column: 1 / -1; }
.check-row { grid-template-columns: auto 1fr !important; align-items: center; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--cyan); }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; }
.split-actions { display: grid; grid-template-columns: auto 1fr auto auto; }
.primary-button, .secondary-button, .danger-button { min-height: 43px; padding: 0 17px; border-radius: 10px; font-weight: 750; cursor: pointer; }
.primary-button { border: 0; background: linear-gradient(135deg, var(--blue), var(--cyan)); color: var(--theme-deep); }
.secondary-button { border: 1px solid var(--line); background: rgba(255,255,255,.05); color: white; }
.danger-button { border: 1px solid hsl(var(--theme-hue) 92% 75% / .42); background: hsl(var(--theme-hue) 92% 75% / .09); color: var(--cyan); }
.primary-button:disabled, .secondary-button:disabled { opacity: .55; cursor: wait; }
.form-error { min-height: 20px; margin: 11px 0 0 !important; color: var(--cyan) !important; font-size: 12px; }
.form-hint { margin: 15px 0 0 !important; font-size: 11px; }

.admin-dock { position: absolute; z-index: 40; left: 50%; bottom: max(28px, calc(env(safe-area-inset-bottom) + 14px)); width: min(700px, calc(100vw - 48px)); padding: 10px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .3); border-radius: 18px; background: hsl(var(--theme-hue) 39% 15% / .95); box-shadow: var(--shadow); transform: translateX(-50%); backdrop-filter: blur(20px); }
.admin-status { display: flex; align-items: center; gap: 8px; padding: 2px 4px 10px; color: var(--muted); font-size: 9px; letter-spacing: .08em; }
.admin-status strong { color: var(--mint); }
.admin-status span:last-child { margin-left: auto; font-family: ui-monospace, monospace; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 12px var(--mint); }
.admin-actions { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.admin-actions button { min-height: 37px; border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.045); color: var(--white); font-size: 11px; cursor: pointer; }
.admin-actions button:hover { border-color: hsl(var(--theme-hue) 92% 75% / .4); background: hsl(var(--theme-hue) 92% 75% / .09); }
.danger-text { color: var(--cyan) !important; }
.admin-dock.is-collapsed .admin-actions { display: none; }
.aim-crosshair { position: absolute; z-index: 12; left: 50%; top: 50%; width: 30px; height: 30px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .72); border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 16px hsl(var(--theme-hue) 92% 75% / .3); }
.aim-crosshair::before, .aim-crosshair::after { content: ""; position: absolute; background: var(--mint); }
.aim-crosshair::before { left: 50%; top: -7px; width: 1px; height: 42px; }
.aim-crosshair::after { left: -7px; top: 50%; width: 42px; height: 1px; }
.aim-crosshair span { position: absolute; inset: 11px; border-radius: 50%; background: var(--mint); }
.admin-mode .viewer-tools { bottom: 126px; }

.link-capture { position: absolute; z-index: 39; left: 50%; bottom: max(132px, calc(env(safe-area-inset-bottom) + 118px)); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 22px; width: min(700px, calc(100vw - 48px)); padding: 14px 16px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .42); border-radius: 18px; background: hsl(var(--theme-hue) 39% 13% / .96); box-shadow: var(--shadow); transform: translateX(-50%); backdrop-filter: blur(20px); }
.link-capture-copy { display: grid; gap: 4px; min-width: 0; }
.link-capture-copy strong { overflow: hidden; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.link-capture-copy p { margin: 0; color: var(--muted); font-size: 11px; }
.link-capture-actions { display: flex; gap: 8px; }

.graph-modal { width: min(1120px, calc(100vw - 28px)); height: min(760px, calc(100vh - 28px)); max-height: none; padding: 26px; overflow: hidden; }
.graph-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.graph-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; padding-right: 52px; }
.graph-heading h2 { margin-bottom: 5px; }
.graph-heading p { margin: 0; font-size: 12px; }
.graph-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; white-space: nowrap; }
.graph-legend span { width: 28px; height: 2px; background: hsl(var(--theme-hue) 92% 75% / .62); }
.node-graph-stage { position: relative; flex: 1; min-height: 0; overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: radial-gradient(circle at 50% 0, hsl(var(--theme-hue) 72% 59% / .22), transparent 42%), var(--theme-deep); overscroll-behavior: contain; }
.node-graph-stage { cursor: grab; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.node-graph-stage.is-panning { cursor: grabbing; user-select: none; }
.arrow-placement { position: fixed; z-index: 80; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; max-width: calc(100vw - 24px); padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-surface); color: var(--white); box-shadow: var(--shadow); }
.arrow-placement[hidden] { display: none; }
.arrow-placement button { min-height: 38px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--theme-raised); color: var(--white); cursor: pointer; }
.arrow-placement button:disabled { opacity: .5; cursor: default; }
.placing-arrow #pano-canvas { cursor: crosshair; }
.placing-arrow .hotspot-layer { pointer-events: none; }
.placing-arrow .hotspot { pointer-events: none; }
.placing-arrow .admin-dock { display: none; }
.hotspot-preview { border-color: white; }
.arrow-editor { position: absolute; z-index: 80; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(520px, calc(100vw - 24px)); max-height: calc(100dvh - 110px); overflow: auto; display: grid; grid-template-columns: 1fr; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: var(--theme-surface); color: var(--white); box-shadow: var(--shadow); }
.arrow-editor[hidden] { display: none; }
.upload-progress { display: block; width: 100%; height: 8px; margin-top: 18px; accent-color: var(--cyan); }
.upload-progress[hidden] { display: none; }
.arrow-editor-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.arrow-editor-heading strong { font-size: 15px; }
.arrow-editor-heading span, .arrow-editor > label { color: var(--muted); font-size: 11px; }
.arrow-editor select { min-width: 0; width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-deep); color: var(--white); font: inherit; font-size: 12px; }
.arrow-editor p { margin: 0; color: var(--white); font-size: 12px; line-height: 1.6; }
.arrow-editor-actions { display: flex; justify-content: flex-end; gap: 8px; }
.arrow-editor-actions button { min-height: 38px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--theme-raised); color: var(--white); font: inherit; font-size: 12px; cursor: pointer; }
.arrow-editor-actions button:disabled { opacity: .45; cursor: default; }
.editing-arrows .admin-dock, .editing-arrows .cursor-arrow, .editing-arrows .aim-crosshair { display: none; }
.arrow-targeting .hotspot { pointer-events: none; }
.arrow-targeting #pano-canvas { cursor: crosshair; }
.editing-arrows .hotspot-label { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 160px; padding: 5px 8px; border-radius: 6px; background: var(--theme-deep); color: var(--white); font-size: 11px; line-height: 1.4; pointer-events: none; }
.hotspot-selected .hotspot-icon { border: 2px solid white; background: hsl(var(--theme-hue) 60% 52% / .85); box-shadow: 0 0 25px hsl(var(--theme-hue) 90% 70% / .45); }
.node-graph-canvas { position: relative; min-width: 100%; min-height: 100%; }
.node-graph-lines { position: absolute; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
.graph-edge { stroke: hsl(var(--theme-hue) 92% 75% / .48); stroke-width: 2; }
.graph-edge.is-current { stroke: var(--mint); stroke-width: 3; filter: drop-shadow(0 0 5px hsl(var(--theme-hue) 92% 75% / .6)); }
.graph-draft-line { stroke: var(--cyan); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 8 7; filter: drop-shadow(0 0 5px hsl(var(--theme-hue) 92% 75% / .6)); }
.graph-floor-label { position: absolute; z-index: 2; left: 20px; display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .3); border-radius: 14px; background: hsl(var(--theme-hue) 39% 19% / .9); color: var(--cyan); font-size: 15px; font-weight: 850; pointer-events: none; }
.graph-node { position: absolute; z-index: 3; width: 168px; height: 104px; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.18); border-radius: 15px; background: var(--theme-raised); box-shadow: 0 12px 30px rgba(0,0,0,.3); text-align: left; cursor: grab; touch-action: none; user-select: none; transition: border-color .16s, box-shadow .16s, transform .16s; }
.graph-node:hover, .graph-node:focus-visible { border-color: hsl(var(--theme-hue) 92% 75% / .68); box-shadow: 0 15px 34px rgba(0,0,0,.38), 0 0 0 2px hsl(var(--theme-hue) 92% 75% / .08); }
.graph-node.is-current { border-color: hsl(var(--theme-hue) 92% 75% / .82); box-shadow: 0 0 0 2px hsl(var(--theme-hue) 92% 75% / .16), 0 15px 34px rgba(0,0,0,.38); }
.graph-node.is-dragging { z-index: 5; cursor: grabbing; transform: scale(1.035); }
.graph-node img { display: block; width: 100%; height: 58px; object-fit: cover; pointer-events: none; }
.graph-node-copy { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 7px; padding: 8px 10px; pointer-events: none; }
.graph-node-copy small { color: var(--cyan); font: 750 9px/1 ui-monospace, monospace; }
.graph-node-copy strong { overflow: hidden; color: white; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }

.link-manager-list { display: grid; gap: 8px; margin-top: 20px; }
.link-manager-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); }
.link-manager-row > div { display: grid; gap: 5px; }
.link-manager-row small { color: var(--muted); }
.small-button { min-height: 34px; padding: 0 12px; }
.empty-state { padding: 28px; border: 1px dashed var(--line); border-radius: 14px; text-align: center; }

.toast-region { position: fixed; z-index: 150; top: 84px; left: 50%; display: grid; gap: 8px; width: min(420px, calc(100vw - 30px)); transform: translateX(-50%); pointer-events: none; }
.toast { padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(29,19,47,.94); box-shadow: 0 14px 36px rgba(0,0,0,.3); color: var(--white); font-size: 12px; opacity: 0; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast-success { border-color: hsl(var(--theme-hue) 92% 75% / .42); }
.toast-error { border-color: hsl(var(--theme-hue) 92% 75% / .48); color: var(--cyan); }

@media (max-width: 860px) {
  .elevator-panel { right: 20px; width: 205px; }
}

@media (max-width: 640px) {
  .topbar { padding: max(12px, env(safe-area-inset-top)) 14px 10px; }
  .brand-copy small { font-size: 8px; }
  .brand-copy strong { font-size: 13px; }
  .admin-button { display: block; width: auto; min-width: 64px; padding: 8px; border-radius: 999px; color: var(--muted); font-size: 12px; }
  .admin-button.is-active { width: auto; color: var(--mint); }
  .admin-button::after { content: none; }
  .viewer-tools { right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); }
  .tool-button { width: 39px; height: 39px; }
  .elevator-panel { left: 50%; right: auto; top: auto; bottom: 120px; width: min(260px, calc(100vw - 32px)); transform: translateX(-50%); }
  .welcome h1 { font-size: clamp(32px, 9.7vw, 62px); letter-spacing: -.035em; }
  .welcome-action-slot { margin-top: 31px; }
  .welcome-loader { width: 38px; height: 38px; }
  .modal { padding: 25px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .split-actions { grid-template-columns: 1fr 1fr; }
  .split-actions span { display: none; }
  .admin-dock { bottom: max(12px, env(safe-area-inset-bottom)); width: calc(100vw - 20px); }
  .admin-actions { grid-template-columns: repeat(4, 1fr); }
  .link-capture { bottom: max(150px, calc(env(safe-area-inset-bottom) + 138px)); grid-template-columns: 1fr; gap: 10px; width: calc(100vw - 20px); }
  .link-capture-actions { justify-content: flex-end; }
  .graph-modal { width: calc(100vw - 12px); height: calc(100vh - 12px); padding: 20px 12px 12px; }
  .graph-heading { align-items: flex-start; padding-right: 42px; }
  .graph-legend { display: none; }
  .admin-mode .viewer-tools { display: grid; bottom: 180px; }
  .hotspot { width: 94px; }
  .hotspot-icon { width: 50px; height: 50px; }
}

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

.gungri-plan .plan-node.type-hall { background:var(--cyan);color:var(--theme-deep); }
.gungri-plan .plan-node.type-stairs { background:var(--theme-soft);color:white; }
.gungri-plan .plan-node.type-stairs-mid { background:#873dc6;color:white; }
.gungri-plan .plan-node.type-elevator-landing,.gungri-plan .plan-node.type-elevator-cab { background:var(--theme-raised);color:white; }
.gungri-plan .graph-edge { stroke:var(--blue); }
.geogyeong-plan .plan-node.type-hall { background:var(--theme-soft);border-color:var(--cyan);color:white; }
.geogyeong-plan .plan-node.type-stairs { background:var(--theme-soft);border-color:var(--cyan);color:white; }
.geogyeong-plan .plan-node.type-stairs-mid { background:var(--blue);border-color:var(--cyan);color:var(--theme-deep); }
.geogyeong-plan .graph-edge { stroke:var(--blue); }
.outdoor-plan { background:radial-gradient(circle at 66% 24%,hsl(var(--theme-hue) 42% 28% / .13),transparent 36%),linear-gradient(180deg,var(--theme-deep),var(--theme-deep)); }
.outdoor-plan .campus-map-title { position:absolute;z-index:3;left:22px;top:18px;color:var(--white);font-size:15px;letter-spacing:.08em; }
.campus-zone { position:absolute;z-index:0;display:flex;align-items:center;justify-content:center;border:1px solid hsl(var(--theme-hue) 45% 72% / .18);border-radius:20px;background:hsl(var(--theme-hue) 39% 15% / .48);color:hsl(var(--theme-hue) 45% 85% / .4);font-size:18px;font-weight:700;letter-spacing:.08em;pointer-events:none; }
.campus-zone-field { border-radius:42%;background:hsl(var(--theme-hue) 42% 28% / .2); }
.campus-zone-court { background:repeating-linear-gradient(45deg,hsl(var(--theme-hue) 39% 20% / .22) 0 12px,hsl(var(--theme-hue) 39% 17% / .22) 12px 24px); }
.campus-zone-gate { background:hsl(var(--theme-hue) 39% 16% / .38); }
.outdoor-plan .plan-node { width:25px;height:25px;border-color:var(--cyan);background:var(--blue);color:var(--theme-deep);font-size:9px; }
.outdoor-plan .plan-node.type-entrance { background:var(--theme-soft);border-color:var(--cyan); }
.outdoor-plan .graph-edge { stroke:var(--blue);stroke-width:4;opacity:.92; }
.outdoor-plan .graph-edge.is-secondary-path { stroke:var(--cyan); }

/* Boundary destinations are listed beside the diagram so distant nodes cannot
   look connected through intervening corridors. */
.boundary-rail { position: absolute; z-index: 3; top: 8px; bottom: 8px; width: 252px; overflow: auto; display: flex; flex-direction: column; gap: 9px; padding: 16px; border-left: 1px solid hsl(var(--theme-hue) 92% 75% / .28); background: hsl(var(--theme-hue) 39% 12% / .96); }
.boundary-rail > strong { padding-bottom: 9px; color: var(--cyan); font-size: 14px; }
.boundary-rail button { width: 100%; padding: 10px 12px; border: 1px solid hsl(var(--theme-hue) 92% 75% / .22); border-radius: 10px; background: var(--theme-raised); color: var(--white); text-align: left; font-size: 13px; line-height: 1.5; cursor: pointer; }
.boundary-rail button:hover,.boundary-rail button:focus-visible { border-color: var(--cyan); background: var(--theme-soft); }
/* Fixed purple interface palette. */
.modal,.tour-menu { background: var(--theme-surface); }
.plan-lane { background: hsl(var(--theme-hue) 39% 28% / .055); }
.plan-node:hover,.plan-node:focus-visible,.plan-node.is-current { outline-color: var(--cyan); }
.primary-button { background: linear-gradient(135deg,var(--blue),var(--cyan)); }
.admin-button:hover,.icon-button:hover { background: var(--theme-soft); border-color: var(--cyan); }

/* Color coded node types remain distinguishable without leaving blue accents behind. */
.gungri-plan .plan-node.type-stairs,.geogyeong-plan .plan-node.type-stairs { background: var(--theme-soft); border-color: var(--cyan); }
.gungri-plan .plan-node.type-stairs-mid,.geogyeong-plan .plan-node.type-stairs-mid { background: var(--blue); border-color: var(--cyan); color: var(--theme-deep); }
.gungri-plan .plan-node.type-elevator-landing,.gungri-plan .plan-node.type-elevator-cab { background: var(--theme-raised); border-color: var(--cyan); }
.campus-zone { background: hsl(var(--theme-hue) 39% 15% / .48); }
.outdoor-plan { background: radial-gradient(circle at 66% 24%,hsl(var(--theme-hue) 42% 28% / .2),transparent 36%),var(--theme-deep); }

/* Creator confirmation is independent of node type, building and photograph. */
.graph-tools { display: flex; align-items: end; justify-content: end; gap: 10px; flex-wrap: wrap; }
.graph-tools label { margin: 0; min-width: 110px; }
#graph-mark-mode { min-height: 44px; white-space: nowrap; }
#graph-mark-mode[hidden] { display: none; }
#graph-mark-mode.is-active { background: #492330; border-color: #ff8c9b; color: #ffdee3; }
.plan-legend .confirmed-legend { color: #ff8c9b; }
.graph-mark-status { margin: 0 0 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.graph-mark-status:empty { display: none; }
.node-graph-canvas [data-scene-id].is-location-confirmed { background: #b92239; border-color: #ffabb7; color: #fff; }
.node-graph-canvas [data-scene-id][aria-busy="true"] { opacity: .55; }
.node-graph-stage.is-marking-locations [data-scene-id] { cursor: crosshair; }
@media (max-width: 680px) {
  .graph-heading { flex-direction: column; align-items: stretch; gap: 12px; padding-right: 0; }
  .graph-heading > div:first-child { padding-right: 44px; }
  .graph-tools label,#graph-mark-mode { flex: 1; }
}
