:root {
  --bg: #0d1117;
  --panel: #131a22;
  --panel2: #18212b;
  --line: #26313d;
  --text: #d6dee8;
  --muted: #8592a3;
  --accent: #3fb6d8;
  --ok: #4cc27a;
  --warn: #e6b23c;
  --bad: #e5534b;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 11.5px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }

.top { height: 44px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--line); background: #0f151c; }
.brand b { font-size: 15px; letter-spacing: .5px; color: var(--accent); margin-right: 10px; }
.brand span { color: var(--muted); }
.top-run { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.layout { display: grid; grid-template-columns: 300px minmax(0, 1fr) 370px; height: calc(100vh - 44px); }
.panel { background: var(--panel); overflow-y: auto; padding: 10px 12px 24px; }
.left { border-right: 1px solid var(--line); }
.right { border-left: 1px solid var(--line); }
h2 { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--muted);
  margin: 14px 0 6px; }
h3 { font-size: 12.5px; margin: 0 0 6px; font-weight: 600; }
section:first-child h2 { margin-top: 2px; }

select, input, button { font: inherit; color: var(--text); background: var(--panel2);
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; }
select { width: 100%; margin-bottom: 4px; }
input[type=number], input:not([type]) { width: 100%; }
input[type=checkbox] { padding: 0; margin: 0 4px 0 0; accent-color: var(--accent); }
button { cursor: pointer; padding: 6px 10px; }
button:hover { border-color: var(--accent); }
button.primary { background: #1d5f78; border-color: #2a7d9c; color: #fff; }
button:disabled { opacity: .5; cursor: default; }
label { display: block; color: var(--muted); font-size: 11.5px; margin: 6px 0 2px; }
label > input, label > select { margin-top: 2px; color: var(--text); font-size: 13px; }
label.check { display: inline-flex; align-items: center; color: var(--text); font-size: 12.5px; margin: 4px 10px 4px 0; }

.runlist { list-style: none; margin: 0; padding: 0; max-height: 230px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 4px; }
.runlist li { padding: 6px 8px; border-bottom: 1px solid var(--line); cursor: pointer; display: grid;
  grid-template-columns: 1fr auto; gap: 0 6px; }
.runlist li:last-child { border-bottom: 0; }
.runlist li:hover { background: var(--panel2); }
.runlist li.sel { background: #173444; }
.runlist .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.runlist .meta { grid-column: 1 / 3; font-family: var(--mono); font-size: 11px; color: var(--muted); }
.badge { font-size: 10.5px; padding: 1px 6px; border-radius: 8px; border: 1px solid; white-space: nowrap; align-self: start; }
.badge.done { color: var(--ok); border-color: #2e6b46; }
.badge.running { color: var(--accent); border-color: #2a6578; }
.badge.queued { color: var(--warn); border-color: #6b5a2a; }
.badge.failed { color: var(--bad); border-color: #6b2e2b; }

.scform fieldset { border: 1px solid var(--line); border-radius: 4px; margin: 8px 0; padding: 4px 8px 6px; }
.scform legend { color: var(--muted); font-size: 11.5px; padding: 0 4px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; }
.checks label.check { margin: 2px 0; font-family: var(--mono); font-size: 11.5px; }
.groups { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.groups label { margin: 3px 0; }
.btns { display: flex; gap: 8px; margin-top: 10px; }
.btns button { flex: 1; }
.preview { margin-top: 10px; }
.preview .box, .card { background: var(--panel2); border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; margin-bottom: 8px; }
.err { color: var(--bad); }
.warn { color: var(--warn); }

/* centre */
.centre { position: relative; min-width: 0; background: #0a0e13; }
.view { position: absolute; inset: 0 0 44px 0; }
.view canvas { display: block; }
.toolbar { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; display: flex; align-items: center;
  gap: 4px; padding: 0 10px; background: #0f151c; border-top: 1px solid var(--line); overflow-x: auto; white-space: nowrap; }
.toolbar select { width: auto; margin: 0 4px 0 0; padding: 2px 4px; font-size: 12px; }
.toolbar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.slider { display: inline-flex; align-items: center; gap: 4px; margin: 0; color: var(--text); font-size: 12px; }
.slider input { width: 90px; padding: 0; }
.slider output { font-family: var(--mono); font-size: 11.5px; min-width: 44px; }
.legend { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.legend canvas { background: rgba(10, 14, 19, .78); border: 1px solid var(--line); border-radius: 4px; }
.pick { position: absolute; right: 10px; top: 50px; width: 230px; background: rgba(19, 26, 34, .95);
  border: 1px solid var(--line); border-radius: 5px; padding: 8px 10px; }
.pick .x { float: right; cursor: pointer; color: var(--muted); }
.viewnote { position: absolute; left: 10px; bottom: 52px; color: var(--muted); font-size: 11.5px; pointer-events: none; }

/* right */
.tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.tabs button { flex: 1; background: transparent; }
.tabs button.on { background: var(--panel2); border-color: var(--accent); color: #fff; }
.card h3 { display: flex; justify-content: space-between; align-items: baseline; }
.card .help { color: var(--muted); font-size: 11.5px; margin: 2px 0 4px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; }
.kv .v { font-family: var(--mono); text-align: right; }
.big { font-family: var(--mono); font-size: 20px; font-weight: 600; }
.big small { font-size: 12px; color: var(--muted); font-weight: 400; }
.kgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.kgrid .l { color: var(--muted); font-size: 11.5px; }
.prov { margin-top: 6px; font-size: 10.5px; color: #6f7d8e; font-family: var(--mono); border-top: 1px dashed var(--line); padding-top: 4px; }
.prov b { color: #8fb7c7; font-weight: 500; }
.tag-assume { display: inline-block; color: #1a1a1a; background: var(--warn); border-radius: 3px; padding: 0 5px; font-size: 11px; font-weight: 600; }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
th, td { padding: 3px 4px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-weight: 500; font-size: 11px; }
td { font-family: var(--mono); }
.good { color: var(--ok); }
.bad { color: var(--bad); }
.badge.invalid { color: var(--muted); border-color: #3a4552; text-decoration: line-through; }
.runlist li:has(.badge.invalid) { opacity: .45; }
.unsteady { background: #3a1716; border: 1px solid #7a2d29; color: #ffb4ae; border-radius: 4px; padding: 6px 8px; margin-bottom: 6px; font-weight: 600; }
.unsteady .small { font-weight: 400; color: #e8b4b0; margin-top: 2px; }

/* view modes, walk HUD, tour caption */
.modes { position: absolute; right: 10px; top: 10px; display: flex; gap: 0; z-index: 3; }
.modes button { border-radius: 0; background: rgba(19, 26, 34, .92); padding: 5px 12px; font-size: 12.5px; }
.modes button:first-child { border-radius: 4px 0 0 4px; }
.modes button:last-child { border-radius: 0 4px 4px 0; }
.modes button + button { border-left-width: 0; }
.modes button.on { background: #1d5f78; border-color: #2a7d9c; color: #fff; }
.crosshair { position: absolute; left: 50%; top: calc(50% - 22px); width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; }
.crosshair::before, .crosshair::after { content: ''; position: absolute; background: rgba(255, 255, 255, .55); }
.crosshair::before { left: 6px; top: 0; width: 2px; height: 14px; }
.crosshair::after { top: 6px; left: 0; height: 2px; width: 14px; }
.hud { position: absolute; left: 50%; transform: translateX(-50%); bottom: 58px; background: rgba(10, 14, 19, .86);
  border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; display: flex; gap: 16px; align-items: baseline; pointer-events: none; }
.hud .v { font-family: var(--mono); font-size: 18px; font-weight: 600; }
.hud .l { color: var(--muted); font-size: 11px; margin-right: 4px; }
.hud .prov { margin: 0; border: 0; padding: 0; }
.walkhelp { position: absolute; left: 50%; transform: translateX(-50%); top: 12px; color: #c8d2dd; font-size: 12px;
  background: rgba(10, 14, 19, .78); border: 1px solid var(--line); border-radius: 4px; padding: 4px 10px; pointer-events: none; }
.caption { position: absolute; left: 50%; transform: translateX(-50%); top: 14px; width: min(560px, 90%); background: rgba(13, 20, 28, .93);
  border: 1px solid #2a6578; border-left: 4px solid var(--accent); border-radius: 6px; padding: 10px 14px; }
.caption h3 { font-size: 15px; margin: 0 0 4px; display: flex; justify-content: space-between; align-items: baseline; }
.caption .step { font-family: var(--mono); color: var(--muted); font-size: 11.5px; font-weight: 400; }
.caption p { margin: 2px 0; font-size: 12.5px; }
.caption .btns { margin-top: 8px; }
.caption .btns button { flex: 0 0 auto; padding: 3px 10px; font-size: 12px; }
.view.walking canvas { cursor: crosshair; }
.hud { white-space: nowrap; }
.centre.immersive .legend { top: auto; bottom: 56px; }
.centre.immersive #legendRack, .centre.immersive .viewnote { display: none; }
.caption { z-index: 2; }
.hud { left: auto; right: 10px; transform: none; }
.hud { flex-wrap: wrap; width: 330px; gap: 2px 14px; white-space: normal; }
.hud > .num, .hud > .prov { flex-basis: 100%; }

/* ── 세션(헤더)·로그인 화면 ── */
.top-right { display: flex; align-items: center; gap: 14px; }
.session { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.session button { padding: 3px 9px; font-size: 12px; }
body.loginPage { display: grid; place-items: center; min-height: 100vh; }
.loginBox { width: min(340px, calc(100vw - 32px)); padding: 26px 24px 18px; background: var(--panel);
  border: 1px solid var(--line); border-radius: 8px; }
.loginBox h1 { font-size: 17px; font-weight: 600; margin: 0 0 4px; }
.loginBox h1 b { color: var(--accent); letter-spacing: .5px; margin-right: 4px; }
.loginBox p.muted { margin: 0 0 14px; font-size: 12px; }
.loginBox label { margin: 10px 0 2px; }
.loginBox input { width: 100%; padding: 7px 8px; }
.loginBox button { width: 100%; margin-top: 16px; padding: 8px; }
.loginBox .err { min-height: 1.4em; margin: 10px 0 0; color: var(--bad); font-size: 12px; }

/* ── hall builder · what-if · facility ─────────────────────────────────── */
#hallLeft, #hallPrev { display: none; }
body.building #hallLeft, body.building #hallPrev { display: block; }
body.building #mainLeft, body.building #rTabs, body.building #kpi, body.building #cmp, body.building #fac { display: none !important; }
button.wide { width: 100%; margin-bottom: 8px; }
button.mini { padding: 3px 8px; font-size: 11.5px; margin-top: 4px; }
textarea { width: 100%; font: inherit; color: var(--text); background: var(--panel2); border: 1px solid var(--line);
  border-radius: 4px; padding: 6px; resize: vertical; }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--accent); }
details > summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .4px; margin: 10px 0 4px; }
.exs { display: flex; gap: 4px; margin-top: 4px; }
.exs button { flex: 1; padding: 3px 4px; font-size: 11px; background: transparent; }
.hb { display: grid; grid-template-columns: 1.1fr 1fr 1fr 1.1fr auto; gap: 4px; align-items: end; margin-bottom: 4px; }
.hb label { margin: 0; }
.hb select { margin: 2px 0 0; }
.hb .x { padding: 4px 6px; background: transparent; }
.nlres { margin-top: 8px; padding: 6px 8px; border-left: 3px solid var(--accent); background: #13242d; border-radius: 3px; }
.nlres .src { font-size: 11.5px; color: #8fc9dc; }
.chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 6px 0 2px; }
.chip { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: #1d3a48; border: 1px solid #2a6578; color: #cfeaf3; }
ul.desc { margin: 0; padding-left: 16px; }
ul.desc li { margin: 2px 0; }
.tag-plain { display: inline-block; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 5px; font-size: 11px; font-weight: 500; }
.hallinfo { margin-top: 4px; }
.hallinfo .tag-plain { margin-right: 4px; }
table.ut { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 6px; }
table.ut th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 2px 4px; }
table.ut td { padding: 3px 4px; border-bottom: 1px solid #1f2a35; }
table.ut td:first-child { font-family: var(--mono); white-space: nowrap; }
table.ut tr.off td { opacity: .75; }
.card h4 { font-size: 11.5px; color: var(--muted); margin: 10px 0 4px; font-weight: 600; }
ul.chk { list-style: none; margin: 0; padding: 0; font-size: 12px; }
ul.chk li { padding: 2px 0; display: flex; gap: 6px; align-items: baseline; }
ul.chk .ic { width: 14px; text-align: center; font-weight: 700; }
ul.chk li.ok .ic { color: var(--ok); }
ul.chk li.no .ic, ul.chk li.no { color: var(--bad); }
ul.chk li.w .ic { color: var(--warn); }
.approve { margin-top: 10px; padding: 8px; border: 1px solid #2a6578; border-radius: 4px; background: #11262f; }
.approve label { color: var(--text); }
.bar { height: 6px; background: #1f2a35; border-radius: 3px; margin: 8px 0; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); transition: width .4s; }
ul.flog { list-style: none; margin: 0; padding: 0; font-size: 11.5px; max-height: 220px; overflow-y: auto; }
ul.flog li { padding: 3px 0; border-bottom: 1px dashed #1f2a35; }
ul.flog .cmds { font-family: var(--mono); font-size: 10.5px; color: #8fb7c7; margin-top: 1px; }
ul.plist { list-style: none; margin: 0; padding: 0; }
ul.plist li { padding: 4px 6px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12px; }
ul.plist li:hover { background: #1a2530; }
ul.plist li.sel { background: #173444; }
ul.plist .meta { display: block; color: var(--muted); font-size: 10.5px; font-family: var(--mono); }
