/* BSP 4D — 룸별 4D 뷰어 (2026-10-11 밤) · BSP HTS 4D 와 같은 어두운 바탕 */
:root { --bg:#0b1118; --panel:#111a24; --panel2:#152030; --line:#223044; --line2:#2c3d55; --text:#e6edf5; --muted:#8fa0b5; --accent:#2bd4ad; --accent2:#5ac8fa; --warn:#f2c14e; }
* { box-sizing:border-box; }
html, body { margin:0; height:100%; background:var(--bg); color:var(--text); font-family:system-ui, -apple-system, "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; }
button { font:inherit; color:var(--text); background:var(--panel2); border:1px solid var(--line2); border-radius:10px; padding:8px 14px; min-height:40px; cursor:pointer; }
button:hover { border-color:#3d5372; }
button.primary { background:linear-gradient(180deg,#2bd4ad,#1d9c80); border-color:#7dffe0; color:#05231b; font-weight:800; }
button.ghost { background:transparent; }
button.small { min-height:32px; padding:4px 10px; font-size:13px; }
input, select { font:inherit; color:var(--text); background:#0c1219; border:1px solid var(--line2); border-radius:10px; padding:9px 12px; min-height:42px; outline:none; }
input:focus, select:focus { border-color:var(--accent2); }
.hide { display:none !important; }
.mut { color:var(--muted); } .small { font-size:12.5px; }
.sp { flex:1; }

#top { position:fixed; inset:0 0 auto 0; height:56px; display:flex; align-items:center; gap:12px; padding:0 14px; background:rgba(11,17,24,.92); border-bottom:1px solid var(--line); z-index:10; backdrop-filter:blur(6px); }
.brand { display:flex; align-items:baseline; gap:8px; } .brand b { font-size:20px; font-weight:900; letter-spacing:.02em; color:#7dffe0; } .brand small { color:var(--muted); font-size:12px; }
#roomSel { min-width:220px; max-width:40vw; font-weight:800; }
#roomInfo { font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:36vw; }

.login { position:fixed; inset:56px 0 0 0; display:grid; place-items:center; padding:16px; }
.login .card { width:min(420px, 100%); background:var(--panel); border:1px solid var(--line2); border-radius:18px; padding:24px; display:grid; gap:12px; }
.login h1 { margin:0; font-size:30px; color:#7dffe0; }
.login label { display:grid; gap:6px; font-size:13px; color:var(--muted); }
.msg { min-height:20px; font-size:13px; color:#ff9f9f; } .msg.info { color:var(--accent2); }

.main { position:fixed; inset:56px 0 0 0; display:grid; grid-template-columns:300px minmax(0,1fr); }
#side { border-right:1px solid var(--line); background:var(--panel); overflow:auto; padding:10px; display:grid; gap:10px; align-content:start; }
.sbox { border:1px solid var(--line); border-radius:12px; padding:10px; background:#0f1722; display:grid; gap:8px; }
.shead { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.cats { display:grid; gap:4px; }
.cat { display:flex; align-items:center; gap:8px; padding:5px 6px; border-radius:8px; cursor:pointer; font-size:13px; user-select:none; }
.cat:hover { background:rgba(255,255,255,.04); }
.cat input { width:18px; height:18px; min-height:0; margin:0; }
.cat i { width:12px; height:12px; border-radius:3px; flex:none; border:1px solid rgba(255,255,255,.25); }
.cat span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cat small { color:var(--muted); }
.pick { display:grid; gap:4px; font-size:13px; line-height:1.45; word-break:break-all; }
.pick b { color:#ffd48a; font-size:14px; }
.pick .kv { display:grid; grid-template-columns:78px minmax(0,1fr); gap:6px; } .pick .kv span:first-child { color:var(--muted); }
.hint { line-height:1.6; }

.stage { position:relative; overflow:hidden; background:#0f141b; }
.stage canvas { display:block; width:100%; height:100%; touch-action:none; }
.tools { position:absolute; top:10px; right:10px; display:flex; gap:6px; z-index:3; }
.tools button { background:rgba(17,26,36,.85); }
.loadbox { position:absolute; left:50%; top:46%; transform:translate(-50%,-50%); width:min(420px, 80%); background:rgba(17,26,36,.95); border:1px solid var(--line2); border-radius:14px; padding:16px; display:grid; gap:8px; z-index:4; }
.bar { height:8px; border-radius:999px; background:#0c1219; overflow:hidden; } .bar i { display:block; height:100%; width:0; background:linear-gradient(90deg,#2bd4ad,#5ac8fa); }
.empty { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:15px; text-align:center; padding:20px; }
.toast { position:fixed; left:50%; bottom:22px; transform:translate(-50%, 20px); opacity:0; pointer-events:none; background:#1b2636; border:1px solid var(--line2); border-radius:12px; padding:10px 16px; transition:all .2s; z-index:20; }
.toast.on { opacity:1; transform:translate(-50%, 0); }

@media (max-width:820px) {
  .main { grid-template-columns:1fr; grid-template-rows:minmax(0,1fr) auto; }
  #side { order:2; max-height:38vh; border-right:0; border-top:1px solid var(--line); }
  #roomInfo { display:none; }
}

/* ★ 로그인 칸 — 이어서 들어오기 안내 (2026-10-11 밤) */
.lhint { display:grid; gap:6px; border:1px dashed #2c4a5e; border-radius:12px; padding:10px 12px; background:rgba(90,200,250,.06); font-size:13px; line-height:1.5; }
.lhint b { color:#bfe9ff; } .lhint i { font-style:normal; font-weight:800; color:#7dffe0; }
.lhint a { color:#5ac8fa; font-weight:800; text-decoration:none; } .lhint a:hover { text-decoration:underline; }
.lhint small { color:var(--muted); font-size:12px; }

/* ★ 색 모드 · 공정 리포트 (2026-10-11 밤 — 링크별 색 · 공정 샘플링 · 공종별 제작율 / 설치율 · 라인별) */
:root { --s4:#1b8a4c; --s3:#f28c28; --s2:#f2d53c; --s1:#8c939c; }
.center { display:flex; flex-direction:column; min-width:0; min-height:0; }
.center > .stage { flex:1; min-height:0; }
.seg { display:inline-flex; border:1px solid var(--line2); border-radius:10px; overflow:hidden; background:rgba(17,26,36,.85); }
.seg button { border:0; border-radius:0; min-height:32px; padding:4px 12px; font-size:13px; background:transparent; }
.seg button + button { border-left:1px solid var(--line2); }
.seg button.on { background:#1f3a4d; color:#dff4ff; font-weight:800; }
.seg button.samp { color:#ffe08a; } .seg button.samp.on { background:linear-gradient(180deg,#2a6b45,#1b8a4c); color:#fff; }
.legrow { display:flex; align-items:center; gap:8px; padding:3px 6px; font-size:13px; }
.legrow i { width:12px; height:12px; border-radius:3px; flex:none; border:1px solid rgba(255,255,255,.2); }
.legrow span { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .legrow small { color:var(--muted); }

.report { flex:none; height:min(330px, 42vh); border-top:2px solid #24405a; background:#0d151f; display:grid; grid-template-rows:auto minmax(0,1fr); }
.report.fold { height:44px; } .report.fold .rbody { display:none; }
.rhead { display:flex; align-items:center; gap:10px; padding:8px 12px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.rhead > b { font-size:15px; }
.rbadge { font-size:11.5px; font-weight:800; color:#2a1d00; background:#f2c14e; border-radius:999px; padding:2px 9px; }
.rleg { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:#c9d3df; } .rleg i { width:12px; height:12px; border-radius:3px; display:inline-block; margin-left:6px; }
.s4 { background:var(--s4); } .s3 { background:var(--s3); } .s2 { background:var(--s2); } .s1 { background:var(--s1); }
.rbody { display:grid; grid-template-columns:minmax(0, 1.25fr) minmax(0, 1fr); min-height:0; }
.rleft { overflow:auto; padding:10px 12px; display:grid; gap:10px; align-content:start; border-right:1px solid var(--line); }
.rtot { display:flex; align-items:stretch; gap:10px; flex-wrap:wrap; }
.tbig { display:grid; gap:2px; padding:8px 14px; border-radius:12px; background:#111c28; border:1px solid var(--line2); min-width:120px; }
.tbig small { color:var(--muted); font-size:12px; } .tbig b { font-size:30px; font-weight:900; line-height:1.05; } .tbig.f b { color:#ffe08a; } .tbig.d b { color:#3fd27e; } .tbig.r b { color:#ffb36b; }
.tbig.wide { flex:1; min-width:220px; align-content:center; }
.rdisc { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:10px; }
.dcard { border:1px solid var(--line2); border-left:5px solid var(--c, #4fc3f7); border-radius:12px; padding:9px 11px; background:#101a26; display:grid; gap:6px; cursor:pointer; }
.dcard:hover { border-color:#3d5372; } .dcard.on { box-shadow:0 0 0 2px var(--c, #4fc3f7) inset; }
.dhd { display:flex; align-items:baseline; gap:8px; } .dhd b { font-size:16px; font-weight:900; color:#f2f6fb; } .dhd small { color:var(--muted); font-size:12px; margin-left:auto; }
.dbar { display:grid; grid-template-columns:34px minmax(0,1fr) 46px; align-items:center; gap:8px; font-size:12.5px; } .dbar span { color:#c9d3df; } .dbar b { text-align:right; font-size:15px; }
.pbar { height:10px; border-radius:999px; background:#1b2532; overflow:hidden; } .pbar i { display:block; height:100%; border-radius:999px; }
.pbar.f i { background:linear-gradient(90deg,#d4b22a,#f2d53c); } .pbar.d i { background:linear-gradient(90deg,#167a42,#2fb86a); }
.stack { display:flex; height:8px; border-radius:999px; overflow:hidden; background:#1b2532; } .stack i { display:block; height:100%; }
.dutil { display:flex; flex-wrap:wrap; gap:4px; } .dutil span { font-size:11.5px; padding:1px 7px; border-radius:999px; background:#162231; border:1px solid var(--line2); color:#c9d3df; }
.rright { display:grid; grid-template-rows:auto minmax(0,1fr); min-height:0; }
.rlh { display:flex; align-items:center; gap:8px; padding:8px 12px; border-bottom:1px solid var(--line); } .rlh select { min-height:30px; padding:2px 8px; font-size:12.5px; }
.rlines { overflow:auto; }
.lr { display:grid; grid-template-columns:minmax(0, 2.2fr) minmax(0, .9fr) 64px 52px minmax(70px, 1fr) 44px 44px; align-items:center; gap:8px; padding:5px 12px; border-bottom:1px solid #16212e; font-size:12.5px; cursor:pointer; }
.lr:hover { background:rgba(255,255,255,.03); } .lr.on { background:rgba(90,200,250,.10); }
.lr.hd { position:sticky; top:0; background:#0f1923; color:var(--muted); font-size:11.5px; cursor:default; z-index:1; }
.lr b { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .lr span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#c9d3df; }
.lr .n { text-align:right; } .lr .pf { text-align:right; color:#ffe08a; font-weight:800; } .lr .pd { text-align:right; color:#3fd27e; font-weight:800; }
@media (max-width:1100px) { .rbody { grid-template-columns:1fr; } .rleft { border-right:0; border-bottom:1px solid var(--line); max-height:none; } .report { height:min(460px, 55vh); } }

/* ★ 공정 4D SIMULATION — 재생 막대 · 진행 글 (2026-10-11 밤) */
.simcap { position:absolute; left:12px; top:12px; z-index:3; padding:6px 12px; border-radius:10px; background:rgba(11,17,24,.82); border:1px solid var(--line2); font-size:13px; font-weight:700; color:#e6edf5; max-width:calc(100% - 420px); }
.simbar { position:absolute; left:50%; bottom:12px; transform:translateX(-50%); z-index:3; display:flex; align-items:center; gap:8px; padding:6px 10px; border-radius:12px; background:rgba(11,17,24,.9); border:1px solid var(--line2); width:min(900px, calc(100% - 24px)); }
.simbar input[type=range] { flex:1; min-width:120px; min-height:0; padding:0; accent-color:#2bd4ad; }
.simbar b { font-size:13px; white-space:nowrap; color:#ffe08a; min-width:150px; }
.simbar select { min-height:30px; padding:2px 6px; font-size:12.5px; }
.simbar #simPlay { min-width:44px; font-weight:900; background:linear-gradient(180deg,#2a6b45,#1b8a4c); color:#fff; border-color:#3fd27e; }
.simgh { display:flex; align-items:center; gap:5px; font-size:12px; color:#c9d3df; white-space:nowrap; } .simgh input { width:16px; height:16px; min-height:0; }
@media (max-width:820px) { .simcap { max-width:calc(100% - 24px); top:56px; } .simbar b { min-width:0; } .simgh { display:none; } }
