:root {
  --bg: #0d1117;
  --panel: rgba(16, 22, 30, 0.82);
  --line: rgba(255, 255, 255, 0.09);
  --ink: #e8edf2;
  --ink2: #a9b4c0;
  --muted: #6c7a89;
  --accent: #37a0ff;
  --good: #3ddc84;
  --warn: #f5b82e;
  --bad: #ff5a5a;
  --plan: #6aa8ff;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-size: 13px; }
#viewport { position: fixed; inset: 0; background: #0d1117; }   /* GPU 컨텍스트가 사라져도 흰 화면 대신 어두운 바탕 */
#viewport canvas { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* 상단 바 */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 58px; display: flex; align-items: center; gap: 16px;
  padding: 0 16px; background: linear-gradient(180deg, rgba(10, 14, 20, 0.95), rgba(10, 14, 20, 0.7));
  border-bottom: 1px solid var(--line); z-index: 10; backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; }
.logo { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, #1f6feb, #37e8ff); font-size: 18px; }
.brand h1 { margin: 0; font-size: 16px; letter-spacing: 0.3px; }
.brand p { margin: 0; font-size: 11px; color: var(--ink2); }
.seg { display: flex; background: rgba(255, 255, 255, 0.05); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 7px; color: var(--ink2); white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: #fff; }
body[data-mode="traditional"] #modeSeg button.on { background: #c27c2c; }
body[data-mode="dark"] #modeSeg button.on { background: #6d4aff; }
.seg.small button { padding: 6px 9px; }
.timectl { display: flex; align-items: center; gap: 8px; }
.icon { width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); }
.clock { font-variant-numeric: tabular-nums; font-weight: 600; min-width: 92px; text-align: right; color: var(--ink); font-size: 14px; }

/* 패널 */
.panel { position: fixed; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; backdrop-filter: blur(10px); z-index: 5; }
.panel.left { top: 70px; left: 12px; width: 290px; bottom: 64px; padding: 12px; overflow-y: auto; }
.panel.right { top: 70px; right: 12px; width: 340px; bottom: 112px; padding: 12px; display: flex; flex-direction: column; }
.mode-desc { font-size: 12px; line-height: 1.5; color: var(--ink2); padding: 8px 10px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid var(--accent); margin-bottom: 10px; }
.mode-desc b { color: var(--ink); display: block; font-size: 13px; margin-bottom: 2px; }

/* 정밀조립Zone 카드 */
.zone-card { padding: 9px 10px; border-radius: 10px; background: rgba(55, 232, 255, 0.06); border: 1px solid rgba(55, 232, 255, 0.25); margin-bottom: 10px; font-size: 12px; }
.zc-h { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 6px; }
.zc-h b { font-size: 13px; color: #7ff3ff; }
.zc-h small { color: var(--muted); font-size: 10.5px; }
.zone-card .seg { margin-bottom: 6px; }
.zone-card .seg button { flex: 1; }
.zc-sub { color: var(--ink2); margin-bottom: 5px; }
.zc-cells { display: grid; gap: 3px; }
.zc-cell { display: grid; grid-template-columns: 16px 1fr auto; grid-template-rows: auto auto; column-gap: 6px; padding: 4px 6px; border-radius: 7px; background: rgba(255, 255, 255, 0.04); border-left: 3px solid #2bb3a6; cursor: pointer; }
.zc-cell:hover { background: rgba(255, 255, 255, 0.08); }
.zc-cell.p-doortrim { border-left-color: #f0a030; }
.zc-cell.p-eaxle { border-left-color: #9a6bff; }
.zc-branch { display: grid; gap: 4px; padding-left: 10px; border-left: 1px dashed rgba(255, 255, 255, 0.18); margin-left: 7px; }
.zc-line { display: grid; gap: 3px; }
.zc-line small { font-size: 10.5px; font-weight: 600; }
.zc-line.p-doortrim small { color: #f5bd5c; }
.zc-line.p-eaxle small { color: #b89bff; }
.zone-card .zc-mix { margin: 3px 0 7px; }
.zone-card .zc-mix button { padding: 4px 4px; font-size: 11px; }
.zc-cell.off { opacity: 0.45; }
.zc-cell b { grid-row: span 2; align-self: center; color: var(--ink); }
.zc-cell span { font-weight: 600; color: var(--ink); }
.zc-cell em { grid-column: 2; font-style: normal; font-size: 10.5px; color: var(--muted); }
.zc-cell .chip { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-style: normal; }
.zc-flow { margin-top: 6px; font-size: 11px; color: var(--ink2); line-height: 1.45; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.kpi { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 10px; padding: 7px 9px; }
.kpi .k { font-size: 11px; color: var(--muted); }
.kpi .v { font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 1px; }
.kpi .v small { font-size: 11px; font-weight: 500; color: var(--ink2); margin-left: 2px; }
.kpi .s { font-size: 10.5px; color: var(--ink2); margin-top: 1px; }
.kpi.wide { grid-column: span 2; }
.apq { display: flex; gap: 6px; margin-top: 5px; }
.apq div { flex: 1; font-size: 10px; color: var(--ink2); }
.apq i { display: block; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.08); margin-top: 2px; overflow: hidden; }
.apq i::after { content: ""; display: block; height: 100%; width: var(--w); background: var(--accent); border-radius: 2px; }
.chart { margin-top: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 10px; padding: 8px; position: relative; }
.chart-h { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink2); margin-bottom: 4px; }
.chart-h b { color: var(--ink); font-variant-numeric: tabular-nums; }
.chart canvas { width: 100%; height: 70px; display: block; }

/* 에이전트 */
.agent-h { display: flex; gap: 10px; align-items: center; }
.agent-avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: linear-gradient(135deg, #1f6feb, #37e8ff); box-shadow: 0 0 18px rgba(55, 160, 255, 0.45); }
body[data-mode="dark"] .agent-avatar { background: linear-gradient(135deg, #6d4aff, #37e8ff); box-shadow: 0 0 22px rgba(109, 74, 255, 0.6); }
body[data-mode="traditional"] .agent-avatar { background: linear-gradient(135deg, #8a5a2b, #c27c2c); box-shadow: none; }
.agent-name { font-weight: 700; font-size: 14px; }
.agent-sub { font-size: 11px; color: var(--ink2); margin-top: 2px; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 99px; background: rgba(61, 220, 132, 0.15); color: var(--good); font-weight: 600; margin-right: 4px; }
.pill.off { background: rgba(245, 184, 46, 0.15); color: var(--warn); }
.thought { margin-top: 10px; font-size: 11.5px; color: var(--ink2); padding: 8px 10px; border-radius: 10px; background: rgba(55, 160, 255, 0.08); border: 1px dashed rgba(55, 160, 255, 0.3); line-height: 1.45; }
.loop { display: flex; justify-content: center; gap: 6px; font-size: 11px; color: var(--muted); margin: 8px 0; }
.loop span { padding: 2px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.05); color: var(--ink2); }
.log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 2px; }
.entry { border-radius: 10px; background: rgba(255, 255, 255, 0.035); border: 1px solid var(--line); border-left: 3px solid var(--muted); padding: 7px 9px; font-size: 11.5px; line-height: 1.45; animation: pop 0.35s ease; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }
.entry .h { display: flex; justify-content: space-between; gap: 6px; font-weight: 650; color: var(--ink); font-size: 12px; }
.entry .h time { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; font-size: 10.5px; flex: none; }
.entry .r { color: var(--ink2); margin-top: 2px; }
.entry .r em { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 4px; margin-right: 4px; background: rgba(255, 255, 255, 0.07); color: var(--ink2); }
.entry.alert { border-left-color: var(--bad); }
.entry.warn { border-left-color: var(--warn); }
.entry.plan { border-left-color: var(--plan); }
.entry.act { border-left-color: var(--accent); }
.entry.ok { border-left-color: var(--good); }

/* LLM 엔진 */
.engine { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.engine .seg button:disabled { opacity: 0.35; cursor: not-allowed; }
#engineSeg button[data-engine="llm"].on { background: #d97757; }
.chk { font-size: 11px; color: var(--ink2); display: flex; align-items: center; gap: 4px; cursor: pointer; white-space: nowrap; }
.llm-status { font-size: 11px; color: var(--muted); margin-top: 6px; min-height: 15px; display: flex; align-items: center; gap: 6px; }
.llm-status.busy { color: #f0a988; }
.llm-status .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(240, 169, 136, 0.3); border-top-color: #f0a988; animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
body.llm-on .agent-avatar { background: linear-gradient(135deg, #d97757, #f0c27b); box-shadow: 0 0 20px rgba(217, 119, 87, 0.5); }
.entry.llm { border-left-color: #d97757; background: rgba(217, 119, 87, 0.08); }
.entry.chat { border-left-color: #c9d1d9; background: rgba(255, 255, 255, 0.06); }
.chatbox { display: flex; gap: 6px; margin-top: 8px; }
.chatbox input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink); font: inherit; }
.chatbox input:disabled { opacity: 0.45; }
.chatbox button { border: 1px solid #d97757; background: #d97757; color: #fff; border-radius: 9px; padding: 0 12px; }
.chatbox button:disabled { opacity: 0.35; background: transparent; border-color: var(--line); cursor: not-allowed; }

/* 상세 패널 */
.detail { left: var(--lx); bottom: 64px; width: 300px; padding: 12px; }
.detail.hidden, .modal.hidden { display: none; }
.detail h3 { margin: 0 0 6px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; }
.detail h3 button { border: 0; background: none; color: var(--ink2); font-size: 14px; }
.detail .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 12px; margin: 8px 0; }
.detail .grid span { color: var(--muted); }
.detail .grid b { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.detail .note { font-size: 11px; color: var(--warn); margin-bottom: 8px; }
.detail .btns { display: flex; gap: 6px; }
.detail .btns button { flex: 1; }
.bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 3px; }

/* 하단 */
.bottombar { position: fixed; bottom: 12px; left: var(--lx); display: flex; gap: 6px; z-index: 6; padding: 6px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); }
.bottombar button, .detail .btns button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); padding: 7px 12px; border-radius: 9px; white-space: nowrap; }
.bottombar button:hover, .detail .btns button:hover { background: rgba(255, 255, 255, 0.1); }
.bottombar button.on { border-color: var(--accent); color: #9fd0ff; }
.bottombar button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.hint { position: fixed; bottom: 70px; left: 318px; font-size: 11px; color: var(--muted); z-index: 4; pointer-events: none; }

/* 3D 라벨 */
.st-label { background: rgba(10, 14, 20, 0.82); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 8px; padding: 4px 7px; font-size: 11px; color: var(--ink); white-space: nowrap; pointer-events: none; transform: translateY(-6px); }
.st-label.sel { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(55, 160, 255, 0.35); }
.st-label .nm { font-weight: 700; }
.st-label .use { font-size: 10px; margin-top: 1px; color: #7fe0d6; }
.st-label .use.u-doortrim { color: #f5bd5c; }
.st-label .use.u-eaxle { color: #b89bff; }
.st-label.standby { opacity: 0.55; border-style: dashed; }
.chip.s-OFF { background: rgba(255, 255, 255, 0.05); color: var(--muted); }
.st-label .row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.chip { font-size: 10px; padding: 0 5px; border-radius: 4px; background: rgba(255, 255, 255, 0.1); color: var(--ink2); }
.chip.s-BUSY { background: rgba(61, 220, 132, 0.2); color: var(--good); }
.chip.s-DOWN { background: rgba(255, 90, 90, 0.25); color: #ff8a8a; }
.chip.s-MAINT, .chip.s-BLOCKED, .chip.s-FULL, .chip.s-HOLD { background: rgba(245, 184, 46, 0.2); color: var(--warn); }
.hp { width: 46px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.12); overflow: hidden; }
.hp i { display: block; height: 100%; }
.v-label { font-size: 10px; color: #cfe3f5; background: rgba(10, 14, 20, 0.7); padding: 1px 5px; border-radius: 5px; white-space: nowrap; pointer-events: none; }
.v-label em { font-style: normal; color: var(--muted); margin-left: 4px; }
.v-label.tech { color: #ffc58a; }
.v-label.helper { color: #9fd0ff; }
.v-label.quad { color: #f5d36b; }
.chip.s-NOPARTS, .chip.s-NOAMR { background: rgba(245, 184, 46, 0.2); color: var(--warn); }

/* 비교 모달 */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 20; display: grid; place-items: center; }
.modal-card { width: min(860px, 94vw); max-height: 88vh; overflow: auto; background: #121922; border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; }
.modal-h { display: flex; justify-content: space-between; align-items: flex-start; }
.modal-h h2 { margin: 0 0 12px; font-size: 18px; }
.modal-h h2 small { display: block; font-size: 12px; color: var(--ink2); font-weight: 400; margin-top: 3px; }
.modal-h button { border: 0; background: none; color: var(--ink2); font-size: 18px; }
table.cmp { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.cmp th, table.cmp td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; }
table.cmp th:first-child, table.cmp td:first-child { text-align: left; color: var(--ink2); }
table.cmp thead th { color: var(--ink); font-size: 13px; }
table.cmp td.best { color: var(--good); font-weight: 700; }
.cmp-note { margin-top: 12px; font-size: 11.5px; color: var(--ink2); line-height: 1.6; }
.cmp-bars { display: grid; grid-template-columns: 90px 1fr 70px; gap: 6px 10px; align-items: center; margin: 4px 0 14px; font-size: 12px; }
.cmp-bars .b { height: 14px; border-radius: 0 4px 4px 0; background: var(--accent); }

@media (max-width: 1100px) {
  .panel.right { width: 280px; }
  .dock { width: 280px; }
  .panel.left { width: 250px; }
  .brand p { display: none; }
}

/* 맥 앱 (Electron) */
.app-only { display: none; }
.dark-only { display: none; }
body[data-mode="dark"] .dark-only { display: inline-block; }
body.app .app-only { display: inline-block; }
body.app .topbar { padding-left: 88px; -webkit-app-region: drag; }
body.app .topbar button, body.app .topbar .seg { -webkit-app-region: no-drag; }
.modal-card.small { width: min(520px, 94vw); }
.key-status { font-size: 12px; padding: 8px 10px; border-radius: 9px; background: rgba(255, 255, 255, 0.05); margin-bottom: 10px; color: var(--ink2); }
.key-status.ok { color: var(--good); background: rgba(61, 220, 132, 0.1); }
.key-status.err { color: #ff8a8a; background: rgba(255, 90, 90, 0.1); }
#keyForm input { width: 100%; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; color: var(--ink); font: inherit; font-family: ui-monospace, Menlo, monospace; }
.key-btns { display: flex; justify-content: space-between; margin-top: 10px; }
.key-btns button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); padding: 8px 14px; border-radius: 9px; }
.key-btns button.primary { background: #d97757; border-color: #d97757; color: #fff; }
.key-note { font-size: 11.5px; color: var(--muted); margin: 12px 0 0; }
.key-note a { color: #9fd0ff; }

/* 공정 설계 도크 (오른쪽 하단) */
.dock { right: 12px; bottom: 12px; width: 340px; padding: 8px; z-index: 8; display: flex; flex-direction: column; gap: 6px; }
.dock.open { width: min(600px, calc(100vw - 24px)); max-height: min(78vh, calc(100vh - 82px)); box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.dock-title { display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 2px 4px; font-weight: 700; font-size: 13px; text-align: left; }
.dock-title .dock-line { flex: 1; min-width: 0; font-weight: 400; font-size: 11px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-title i { font-style: normal; color: var(--muted); font-size: 10px; }
.dock-body { display: none; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.dock.open .dock-body { display: flex; }
.dock-status { font-size: 11.5px; color: #f0a988; display: flex; align-items: center; gap: 6px; }
.dock-status:empty { display: none; }
.dock-status .spin { width: 10px; height: 10px; border-radius: 50%; border: 2px solid rgba(240, 169, 136, 0.3); border-top-color: #f0a988; animation: spin 0.8s linear infinite; flex: none; }
.dock-summary { font-size: 11.5px; line-height: 1.5; max-height: 150px; overflow-y: auto; }
.dock-summary .sum { padding: 6px 8px; border-radius: 8px; background: rgba(217, 119, 87, 0.1); border-left: 3px solid #d97757; margin-bottom: 4px; }
.dock-summary .sum.ok { background: rgba(61, 220, 132, 0.1); border-left-color: var(--good); }
.dock-summary ul { margin: 2px 0; padding-left: 16px; }
.dock-summary .diff li.add { color: var(--good); }
.dock-summary .diff li.del { color: #ff8a8a; }
.dock-summary .diff li.mod { color: #9fd0ff; }
.dock-summary .warn li { color: var(--warn); }
.dock-summary .err li { color: #ff8a8a; }
.dock-summary .muted { color: var(--muted); }
.dock-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.dock-metrics div { background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line); border-radius: 8px; padding: 5px 7px; font-size: 11.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock-metrics span { display: block; font-size: 10px; color: var(--muted); }
.dock-metrics b { color: var(--ink); }
.st-list { overflow-y: auto; display: flex; flex-direction: column; gap: 5px; min-height: 80px; padding-right: 2px; }
.st-card { border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 9px; padding: 6px; background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 4px; }
.st-card.add { border-left-color: var(--good); }
.st-card.mod { border-left-color: var(--accent); }
.st-card .r { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--ink2); }
.st-card .no { width: 18px; text-align: center; color: var(--muted); }
.st-card input, .st-card select { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: inherit; font-size: 11.5px; padding: 3px 5px; min-width: 0; }
.st-card select option { background: #1b2230; }
.st-card input[data-f="name"] { flex: 1; }
.st-card input[type="number"] { width: 46px; margin: 0 3px; }
.st-card input.task { flex: 1; }
.st-card label { display: flex; align-items: center; }
.st-card .tag { font-style: normal; font-size: 10px; padding: 0 5px; border-radius: 4px; background: rgba(55, 160, 255, 0.2); color: #9fd0ff; }
.st-card.add .tag { background: rgba(61, 220, 132, 0.2); color: var(--good); }
.st-card .ops { display: flex; gap: 2px; margin-left: auto; }
.st-card .ops button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 5px; width: 22px; height: 22px; padding: 0; font-size: 11px; color: var(--ink2); }
.st-card .eff { margin-left: auto; color: var(--muted); }
.st-card .eff.bn { color: var(--warn); font-weight: 600; }
.dock-actions { display: flex; gap: 6px; align-items: center; }
.dock-actions button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); padding: 6px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap; }
.dock-actions button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.dock-actions button:disabled { opacity: 0.4; cursor: not-allowed; }
.dock-cost { flex: 1; font-size: 10.5px; color: var(--muted); text-align: right; }
.dock-form { display: flex; gap: 6px; }
.dock-form input { flex: 1; min-width: 0; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; color: var(--ink); font: inherit; }
.dock-form button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 9px; padding: 0 12px; white-space: nowrap; }
.dock-form button:disabled { opacity: 0.4; }
.st-label .rb { font-size: 10px; color: #ffc58a; margin-top: 1px; }
.st-label .gd { font-size: 10px; color: #9fb4c8; margin-top: 2px; max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-label .gd.doortrim { color: #f0a030; } .st-label .gd.eaxle { color: #b89bff; }
.st-label.changed { border-color: var(--good); box-shadow: 0 0 0 2px rgba(61, 220, 132, 0.35); }
.st-label.changed .nm::after { content: " ● 변경"; color: var(--good); font-size: 10px; font-weight: 600; }
.detail .task { font-size: 11.5px; color: var(--ink2); margin: 2px 0 6px; }

.dock.drop { outline: 2px dashed var(--accent); outline-offset: -4px; }
.dock-files { display: none; flex-wrap: wrap; gap: 4px; }
.dock-files.has { display: flex; }
.chip-file { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 3px 4px 3px 8px; border-radius: 7px; background: rgba(55, 160, 255, 0.12); border: 1px solid rgba(55, 160, 255, 0.3); max-width: 100%; }
.chip-file.warn { border-color: var(--warn); }
.chip-file small { color: var(--muted); }
.chip-file button { border: 0; background: none; color: var(--ink2); font-size: 11px; padding: 0 3px; }
.dock-form .attach { background: rgba(255, 255, 255, 0.06); border-color: var(--line); color: var(--ink); padding: 0 10px; font-size: 14px; }
.dock-meta { display: flex; gap: 8px; font-size: 11px; color: var(--ink2); }
.dock-meta label { display: flex; align-items: center; gap: 5px; }
.dock-meta label:first-child { flex: 1; }
.dock-meta input, .dock-meta select { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: inherit; font-size: 11.5px; padding: 3px 6px; min-width: 0; }
.dock-meta input { flex: 1; }
.dock-meta select option { background: #1b2230; }
.dock-summary details.ext { margin: 4px 0; padding: 4px 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.04); }
.dock-summary details.ext summary { cursor: pointer; color: var(--ink); }
.dock-summary .key-link { margin-top: 4px; border: 1px solid #d97757; background: rgba(217, 119, 87, 0.15); color: #f0a988; border-radius: 7px; padding: 4px 10px; font-size: 11.5px; }
.st-card .ops.cell-use { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.st-label .nm .no, .zc-cell b, .st-card .no.cell { display: inline-grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: #2bb3a6; color: #04121f; font-size: 10px; font-weight: 800; margin-right: 4px; vertical-align: 1px; }
.zc-cell.p-doortrim b { background: #f0a030; }
.zc-cell.p-eaxle b { background: #9a6bff; }
.zc-amr { margin-top: 6px; font-size: 11px; color: var(--ink2); padding: 4px 6px; border-radius: 7px; background: rgba(255, 255, 255, 0.04); }
.zc-amr b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* 단계 화살표 (레거시 › 자동화 › 피지컬AI) */
#modeSeg { align-items: center; }
.seg-arrow { font-style: normal; color: var(--muted); padding: 0 1px; font-size: 13px; }
#modeSeg button[data-mode="traditional"].on { background: #a5824c; }
#modeSeg button[data-mode="dark"].on { background: #7c4dff; }

/* 공장 진화 컨셉 */
.modal-card.wide { width: min(1180px, 96vw); }
.cc-grid { display: grid; gap: 4px 0; align-items: stretch; font-size: 12px; }
.cc-label { color: var(--muted); font-size: 11.5px; display: flex; align-items: center; padding-right: 8px; }
.cc-cell { position: relative; padding: 7px 10px; background: rgba(255, 255, 255, 0.03); border-left: 3px solid var(--c); border-radius: 6px; color: var(--ink2); line-height: 1.45; display: flex; align-items: center; }
.cc-cell.cur { background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--ink); }
.cc-cell.head { flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border-left-width: 0; border-top: 4px solid var(--c); }
.cc-cell.head.cur { box-shadow: 0 0 0 1px var(--c) inset; }
.cc-no { position: absolute; top: 8px; right: 10px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #0b1018; font-weight: 800; }
.cc-icon { font-size: 26px; line-height: 1.1; }
.cc-title { font-size: 15px; font-weight: 800; color: var(--ink); }
.cc-motto { font-size: 11.5px; color: var(--ink2); }
.cc-cell.head button { margin-top: 6px; border: 1px solid var(--c); background: transparent; color: var(--ink); border-radius: 7px; padding: 4px 10px; font-size: 11.5px; }
.cc-cell.head.cur button { background: var(--c); color: #0b1018; font-weight: 700; }
.cc-arrow { display: flex; align-items: center; justify-content: center; position: relative; }
.cc-arrow::before { content: ''; position: absolute; left: 6px; right: 10px; top: 50%; height: 2px; background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.35)); }
.cc-arrow::after { content: ''; position: absolute; right: 6px; top: calc(50% - 5px); border: 5px solid transparent; border-left-color: rgba(255, 255, 255, 0.45); }
.cc-arrow span { position: relative; z-index: 1; text-align: center; font-size: 10.5px; color: var(--ink); background: #121922; padding: 2px 0; line-height: 1.3; }
.cc-arrow span small { color: var(--muted); font-size: 9.5px; }
.cc-sep { margin: 10px 0 2px; font-size: 12px; font-weight: 700; color: var(--ink); border-top: 1px solid var(--line); padding-top: 10px; }
.cc-cell.kpi { display: block; }
.cc-kv b { font-variant-numeric: tabular-nums; font-weight: 600; }
.cc-kv.best b { color: var(--good); }
.cc-kv i { display: block; height: 4px; margin-top: 4px; border-radius: 2px; background: var(--c); opacity: 0.7; }
.cc-calc { padding: 10px; display: flex; align-items: center; gap: 8px; color: var(--ink2); }
.cc-calc button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 9px; padding: 7px 14px; }
.cc-calc .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.zc-flow .t-dt { color: #f5bd5c; }
.zc-flow .t-ea { color: #b89bff; }

/* 로봇 텔레메트리 패널 */
.detail.robot { width: 400px; max-height: calc(100vh - 150px); overflow-y: auto; }
/* 선택한 로봇을 가리지 않도록 오른쪽(에이전트 패널 옆)으로 옮긴 위치 */
.detail.robot.side-right { left: auto; right: var(--rx); }
.rb-status .grid { margin: 4px 0 6px; }
table.rb-j { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
table.rb-j th { color: var(--muted); font-weight: 500; text-align: left; padding: 2px 4px; font-size: 10.5px; }
table.rb-j td { padding: 3px 4px; border-top: 1px solid rgba(255, 255, 255, 0.06); vertical-align: middle; }
table.rb-j td.num { text-align: right; white-space: nowrap; }
table.rb-j td.warn { color: var(--warn); }
table.rb-j .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
table.rb-j .rng { position: relative; height: 3px; margin-top: 2px; background: rgba(255, 255, 255, 0.1); border-radius: 2px; }
table.rb-j .rng i { position: absolute; top: -2px; width: 3px; height: 7px; margin-left: -1px; background: var(--ink); border-radius: 1px; }
table.rb-j .tq { display: inline-block; width: 34px; height: 5px; margin-right: 4px; background: rgba(255, 255, 255, 0.1); border-radius: 3px; overflow: hidden; vertical-align: middle; }
table.rb-j .tq i { display: block; height: 100%; }
#rbChart { width: 100%; height: 75px; margin: 6px 0 2px; background: rgba(0, 0, 0, 0.25); border-radius: 8px; }
.rb-sec { margin-top: 6px; }
.rb-h { font-size: 11px; font-weight: 700; color: #7ff3ff; margin-bottom: 2px; }
.detail .grid b.ok { color: var(--good); }
.detail .grid b.warn { color: var(--warn); }
.detail .grid b.bad { color: #ff8a8a; }
.rb-note { font-size: 10.5px; color: var(--muted); margin-top: 8px; line-height: 1.45; }

/* 데이터 연동 */
.dh-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px; }
.dh-grid section { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-width: 0; }
.dh-grid section.span2 { grid-column: 1 / -1; }
.dh-grid h4 { margin: 0 0 6px; font-size: 13px; color: #7ff3ff; }
.grid2 { display: grid; grid-template-columns: 170px 1fr; gap: 4px 10px; }
.grid2 span { color: var(--muted); }
.grid2 b { font-weight: 600; font-variant-numeric: tabular-nums; word-break: break-all; }
.grid2 b.ok, .grid2 b .ok { color: var(--good); }
.grid2 b .bad { color: #ff8a8a; }
.grid2 code, .cmp-note code, .dh-grid summary code { font-size: 11px; background: rgba(255, 255, 255, 0.07); padding: 1px 5px; border-radius: 4px; }
.grid2 select { background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); font: inherit; font-size: 11.5px; padding: 2px 6px; }
.dh-kinds { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.dh-kinds i { font-style: normal; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: rgba(55, 232, 255, 0.1); color: #9fe9f5; }
.dh-grid details { margin-top: 8px; }
.dh-grid summary { cursor: pointer; color: var(--ink2); font-size: 11.5px; }
.dh-pre { max-height: 220px; overflow: auto; background: rgba(0, 0, 0, 0.35); border-radius: 8px; padding: 8px; font-size: 10.5px; line-height: 1.4; color: #cfe6f0; margin: 6px 0 0; white-space: pre-wrap; word-break: break-all; }
.dh-save { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.dh-save button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 9px; padding: 8px 10px; }
.dh-save button:hover { border-color: var(--accent); background: rgba(55, 160, 255, 0.12); }
.dh-save b { font-size: 13px; }
.dh-save small { color: var(--muted); font-size: 10.5px; line-height: 1.35; }
.dh-note { margin-top: 6px; font-size: 11.5px; color: var(--good); min-height: 15px; }
.rb-save { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.rb-count { font-size: 11px; color: var(--ink2); line-height: 1.5; }
.rb-count b { color: var(--ink); font-variant-numeric: tabular-nums; }
.rb-save-row { display: flex; gap: 6px; margin-top: 6px; }
.rb-save-row select { flex: 1; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); font: inherit; font-size: 11.5px; padding: 5px 7px; }
.rb-save-row button { border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 7px; padding: 5px 14px; }
.rb-save-note { font-size: 11px; color: var(--good); margin-top: 4px; min-height: 14px; word-break: break-all; }

/* 오케스트레이터 인시던트 흐름 */
:root { --o-detect: #ff6b6b; --o-self: #2bd4c6; --o-report: #5aa9ff; --o-decide: #b89bff; --o-command: #ff9a3d; --o-act: #3ddc84; --o-notify: #a9b4c0; --o-done: #7dffb0; --o-line: rgba(232, 237, 242, 0.55); }
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 3px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; }
.panel.orch { top: 70px; left: var(--lx); width: min(1000px, calc(100vw - var(--lx) - var(--rx) - 2px)); max-height: calc(100vh - 150px); z-index: 9; padding: 10px 12px; display: flex; flex-direction: column; }
.panel.orch.hidden { display: none; }
.orch-h { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.orch-h b { font-size: 14px; }
.orch-h small { color: var(--muted); margin-right: auto; }
.orch-h button { border: 0; background: none; color: var(--ink2); font-size: 15px; }
.orch-b { display: grid; grid-template-columns: 230px 1fr; gap: 10px; min-height: 0; flex: 1; overflow: hidden; }
.orch-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; padding-right: 2px; }
.oi { display: grid; grid-template-columns: 18px 1fr auto; grid-template-rows: auto auto; column-gap: 6px; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 8px; padding: 6px 8px; }
.oi.sel { border-color: var(--accent); background: rgba(55, 160, 255, 0.12); }
.oi-ic { grid-row: span 2; align-self: center; }
.oi-t { font-weight: 600; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-m { grid-column: 2; font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.oi-s { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.08); color: var(--ink2); }
.oi.st-open .oi-s { background: rgba(255, 90, 90, 0.2); color: #ff8a8a; }
.oi.st-done .oi-s { background: rgba(61, 220, 132, 0.18); color: var(--good); }
.oi.st-cell .oi-s { background: rgba(43, 212, 198, 0.16); color: #7fe0d6; }
.oi-empty { font-size: 11.5px; color: var(--muted); line-height: 1.5; padding: 8px; }
.orch-flow { min-width: 0; display: flex; flex-direction: column; gap: 6px; overflow: hidden; }
.of-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--ink2); flex-wrap: wrap; }
.of-h b { color: var(--ink); }
.of-st { font-size: 11px; padding: 1px 8px; border-radius: 6px; background: rgba(61, 220, 132, 0.18); color: var(--good); font-variant-numeric: tabular-nums; }
.of-st.open { background: rgba(255, 90, 90, 0.2); color: #ff8a8a; }
.ostp { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 11px; }
.os { display: flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.04); color: var(--muted); }
.os i { font-style: normal; width: 16px; height: 16px; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 10px; }
.os small { font-variant-numeric: tabular-nums; }
.os.on { color: var(--ink); } .os.on i { background: var(--good); color: #05220f; }
.os.cur { color: var(--warn); box-shadow: inset 0 0 0 1px var(--warn); }
.os-ar { color: var(--muted); font-weight: 400; }
.sw-wrap { overflow-y: auto; min-height: 0; flex: 1; border-radius: 8px; background: rgba(0, 0, 0, 0.18); }
.sw .lane { fill: rgba(255, 255, 255, 0.025); stroke: rgba(255, 255, 255, 0.06); }
.sw .lane.l-orch { fill: rgba(184, 155, 255, 0.06); }
.sw .ln { fill: var(--ink); font-size: 12px; font-weight: 700; }
.sw .ls { fill: var(--muted); font-size: 9.5px; }
.sw .tm { fill: var(--ink2); font-size: 10px; font-variant-numeric: tabular-nums; }
.sw .tm2 { fill: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.sw .bx { fill: rgba(16, 22, 30, 0.95); stroke: var(--k); stroke-width: 1.4; }
.sw .bk { font-size: 9.5px; font-weight: 700; }
.sw .bt { fill: var(--ink); font-size: 9.5px; }
.sw .ar { fill: none; stroke: var(--o-line); stroke-width: 1.4; }
.sw .al { fill: var(--ink); font-size: 9.5px; font-weight: 700; paint-order: stroke; stroke: rgba(10, 14, 20, 0.95); stroke-width: 3px; }
.sw .cur .bx { animation: orch-pulse 1.1s ease-in-out infinite; }
@keyframes orch-pulse { 50% { stroke-width: 3.2; } }
@media (prefers-reduced-motion: reduce) { .sw .cur .bx { animation: none; stroke-width: 2.6; } }
.badge[hidden] { display: none; }

/* 경보: 진행 중인 고장·공급 차질·현장 이벤트 — 하단 버튼과 현장 라벨이 깜빡인다 (해결되면 원래대로) */
:root { --al-fault: 255, 70, 70; --al-supply: 255, 138, 31; --al-event: 255, 194, 31; }
@keyframes al-blink { 0%, 100% { background: rgba(var(--al), 0.16); box-shadow: 0 0 0 0 rgba(var(--al), 0); } 50% { background: rgba(var(--al), 0.85); color: #fff; box-shadow: 0 0 16px 3px rgba(var(--al), 0.75); } }
.bottombar button.alarm-fault { --al: var(--al-fault); }
.bottombar button.alarm-supply { --al: var(--al-supply); }
.bottombar button.alarm-event { --al: var(--al-event); }
.bottombar button.alarm-fault, .bottombar button.alarm-supply, .bottombar button.alarm-event { border-color: rgb(var(--al)); animation: al-blink 0.9s steps(2, jump-none) infinite; font-weight: 700; }
.bottombar button[data-count]::after { content: attr(data-count); margin-left: 6px; padding: 0 6px; border-radius: 8px; background: rgba(0, 0, 0, 0.35); font-size: 11px; }
.st-label.alarm-fault { --al: var(--al-fault); }
.st-label.alarm-supply { --al: var(--al-supply); }
.st-label.alarm-fault, .st-label.alarm-supply { border-color: rgb(var(--al)); animation: al-blink 0.9s steps(2, jump-none) infinite; }
@media (prefers-reduced-motion: reduce) {
  .bottombar button.alarm-fault, .bottombar button.alarm-supply, .bottombar button.alarm-event, .st-label.alarm-fault, .st-label.alarm-supply { animation: none; background: rgba(var(--al), 0.7); color: #fff; }
}

/* 상위 명령: 비상정지 버튼 · 상단 알림 띠 · 명령 콘솔 */
:root { --cmd-bad: 255, 70, 70; --cmd-warn: 245, 184, 46; --cmd-info: 90, 169, 255; }
.topbar .estop { border: 1px solid rgb(var(--cmd-bad)); background: rgba(var(--cmd-bad), 0.16); color: #ffb3b3; font-weight: 700; padding: 6px 14px; border-radius: 10px; white-space: nowrap; }
.topbar .estop:hover { background: rgba(var(--cmd-bad), 0.3); }
.topbar .estop.armed { background: rgb(var(--cmd-bad)); color: #fff; animation: al-blink 0.9s steps(2, jump-none) infinite; --al: var(--cmd-bad); }
.cmd-banner { position: fixed; bottom: 74px; left: 50%; transform: translateX(-50%); z-index: 12; max-width: min(760px, calc(100vw - 40px)); padding: 9px 18px; border-radius: 10px; font-weight: 700; font-size: 13.5px; text-align: center; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35); }
.cmd-banner.bad { background: rgba(var(--cmd-bad), 0.92); animation: cmd-pulse 0.9s steps(2, jump-none) infinite; }
.cmd-banner.warn { background: rgba(var(--cmd-warn), 0.92); color: #241800; }
.cmd-banner.info { background: rgba(var(--cmd-info), 0.9); }
@keyframes cmd-pulse { 50% { background: rgba(var(--cmd-bad), 0.62); } }
.orch-tabs { margin-left: 4px; }
.cmd-b { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 12px; min-height: 0; flex: 1; overflow: hidden; }
.cmd-ctl, .cmd-side { display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow-y: auto; }
.cmd-b h4 { margin: 2px 0 0; font-size: 11.5px; color: var(--ink2); letter-spacing: 0.04em; }
.cmd-b h4 small { color: var(--muted); font-weight: 400; margin-left: 6px; letter-spacing: 0; }
.cmd-tg { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink2); }
.cmd-tg select { flex: 1; min-width: 0; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); color: var(--ink); }
.cmd-grp { display: flex; flex-direction: column; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.025); }
.cmd-grp.emg { border-color: rgba(var(--cmd-bad), 0.45); background: rgba(var(--cmd-bad), 0.05); }
.cmd-grp.emg h4 { color: #ff9a9a; }
.cmd-btns { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 5px; }
.cb { display: flex; align-items: center; gap: 6px; text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 6px 8px; font-size: 12px; }
.cb i { font-style: normal; }
.cb:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); }
.cb:disabled { opacity: 0.35; cursor: not-allowed; }
.cb.g-emergency { border-color: rgba(var(--cmd-bad), 0.4); }
.cb.c-ESTOP { background: rgba(var(--cmd-bad), 0.85); border-color: rgb(var(--cmd-bad)); color: #fff; font-weight: 700; }
.cb.c-ESTOP:hover:not(:disabled) { background: rgb(var(--cmd-bad)); }
.cb.on { border-color: var(--accent); color: #9fd0ff; }
.cb-args { grid-column: 1 / -1; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; color: var(--ink2); }
.cb-args span { margin-right: 4px; }
.cb-args .cb { padding: 5px 10px; }
.cmd-note { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.cmd-state { display: flex; flex-direction: column; gap: 3px; }
.cs-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 3px; }
.cs-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 11.5px; padding: 4px 6px; border-radius: 7px; background: rgba(255, 255, 255, 0.03); }
.cs-row.sel { box-shadow: inset 0 0 0 1px var(--accent); }
.cs-row > span { min-width: 0; flex: 1 1 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg { font-style: normal; font-size: 10.5px; padding: 1px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.07); color: var(--muted); }
.tg.bad { background: rgba(var(--cmd-bad), 0.22); color: #ff9a9a; }
.tg.warn { background: rgba(var(--cmd-warn), 0.2); color: var(--warn); }
.tg.info { background: rgba(var(--cmd-info), 0.2); color: #9fd0ff; }
.cmd-hist { display: flex; flex-direction: column; gap: 4px; }
.ch { display: flex; flex-direction: column; gap: 2px; text-align: left; border: 1px solid var(--line); border-left: 3px solid rgba(var(--cmd-info), 0.8); background: rgba(255, 255, 255, 0.03); border-radius: 8px; padding: 5px 8px; }
.ch.g-emergency { border-left-color: rgb(var(--cmd-bad)); }
.ch:hover { background: rgba(255, 255, 255, 0.07); }
.ch-t { font-weight: 600; font-size: 12px; }
.ch-m { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ch-p { display: flex; align-items: center; gap: 3px; flex-wrap: wrap; font-size: 10.5px; color: var(--muted); }
.cp { padding: 0 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.05); font-variant-numeric: tabular-nums; }
.cp.on { background: rgba(61, 220, 132, 0.18); color: var(--good); }
.cp.rej { background: rgba(var(--cmd-bad), 0.2); color: #ff9a9a; }
.ch.st-exec .cp:not(.on) { color: var(--warn); }
.chip.s-ESTOP { background: rgba(var(--cmd-bad), 0.32); color: #ffb3b3; }
.chip.s-PSTOP, .chip.s-CSTOP { background: rgba(var(--cmd-warn), 0.22); color: var(--warn); }
.chip.s-CHECK { background: rgba(var(--cmd-info), 0.22); color: #9fd0ff; }
@media (max-width: 1100px) { .cmd-b { grid-template-columns: 1fr; overflow-y: auto; } }
@media (prefers-reduced-motion: reduce) { .topbar .estop.armed, .cmd-banner.bad { animation: none; } }

.entry.dialog { border-left-color: #2bd4c6; background: rgba(43, 212, 198, 0.08); }
.entry.dialog .r { white-space: pre-line; }

/* 운영자 지시 게이트: 대화창 항목(누르면 도식) · 게이트 도식 모달 */
:root { --g-pass: 61, 220, 132; --g-warn: 245, 184, 46; --g-fail: 255, 90, 90; --g-pend: 90, 169, 255; }
.entry.dlg { cursor: pointer; }
.entry.dlg:hover { filter: brightness(1.18); }
.g-hint { margin-top: 4px; font-size: 10.5px; color: #7fe0d6; }
.g-intro { margin: -4px 0 10px; font-size: 12px; color: var(--ink2); line-height: 1.5; }
.g-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 11px; margin-bottom: 8px; color: var(--ink2); }
.g-legend .pass { color: rgb(var(--g-pass)); } .g-legend .warn { color: rgb(var(--g-warn)); } .g-legend .fail { color: rgb(var(--g-fail)); } .g-legend .skip { color: var(--muted); } .g-legend .cur { color: rgb(var(--g-pend)); }
.g-row { border: 1px solid var(--line); border-left: 4px solid var(--muted); border-radius: 10px; padding: 8px 10px; margin-bottom: 10px; background: rgba(255, 255, 255, 0.02); }
.g-row.v-pass { border-left-color: rgb(var(--g-pass)); } .g-row.v-fail { border-left-color: rgb(var(--g-fail)); } .g-row.v-pending { border-left-color: rgb(var(--g-pend)); }
.g-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.g-head small { color: var(--muted); margin-left: auto; }
.g-no { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 11px; font-weight: 700; }
.g-v { font-style: normal; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 6px; }
.g-v.pass { background: rgba(var(--g-pass), 0.2); color: rgb(var(--g-pass)); } .g-v.fail { background: rgba(var(--g-fail), 0.22); color: #ff9a9a; } .g-v.pending { background: rgba(var(--g-pend), 0.2); color: #9fd0ff; }
.g-svg { overflow-x: auto; margin: 6px 0; }
.gsvg { min-width: 900px; display: block; }
.gsvg .gn rect { fill: rgba(16, 22, 30, 0.95); stroke: var(--muted); stroke-width: 1.3; }
.gsvg .gn.s-pass rect { stroke: rgb(var(--g-pass)); fill: rgba(var(--g-pass), 0.08); }
.gsvg .gn.s-warn rect { stroke: rgb(var(--g-warn)); fill: rgba(var(--g-warn), 0.1); }
.gsvg .gn.s-fail rect { stroke: rgb(var(--g-fail)); fill: rgba(var(--g-fail), 0.12); stroke-width: 2; }
.gsvg .gn.s-pending rect, .gsvg .gn.s-cur rect { stroke: rgb(var(--g-pend)); fill: rgba(var(--g-pend), 0.1); stroke-dasharray: 4 3; }
.gsvg .gn.s-skip { opacity: 0.38; } .gsvg .gn.s-skip rect { stroke-dasharray: 3 3; }
.gsvg .gl { fill: var(--ink); font-size: 11px; font-weight: 700; }
.gsvg .gt { fill: var(--ink2); font-size: 10px; }
.gsvg .gb { fill: var(--muted); font-size: 10.5px; font-weight: 700; } .gsvg .gb.on { fill: rgb(var(--g-pass)); } .gsvg .gb.bad { fill: #ff9a9a; }
.gsvg .ga { fill: none; stroke-width: 1.6; }
.gsvg .ga.on { stroke: rgb(var(--g-pass)); } .gsvg .ga.fail { stroke: rgb(var(--g-fail)); } .gsvg .ga.off { stroke: rgba(255, 255, 255, 0.18); stroke-dasharray: 4 3; } .gsvg .ga.pend { stroke: rgb(var(--g-pend)); stroke-dasharray: 5 3; }
.gsvg .gm.on { fill: rgb(var(--g-pass)); } .gsvg .gm.fail { fill: rgb(var(--g-fail)); } .gsvg .gm.off { fill: rgba(255, 255, 255, 0.25); } .gsvg .gm.pend { fill: rgb(var(--g-pend)); }
.gsvg .gd path { stroke-width: 2; fill: rgba(16, 22, 30, 0.95); stroke: var(--muted); }
.gsvg .gd.s-pass path { stroke: rgb(var(--g-pass)); fill: rgba(var(--g-pass), 0.14); } .gsvg .gd.s-fail path { stroke: rgb(var(--g-fail)); fill: rgba(var(--g-fail), 0.16); } .gsvg .gd.s-pending path { stroke: rgb(var(--g-pend)); }
.gsvg .gn.s-cur rect { animation: g-pulse 1s ease-in-out infinite; }
@keyframes g-pulse { 50% { stroke-width: 2.6; } }
@media (prefers-reduced-motion: reduce) { .gsvg .gn.s-cur rect { animation: none; } }
.g-detail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 3px; font-size: 11.5px; }
.g-detail li { display: grid; grid-template-columns: 110px 1fr; gap: 8px; padding: 3px 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.03); }
.g-detail li b { font-weight: 700; } .g-detail li span { color: var(--ink2); min-width: 0; overflow-wrap: anywhere; }
.g-detail li.s-pass b { color: rgb(var(--g-pass)); } .g-detail li.s-warn b { color: rgb(var(--g-warn)); } .g-detail li.s-fail b { color: #ff9a9a; } .g-detail li.s-skip { opacity: 0.5; } .g-detail li.s-pending b { color: #9fd0ff; }
.g-detail .cp { margin-right: 4px; }
.uid { font-style: normal; font-family: Menlo, 'SF Mono', Consolas, monospace; font-size: 9.5px; font-weight: 700; color: #ffb020; background: rgba(255, 176, 32, 0.14); border: 1px solid rgba(255, 176, 32, 0.45); border-radius: 4px; padding: 0 4px; margin: 0 5px 0 0; }
.st-label .nm .uid { margin: 0 0 0 6px; }
.rb-cam { margin: 6px 0 8px; border-radius: 8px; overflow: hidden; border: 1px solid rgba(55, 232, 255, 0.35); background: #05080c; line-height: 0; }
.rb-cam canvas { width: 100%; height: auto; display: block; }

/* VLA 데이터·학습 파이프라인 창 */
.vla-flow { display: flex; align-items: stretch; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.vla-flow .va { align-self: center; color: var(--muted); }
.vs { flex: 1 1 0; min-width: 120px; display: flex; flex-direction: column; gap: 3px; padding: 8px 9px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); font-size: 11px; }
.vs i { font-style: normal; font-size: 18px; }
.vs b { font-size: 12px; } .vs span { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; } .vs small { color: var(--muted); line-height: 1.35; overflow-wrap: anywhere; }
.vs.on { border-color: #b89bff; background: rgba(184, 155, 255, 0.12); box-shadow: 0 0 0 1px rgba(184, 155, 255, 0.35); }
.vla-actions { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.vla-actions button { border: 1px solid #b89bff; background: rgba(184, 155, 255, 0.18); border-radius: 8px; padding: 6px 12px; font-weight: 700; }
.vla-actions button:disabled { opacity: 0.4; }
.vla-note { font-size: 11px; color: var(--muted); }
.vla-grid { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: 14px; }
.vla-grid h4 { margin: 4px 0 6px; font-size: 12.5px; } .vla-grid h4 small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.vla-t { width: 100%; border-collapse: collapse; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.vla-t th { text-align: left; color: var(--muted); font-weight: 600; padding: 3px 5px; border-bottom: 1px solid var(--line); }
.vla-t td { padding: 3px 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: middle; }
.vla-t td.ins { max-width: 220px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vla-t td.dl { white-space: nowrap; } .vla-t td.dl button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 2px 7px; font-size: 11px; margin-left: 3px; }
.vla-t td.dl button:disabled { opacity: 0.35; }
.vla-t .uidc { color: #ffb020; font-family: Menlo, 'SF Mono', Consolas, monospace; }
.vla-t .p-train, .vla-t .p-eval, .vla-t .p-canary, .vla-t .p-rollout { color: #b89bff; } .vla-t .p-done { color: var(--good); } .vla-t .p-rejected { color: var(--warn); }
@media (max-width: 1100px) { .vla-grid { grid-template-columns: 1fr; } }

/* GPU 컨텍스트 복구 안내 */
#glNote { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 50; padding: 10px 16px; border-radius: 10px; background: rgba(13, 17, 23, 0.88); border: 1px solid var(--line); color: var(--ink); font-size: 13px; pointer-events: none; }
#glNote[hidden] { display: none; }

/* 상단: 피지컬AI 버튼 옆 VLA 학습 */
.topbar .vla-top { border: 1px solid #b89bff; background: rgba(184, 155, 255, 0.16); color: #e2d6ff; font-weight: 700; padding: 6px 12px; border-radius: 10px; white-space: nowrap; }
.topbar .vla-top:hover { background: rgba(184, 155, 255, 0.3); }

/* AIOS 공장 운영 AI */
.topbar .aios-top { border-color: #3fd0c9; background: rgba(63, 208, 201, 0.14); color: #c4f5f2; margin-left: -4px; margin-right: 4px; }
.topbar .aios-top:hover { background: rgba(63, 208, 201, 0.28); }
.vs.aios.on { border-color: #3fd0c9; background: rgba(63, 208, 201, 0.12); box-shadow: 0 0 0 1px rgba(63, 208, 201, 0.35); }
#aiosBody .vla-actions button { border-color: #3fd0c9; background: rgba(63, 208, 201, 0.16); }
#aiosBody .vla-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
#aiosBody .vla-grid h4:not(:first-child) { margin-top: 14px; }

/* 공정 설계: 피지컬AI 단계에서만 AMMR인 셀 표시 */
.st-card .ammr-note { font-size: 10.5px; color: #b89bff; white-space: nowrap; }

/* FACOS 공장 운영 SW 통합 표시 (피지컬AI): 상단 바 아래 가운데, 계층별 실시간 상태 칩 */
.dark-only-flex { display: none; }
body[data-mode="dark"] .dark-only-flex { display: flex; }
#facos { position: fixed; top: 66px; left: var(--lx); right: var(--rx); z-index: 6; align-items: stretch; gap: 3px; flex-wrap: wrap; justify-content: center; pointer-events: none; }
#facos > * { pointer-events: auto; }
#facos .fc-brand { display: flex; flex-direction: column; justify-content: center; padding: 3px 9px; border-radius: 9px; border: 1px solid #3fd0c9; background: linear-gradient(135deg, rgba(63, 208, 201, 0.28), rgba(184, 155, 255, 0.24)); color: #e8fffd; line-height: 1.1; }
#facos .fc-brand b { font-size: 12.5px; letter-spacing: 1.2px; } #facos .fc-brand small { font-size: 9px; color: #b9e9e6; }
#facos .fc-l { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 3px 7px; border-radius: 8px; border: 1px solid var(--line); background: rgba(13, 17, 23, 0.82); backdrop-filter: blur(6px); color: var(--ink); line-height: 1.15; cursor: pointer; }
#facos .fc-l:disabled { cursor: default; opacity: 1; }
#facos .fc-l:not(:disabled):hover { border-color: #3fd0c9; }
#facos .fc-n { font-size: 9.5px; color: var(--muted); white-space: nowrap; }
#facos .fc-v { font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#facos .fc-l.ok .fc-v { color: #8ff0b8; } #facos .fc-l.act .fc-v { color: #c9b5ff; } #facos .fc-l.warn .fc-v { color: #ffc65a; } #facos .fc-l.bad .fc-v { color: #ff7b7b; }
#facos .fc-l.act { border-color: rgba(184, 155, 255, 0.6); } #facos .fc-l.warn { border-color: rgba(255, 176, 32, 0.6); } #facos .fc-l.bad { border-color: rgba(255, 90, 90, 0.8); }
#facos .fc-arw { align-self: center; color: var(--muted); font-style: normal; font-size: 11px; }
#facos.min .fc-l, #facos.min .fc-arw { display: none; }
#facos .fc-ic { font-style: normal; margin-right: 3px; }
@media (max-width: 1500px) { #facos { gap: 2px; } #facos .fc-arw, #facos .fc-ic { display: none; } #facos .fc-l { padding: 2px 5px; } #facos .fc-n { font-size: 9px; } #facos .fc-v { font-size: 10.5px; } #facos .fc-brand { padding: 2px 7px; } }

/* FACOS 계층 상세 창 (자율 에이전트 · 셀·게이트 · 현장 감지) */
#facosBody h4 { margin: 12px 0 6px; font-size: 12.5px; } #facosBody h4 small { font-weight: 400; color: var(--muted); margin-left: 6px; }
#facosBody h4:first-child { margin-top: 2px; }
.fc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; margin-bottom: 4px; }
.fc-tile { display: flex; flex-direction: column; gap: 2px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); }
.fc-tile small { font-size: 10.5px; color: var(--muted); } .fc-tile b { font-size: 15px; font-variant-numeric: tabular-nums; } .fc-tile i { font-style: normal; font-size: 10.5px; color: var(--ink2); }
.fc-bars { display: flex; flex-direction: column; gap: 4px; }
.fc-bar { display: grid; grid-template-columns: minmax(0, 150px) 1fr 56px; align-items: center; gap: 8px; font-size: 11.5px; }
.fc-bar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .fc-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.fc-bar i { display: block; height: 9px; border-radius: 5px; background: #3fd0c9; min-width: 2px; }
.fc-spark { width: 100%; height: 70px; display: block; background: rgba(255, 255, 255, 0.02); border-radius: 6px; }
.fc-axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); margin-top: 2px; }
.fc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 10px; margin-top: 6px; }
.fc-card { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(255, 255, 255, 0.02); min-width: 0; }
.fc-sub { font-size: 11px; color: var(--ink2); margin: 6px 0; }

/* 양쪽 패널 숨기기/보이기 — 가운데 요소(하단 버튼·정보 창·오케스트레이터·FACOS)는 --lx/--rx 기준으로 넓어진다 */
:root { --lx: 314px; --rx: 364px; }
@media (max-width: 1100px) { :root { --lx: 270px; --rx: 304px; } }
body.hide-left { --lx: 44px; }
body.hide-right { --rx: 44px; }
.panel.left, .panel.right { transition: transform 0.22s ease, opacity 0.22s ease; }
body.hide-left .panel.left { transform: translateX(calc(-100% - 16px)); opacity: 0; pointer-events: none; }
body.hide-right .panel.right { transform: translateX(calc(100% + 16px)); opacity: 0; pointer-events: none; }
.side-tgl { position: fixed; top: 50%; transform: translateY(-50%); z-index: 7; width: 22px; height: 46px; display: grid; place-items: center; padding: 0; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(10px); color: var(--ink2); font-size: 12px; cursor: pointer; transition: left 0.22s ease, right 0.22s ease; }
.side-tgl:hover { color: var(--ink); border-color: #3fd0c9; }
#tglLeft { left: calc(var(--lx) - 23px); } #tglRight { right: calc(var(--rx) - 23px); }   /* 패널 가장자리에 걸쳐 둔다 */
body.hide-left #tglLeft { left: 12px; } body.hide-right #tglRight { right: 12px; }

/* CCTV 커버리지 요약 카드 (📹 CCTV 켜면) */
#cctvCard { position: fixed; left: var(--lx); bottom: 120px; z-index: 6; max-width: 520px; display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 10px; border: 1px solid #37e8ff; background: rgba(13, 17, 23, 0.88); backdrop-filter: blur(8px); font-size: 11.5px; color: var(--ink2); }
#cctvCard b { font-size: 13px; color: var(--ink); } #cctvCard[hidden] { display: none; }

/* CCTV 영상 창 */
.cc-panel { position: fixed; right: var(--rx); top: 70px; z-index: 9; width: 680px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 10px 12px; border-radius: 14px; border: 1px solid #37e8ff; background: var(--panel); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; }
.cc-panel[hidden] { display: none; }
.cc-head { display: flex; align-items: center; gap: 8px; } .cc-head > div { flex: 1; min-width: 0; } .cc-head h3 { margin: 0; font-size: 14px; } .cc-head small { color: var(--muted); font-size: 11px; }
.cc-ptz { display: flex; gap: 3px; } .cc-ptz button, #cctvClose { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 7px; padding: 3px 8px; font-size: 11px; }
#cctvCanvas { width: 100%; height: auto; border-radius: 8px; background: #05080c; display: block; }
.cc-models { display: flex; flex-wrap: wrap; gap: 4px; } .cc-m { font-size: 10.5px; padding: 2px 7px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.cc-m.on { border-color: var(--c); color: var(--c); background: rgba(255, 255, 255, 0.05); font-weight: 700; }
.cc-cnt { font-size: 11.5px; color: var(--ink2); margin-top: 3px; } .cc-cnt small { color: var(--muted); }
.cc-hh { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; } .cc-hh b { font-size: 12.5px; } .cc-hh small { color: var(--muted); font-size: 10.5px; flex: 1; }
.cc-hh button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 6px; padding: 2px 8px; font-size: 11px; } .cc-hh button.on { border-color: #37e8ff; color: #37e8ff; }
.cc-hist { max-height: 260px; overflow-y: auto; } .cc-cam { border: 0; background: none; color: #37e8ff; font: inherit; padding: 0; cursor: pointer; font-family: Menlo, monospace; }
#cctvCard button { border: 1px solid #37e8ff; background: rgba(55, 232, 255, 0.12); border-radius: 6px; padding: 2px 8px; font-size: 11px; color: var(--ink); }
#net5gCard { position: fixed; left: var(--lx); bottom: 120px; z-index: 6; max-width: 560px; display: flex; flex-direction: column; gap: 3px; padding: 8px 12px; border-radius: 10px; border: 1px solid #b89bff; background: rgba(13, 17, 23, 0.9); backdrop-filter: blur(8px); font-size: 11.5px; color: var(--ink2); }
#net5gCard b { font-size: 13px; color: var(--ink); } #net5gCard[hidden] { display: none; }
#net5gCard .ok { color: #3ddc84; } #net5gCard .pci { color: #b89bff; font-variant-numeric: tabular-nums; }
#net5gCard .ho { max-height: 96px; overflow: auto; font-variant-numeric: tabular-nums; border-top: 1px solid rgba(184, 155, 255, 0.25); padding-top: 3px; }
.gnb-panel { position: fixed; right: var(--rx); top: 70px; z-index: 9; width: 520px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 10px 12px; border-radius: 14px; border: 1px solid #b89bff; background: var(--panel); backdrop-filter: blur(10px); display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--ink2); }
.gnb-panel[hidden] { display: none; }
.gnb-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; } .gnb-head h3 { margin: 0; font-size: 15px; color: var(--ink); } .gnb-head small { color: #b89bff; }
.gnb-head button { border: 1px solid var(--line, #333); background: transparent; color: var(--ink); border-radius: 6px; padding: 2px 8px; }
.gnb-sec { border-top: 1px solid rgba(184, 155, 255, 0.25); padding-top: 5px; } .gnb-sec h4 { margin: 0 0 4px; font-size: 12.5px; color: #b89bff; }
.gnb-grid { display: grid; grid-template-columns: 150px 1fr; gap: 2px 10px; } .gnb-grid b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.gnb-panel table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; } .gnb-panel td, .gnb-panel th { padding: 2px 4px; text-align: left; border-bottom: 1px solid rgba(255,255,255,0.05); } .gnb-panel th { color: var(--ink3, #8a96a3); font-weight: 500; }
.gnb-panel .ok { color: #3ddc84; } .gnb-panel .warn { color: #f5b82e; }
.pcap-box { margin-top: 8px; padding: 7px 9px; border: 1px solid rgba(55, 232, 255, 0.35); border-radius: 9px; background: rgba(55, 232, 255, 0.05); font-size: 11.5px; color: var(--ink2); display: flex; flex-direction: column; gap: 4px; }
.pcap-box:empty { display: none; }
.pcap-box .ph { font-weight: 700; color: var(--ink); font-size: 12px; } .pcap-box .ph .rec { color: #ff5a5a; }
.pcap-box .prow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pcap-box button { border: 1px solid #37e8ff; background: rgba(55, 232, 255, 0.12); color: var(--ink); border-radius: 6px; padding: 3px 9px; font-size: 11.5px; }
.pcap-box .pnote { color: var(--ink3, #8a96a3); font-size: 11px; }
.od-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 10px; }
.od-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: rgba(113, 75, 103, 0.12); }
.od-kpi span { display: block; font-size: 11px; color: var(--ink2); } .od-kpi b { font-size: 18px; color: var(--ink); font-variant-numeric: tabular-nums; } .od-kpi small { display: block; font-size: 11px; color: var(--ink3, #8a96a3); }
.od-tabs { display: flex; gap: 6px; margin: 4px 0 8px; flex-wrap: wrap; } .od-tabs button { border: 1px solid var(--line); background: transparent; color: var(--ink2); border-radius: 8px; padding: 4px 12px; font-size: 12px; }
.od-tabs button.on { border-color: #a2649a; background: rgba(162, 100, 154, 0.22); color: var(--ink); }
.od-tbl { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; } .od-tbl th, .od-tbl td { text-align: left; padding: 4px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); } .od-tbl th { color: var(--ink3, #8a96a3); font-weight: 500; }
.od-st { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 11px; } .od-st.done { background: rgba(61, 220, 132, 0.18); color: #3ddc84; } .od-st.wait { background: rgba(245, 184, 46, 0.18); color: #f5b82e; } .od-st.new { background: rgba(90, 169, 255, 0.18); color: #5aa9ff; }
.od-live { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 10px; font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.od-live .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .od-live input:not([type=checkbox]) { background: #0d131a; border: 1px solid var(--line); color: var(--ink); border-radius: 6px; padding: 3px 6px; font-size: 12px; width: 170px; }
.od-live button { border: 1px solid #a2649a; background: rgba(162, 100, 154, 0.2); color: var(--ink); border-radius: 6px; padding: 3px 10px; font-size: 12px; }
@media (max-width: 760px) { .od-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── KPI 영향 분석 · 개선 제안 · 의사결정 ── */
.topbar .imp-top { border-color: #f5b82e; background: rgba(245, 184, 46, 0.13); color: #ffe3a3; margin-right: 4px; position: relative; }
.topbar .imp-top:hover { background: rgba(245, 184, 46, 0.26); }
.topbar .imp-top b { position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: var(--bad); color: #fff; font-size: 10px; line-height: 17px; text-align: center; }
.kpi.imp-pend { cursor: pointer; border-color: rgba(245, 184, 46, 0.55); background: rgba(245, 184, 46, 0.1); color: #ffe3a3; font-size: 12px; line-height: 1.45; }
.kpi.imp-pend:hover { background: rgba(245, 184, 46, 0.2); }
.imp-top1 { font-size: 11px; color: #ffb3b3; margin: 2px 0 4px; }
#impactBody h3 { font-size: 14px; margin: 18px 0 8px; }
#impactBody h3 small { font-weight: 400; color: var(--ink2); font-size: 11px; margin-left: 6px; }
.imp-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.imp-win button { padding: 4px 10px; }
.imp-md { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 9px; padding: 5px 12px; }
.imp-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.imp-tile { border: 1px solid var(--line); border-radius: 12px; padding: 9px 11px; background: rgba(255, 255, 255, 0.03); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.imp-tile span { font-size: 11px; color: var(--ink2); letter-spacing: 0.04em; }
.imp-tile b { font-size: 21px; font-variant-numeric: tabular-nums; }
.imp-tile small { font-size: 11px; color: var(--muted); }
.imp-bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: rgba(255, 255, 255, 0.06); }
.imp-bar i { display: block; height: 100%; }
.imp-leg { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 8px; font-size: 11px; color: var(--ink2); }
.imp-leg b, .imp-t .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.imp-t { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.imp-t th { text-align: left; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 6px; }
.imp-t td { border-bottom: 1px solid rgba(255, 255, 255, 0.04); padding: 4px 6px; }
.imp-t td:nth-child(n+2), .imp-t th:nth-child(n+2) { text-align: right; }
.imp-note { font-size: 11px; color: var(--muted); line-height: 1.5; margin: 6px 0 0; }
.imp-card { border: 1px solid var(--line); border-left: 3px solid #f5b82e; border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; background: rgba(255, 255, 255, 0.025); display: flex; flex-direction: column; gap: 4px; }
.imp-card.applied { border-left-color: var(--good); }
.imp-card.held, .imp-card.reverted { border-left-color: var(--muted); opacity: 0.7; }
.imp-ch { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.imp-ch b { font-size: 13px; }
.imp-ch small { margin-left: auto; color: var(--ink2); font-size: 11px; }
.imp-chips i { font-style: normal; font-size: 10px; border: 1px solid rgba(245, 184, 46, 0.5); color: #ffe3a3; border-radius: 6px; padding: 0 5px; margin-right: 3px; }
.imp-why { font-size: 12px; color: var(--ink2); line-height: 1.45; }
.imp-why em { font-style: normal; color: #ffe3a3; }
.imp-why.muted { color: var(--muted); }
.imp-chg { font-size: 12px; }
.imp-chg b { color: #9fd0ff; }
.imp-twin { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; font-size: 12px; background: rgba(55, 160, 255, 0.07); border-radius: 8px; padding: 6px 9px; font-variant-numeric: tabular-nums; }
.imp-twin small { color: var(--muted); }
.imp-twin em, .imp-t em { font-style: normal; font-size: 11px; }
em.up { color: var(--good); } em.dn { color: var(--bad); }
.imp-twin strong { margin-left: auto; font-size: 11px; padding: 1px 8px; border-radius: 6px; }
.imp-twin strong.good { background: rgba(61, 220, 132, 0.18); color: var(--good); }
.imp-twin strong.mid { background: rgba(245, 184, 46, 0.18); color: var(--warn); }
.imp-twin strong.bad { background: rgba(255, 90, 90, 0.18); color: var(--bad); }
.fleet-sim-note { margin: 0 0 10px; padding: 6px 10px; font-size: 12px; color: var(--warn); background: rgba(245, 184, 46, 0.1); border: 1px solid rgba(245, 184, 46, 0.3); border-radius: 8px; }
.imp-expl { margin: 0; padding: 6px 9px 6px 24px; font-size: 11.5px; line-height: 1.5; color: var(--ink2); background: rgba(55, 160, 255, 0.04); border-radius: 8px; }
.imp-expl li { margin: 1px 0; }
.imp-expl b { color: var(--ink); }
.imp-expl.good { background: rgba(61, 220, 132, 0.06); }
.imp-expl.bad { background: rgba(255, 90, 90, 0.06); }
.imp-prog { position: relative; height: 18px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); overflow: hidden; font-size: 11px; }
.imp-prog i { position: absolute; inset: 0 auto 0 0; background: rgba(55, 160, 255, 0.35); }
.imp-prog span { position: relative; padding-left: 8px; line-height: 18px; }
.imp-ask { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; font-size: 12px; }
.imp-ask span { margin-right: auto; color: #ffe3a3; }
.imp-ask button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 4px 11px; }
.imp-ask button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.imp-log { margin: 0; padding-left: 18px; font-size: 12px; color: var(--ink2); line-height: 1.6; }
@media (max-width: 720px) { .imp-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.imp-t.ev td:nth-child(2), .imp-t.ev th:nth-child(2), .imp-t.ev td:nth-child(3), .imp-t.ev th:nth-child(3) { text-align: left; }

/* 문제 해결 우선순위 배지 (P1 화재·인명 → P5 효율·품질) */
.oi-p { font-style: normal; font-size: 10px; font-weight: 800; border-radius: 5px; padding: 0 5px; margin-right: 5px; vertical-align: 1px; }
.oi-p.p1 { background: #ff5a5a; color: #fff; }
.oi-p.p2 { background: #ff9152; color: #1a0d00; }
.oi-p.p3 { background: #f5b82e; color: #1a1200; }
.oi-p.p4 { background: rgba(106, 168, 255, 0.35); color: #dbe9ff; }
.oi-p.p5 { background: rgba(255, 255, 255, 0.12); color: var(--ink2); }
/* 로봇 정보 창 카메라 선택 (휴머노이드·AMMR 4대) */
.rb-camtabs { display: flex; gap: 4px; margin-bottom: 4px; }
.rb-camtabs button { flex: 1; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 7px; padding: 3px 0; font-size: 11px; color: var(--ink2); }
.rb-camtabs button.on { background: var(--accent); border-color: var(--accent); color: #fff; }
/* CCTV 영상 저장 (개별 녹화 · 스냅샷 · 자동 녹화 NVR) */
.cc-save { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 11px; }
.cc-save button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.06); border-radius: 8px; padding: 4px 10px; font-size: 12px; }
.cc-save button.rec { background: rgba(255, 70, 70, 0.25); border-color: #ff5a5a; color: #ffd0d0; }
.cc-save button:disabled { opacity: 0.45; cursor: default; }
.cc-save small { color: var(--ink2); flex-basis: 100%; }
.cc-rec { color: #ff6b6b; }
/* 에이전트 구조 (단일 · 혼합형 다중) */
.engine.arch-row { margin-top: 4px; }
.arch-cmp { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.05); border-radius: 8px; padding: 3px 9px; font-size: 11px; color: var(--ink2); }
.arch-cmp:hover { border-color: var(--accent); color: var(--ink); }
/* 자율 에이전트 구성 (FACOS 🤖 팝업) */
.ai-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-bar small { color: var(--ink2); font-size: 11px; }
.ai-btn { border: 1px solid #b89bff; background: rgba(184, 155, 255, 0.14); color: #e2d6ff; border-radius: 9px; padding: 5px 12px; font-weight: 700; font-size: 12px; }
.ai-btn.on, .ai-btn:hover { background: rgba(184, 155, 255, 0.3); }
.ai-info { border: 1px solid rgba(184, 155, 255, 0.35); border-radius: 12px; padding: 8px 12px 12px; margin-bottom: 12px; background: rgba(184, 155, 255, 0.05); }
.ai-info h4 { margin: 12px 0 6px; }
.ai-svg { width: 100%; height: auto; display: block; }
.ai-svg .ai-box rect { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.25); stroke-width: 1.2; }
.ai-svg .ai-box.main rect { fill: rgba(184, 155, 255, 0.2); stroke: #b89bff; stroke-width: 2; }
.ai-svg .ai-box.dom rect { fill: rgba(55, 160, 255, 0.14); stroke: #37a0ff; }
.ai-svg .ai-box.reflex rect { fill: rgba(61, 220, 132, 0.12); stroke: #3ddc84; }
.ai-svg .ai-box.orch rect { fill: rgba(255, 145, 82, 0.12); stroke: #ff9152; }
.ai-svg .ai-box.field rect { fill: rgba(245, 211, 107, 0.1); stroke: #f5d36b; }
.ai-svg .ai-box.queue rect, .ai-svg .ai-box.data rect, .ai-svg .ai-box.plant rect { stroke-dasharray: 4 3; }
.ai-svg text { fill: var(--ink); text-anchor: middle; font-size: 12px; }
.ai-svg text.t { font-weight: 700; font-size: 13px; }
.ai-svg text.s { fill: var(--ink2); font-size: 10.5px; }
.ai-svg .ai-arrow line { stroke: #9fb3c8; stroke-width: 1.5; }
.ai-svg .ai-arrow.dash line { stroke-dasharray: 5 4; }
.ai-svg .ai-arrow text.l { fill: #9fb3c8; font-size: 10.5px; text-anchor: start; }
.ai-svg marker path { fill: #9fb3c8; }
.ai-svg text.ai-cap { fill: var(--muted); font-size: 11px; text-anchor: start; }
.ai-tw { overflow-x: auto; }
.ai-t td.ins2 { white-space: normal; min-width: 180px; font-size: 11.5px; line-height: 1.45; }
.ai-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.ai-steps li { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: baseline; }
.ai-steps li span { color: var(--ink2); }
.ai-steps li em { font-style: normal; color: #e2d6ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* AAS 메타모델 버전 선택 */
.rb-save-row #rbVer { flex: 0 0 auto; }
.dh-ver { font-size: 12px; color: var(--ink2); margin: 4px 0 6px; display: flex; align-items: center; gap: 6px; }
.dh-ver select { background: rgba(255, 255, 255, 0.06); color: var(--ink); border: 1px solid var(--line); border-radius: 7px; padding: 2px 6px; }
.rb-rec { display: block; font-size: 10.5px; color: var(--ink2); margin-top: 3px; line-height: 1.4; }
/* 서열 키팅 · 라인사이드 칸반 정보 (부품분류셀 · 조립·체결셀 정보 창 — js/spsview.js) */
#detail .mm { margin-top: 10px; border-top: 1px solid rgba(255,255,255,0.08); padding-top: 8px; }
#detail .mm h4 { margin: 0 0 6px; font-size: 13px; }
#detail .mm-dec { border-left: 3px solid; padding: 4px 8px; margin-bottom: 6px; background: rgba(255,255,255,0.03); display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
#detail .mm-t { width: 100%; border-collapse: collapse; font-size: 11.5px; }
#detail .mm-t td, #detail .mm-t th { padding: 2px 4px; border-bottom: 1px solid rgba(255,255,255,0.05); text-align: left; }
#detail .mm-t th { color: #8fa3b8; font-weight: 600; }
#detail .mm-h { margin: 8px 0 3px; color: #8fa3b8; font-size: 11.5px; }
#detail .mm-r { margin: 0; padding-left: 16px; font-size: 11.5px; }
#detail .mm-r li { margin: 2px 0; }
