:root {
  --acc: #36d399; --acc2: #27d3ff; --warn: #ffb340; --ink: #0b1220; --panel: rgba(12, 18, 30, .86); --panel2: rgba(18, 26, 42, .9); --line: rgba(255, 255, 255, .12); --txt: #e8edf5; --muted: rgba(232, 237, 245, .62);
  --r: 12px; --shadow: 0 8px 28px rgba(0, 0, 0, .35); --font: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05080f; font-family: var(--font); color: var(--txt); font-size: 13px; }
button, select, input { font: inherit; color: inherit; }
#cesium { position: absolute; inset: 0; }
#three { position: absolute; inset: 0; width: 100%; height: 100%; display: block; visibility: hidden; pointer-events: none; }
#markers, #labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#fade { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 30; }
#ripple { position: absolute; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--acc); pointer-events: none; opacity: 0; transform: translate(-50%, -50%); z-index: 25; }
#ripple.go { animation: rip .6s ease-out; } @keyframes rip { 0% { opacity: 1; transform: translate(-50%, -50%) scale(1) } 100% { opacity: 0; transform: translate(-50%, -50%) scale(5) } }
.cesium-viewer-bottom, .cesium-widget-credits { display: none !important; }

/* 마커 */
.mk { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); pointer-events: auto; cursor: pointer; display: flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .2s; will-change: transform; z-index: 5; }
.mk.show { opacity: 1; } .mk.occ { opacity: .25; }
.mk .dot { width: 16px; height: 16px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 4px rgba(54, 211, 153, .25), 0 2px 8px rgba(0, 0, 0, .5); flex: none; position: relative; }
.mk .dot::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid rgba(54, 211, 153, .55); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.6); opacity: .9 } 100% { transform: scale(1.7); opacity: 0 } }
.mk .lbl { background: rgba(6, 10, 18, .88); color: #fff; font-size: 12px; padding: 4px 9px; border-radius: 6px; white-space: nowrap; border: 1px solid rgba(54, 211, 153, .35); }
.mk:hover .lbl, .mk.sel .lbl { background: var(--acc); color: #05110a; }
.mk.bldg .dot { width: 22px; height: 22px; background: var(--acc2); box-shadow: 0 0 0 5px rgba(39, 211, 255, .2), 0 2px 10px rgba(0, 0, 0, .6); } .mk.bldg .dot::after { border-color: rgba(39, 211, 255, .6); } .mk.bldg .lbl { font-size: 13px; font-weight: 600; border-color: rgba(39, 211, 255, .45); padding: 6px 11px; }
.mk.bldg .lbl small { display: block; font-weight: 400; opacity: .7; font-size: 11px; }
.mk.floor .dot { width: 11px; height: 11px; } .mk.floor .dot::after { display: none; } .mk.floor .lbl { font-size: 11px; padding: 3px 7px; }
.mk.unit .dot { background: var(--warn); box-shadow: 0 0 0 4px rgba(255, 179, 64, .22), 0 2px 8px rgba(0, 0, 0, .5); } .mk.unit .dot::after { border-color: rgba(255, 179, 64, .6); }
.mk.room { pointer-events: none; } .mk.room .dot { display: none; } .mk.room .lbl { background: rgba(8, 12, 20, .72); border-color: rgba(255, 255, 255, .18); font-size: 11px; padding: 2px 6px; }
.mk.nav .dot { background: #ff6b6b; }
#tip { position: absolute; z-index: 40; background: rgba(6, 10, 18, .92); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; font-size: 12px; pointer-events: none; max-width: 260px; box-shadow: var(--shadow); }
#tip b { color: var(--acc); }

/* 상단바 */
#topbar { position: absolute; left: 0; right: 0; top: 0; height: 52px; display: flex; align-items: center; gap: 12px; padding: 0 14px; background: linear-gradient(180deg, rgba(5, 8, 15, .92), rgba(5, 8, 15, .6)); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; } .logo { width: 28px; height: 28px; border-radius: 8px; background: conic-gradient(from 210deg, var(--acc), var(--acc2), #7c5cff, var(--acc)); box-shadow: 0 0 0 2px rgba(255, 255, 255, .08) inset; }
.brand .t { font-weight: 700; font-size: 14px; letter-spacing: -.2px; } .brand .s { font-size: 11px; color: var(--muted); }
#bldgTabs { display: flex; gap: 6px; margin-left: 8px; } #bldgTabs button { border-radius: 999px; padding: 6px 12px; }
#crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; margin-left: 8px; } #crumb span { opacity: .75; cursor: pointer; } #crumb span:hover { opacity: 1; text-decoration: underline; } #crumb span.cur { opacity: 1; color: var(--acc); font-weight: 600; cursor: default; text-decoration: none; } #crumb .sep { opacity: .35; cursor: default; }
.spacer { flex: 1; }
.tb-group { display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: 10px; padding: 4px 8px; }
.tb-group .ic { opacity: .7; } #hour { width: 130px; accent-color: var(--acc); } #hourLbl { font-variant-numeric: tabular-nums; min-width: 40px; text-align: center; }
button { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 12px; transition: background .15s, border-color .15s; white-space: nowrap; }
button:hover { background: rgba(54, 211, 153, .16); border-color: rgba(54, 211, 153, .5); } button.on { background: var(--acc); color: #05110a; border-color: var(--acc); font-weight: 600; } button.accent { background: rgba(39, 211, 255, .18); border-color: rgba(39, 211, 255, .5); } button.accent:hover { background: rgba(39, 211, 255, .32); }
button.mini { padding: 4px 8px; font-size: 11.5px; } button:disabled { opacity: .4; cursor: default; }
select { background: rgba(255, 255, 255, .07); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; } select option { background: #101826; }
input[type=range] { accent-color: var(--acc); }
.rowb { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; } .rowb.small button { font-size: 11px; padding: 4px 8px; }
.muted { color: var(--muted); }

/* 좌측 패널 */
#leftPanel { position: absolute; left: 14px; top: 64px; bottom: 60px; width: 330px; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); backdrop-filter: blur(10px); z-index: 15; overflow: hidden; transition: transform .25s, opacity .25s; }
#leftPanel.hide { transform: translateX(-110%); opacity: 0; pointer-events: none; }
#bcard { display: flex; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); } #bthumb { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #101826; }
.bc-body { flex: 1; min-width: 0; } #bname { margin: 0 0 2px; font-size: 15px; } .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: 11.5px; margin: 6px 0 8px; } .stats span { color: var(--muted); } .stats b { font-weight: 500; }
.tabs { display: flex; border-bottom: 1px solid var(--line); } .tabs button { flex: 1; border: 0; border-radius: 0; background: transparent; padding: 9px 0; color: var(--muted); } .tabs button.on { color: var(--acc); background: transparent; box-shadow: inset 0 -2px 0 var(--acc); font-weight: 600; }
.tab { display: none; flex: 1; overflow: auto; padding: 10px 12px; } .tab.on { display: block; }
#floorStack { display: flex; flex-direction: column-reverse; gap: 3px; }
.fr { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; } .fr:hover { background: rgba(255, 255, 255, .06); } .fr.on { background: rgba(54, 211, 153, .16); border-color: rgba(54, 211, 153, .5); } .fr.dim { opacity: .45; }
.fr .fno { width: 34px; font-weight: 600; font-variant-numeric: tabular-nums; } .fr .use { flex: 1; font-size: 12px; color: var(--muted); } .fr .chip { width: 8px; height: 8px; border-radius: 2px; } .fr .cnt { font-size: 11px; color: var(--muted); }
#zoneList { margin-top: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; } .zn { padding: 7px 9px; border-radius: 8px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); cursor: pointer; font-size: 12px; } .zn:hover { border-color: rgba(255, 179, 64, .6); } .zn small { display: block; color: var(--muted); font-size: 11px; } .zn.no { cursor: default; opacity: .6; }
.srch { display: flex; gap: 6px; } .srch input { flex: 1; background: rgba(255, 255, 255, .06); border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; } .chips button { font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.tree { font-size: 12.5px; } .tn { padding: 4px 6px; border-radius: 6px; cursor: pointer; display: flex; align-items: center; gap: 6px; } .tn:hover { background: rgba(255, 255, 255, .06); } .tn.sel { background: rgba(54, 211, 153, .18); } .tn .k { width: 8px; height: 8px; border-radius: 50%; flex: none; } .tn .ty { color: var(--muted); font-size: 11px; margin-left: auto; }
.tn.l1 { padding-left: 18px; } .tn.l2 { padding-left: 32px; } .tg { cursor: pointer; padding: 6px; font-weight: 600; display: flex; gap: 6px; align-items: center; } .tg::before { content: "▾"; opacity: .6; } .tg.closed::before { content: "▸"; } .tg + .tc.closed { display: none; }
.detail { margin-top: 8px; padding: 10px; border-radius: 10px; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); } .detail h4 { margin: 0 0 6px; color: var(--acc); font-size: 13px; } .detail .kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: 12px; } .detail .kv span { color: var(--muted); } .detail .rel { margin-top: 8px; } .detail .rel b { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.navrow { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .navrow label { width: 34px; color: var(--muted); } .navrow select { flex: 1; min-width: 0; }
#routeLegs { padding-left: 18px; font-size: 12px; } #routeLegs li { margin: 4px 0; cursor: pointer; } #routeLegs li:hover { color: var(--acc); }

/* 우측 도구 */
#tools { position: absolute; right: 14px; top: 64px; display: flex; flex-direction: column; gap: 8px; z-index: 15; width: 232px; }
#tools .grp { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; backdrop-filter: blur(10px); box-shadow: var(--shadow); } #tools .t { font-size: 11px; color: var(--muted); }
#cutH { width: 150px; } #cutLbl { font-size: 11px; color: var(--muted); }
.blist { display: flex; flex-direction: column; gap: 4px; } .bl { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; font-size: 12px; } .bl:hover { background: rgba(255, 255, 255, .06); } .bl.on { border-color: rgba(39, 211, 255, .5); background: rgba(39, 211, 255, .12); } .bl img { width: 42px; height: 30px; object-fit: cover; border-radius: 4px; background: #101826; } .bl small { display: block; color: var(--muted); font-size: 10.5px; }

/* 하단 */
#floorbar { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); display: none; gap: 3px; background: var(--panel); padding: 6px 8px; border-radius: 12px; border: 1px solid var(--line); max-width: 70vw; overflow-x: auto; backdrop-filter: blur(8px); z-index: 15; }
#floorbar.show { display: flex; } #floorbar button { min-width: 40px; padding: 5px 5px; font-size: 11px; }
#bottom { position: absolute; left: 14px; right: 14px; bottom: 12px; display: flex; align-items: center; gap: 12px; z-index: 15; pointer-events: none; }
#status { font-size: 11px; color: var(--muted); background: rgba(0, 0, 0, .45); padding: 4px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; } #hint { font-size: 12px; background: rgba(0, 0, 0, .45); padding: 4px 10px; border-radius: 6px; color: var(--txt); opacity: .9; }
#compass { margin-left: auto; width: 44px; height: 44px; border-radius: 50%; background: rgba(6, 10, 18, .8); border: 1px solid var(--line); position: relative; pointer-events: auto; cursor: pointer; } #compass .n { position: absolute; left: 50%; top: 3px; transform: translateX(-50%); font-size: 10px; color: var(--acc); font-weight: 700; } #compass .needle { position: absolute; left: 50%; top: 50%; width: 3px; height: 16px; margin: -16px 0 0 -1.5px; background: linear-gradient(var(--acc), transparent); transform-origin: 50% 100%; border-radius: 2px; }
#legend { position: absolute; right: 14px; bottom: 12px; z-index: 15; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; } #legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
#walkHint { position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); font-size: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; z-index: 15; }
#toast { position: absolute; left: 50%; top: 66px; transform: translate(-50%, -10px); background: rgba(6, 10, 18, .92); border: 1px solid rgba(54, 211, 153, .4); border-radius: 10px; padding: 8px 14px; font-size: 12.5px; opacity: 0; transition: opacity .25s, transform .25s; z-index: 45; pointer-events: none; } #toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 로딩 · 도움말 · 갤러리 */
#loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 50% 40%, #0e1830, #05080f); z-index: 50; transition: opacity .6s; } #loading.out { opacity: 0; pointer-events: none; }
.ld-box { display: flex; flex-direction: column; align-items: center; gap: 12px; } .ld-logo { width: 54px; height: 54px; border-radius: 16px; background: conic-gradient(from 210deg, var(--acc), var(--acc2), #7c5cff, var(--acc)); animation: spin 3s linear infinite; } @keyframes spin { to { transform: rotate(360deg) } }
.ld-t { font-size: 16px; font-weight: 600; } .bar { width: 280px; height: 4px; background: rgba(255, 255, 255, .12); border-radius: 2px; overflow: hidden; } .bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--acc), var(--acc2)); transition: width .3s; } #ltxt { font-size: 12px; color: var(--muted); }
#help { position: absolute; inset: 0; background: rgba(4, 8, 14, .7); z-index: 46; display: flex; align-items: center; justify-content: center; } .hb { background: var(--panel2); border: 1px solid var(--line); border-radius: 14px; padding: 18px 22px; max-width: 560px; font-size: 13px; line-height: 1.6; } .hb h3 { margin: 0 0 8px; } .hb ul { padding-left: 18px; margin: 0 0 12px; }
#gallery { position: absolute; inset: 0; background: rgba(4, 8, 14, .94); z-index: 44; display: flex; flex-direction: column; } #gallery .gh { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); } #gallery .gh span { opacity: .6; flex: 1; font-size: 11px; }
#gallery .gg { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; padding: 12px; } #gallery .gi { cursor: pointer; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 11px; } #gallery .gi img { width: 100%; height: 150px; object-fit: contain; background: #fff; } #gallery .gi span { display: block; padding: 6px 8px; opacity: .85; }
#gallery .gv { position: absolute; inset: 0; background: rgba(0, 0, 0, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: zoom-out; } #gallery .gv img { max-width: 96vw; max-height: 88vh; background: #fff; } #gallery .gv div { margin-top: 8px; }

/* 상태별 표시 */
body.stage-city #modes, body.stage-city #floorbar { display: none !important; }
body.walk #leftPanel, body.walk #tools .grp:not(#unitModes) { opacity: .35; pointer-events: none; }
@media (max-width: 1100px) { #leftPanel { width: 290px; } #tools { width: 200px; } #timeCtl #hour { width: 90px; } }
@media (max-width: 820px) {
  #topbar { height: 48px; gap: 8px; padding: 0 10px; } .brand .s, #crumb, #timeCtl, #shareBtn { display: none; }
  #leftPanel { left: 8px; right: 8px; width: auto; top: auto; bottom: 8px; height: 46vh; } #leftPanel.hide { transform: translateY(110%); }
  #tools { right: 8px; top: 56px; width: 168px; } #tools .grp:not(#unitModes):not(#modes) { display: none; } #bottom { bottom: calc(46vh + 14px); } #floorbar { bottom: calc(46vh + 14px); max-width: 94vw; }
}
