:root {
  --bg: #0e1319; --bg2: #151c24; --bg3: #1d2630; --line: #2a3542; --fg: #e3e9ef; --muted: #8a97a6;
  --accent: #39b8e6; --ok: #3fb950; --warn: #e3a32b; --crit: #ef5350; --info: #6aa3ff;
  --scene: #10161d;
  --font: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Noto Sans CJK KR", system-ui, sans-serif;
}
:root[data-theme="light"] {
  --bg: #f3f5f8; --bg2: #ffffff; --bg3: #eef1f5; --line: #d5dbe3; --fg: #18212b; --muted: #627083;
  --accent: #0b84c6; --scene: #dfe5ec;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 1rem/1.45 var(--font); }
button, select, input { font: inherit; color: inherit; }
button, select { background: var(--bg3); border: 0.07143rem solid var(--line); border-radius: 0.4286rem; padding: 0.2857rem 0.6429rem; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: not-allowed; }
input { background: var(--bg); border: 0.07143rem solid var(--line); border-radius: 0.4286rem; padding: 0.2857rem 0.5rem; width: 6rem; }
.muted { color: var(--muted); }
[hidden] { display: none !important; }

#top { height: 3.429rem; display: flex; align-items: center; gap: 0.7143rem; padding: 0 1rem; background: var(--bg2); border-bottom: 0.07143rem solid var(--line); position: relative; z-index: 5; }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; white-space: nowrap; }
#crumbs { display: flex; gap: 0.4286rem; color: var(--muted); white-space: nowrap; overflow: hidden; }
#crumbs a { color: var(--muted); text-decoration: none; }
#crumbs a:hover { color: var(--accent); }
#crumbs b { color: var(--fg); font-weight: 600; }
.spacer { flex: 1; }
#simbar { display: flex; align-items: center; gap: 0.5714rem; }
.navlink { color: var(--muted); text-decoration: none; padding: 0.2143rem 0.5714rem; border-radius: 0.4286rem; }
.navlink:hover, .navlink.on { color: var(--fg); background: var(--bg3); }
.srcTag { font-size: 0.8571rem; padding: 0.1429rem 0.5714rem; border-radius: 0.7143rem; border: 0.07143rem dashed var(--warn); color: var(--warn); white-space: nowrap; }
.srcTag.real { border-style: solid; border-color: var(--ok); color: var(--ok); }
#helpBtn { width: 2.143rem; padding: 0.2857rem 0; font-weight: 700; }
input[type="date"] { width: auto; }
.badge { font-weight: 700; }
.badge.CHG { color: #8fd3ff; } .badge.DIS { color: #b6a8ff; } .badge.SIM { color: #ffd479; } .badge.CHILL { color: #ffa48c; }
#clock { font-variant-numeric: tabular-nums; color: var(--muted); }

main { position: absolute; inset: 3.429rem 0 0 0; }
.view { position: absolute; inset: 0; }

/* L0 지점 선택 · 보고서 */
#sites, #reports, #whatif { overflow: auto; padding: 1.571rem clamp(1.143rem, 4vw, 2.857rem) 2.857rem; }
#sites h1, #reports h1, #whatif h1 { font-size: 1.429rem; margin: 0 0 0.2857rem; }
#sites .lead, #reports .lead, #whatif .lead { color: var(--muted); margin: 0 0 1.286rem; max-width: 64.29rem; }
.rcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.57rem, 1fr)); gap: 0.8571rem; }
.rcard { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.8571rem 1rem; }
.rcard h3 { margin: 0 0 0.4286rem; font-size: 1.071rem; }
.rcard dl { display: grid; grid-template-columns: auto 1fr; gap: 0.1429rem 0.7143rem; margin: 0.5714rem 0; font-size: 0.9286rem; }
.rcard dt { color: var(--muted); } .rcard dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.rcard .act { display: flex; gap: 0.4286rem; flex-wrap: wrap; }
.rcard .act a { color: var(--accent); text-decoration: none; border: 0.07143rem solid var(--line); border-radius: 0.4286rem; padding: 0.2143rem 0.6429rem; }
.region { margin-bottom: 1.286rem; }
.region h2 { font-size: 0.9286rem; color: var(--muted); font-weight: 600; margin: 0 0 0.5714rem; letter-spacing: .02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(13.57rem, 1fr)); gap: 0.7143rem; }
.card { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.7857rem 0.9286rem; min-height: 5.429rem; }
.card.twin { cursor: pointer; border-color: var(--accent); grid-column: span 2; }
.card.twin:hover { box-shadow: 0 0 0 0.1429rem var(--accent) inset; }
.card .nm { font-weight: 600; }
.card .st { margin-top: 0.4286rem; font-size: 0.9286rem; color: var(--muted); }
.card.wait { opacity: .6; }
.dot { display: inline-block; width: 0.5714rem; height: 0.5714rem; border-radius: 50%; margin-right: 0.3571rem; background: var(--muted); vertical-align: middle; }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.crit { background: var(--crit); }

/* 3D 스테이지 */
#c { width: 100%; height: 100%; display: block; }
#labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl { position: absolute; transform: translate(-50%, -100%); pointer-events: auto; cursor: pointer; white-space: nowrap;
  background: color-mix(in srgb, var(--bg2) 88%, transparent); border: 0.07143rem solid var(--line); border-radius: 0.4286rem;
  padding: 0.1429rem 0.5rem; font-size: 0.8571rem; line-height: 1.3; }
.lbl small { color: var(--muted); }
.lbl.alarm { border-color: var(--crit); box-shadow: 0 0 0 0.07143rem var(--crit); }
.lbl.sel { border-color: var(--accent); }
.lbl.pin { font-size: 0.9286rem; padding: 0.3571rem 0.7143rem; border-color: #ff9a3c; }
#loading { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); background: var(--scene); }
main { --sl: 0; }
main.sideOpen { --sl: 21.43rem; }
#hint { position: absolute; left: calc(3.714rem + var(--sl)); top: 0.8571rem; color: var(--muted); font-size: 0.9286rem; pointer-events: none; }
#legend { position: absolute; left: calc(1rem + var(--sl)); bottom: 0.8571rem; display: flex; gap: 0.8571rem; font-size: 0.8571rem; color: var(--muted);
  background: color-mix(in srgb, var(--bg2) 80%, transparent); padding: 0.2857rem 0.6429rem; border-radius: 0.4286rem; }
#legend i { display: inline-block; width: 1rem; height: 0.2857rem; border-radius: 0.1429rem; margin-right: 0.2857rem; vertical-align: middle; }
#feed { position: absolute; left: calc(1rem + var(--sl)); bottom: 3.143rem; width: min(27.14rem, calc(100% - 2rem - var(--sl))); max-height: 38%; overflow: auto;
  background: color-mix(in srgb, var(--bg2) 92%, transparent); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.5714rem 0.7143rem; }
#feed h3 { margin: 0 0 0.4286rem; font-size: 0.9286rem; }
#feed ul { list-style: none; margin: 0; padding: 0; }
#feed li { padding: 0.4286rem 0.2857rem; border-top: 0.07143rem solid var(--line); cursor: pointer; font-size: 0.9286rem; }
#feed li:first-child { border-top: 0; }
#feed li .ev { color: var(--muted); font-size: 0.8571rem; }
#feed .empty { color: var(--muted); cursor: default; }

/* 왼쪽 패널: 운영 제어 · 시점 가이드 */
#side { position: absolute; top: 0; left: 0; bottom: 0; z-index: 4; display: flex; pointer-events: none; }
#side .sideBody { width: 19.43rem; overflow: auto; background: var(--bg2); border-right: 0.07143rem solid var(--line); padding: 0.7143rem 0.8571rem 1.714rem; pointer-events: auto; }
#side.collapsed .sideBody { display: none; }
#sideToggle { pointer-events: auto; align-self: flex-start; margin: 0.7143rem 0 0 0.4286rem; padding: 0.4286rem 0.5rem; order: 2; }
#side section + section { margin-top: 1.143rem; border-top: 0.07143rem solid var(--line); padding-top: 0.7143rem; }
#side h4 { margin: 0.1429rem 0 0.5714rem; font-size: 0.9286rem; }
#side label { display: flex; justify-content: space-between; align-items: center; gap: 0.5714rem; font-size: 0.9286rem; margin-top: 0.5714rem; }
#side label select { max-width: 11.43rem; }
#side label.chk { justify-content: flex-start; margin-top: 0.7143rem; gap: 0.4286rem; }
#side label.chk input { width: auto; margin: 0; }
#side input[type="date"] { margin-top: 0.4286rem; width: 100%; }
#side .desc { margin: 0.2143rem 0 0; font-size: 0.8214rem; color: var(--muted); line-height: 1.4; }
#minimap { width: 100%; background: var(--bg); border: 0.07143rem solid var(--line); border-radius: 0.5714rem; display: block; }
#minimap .room { fill: none; stroke: var(--muted); stroke-width: .4; }
#minimap .eq { fill: var(--bg3); stroke: var(--muted); stroke-width: .25; cursor: pointer; }
#minimap .eq:hover { fill: color-mix(in srgb, var(--accent) 30%, var(--bg3)); }
#minimap .eq.run { stroke: var(--ok); } #minimap .eq.alarm { fill: color-mix(in srgb, var(--crit) 45%, var(--bg3)); }
#minimap .eq.sel { stroke: var(--accent); stroke-width: .7; }
#minimap .pipe { fill: none; stroke-width: .35; opacity: .7; }
#minimap .cam { fill: var(--accent); }
#minimap .fov { fill: var(--accent); opacity: .15; }
#minimap text { font-size: 0.1643rem; fill: var(--muted); pointer-events: none; }
.views { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.2857rem; margin-top: 0.5714rem; }
.views button { font-size: 0.8571rem; padding: 0.2857rem 0; }
.views button.on { border-color: var(--accent); color: var(--accent); }
#eqList { margin-top: 0.5714rem; font-size: 0.8929rem; }
#eqList .grp { color: var(--muted); font-size: 0.8214rem; margin: 0.5714rem 0 0.2143rem; }
#eqList button { display: flex; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 0.2143rem 0.2857rem; border-radius: 0.3571rem; }
#eqList button:hover, #eqList button.sel { background: var(--bg3); }
#eqList button small { margin-left: auto; color: var(--muted); }

/* 기능 설명 */
#help { position: fixed; inset: 0; z-index: 20; background: rgb(0 0 0 / .45); display: grid; place-items: center; padding: 1.143rem; }
.helpBox { position: relative; background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.8571rem; max-width: 51.43rem; max-height: 86vh; overflow: auto; padding: 1.286rem 1.571rem; font-size: 1rem; }
.helpBox h2 { margin: 0 0 0.4286rem; font-size: 1.286rem; } .helpBox h3 { margin: 1rem 0 0.2857rem; font-size: 1rem; color: var(--accent); }
.helpBox ol, .helpBox ul { padding-left: 1.429rem; margin: 0.2857rem 0; } .helpBox li { margin: 0.2143rem 0; }
#helpClose { position: absolute; top: 0.8571rem; right: 0.8571rem; }

/* L3 설비 패널 */
#panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(30rem, 100%); background: var(--bg2); border-left: 0.07143rem solid var(--line);
  display: flex; flex-direction: column; z-index: 4; }
#panel > header { display: flex; justify-content: space-between; align-items: flex-start; padding: 0.8571rem 1rem 0.4286rem; }
#pTitle { font-size: 1.143rem; font-weight: 700; }
#pSub { font-size: 0.8571rem; }
#pState { padding: 0 1rem 0.5714rem; font-size: 0.9286rem; }
#pTabs { display: flex; gap: 0.2857rem; padding: 0 0.7143rem; border-bottom: 0.07143rem solid var(--line); }
#pTabs button { border: 0; border-bottom: 0.1429rem solid transparent; border-radius: 0; background: none; padding: 0.5rem 0.6429rem; color: var(--muted); }
#pTabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
#pBody { flex: 1; overflow: auto; padding: 0.7143rem 1rem 1.429rem; }
#pBody h4 { margin: 1rem 0 0.4286rem; font-size: 0.8571rem; color: var(--muted); font-weight: 600; }
table.vals { width: 100%; border-collapse: collapse; font-size: 0.9286rem; }
table.vals td { padding: 0.2857rem 0.1429rem; border-bottom: 0.07143rem solid var(--line); vertical-align: top; }
table.vals tr.row { cursor: pointer; }
table.vals tr.row:hover td, table.vals tr.on td { background: var(--bg3); }
table.vals td.v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.vals .tid { color: var(--muted); font-size: 0.7857rem; }
canvas.trend { width: 100%; height: 8.571rem; background: var(--bg); border: 0.07143rem solid var(--line); border-radius: 0.5714rem; display: block; }
.tier { font-size: 0.7857rem; padding: 0.07143rem 0.4286rem; border-radius: 0.6429rem; border: 0.07143rem solid var(--line); color: var(--muted); }
.tier.auto_candidate { border-color: var(--ok); color: var(--ok); }
.tier.approval { border-color: var(--warn); color: var(--warn); }
.ctl { display: grid; grid-template-columns: 1fr auto; gap: 0.2857rem 0.5714rem; padding: 0.5rem 0; border-bottom: 0.07143rem solid var(--line); align-items: center; }
.ctl .act { display: flex; gap: 0.3571rem; align-items: center; justify-content: flex-end; }
.cmd { padding: 0.5rem 0.6429rem; border: 0.07143rem solid var(--line); border-radius: 0.5714rem; margin-bottom: 0.4286rem; font-size: 0.9286rem; }
.cmd.pending { border-color: var(--warn); } .cmd.done { border-color: var(--ok); } .cmd.rejected, .cmd.denied { border-color: var(--crit); }
.cmd .act { margin-top: 0.3571rem; display: flex; gap: 0.4286rem; }
.item { padding: 0.5rem 0; border-bottom: 0.07143rem solid var(--line); font-size: 0.9286rem; }
.item .ev { color: var(--muted); font-size: 0.8571rem; }
.sev-crit { color: var(--crit); } .sev-warn { color: var(--warn); } .sev-info { color: var(--info); }
.note { font-size: 0.8571rem; color: var(--muted); background: var(--bg3); border-radius: 0.5714rem; padding: 0.5rem 0.6429rem; margin: 0.5714rem 0; }

@media (max-width: 760px) {
  #clock, #legend, .srcTag { display: none; }
  main.sideOpen { --sl: 0; }
  #side .sideBody { width: min(19.43rem, 80vw); }
  #top { gap: 0.4286rem; padding: 0 0.5714rem; }
  #crumbs { display: none; }
  #panel { top: auto; height: 62%; width: 100%; border-left: 0; border-top: 0.07143rem solid var(--line); }
  #feed { max-height: 26%; }
  .card.twin { grid-column: span 1; }
}

/* 절감 시뮬레이션 */
:root { --wi-d: #8a97a6; --wi-act: #e3a32b; --wi-ai: #39b8e6; }
.wi { display: grid; grid-template-columns: 20.71rem 1fr; gap: 1rem; align-items: start; }
.wiCtl { position: sticky; top: 0; display: grid; gap: 0.2857rem; }
.wiCtl label { display: flex; justify-content: space-between; align-items: center; gap: 0.5714rem; font-size: 0.9286rem; margin-top: 0.5714rem; }
.wiCtl label select { max-width: 12.14rem; } .wiCtl input[type="range"] { flex: 1; }
.wiCtl label.chk { justify-content: flex-start; } .wiCtl label.chk input { width: auto; }
.wiCtl .desc { margin: 0.1429rem 0 0; font-size: 0.8214rem; color: var(--muted); line-height: 1.4; }
.wiBtns { display: flex; gap: 0.4286rem; margin-top: 0.8571rem; flex-wrap: wrap; } .wiBtns button { flex: 1; }
.card { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.8571rem 1rem; margin-bottom: 0.8571rem; }
.wiMain .kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(11.79rem, 1fr)); gap: 0.5714rem; margin-bottom: 0.8571rem; }
.wiMain .kpi { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.6429rem 0.7857rem; font-size: 0.8571rem; }
.wiMain .kpi b { display: block; font-size: 1.143rem; margin: 0.1429rem 0; font-variant-numeric: tabular-nums; }
.wiDayHead { display: flex; gap: 0.5714rem; flex-wrap: wrap; align-items: baseline; margin-bottom: 0.2857rem; font-size: 0.9286rem; }
.lg { font-size: 0.8571rem; color: var(--muted); } .lg span { margin-right: 0.8571rem; white-space: nowrap; }
.lg i { display: inline-block; width: 1rem; height: 0.4286rem; margin-right: 0.2857rem; vertical-align: middle; border-radius: 0.1429rem; }
.lg i.dash { height: 0; border-top: 0.1429rem dashed; border-radius: 0; }
#wiChart { width: 100%; height: auto; display: block; } #wiChart .grid { stroke: var(--line); } #wiChart .ax { font-size: 0.7857rem; fill: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.143rem, 1fr)); gap: 0.2143rem; margin-top: 0.5714rem; }
.cal button { padding: 0.2857rem 0; font-size: 0.7857rem; border-radius: 0.2857rem; border: 0.07143rem solid var(--line); }
#wiTable { width: 100%; border-collapse: collapse; font-size: 0.9286rem; margin-top: 0.4286rem; }
#wiTable td, #wiTable th { border-bottom: 0.07143rem solid var(--line); padding: 0.3571rem 0.4286rem; text-align: right; } #wiTable td:first-child, #wiTable th:first-child { text-align: left; }
.wrap { overflow-x: auto; }
@media (max-width: 860px) { .wi { grid-template-columns: 1fr; } .wiCtl { position: static; } }

/* 로그인 */
body.loginPage { display: grid; place-items: center; min-height: 100vh; padding: 1.143rem; }
.loginBox { width: min(24.29rem, 100%); background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.8571rem; padding: 1.714rem; display: grid; gap: 0.8571rem; }
.loginBox h1 { margin: 0; font-size: 1.429rem; } .loginBox p { margin: 0; }
.loginBox label { display: grid; gap: 0.2857rem; font-size: 0.9286rem; color: var(--muted); }
.loginBox input { width: 100%; padding: 0.5714rem 0.7143rem; font-size: 1rem; }
.loginBox button { padding: 0.6429rem; font-weight: 700; background: var(--accent); color: #fff; border-color: var(--accent); }
.err { color: var(--crit); font-size: 0.9286rem; min-height: 1em; }
#userBox { display: flex; align-items: center; gap: 0.4286rem; font-size: 0.9286rem; color: var(--muted); white-space: nowrap; }

/* AI 운영 */
#ops { overflow: auto; padding: 1.571rem clamp(1.143rem, 4vw, 2.857rem) 2.857rem; }
#ops h1 { font-size: 1.429rem; margin: 0; } #ops h2 { font-size: 1.143rem; margin: 1.857rem 0 0.5714rem; } #ops .lead { color: var(--muted); max-width: 70rem; }
.opsHead { display: flex; justify-content: space-between; align-items: center; gap: 0.8571rem; flex-wrap: wrap; }
.opsNav { display: flex; gap: 0.4286rem; } .opsNav select { max-width: 20rem; }
.badge2 { font-size: 0.8571rem; font-weight: 500; border: 0.07143rem solid var(--warn); color: var(--warn); border-radius: 0.7143rem; padding: 0.1429rem 0.5714rem; vertical-align: middle; }
.opsGrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.opsItem .opsTop { display: flex; justify-content: space-between; gap: 0.7143rem; align-items: flex-start; flex-wrap: wrap; }
.opsItem .opsTop > div:first-child { display: grid; } .opsItem .opsTop b { font-size: 1.214rem; margin: 0.1429rem 0; }
.opsAct { display: flex; gap: 0.3571rem; align-items: center; flex-wrap: wrap; }
.state { font-size: 0.8571rem; border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.1429rem 0.5714rem; color: var(--muted); }
.state.ok { border-color: var(--ok); color: var(--ok); } .state.hold { border-color: var(--warn); color: var(--warn); }
.why { margin-top: 0.5714rem; font-size: 0.9286rem; background: var(--bg3); border-radius: 0.5714rem; padding: 0.5714rem 0.7143rem; }
.why ol { margin: 0.2857rem 0; padding-left: 1.429rem; } .why li { margin: 0.2143rem 0; } .basis { font-size: 0.8571rem; margin-top: 0.2857rem; }
.opsChart { width: 100%; height: auto; display: block; margin-top: 0.4286rem; } .opsChart .ax { font-size: 0.7857rem; fill: var(--muted); }
table.kv { width: 100%; font-size: 0.9286rem; border-collapse: collapse; } table.kv td { padding: 0.3571rem 0.2857rem; border-bottom: 0.07143rem solid var(--line); } table.kv td:last-child { text-align: right; }
.opsIns { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.57rem, 1fr)); gap: 0.7143rem; }
.opsIns .card p { margin: 0.4286rem 0; font-size: 0.9286rem; } .tag { font-size: 0.8214rem; color: var(--accent); }
table.needs { width: 100%; border-collapse: collapse; font-size: 0.9286rem; } table.needs td, table.needs th { border-bottom: 0.07143rem solid var(--line); padding: 0.4286rem; text-align: left; vertical-align: top; }
#sideOps .val { font-size: 1.071rem; font-weight: 700; } #sideOps a { color: var(--accent); }
@media (max-width: 900px) { .opsGrid { grid-template-columns: 1fr; } }

/* 자연어 지시 */
.nlBox { background: var(--bg3); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.6429rem 0.7143rem; margin-bottom: 0.7143rem; font-size: 0.9286rem; }
.nlRow { display: flex; gap: 0.4286rem; margin-top: 0.4286rem; } .nlRow input { flex: 1; width: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 0.2857rem; margin-top: 0.4286rem; }
.chip { font-size: 0.8214rem; padding: 0.1429rem 0.5714rem; border-radius: 0.8571rem; }
.nlAct { display: flex; justify-content: space-between; gap: 0.5714rem; align-items: center; border-top: 0.07143rem solid var(--line); padding: 0.5rem 0; }
.nlAct button { white-space: nowrap; }
.nlBox .desc { margin: 0.4286rem 0 0; font-size: 0.8214rem; color: var(--muted); }
#ops a { color: var(--accent); }

/* 통합 관제 홈 */
:root { --s1: #3987e5; --s2: #d95926; }
:root[data-theme="light"] { --s1: #2a78d6; --s2: #eb6834; }
.homeHead h1 { margin: 0; }
.kpiRow { display: grid; grid-template-columns: repeat(auto-fit, minmax(11.43rem, 1fr)); gap: 0.7143rem; margin: 1rem 0; }
.kpiT { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.7143rem 0.8571rem; display: grid; gap: 0.1429rem; }
.kpiT span { font-size: 0.8571rem; color: var(--muted); } .kpiT b { font-size: 1.571rem; font-variant-numeric: tabular-nums; } .kpiT small { font-size: 0.8214rem; color: var(--muted); }
.kpiT.alert { border-color: var(--crit); } .kpiT.alert b { color: var(--crit); }
.homeGrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0.8571rem; margin-bottom: 0.8571rem; }
.homeGrid .wide { grid-column: 1 / -1; }
#sites .card { background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.7143rem; padding: 0.8571rem 1rem; }
.secH { display: flex; gap: 0.7143rem; align-items: baseline; flex-wrap: wrap; margin-bottom: 0.5714rem; font-size: 0.9286rem; }
.secH b { font-size: 1rem; } .secH a { color: var(--accent); }
.cartogram { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(4, 4.571rem); gap: 0.4286rem; max-width: 30rem; }
.rg { display: grid; align-content: center; gap: 0.1429rem; text-align: left; padding: 0.4286rem 0.7143rem; border-radius: 0.5714rem; background: var(--bg3); border: 0.07143rem solid var(--line); color: var(--muted); }
.rg b { color: var(--fg); font-size: 0.9286rem; } .rg span { font-size: 0.8214rem; }
.rg.has { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--bg3)); }
.rg.al { box-shadow: inset 0 0 0 0.1429rem var(--crit); } .rg.on { outline: 0.1429rem solid var(--fg); }
.lgd { display: flex; gap: 0.8571rem; font-size: 0.8571rem; color: var(--muted); margin-top: 0.5714rem; }
.lgd i { display: inline-block; width: 0.8571rem; height: 0.8571rem; border-radius: 0.2143rem; margin-right: 0.2857rem; vertical-align: -0.1429rem; background: var(--bg3); border: 0.07143rem solid var(--line); }
.lgd i.has { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 30%, var(--bg3)); } .lgd i.al { box-shadow: inset 0 0 0 0.1429rem var(--crit); }
.lgd i.s1 { background: var(--s1); border: 0; } .lgd i.s2 { background: var(--s2); border: 0; }
.secH .lgd { margin: 0; }
.watch { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4286rem; }
.watch a { display: flex; gap: 0.7143rem; align-items: flex-start; text-decoration: none; color: var(--fg); padding: 0.5rem 0.5714rem; border-radius: 0.5714rem; border: 0.07143rem solid var(--line); }
.watch a:hover { border-color: var(--accent); }
.watch small { display: block; color: var(--muted); font-size: 0.8571rem; }
.watch .sv { font-size: 0.7857rem; font-weight: 700; padding: 0.1429rem 0.4286rem; border-radius: 0.4286rem; white-space: nowrap; border: 0.07143rem solid; }
.watch .crit .sv { color: var(--crit); } .watch .warn .sv { color: var(--warn); } .watch .info .sv { color: var(--info); }
.viz { width: 100%; height: auto; display: block; } .viz .grid { stroke: var(--line); } .viz .ax { font-size: 0.7857rem; fill: var(--muted); }
.viz .s1 { fill: var(--s1); } .viz .s2 { fill: var(--s2); } .viz .hit { fill: transparent; }
.viz .hit:hover { fill: color-mix(in srgb, var(--fg) 6%, transparent); }
.vizTip { position: fixed; z-index: 30; pointer-events: none; background: var(--bg2); border: 0.07143rem solid var(--line); border-radius: 0.5714rem; padding: 0.4286rem 0.6429rem; font-size: 0.8571rem; box-shadow: 0 0.2857rem 1rem rgb(0 0 0 / .25); }
details.tbl { margin-top: 0.4286rem; font-size: 0.9286rem; } details.tbl summary { cursor: pointer; color: var(--muted); }
details.tbl table, .siteTbl { width: 100%; border-collapse: collapse; font-size: 0.9286rem; }
details.tbl td, details.tbl th, .siteTbl td, .siteTbl th { border-bottom: 0.07143rem solid var(--line); padding: 0.4286rem; text-align: right; white-space: nowrap; }
details.tbl td:first-child, details.tbl th:first-child, .siteTbl td:nth-child(-n+3), .siteTbl th:nth-child(-n+3) { text-align: left; }
.siteTbl th { color: var(--muted); font-weight: 600; font-size: 0.8571rem; }
.siteTbl td small { display: block; color: var(--muted); font-size: 0.7857rem; }
.siteTbl tr.wait td { color: var(--muted); padding: 0.2857rem 0.4286rem; font-size: 0.8929rem; } .siteTbl tr.wait b { font-weight: 500; }
.siteTbl tr.twin td { padding: 0.6429rem 0.4286rem; }
.siteTbl td.act { display: flex; gap: 0.4286rem; justify-content: flex-end; }
.siteTbl td.act a { color: var(--accent); text-decoration: none; font-size: 0.8929rem; }
.siteTbl a.btn { border: 0.07143rem solid var(--accent); border-radius: 0.4286rem; padding: 0.1429rem 0.6429rem; }
.spark { width: 8.571rem; height: 2rem; } .spark polyline { fill: none; stroke: var(--s2); stroke-width: 2; } .spark circle { fill: var(--s2); }
.note2 { font-size: 0.8571rem; margin-top: 0.7143rem; }
@media (max-width: 860px) { .homeGrid { grid-template-columns: 1fr; } }
.viz .lbl { fill: var(--fg); }

/* 지점 지도 */
.homeGrid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.mapWrap { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.krmap { flex: none; height: auto; display: block; }
.size-s .krmap { width: 14.29rem; } .size-m .krmap { width: 21.43rem; } .size-l .krmap { width: 31.43rem; }
.krmap .prov { fill: var(--bg3); stroke: var(--bg2); stroke-width: 1.2; }
.krmap .prov.has { fill: color-mix(in srgb, var(--accent) 12%, var(--bg3)); cursor: pointer; }
.krmap .prov.twin { fill: color-mix(in srgb, var(--accent) 28%, var(--bg3)); }
.krmap .prov.has:hover { fill: color-mix(in srgb, var(--accent) 38%, var(--bg3)); }
.krmap .prov.sel { stroke: var(--fg); stroke-width: 2.4; }
.krmap .pvl { font-size: 0.7857rem; fill: var(--muted); pointer-events: none; }
.size-s .krmap .pvl { font-size: 1rem; } .size-l .krmap .pvl { font-size: 0.6429rem; }
.krmap .mk { fill: var(--muted); stroke: var(--bg2); stroke-width: 1; cursor: pointer; }
.krmap .mkT { cursor: pointer; } .krmap .mkT circle { fill: var(--accent); stroke: var(--bg2); stroke-width: 2; }
.krmap .mkT .ring { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .6; animation: mkPulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
.krmap .mkT.al circle { fill: var(--crit); } .krmap .mkT.al .ring { stroke: var(--crit); }
.krmap .mkT text { font-size: 0.9286rem; font-weight: 700; fill: var(--fg); paint-order: stroke; stroke: var(--bg2); stroke-width: 0.2143rem; }
@keyframes mkPulse { from { transform: scale(.6); opacity: .8; } to { transform: scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .krmap .mkT .ring { animation: none; } }
.rgPanel { flex: 1; min-width: 15.71rem; font-size: 0.9286rem; display: grid; gap: 0.4286rem; align-content: start; }
.pH { display: flex; gap: 0.5714rem; align-items: baseline; flex-wrap: wrap; }
.pS { display: flex; justify-content: space-between; gap: 0.5714rem; align-items: center; border: 0.07143rem solid var(--line); border-radius: 0.5714rem; padding: 0.5rem 0.6429rem; }
.pS.twin { border-color: var(--accent); } .pS small { color: var(--muted); }
.pAct { display: flex; gap: 0.4286rem; flex-wrap: wrap; justify-content: flex-end; } .pAct a { color: var(--accent); text-decoration: none; font-size: 0.8929rem; }
.pAct a.btn { border: 0.07143rem solid var(--accent); border-radius: 0.4286rem; padding: 0.1429rem 0.6429rem; }
.pR { display: flex; flex-wrap: wrap; gap: 0.2857rem; } .pR button { font-size: 0.8571rem; padding: 0.2143rem 0.5714rem; } .pR small { color: var(--muted); }
button.lnk { border: 0; background: none; color: var(--accent); padding: 0 0.2857rem; }
.sizeSel { margin-left: auto; display: inline-flex; } .sizeSel button { font-size: 0.8571rem; padding: 0.1429rem 0.6429rem; border-radius: 0; }
.sizeSel button:first-child { border-radius: 0.4286rem 0 0 0.4286rem; } .sizeSel button:last-child { border-radius: 0 0.4286rem 0.4286rem 0; }
.sizeSel button.on { border-color: var(--accent); color: var(--accent); }
.lgd i.mkl { width: 0.5714rem; height: 0.5714rem; border-radius: 50%; background: var(--muted); border: 0; }
.lgd i.mkt { width: 0.7143rem; height: 0.7143rem; border-radius: 50%; background: var(--accent); border: 0; }

/* ===== 비주얼 강화: 배경·카드·히어로·KPI·차트 ===== */
:root { --glow1: #39b8e6; --glow2: #8b7bff; --glow3: #ff8a5c; --shadow: 0 0.7143rem 2.143rem rgb(0 0 0 / .28), 0 0.07143rem 0 rgb(255 255 255 / .04) inset; }
:root[data-theme="light"] { --glow1: #0b84c6; --glow2: #6c5ce7; --glow3: #ff7a45; --shadow: 0 0.5714rem 1.714rem rgb(20 40 70 / .10), 0 0.07143rem 0 rgb(255 255 255 / .8) inset; }
#sites, #ops, #whatif, #reports {
  background:
    radial-gradient(64.29rem 30rem at -5% -10%, color-mix(in srgb, var(--glow1) 18%, transparent), transparent 70%),
    radial-gradient(57.14rem 30rem at 105% -5%, color-mix(in srgb, var(--glow2) 16%, transparent), transparent 70%),
    var(--bg);
}
#top { background: linear-gradient(90deg, color-mix(in srgb, var(--glow1) 10%, var(--bg2)), var(--bg2) 40%, color-mix(in srgb, var(--glow2) 8%, var(--bg2))); backdrop-filter: blur(0.4286rem); }
.brand { font-size: 1.071rem; letter-spacing: -.01em; background: linear-gradient(90deg, var(--glow1), var(--glow2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand::before { content: ""; display: inline-block; width: 0.6429rem; height: 0.6429rem; border-radius: 50%; margin-right: 0.5rem; vertical-align: 0.07143rem; background: var(--glow1); box-shadow: 0 0 0.7143rem var(--glow1); }
.navlink.on { background: color-mix(in srgb, var(--accent) 18%, var(--bg3)); color: var(--fg); }
#sites .card, .wiMain .card, #ops .card, .rcard, .wiCtl.card {
  border-radius: 1rem; border-color: color-mix(in srgb, var(--line) 70%, transparent); box-shadow: var(--shadow);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 94%, #fff), var(--bg2));
}
.secH b { position: relative; padding-left: 0.8571rem; font-size: 1.071rem; }
.secH b::before { content: ""; position: absolute; left: 0; top: 0.2143rem; bottom: 0.2143rem; width: 0.2857rem; border-radius: 0.1429rem; background: linear-gradient(180deg, var(--glow1), var(--glow2)); }

/* 히어로 */
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.143rem; margin-bottom: 1rem; animation: rise .6s ease both; }
.heroL { position: relative; overflow: hidden; border-radius: 1.286rem; padding: 1.571rem 1.857rem; min-height: 13.57rem;
  background: linear-gradient(135deg, color-mix(in srgb, var(--glow1) 26%, var(--bg2)), color-mix(in srgb, var(--glow2) 22%, var(--bg2)) 60%, var(--bg2));
  border: 0.07143rem solid color-mix(in srgb, var(--glow1) 35%, var(--line)); box-shadow: var(--shadow), 0 0 4.286rem color-mix(in srgb, var(--glow1) 18%, transparent); }
.heroL::after { content: ""; position: absolute; right: -4.286rem; top: -5.714rem; width: 18.57rem; height: 18.57rem; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--glow2) 40%, transparent), transparent 70%); pointer-events: none; }
.eyebrow { font-size: 0.8571rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.heroL h1 { margin: 0.4286rem 0 0.2857rem; font-size: 1.571rem; font-weight: 600; letter-spacing: -.01em; }
.heroL h1 b { display: block; font-size: clamp(2.429rem, 4.6vw, 3.714rem); line-height: 1.05; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums;
  background: linear-gradient(90deg, #7fe0ff, #b3a6ff 55%, #ffb08a); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .heroL h1 b { background: linear-gradient(90deg, #0b84c6, #6c5ce7 55%, #ff7a45); -webkit-background-clip: text; background-clip: text; }
.heroL .muted { font-size: 0.9286rem; }
.lever { margin-top: 1rem; }
.leverH { display: flex; justify-content: space-between; align-items: baseline; font-size: 0.8929rem; color: var(--muted); margin-bottom: 0.3571rem; }
.leverH b { font-size: 1.143rem; color: var(--fg); } .leverH b small { color: var(--muted); font-weight: 500; font-size: 0.8571rem; }
.leverBar { display: flex; height: 1rem; border-radius: 0.5rem; overflow: hidden; background: color-mix(in srgb, var(--fg) 8%, transparent); }
.leverBar i { display: block; height: 100%; animation: grow .9s ease both; transform-origin: left; }
.leverBar i.l1 { background: var(--glow1); } .leverBar i.l2 { background: #5fe0a0; } .leverBar i.l3 { background: #ffd479; }
.leverBar i.l4 { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--glow3) 55%, transparent) 0 0.4286rem, transparent 0.4286rem 0.8571rem); }
.leverL { display: flex; gap: 0.8571rem; flex-wrap: wrap; margin-top: 0.4286rem; font-size: 0.8214rem; color: var(--muted); }
.leverL i { display: inline-block; width: 0.7143rem; height: 0.7143rem; border-radius: 0.2143rem; margin-right: 0.2857rem; vertical-align: -0.07143rem; }
.heroR { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7143rem; }
.kpiT { border-radius: 1rem; padding: 1rem 1.143rem; position: relative; overflow: hidden; box-shadow: var(--shadow); animation: rise .6s ease both; animation-delay: calc(var(--i, 0) * 70ms);
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 94%, #fff), var(--bg2)); border-color: color-mix(in srgb, var(--line) 70%, transparent); transition: transform .2s, box-shadow .2s; }
.kpiT::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0.2143rem; background: linear-gradient(90deg, var(--glow1), var(--glow2)); opacity: .8; }
.kpiT:hover { transform: translateY(-0.1429rem); box-shadow: 0 1rem 2.429rem rgb(0 0 0 / .32); }
.kpiT b { font-size: clamp(1.571rem, 2.4vw, 2.143rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; margin: 0.2857rem 0 0.1429rem; }
.kpiT.alert::before { background: var(--crit); }
.kpiT.ok::before { background: var(--ok); } .kpiT.ok b { color: var(--ok); }
.wiMain .kpi { border-radius: 1rem; box-shadow: var(--shadow); background: linear-gradient(180deg, color-mix(in srgb, var(--bg2) 94%, #fff), var(--bg2)); position: relative; overflow: hidden; padding: 0.7857rem 0.9286rem; }
.wiMain .kpi::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 0.2143rem; background: linear-gradient(90deg, var(--glow1), var(--glow2)); opacity: .8; }
.wiMain .kpi b { font-size: 1.429rem; font-weight: 800; letter-spacing: -.02em; }
.wiMain .kpi:nth-child(4) b { background: linear-gradient(90deg, #7fe0ff, #b3a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.opsItem .opsTop b { font-size: 1.571rem; font-weight: 800; letter-spacing: -.02em; background: linear-gradient(90deg, #7fe0ff, #b3a6ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.watch a { border-left: 0.2143rem solid var(--info); background: color-mix(in srgb, var(--bg3) 60%, transparent); transition: transform .15s, border-color .15s; }
.watch a:hover { transform: translateX(0.2143rem); }
.watch .crit { border-left-color: var(--crit); } .watch .warn { border-left-color: var(--warn); }
.watch .sv { border-radius: 0.5714rem; background: color-mix(in srgb, currentColor 12%, transparent); }
.viz .s1 { fill: url(#gS1); } .viz .s2 { fill: url(#gS2); }
.viz .lbl { font-weight: 700; }
.krmap .mkT circle { filter: drop-shadow(0 0 0.4286rem var(--accent)); }
.krmap .prov.twin { fill: color-mix(in srgb, var(--accent) 34%, var(--bg3)); }
.siteTbl tr.twin td { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.siteTbl tr.twin td:first-child { border-left: 0.2143rem solid var(--accent); border-radius: 0.4286rem 0 0 0.4286rem; }
.siteTbl a.btn { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 600; }
button.primary, .wiBtns button:first-child { background: linear-gradient(90deg, var(--glow1), var(--glow2)); color: #fff; border: 0; font-weight: 700; box-shadow: 0 0.2857rem 1rem color-mix(in srgb, var(--glow1) 35%, transparent); }
#sites h1, #ops h1, #whatif h1, #reports h1 { font-size: 1.571rem; font-weight: 800; letter-spacing: -.01em; }
.opsHead h1, #whatif h1 { background: linear-gradient(90deg, var(--fg), color-mix(in srgb, var(--fg) 60%, var(--glow1))); -webkit-background-clip: text; background-clip: text; color: transparent; }
@keyframes rise { from { opacity: 0; transform: translateY(0.7143rem); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .hero, .kpiT, .leverBar i { animation: none; } }
@media (max-width: 860px) { .hero { grid-template-columns: 1fr; } .heroR { grid-template-columns: 1fr 1fr; } }
.heroL h1 b.wait { font-size: clamp(1.857rem, 3.4vw, 2.714rem); background: none; color: var(--muted); -webkit-text-fill-color: var(--muted); font-weight: 700; }
.scopeRow { margin: 0.1429rem 0 0.4286rem; font-size: 0.9286rem; color: var(--muted); } .scopeRow b { color: var(--fg); font-size: 1.071rem; } .scopeRow button.lnk { font-size: 0.9286rem; }


/* ===== 화면 크기 비례 글자: 노트북(≤1450px)은 14px, 1920 → 약 16.6px, 2560 → 약 20px, 4K → 상한 28px. 모든 치수가 rem이라 함께 커짐 ===== */
html { font-size: clamp(14px, calc(6px + 0.55vw), 28px); }

/* 한글 단어 중간에서 줄이 끊기지 않게 · 작은 라벨(등급·칩·상태)은 한 줄 유지 */
body { word-break: keep-all; overflow-wrap: anywhere; }
.tier, .chip, .state, .badge2, .tag, .watch .sv, .nlAct button, .pR button { white-space: nowrap; }
.nlAct > div, .ctl > div, .opsItem .opsTop > div { min-width: 0; }
.nlAct { flex-wrap: wrap; } .nlAct b { font-size: 1rem; }
