:root {
  color-scheme:dark;
  --shell:#191c1d; --panel:#202425; --panel-hi:#2d3233; --stroke:#393e3d;
  --text:#f7f7ef; --muted:#b2b8b2; --accent:#d8f18b; --ink:#20291d;
  font:14px/1.45 "Malgun Gothic","Apple SD Gothic Neo",system-ui,sans-serif;
}
* {box-sizing:border-box}
html,body,#tour {width:100%;height:100%;margin:0;overflow:hidden}
body,#tour {background:var(--shell);color:var(--text)}
#tour {display:flex;flex-direction:column}
button,input,select {font:inherit;color:inherit}
button,a,select {touch-action:manipulation;-webkit-tap-highlight-color:transparent}
button {cursor:pointer;border:0;background:transparent}
button:disabled {opacity:.32;cursor:default}
a {color:inherit}
button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible,canvas:focus-visible {outline:2px solid var(--accent);outline-offset:-2px}
button:not(:disabled),a {transition:background-color .15s,color .15s,border-color .15s}
[hidden] {display:none!important}
.sr-only,.symbols {position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);pointer-events:none}
.icon {display:block;flex:none;width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}
.topbar,.brand,.top-actions,.modes,.modes>*:is(button,a),.library-title,.filters,.search,.zone-select,.library-foot,.page-controls,.view-tools,.map-head,.scene-title,.location,.scene-tools,#focus-view,#view-type,.gesture,.route-heading,#route-list,.dock {display:flex;align-items:center}
.topbar {height:66px;flex:none;justify-content:space-between;gap:20px;padding:0 28px;border-bottom:1px solid var(--stroke)}
.brand,.top-actions {flex:1;gap:10px}
.brand {white-space:nowrap}
.brand-mark {width:34px;height:34px;display:grid;place-items:center;border-radius:50%;background:var(--accent);color:var(--ink)}
.brand-mark .icon {width:24px;height:24px;stroke-width:1.7}
.wordmark {font:600 28px/.95 Georgia,serif;letter-spacing:-1.6px}
.wordmark i {font-weight:400}
.brand-sub {margin-left:4px;padding-left:14px;border-left:1px solid var(--stroke);color:var(--muted);font-size:12px}
.modes {height:100%;gap:22px}
.modes>*:is(button,a) {height:100%;position:relative;gap:7px;padding:0 3px;text-decoration:none;color:var(--muted);font-size:13px;font-weight:600;white-space:nowrap}
.modes .icon {width:17px;height:17px}
.modes [aria-pressed=true],.modes>*:hover {color:var(--text)}
.modes [aria-pressed=true]::after {content:"";position:absolute;height:3px;border-radius:3px 3px 0 0;left:0;right:0;bottom:0;background:var(--accent)}
.modes [aria-pressed=true] .icon {color:var(--accent)}
.top-actions {justify-content:flex-end}
.top-actions button,.icon-btn,.view-tools button,.page-controls button {display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:36px;height:36px;border-radius:7px}
.top-actions #share {padding:0 13px;border:1px solid #535956;border-radius:20px;font-size:12px;font-weight:650}
.top-actions button:hover,.icon-btn:hover,.view-tools button:hover,.page-controls button:hover {background:var(--panel-hi)}
.workspace {display:flex;flex:1;min-height:0;position:relative}
#gallery {width:clamp(272px,21vw,340px);flex:none;display:flex;flex-direction:column;min-height:0;background:var(--panel);border-right:1px solid var(--stroke)}
.library-tools {padding:24px 18px 16px;border-bottom:1px solid var(--stroke)}
.library-title {gap:8px;margin-bottom:17px}
.library-title h2 {margin:0;font-size:21px;font-weight:650;letter-spacing:-1px}
#count,.route-heading span {font:12px/1.2 Consolas,monospace;color:var(--accent);font-variant-numeric:tabular-nums}
#close-library {margin-left:auto;color:var(--muted);height:30px;min-width:30px}
.search {height:38px;gap:9px;padding:0 11px;border:1px solid #454b49;background:#181b1b;border-radius:7px;color:var(--muted)}
.search:focus-within {outline:1px solid var(--accent)}
.search input {min-width:0;width:100%;height:100%;padding:0;border:0;outline:none;background:transparent;font-size:12px}
.search input::placeholder {color:#a4aaa5}
.search input:focus-visible {outline:0}
.search .icon,.filters .icon,.library-foot .icon,.route-heading .icon {width:15px;height:15px}
.filters {margin-top:10px;gap:8px;justify-content:space-between}
.filters button,.zone-select {display:inline-flex;align-items:center;gap:6px;border:1px solid var(--stroke);background:var(--panel);border-radius:16px;padding:4px 10px;font-size:11px;line-height:19px;color:#d0d5cf}
.zone-select {position:relative}
.zone-select select {appearance:none;border:0;padding:4px 24px 4px 31px;margin:-4px -10px;background:transparent;color:inherit;cursor:pointer;max-width:158px;z-index:1}
.zone-select option {background:var(--panel)}
.zone-select>.icon {position:absolute;pointer-events:none}
.zone-select>.icon:last-child {right:8px;width:11px}
.filters [aria-pressed=true] {color:var(--ink);border-color:var(--accent);background:var(--accent)}
#scenes {flex:1;min-height:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:16px 10px;padding:16px 16px 20px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#535a53 transparent}
#scenes button {position:relative;display:flex;min-width:0;flex-direction:column;align-items:stretch;padding:0;text-align:left;border-radius:5px;background:transparent}
#scenes img {width:100%;aspect-ratio:1.75;object-fit:cover;display:block;border-radius:5px;background:var(--panel-hi)}
#scenes button:after {content:"";pointer-events:none;position:absolute;top:0;left:0;width:100%;aspect-ratio:1.75;border-radius:5px;box-shadow:inset 0 0 0 1px #ffffff25}
#scenes button[aria-pressed=true]:after {box-shadow:inset 0 0 0 2px var(--accent)}
#scenes button:hover .scene-copy strong,#scenes [aria-pressed=true] .scene-copy strong {color:var(--accent)}
.scene-copy {min-width:0;padding:6px 1px 0;display:flex;flex-direction:column;gap:1px}
.scene-copy strong {font-size:12px;line-height:1.35;letter-spacing:-.25px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.scene-copy small {font-size:10px;color:var(--muted)}
.scene-index {position:absolute;left:5px;top:5px;background:#171b1bd9;color:#fff;border-radius:3px;padding:2px 4px;font:10px/1.15 Consolas,monospace}
[aria-pressed=true]>.scene-index {background:var(--accent);color:var(--ink)}
#scenes [data-saved=true] .scene-copy small:after {content:" ★";color:var(--accent)}
.library-foot {gap:7px;padding:12px 17px;border-top:1px solid var(--stroke);font-size:10px;color:var(--muted)}
.empty {padding:22px;display:grid;place-items:center;gap:10px;font-size:13px}
#scenes:has(+ .empty:not([hidden])) {flex:0;padding:0}
.empty button {color:var(--accent);text-decoration:underline}
.viewer-workspace {flex:1;min-width:0;min-height:0;display:flex;flex-direction:column;position:relative;background:var(--shell)}
.stage {flex:1;min-height:0;position:relative;isolation:isolate;overflow:hidden;background:#262827}
#view,#floor-points,.stage-shade {position:absolute;inset:0;width:100%;height:100%}
#view {display:block;cursor:grab;touch-action:none}
#view.page-scroll {touch-action:pan-y}
#view.dragging {cursor:grabbing}
.stage-shade {pointer-events:none;background:linear-gradient(0deg,#090d0ec4,transparent 24%),linear-gradient(180deg,#10131333,transparent 14%)}
#floor-points {pointer-events:none;overflow:hidden}
.floor-point,.door-point {position:absolute;transform:translate(-50%,-50%);pointer-events:auto}
.floor-point {display:grid;place-items:center;padding:0}
.floor-ring {
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:var(--ring-diameter); font-size:var(--ring-diameter);
  border:clamp(1px,.035em,2px) solid #fbffef; border-radius:50%;
  background:#26331c70; box-shadow:0 1px 3px #10140e9e,inset 0 0 0 .035em #ffffff42;
}
.floor-ring:after {
  content:""; position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width:40%; height:44%; background:white;
  clip-path:polygon(0 75%,50% 4%,100% 75%,89% 96%,50% 42%,11% 96%);
}
.floor-point:is(:hover,:focus-visible) .floor-ring {background:#778946ac;border-color:var(--accent)}
.floor-label,.door-point {color:white;background:#202420ef;border:1px solid #ffffff7a;border-radius:6px;padding:5px 8px;font-size:12px;white-space:nowrap}
.floor-label {position:absolute;left:50%;bottom:88%;transform:translateX(-50%);opacity:0;pointer-events:none}
.floor-point:is(:hover,:focus-visible) .floor-label {opacity:1}
.scene-tools,#focus-view {position:absolute;top:20px;height:34px;color:#fff;background:#1c201fd6;backdrop-filter:blur(10px);border:1px solid #ffffff48;border-radius:20px}
.scene-tools {left:24px}
#view-type {gap:6px;padding:0 11px;font-size:11px}
.scene-tools .icon,#focus-view .icon {width:15px;height:15px}
#light {display:grid;place-items:center;width:35px;height:27px;border-left:1px solid #ffffff40}
#light[aria-pressed=true] {color:var(--accent)}
#focus-view {right:24px;gap:6px;padding:0 11px;font-size:11px}
#focus-view:hover {background:#111c16}
#scene-badge {position:absolute;bottom:25px;left:30px;max-width:calc(100% - 230px);color:#fff;pointer-events:none;text-shadow:0 2px 12px #080a09a8}
.location {gap:6px;margin-bottom:7px;font-size:12px;color:#f1f1e7}
.location .icon {width:13px;height:13px}
#station-number {display:inline-block;margin-right:3px;padding:3px 7px;border-radius:3px;color:var(--ink);background:var(--accent);font:600 12px/1 Consolas,monospace;text-shadow:none}
.scene-title {gap:11px}
.scene-title h1 {margin:0;font-weight:650;font-size:clamp(25px,2.65vw,48px);line-height:1.18;letter-spacing:-1.8px;word-break:keep-all}
#save-scene {flex:none;pointer-events:auto;width:32px;height:32px;border:1px solid #ffffff80;border-radius:50%;display:grid;place-items:center;background:#21242285}
#save-scene .icon {width:15px;height:15px}
#save-scene[aria-pressed=true] {background:var(--accent);color:var(--ink);border-color:var(--accent)}
#save-scene[aria-pressed=true] .icon {fill:currentColor}
.map-card {position:absolute;bottom:20px;right:24px;width:134px;overflow:hidden;border-radius:9px;background:#f0f0e7ed;color:#30362f;border:1px solid #ffffffab;box-shadow:0 4px 15px #10151042}
.map-head {width:100%;gap:5px;padding:6px 9px;border-bottom:1px solid #c1c4b9;color:#383e35}
.map-head strong {font-size:10px}.map-head .icon {width:13px;height:13px}.map-head .icon:last-child {margin-left:auto}
#map-host {height:110px;background-image:radial-gradient(#49574629 .65px,transparent .85px);background-size:6px 6px}
#map-host svg {display:block;width:100%;height:100%} #map-host .map-station {cursor:pointer;outline:none}
#map-host .map-station:is(:focus-visible,:hover) circle:last-child {fill:#38460f;stroke:white;stroke-width:6}
#map-status {position:absolute;bottom:0;width:100%;background:#fffbeaef;text-align:center;font-size:10px;margin:0;padding:3px}
.dock {min-height:47px;flex:none;justify-content:space-between;padding:3px 20px;gap:10px;background:var(--shell);border-bottom:1px solid var(--stroke)}
.page-controls,.view-tools {gap:2px}.rule {width:1px;height:15px;background:#424846;margin:0 5px}
#position {font:12px/1 Consolas,monospace;white-space:nowrap;color:#e4e8df}
.page-controls .icon,.view-tools .icon {width:16px;height:16px}
.gesture {gap:6px;font-size:11px;color:var(--muted)}.gesture .icon {width:14px;height:14px}
.view-tools button {font-size:11px}.view-tools [aria-pressed=true],#map-toggle[aria-expanded=true] {background:#363d34;color:var(--accent)}#map-toggle {padding:0 10px}
#connections {display:flex;align-items:center;gap:18px;flex:none;min-width:0;padding:12px 20px;background:var(--panel)}
.route-heading {gap:6px;flex:none}.route-heading .icon {color:var(--accent)}.route-heading h2 {font-size:12px;margin:0;font-weight:650}
#route-list {gap:8px;flex:1;overflow:auto;scrollbar-width:thin;scrollbar-color:#586055 transparent;overscroll-behavior-x:contain}
#route-list button {display:flex;align-items:center;text-align:left;gap:9px;padding:4px 10px 4px 4px;border:1px solid var(--stroke);border-radius:7px;flex:none;background:#292d2e}
#route-list button:hover {border-color:var(--accent);background:#313830}
#route-list img {width:56px;height:39px;object-fit:cover;border-radius:4px}
#route-list span {display:grid;gap:1px;font-size:11px;white-space:nowrap}#route-list small {font:10px/1.1 Consolas,monospace;color:var(--muted)}
#miniature-caption {position:absolute;left:24px;top:64px;max-width:65%;padding:10px 12px;display:grid;gap:5px;border:1px solid #ffffff40;border-radius:9px;background:#202624e8;font-size:11px}
#miniature-caption strong {display:none}.model-tools {display:flex;gap:4px;flex-wrap:wrap}
.model-tools button {border:1px solid #596154;border-radius:5px;padding:4px 7px;font-size:11px}
.model-tools [aria-pressed=true] {color:var(--accent);background:#3e4639}
.miniature #floor-points,.miniature #rotate,.miniature #light,.miniature #connections,.miniature .map-heading {display:none}
#loading,#error {position:absolute;top:48%;left:50%;transform:translate(-50%,-50%);padding:10px 15px;border-radius:8px;background:#212623ec;color:white;font-size:13px}
#loading {display:flex;align-items:center;gap:8px;pointer-events:none}
.spinner {width:15px;height:15px;border:2px solid #fff5;border-top-color:var(--accent);border-radius:50%;animation:spin .9s linear infinite}
@keyframes spin {to {transform:rotate(360deg)}}
#error {text-align:center}
#error button,.accent-btn {background:var(--accent);color:var(--ink);border-radius:7px;padding:9px 14px;font-weight:650}
dialog {position:fixed;width:min(410px,calc(100vw - 28px));padding:25px;border:1px solid #50574f;border-radius:13px;background:var(--panel);color:var(--text);box-shadow:0 16px 70px #0006}
dialog::backdrop {background:#090d0dcc}
dialog h2 {font-size:21px;margin:0 30px 15px 0}dialog p,dialog dl {font-size:13px}
.dialog-close {position:absolute;top:10px;right:10px}
#share-url {width:100%;margin:0 0 13px;padding:10px;border:1px solid var(--stroke);border-radius:6px;background:var(--shell)}
#copy-status:empty {display:none}dialog dl {display:grid;grid-template-columns:auto 1fr;gap:10px}
dialog dt {font-weight:650}dialog dd {margin:0;color:var(--muted)}dialog #capture-note {font-size:11px;color:var(--muted)}
body.focus-view :is(.topbar,#gallery,.dock,#connections,.scene-tools,#map-card,#scene-badge,.stage-shade,#miniature-caption) {display:none}
body.focus-view #focus-view {opacity:.85}
#library-scrim {position:absolute;inset:0;z-index:4;background:#10141399}
@media(max-width:1120px) {.gesture,.brand-sub {display:none}#connections{gap:10px}.dock{padding-inline:12px}}
@media(max-width:830px) {
  .topbar {height:87px;display:grid;grid-template-columns:1fr auto;grid-template-rows:41px 36px;gap:2px 8px;padding:4px 15px}
  .brand-mark {width:27px;height:27px}.brand-mark .icon {width:19px;height:19px}.wordmark {font-size:24px}
  .modes {grid-column:1/-1;grid-row:2;justify-content:center;gap:24px}
  .modes>*:is(button,a) {font-size:12px}.modes .icon {width:15px;height:15px}
  .top-actions {grid-column:2;grid-row:1;gap:4px}.top-actions button {min-width:32px;height:30px}
  #gallery {position:absolute;inset:0 auto 0 0;width:min(328px,87vw);z-index:5;box-shadow:5px 0 28px #1118}
  .library-tools {padding-top:15px}.dock {min-height:46px;padding:2px 7px}.view-tools button,.page-controls button{min-width:33px}
  #scene-badge {left:17px;bottom:19px;max-width:calc(100% - 28px)}.scene-title h1 {font-size:28px}
  .scene-tools {top:13px;left:14px}#focus-view {top:13px;right:14px}
  .map-card {top:56px;right:14px;bottom:auto;width:116px}#map-host {height:95px}
  #map-toggle span {display:none}#map-toggle {padding:0}
  #connections {display:block;padding:8px 12px max(8px,env(safe-area-inset-bottom))}
  .route-heading {margin-bottom:6px}.route-heading h2 {font-size:11px}.route-heading .icon {width:13px;height:13px}
  #route-list button {padding-right:7px}#route-list img {width:43px;height:32px}
}
@media(max-width:380px) {.dock .rule{margin:0 2px}.page-controls button,.view-tools button{min-width:30px}}
@media(max-height:540px) {
  .topbar {display:flex;height:43px;min-height:0;padding-block:0}.modes{height:100%;gap:12px}.top-actions{flex:0}
  #connections {padding:4px 12px;display:flex}.route-heading{margin:0}.dock{min-height:36px}
  .scene-tools,#focus-view{top:8px}.map-card{top:47px;bottom:auto;width:95px}#map-host{height:68px}
  #scene-badge{bottom:8px}.library-tools{padding-block:7px}.library-title{margin-bottom:5px}
}
@media(prefers-reduced-motion:reduce) {*,*::before,*::after {transition:none!important}.spinner{animation:none}}
.photo-walk #tour {position:relative}
.photo-stage, .photo-stage #photo-next, .photo-stage img {display:block;width:100%;height:100%;padding:0;object-fit:cover}
.photo-stage #photo-next:disabled {opacity:1}
.photo-stage p:not(:empty) {position:absolute;top:45%;background:var(--shell);padding:.6rem}
.photo-walk h1 {position:absolute;bottom:18px;left:20px;margin:0;color:white;text-shadow:0 1px 5px #111;pointer-events:none}
.photo-turn,.photo-places {position:absolute;top:12px;padding:4px 8px;border-radius:12px;background:#1c201fe8}
.photo-turn {left:12px}
.photo-turn button,.photo-places summary,.photo-places nav button {min-height:36px;align-content:center;cursor:pointer}
.photo-places {right:12px;max-height:75%;max-width:60%;overflow:auto}
.photo-places label,.photo-places nav {display:grid;gap:4px}
.photo-places select {background:var(--shell)}

.panorama-only :is(.topbar,#gallery,#library-scrim,.dock,#connections) {display:none}
.panorama-only .scene-tools {top:clamp(12px,3.3vw,20px);left:clamp(12px,4vw,24px)}
.panorama-only #focus-view {top:clamp(12px,3.3vw,20px);right:clamp(12px,3.5vw,24px)}
.panorama-only .map-card {top:auto;bottom:clamp(10px,2.5vw,20px);right:clamp(10px,3.5vw,24px);width:clamp(88px,22vw,134px)}
.panorama-only #map-host {height:auto;aspect-ratio:134/110}
.panorama-only #scene-badge {left:clamp(14px,5vw,30px);bottom:clamp(12px,3.5vw,25px);max-width:calc(100% - clamp(88px,22vw,134px) - 55px)}
.panorama-only .scene-title h1 {font-size:clamp(24px,3vw,42px)}
@media(max-width:420px) {
  .panorama-only .scene-title {gap:5px}
  .panorama-only .scene-title h1 {font-size:22px}
}

.walk-only .stage > :not(#view, #floor-points, #loading, #error),
.walk-only .photo-turn, .walk-only .photo-places, .walk-only #photo-name {display:none}
.walk-only #photo-connections {
  position:absolute; inset:auto 0 12px; display:flex; justify-content:safe center;
  gap:6px; padding-inline:12px; overflow-x:auto;
}
.walk-only #photo-connections button {
  flex:none; min-height:42px; padding:6px 12px; color:white; background:#1c201fe8;
  border:1px solid #ffffff80; border-radius:24px;
}
