/* Megacity FMS 현장 화면. 색은 모두 아래 변수로만 쓴다. 맥 스타일 시안(총괄 2026-11-12): 밝음은 Main·Robots·Missions,
   어둠은 Layout 시안의 값이다. 색을 바꾸려면 이 표만 고친다(밝음 한 벌, 어둠 한 벌). */

:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --panel: #FFFFFF;
  --group: #F7F7F8;
  --side: #F2F2F4;
  --sideLine: #DCDCDF;
  --sideSel: #DCDCE0;
  --insp: #FAFAFB;
  --ink: #1D1D1F;
  --ink2: #3A3A3C;
  --mute: #6E6E73;
  --line: #E3E3E6;
  --line2: #EDEDF0;
  --acc: #0064D2;
  --accBg: #0064D2;
  --stop: #D70015;
  --ok: #248A3D;
  --warn: #B25000;
  --bad: #D70015;
  --idle: #6E6E73;
  --okSoft: #E8F3EB;
  --badSoft: #FCEBEC;
  --warnSoft: #FBF0E4;
  --badRow: #FDF6F6;
  --fake: #6D28D9;
  --fakeSoft: #F1EBFC;
  --sel: #E4EEFB;
  --map: #CDCDD2;
  --floor: #FCFCFD;
  --mapWall: #2C2C2E;
  --wall: #C7C7CC;
  --block: #E3E3E6;
  --lane: #9A9AA0;
  --tag: #FFFFFF;
  --tagLine: #C7C7CC;
  --ctl: #FFFFFF;
  --ctlLine: #D2D2D7;
  --seg: #E9E9EB;
  --segOn: #FFFFFF;
  --field: #FFFFFF;
  --code: #FFFFFF;
  --codeInk: #1D1D1F;
  --onAcc: #FFFFFF;
  --backdrop: rgba(0, 0, 0, 0.35);
  --onDot: #FFFFFF;
  --drive: #1E7B34;
  --charge: #1E7B34;
  --work: #1E7B34;
  --wait: #B25000;
  --estop: #D70015;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  --ctlShadow: 0 0.5px 1px rgba(0, 0, 0, 0.08);
  --slamFilter: url(#slam-light);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1E1E20;
  --panel: #1E1E20;
  --group: #29292C;
  --side: #29292C;
  --sideLine: #3A3A3D;
  --sideSel: #3F3F44;
  --insp: #232326;
  --ink: #F5F5F7;
  --ink2: #D1D1D6;
  --mute: #A1A1A6;
  --line: #3A3A3D;
  --line2: #303033;
  --acc: #6CB4FF;
  --accBg: #0064D2;
  --stop: #D70015;
  --ok: #30D158;
  --warn: #FFB340;
  --bad: #FF8A80;
  --idle: #A1A1A6;
  --okSoft: #1D3324;
  --badSoft: #3A2020;
  --warnSoft: #3A2E1A;
  --badRow: #2A2021;
  --fake: #C9AEFF;
  --fakeSoft: #261D3A;
  --sel: #2A3A50;
  --map: #111113;
  --floor: #3C3C40;
  --mapWall: #E5E5EA;
  --wall: #6E6E73;
  --block: #3A3A3D;
  --lane: #8E8E93;
  --tag: #29292C;
  --tagLine: #6E6E73;
  --ctl: #323236;
  --ctlLine: #55555A;
  --seg: #111113;
  --segOn: #55555A;
  --field: #111113;
  --code: #111113;
  --codeInk: #F5F5F7;
  --onAcc: #FFFFFF;
  --backdrop: rgba(0, 0, 0, 0.55);
  --onDot: #FFFFFF;
  --drive: #30D158;
  --charge: #30D158;
  --work: #30D158;
  --wait: #FFB340;
  --estop: #FF8A80;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  --ctlShadow: none;
  --slamFilter: url(#slam-dark);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1E1E20;
    --panel: #1E1E20;
    --group: #29292C;
    --side: #29292C;
    --sideLine: #3A3A3D;
    --sideSel: #3F3F44;
    --insp: #232326;
    --ink: #F5F5F7;
    --ink2: #D1D1D6;
    --mute: #A1A1A6;
    --line: #3A3A3D;
    --line2: #303033;
    --acc: #6CB4FF;
    --accBg: #0064D2;
    --stop: #D70015;
    --ok: #30D158;
    --warn: #FFB340;
    --bad: #FF8A80;
    --idle: #A1A1A6;
    --okSoft: #1D3324;
    --badSoft: #3A2020;
    --warnSoft: #3A2E1A;
    --badRow: #2A2021;
    --fake: #C9AEFF;
    --fakeSoft: #261D3A;
    --sel: #2A3A50;
    --map: #111113;
    --floor: #3C3C40;
    --mapWall: #E5E5EA;
    --wall: #6E6E73;
    --block: #3A3A3D;
    --lane: #8E8E93;
    --tag: #29292C;
    --tagLine: #6E6E73;
    --ctl: #323236;
    --ctlLine: #55555A;
    --seg: #111113;
    --segOn: #55555A;
    --field: #111113;
    --code: #111113;
    --codeInk: #F5F5F7;
    --onAcc: #FFFFFF;
    --backdrop: rgba(0, 0, 0, 0.55);
    --onDot: #FFFFFF;
    --drive: #30D158;
    --charge: #30D158;
    --work: #30D158;
    --wait: #FFB340;
    --estop: #FF8A80;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    --ctlShadow: none;
    --slamFilter: url(#slam-dark);
  }
}

* { box-sizing: border-box; }

html, body { margin: 0; background: var(--bg); }

body {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--acc); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-family: var(--mono); }
.muted { color: var(--mute); }
.ink2 { color: var(--ink2); }
.c-ok { color: var(--ok); }
.c-warn { color: var(--warn); }
.c-bad { color: var(--bad); }
.c-acc { color: var(--acc); }
.c-idle { color: var(--idle); }
.c-ink2 { color: var(--ink2); }
.c-ink { color: var(--ink); }
.c-mute { color: var(--mute); }

:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
  border-radius: 4px;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* ── 위 막대 ─────────────────────────────────────────── */

.top {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  min-height: 62px;
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; flex-direction: column; line-height: 1.2; }
.brand b { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.brand span { font-size: 11px; color: var(--mute); }
/* 현장 이름을 아직 안 정한 설치: 이름 자리에 설정으로 가는 흐린 작은 길만 둔다. */
.brand a.unset { font-size: 11px; color: var(--mute); text-decoration: underline dotted; text-underline-offset: 3px; align-self: flex-start; }
.brand a.unset:hover, .brand a.unset:focus-visible { color: var(--acc); text-decoration: underline; }

/* 위 막대의 빵부스러기: 묶음 / 화면 */
.crumb { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--mute); }
.crumb b { font-size: 15px; font-weight: 600; color: var(--ink); }

/* ── 틀: 왼쪽 세로 메뉴 + 화면, 아래 상태 줄 ───────────────── */

.shell { display: flex; flex: 1 0 auto; min-width: 0; }
.sidenav {
  flex: none; width: 184px; padding: 14px 10px 24px;
  background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px;
  position: sticky; top: 62px; align-self: flex-start; height: calc(100vh - 62px - 34px); overflow-y: auto;
}
.side-group { display: flex; flex-direction: column; gap: 2px; }
.side-title { margin: 0 0 4px; padding: 0 10px; font-size: 11px; font-weight: 600; letter-spacing: 0.04em; color: var(--mute); }
.sidenav a {
  display: block; padding: 8px 10px; border-radius: 8px;
  font-weight: 500; color: var(--ink2); text-decoration: none; border-left: 3px solid transparent;
}
.sidenav a:hover { background: var(--line2); color: var(--ink); }
.sidenav a[aria-current="page"] { font-weight: 600; color: var(--ink); background: var(--sel); border-left-color: var(--acc); }

.status {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  min-height: 34px; padding: 4px 24px; font-size: 13px; color: var(--mute);
  background: var(--panel); border-top: 1px solid var(--line);
}
.status-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ok); }
.status-link::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-link[data-state="disconnected"] { color: var(--bad); }
.status-link[data-state="connecting"] { color: var(--warn); }
.status-link[data-state="disconnected"]::before { animation: blink 1.2s ease-in-out infinite; }

.grow { flex-grow: 1; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600;
  border-radius: 99px; padding: 4px 12px;
  color: var(--idle); background: var(--line2);
  white-space: nowrap;
}
.chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }
.chip[data-state="connected"] { color: var(--ok); background: var(--okSoft); }
.chip[data-state="reconnecting"] { color: var(--warn); background: var(--warnSoft); }
.chip[data-state="reconnecting"]::before { animation: blink 1.2s ease-in-out infinite; }
.chip[data-state="disconnected"] { color: var(--bad); background: var(--badSoft); }
@keyframes blink { 50% { opacity: 0.25; } }

.btn-theme {
  border: 1px solid var(--line); background: transparent; color: var(--ink2);
  border-radius: 99px; padding: 6px 12px; font-size: 13px; min-height: 36px;
}
.btn-theme:hover { border-color: var(--wall); }

.btn-pause {
  background: var(--ink); color: var(--bg); border: 0; border-radius: 8px;
  padding: 9px 16px; font-weight: 600; min-height: 40px;
}
.btn-pause:hover { filter: brightness(1.15); }
.btn-resume {
  background: var(--ok); color: var(--bg); border: 0; border-radius: 8px;
  padding: 9px 16px; font-weight: 600; min-height: 40px; white-space: nowrap;
}
.btn-resume:hover { filter: brightness(1.1); }

/* ── 공통 ─────────────────────────────────────────────── */

main.view { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; }
/* 다시 그려 페이지가 짧아질 때 누른 단추를 같은 자리에 두는 아래 빈 칸(app.mjs restorePlace) */
#place-pad { flex-shrink: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.card-head {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line2);
}
.card-title { font-weight: 600; }

.pagehead { padding: 24px 24px 0; display: flex; flex-direction: column; gap: 4px; }
.pagehead h1 { margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.pagehead p { margin: 0; color: var(--ink2); max-width: 980px; }

.btn {
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  border-radius: 8px; padding: 10px 18px; min-height: 44px;
}
.btn:hover:not(:disabled) { border-color: var(--wall); }
.btn-sm { padding: 9px 14px; min-height: 40px; }
.btn-primary {
  background: var(--acc); color: var(--onAcc); border: 0;
  border-radius: 8px; padding: 10px 22px; font-weight: 600; min-height: 44px;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-danger { border-color: var(--line); color: var(--bad); }
.btn-danger:hover:not(:disabled) { border-color: var(--bad); }
.btn-icon {
  width: 32px; height: 32px; border: 1px solid var(--line); background: transparent;
  color: var(--ink2); border-radius: 6px; padding: 0; line-height: 1;
}
.btn-icon:hover:not(:disabled) { border-color: var(--wall); color: var(--ink); }
.btn-dashed {
  width: 100%; border: 1px dashed var(--line); background: transparent; color: var(--acc);
  border-radius: 8px; padding: 10px; font-weight: 600; min-height: 44px;
}
.btn-dashed:hover { border-color: var(--acc); }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink2); }
.field small { font-weight: 500; color: var(--mute); font-size: 11px; }
.input, .select {
  font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--bg); color: var(--ink); font-weight: 400; min-width: 0;
}
.select { padding: 10px; }
.input:focus, .select:focus { border-color: var(--acc); outline: none; box-shadow: 0 0 0 3px var(--sel); }
.input.mono { font-family: var(--mono); }
.input-sm { padding: 7px 10px; font-size: 13px; }

.note { font-size: 13px; color: var(--mute); margin: 0; }
/* 알림 글(note)에 색 갈래를 단 것(오류 c-bad·경고 c-warn·좋음 c-ok)은 그 색이다. .note 가 뒤에 있어 덮던 것(083). */
.note.c-bad { color: var(--bad); }
.note.c-warn { color: var(--warn); }
.note.c-ok { color: var(--ok); }

.box { border-radius: 10px; padding: 12px 14px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; }
.box-ok { background: var(--okSoft); }
.box-ok > b { color: var(--ok); }
.box-bad { background: var(--badSoft); }
.box-bad > b { color: var(--bad); }
.box-warn { background: var(--warnSoft); }
.box-warn > b { color: var(--warn); }
.box-calm { background: var(--line2); }
.box span { color: var(--ink2); }
.box .note-ref { margin-top: 8px; }
/* 참고 상자 안의 줄 라벨은 상자와 같은 바탕이라 칠하지 않고 왼쪽에 맞춘다. */
.box-warn .badge-warn { background: transparent; padding-left: 0; }
.box ul { margin: 6px 0 0; padding-left: 18px; color: var(--ink2); font-size: 13px; }

.badge {
  justify-self: end; font-size: 11px; font-weight: 600; padding: 2px 10px;
  border-radius: 99px; white-space: nowrap; color: var(--mute); background: var(--line2);
}
.badge-ok { color: var(--ok); background: var(--okSoft); }
.badge-bad { color: var(--bad); background: var(--badSoft); }
.badge-warn { color: var(--warn); background: var(--warnSoft); }
/* 가짜 양팔 모드(양팔 작업 시험): 양팔이 없는 실물 로봇. 띠와 배지로 다른 로봇과 가른다. */
.badge-fake { color: var(--fake); background: var(--fakeSoft); border: 1px solid var(--fake); padding: 1px 8px; vertical-align: 1px; }
.tbl tr.fake-arm td:first-child { box-shadow: inset 4px 0 0 var(--fake); }
.arm-open { display: block; margin-top: 6px; white-space: nowrap; }
/* 로봇 표의 짧은 칸(상태·연결·양팔)은 좁은 화면에서 글자마다 접히지 않게 한 줄로 둔다(표는 옆으로 밀린다). */
.robots-tbl td:nth-child(3), .robots-tbl td:nth-child(4), .robots-tbl td:nth-child(7) { white-space: nowrap; }
.arm-test { margin-top: 16px; border-left: 4px solid var(--fake); }
/* 로봇 화면 "로봇 등록"(평가 11-09 ①): 받는 유형, 등록 방식, 등록한 로봇과 등록 칸. */
.reg-card { margin-top: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; }
.reg-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.reg-card h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ink2); }
.reg-card h3 small { font-weight: 500; margin-left: 6px; }
.reg-types { margin: 0; padding-left: 18px; font-size: 13px; }
.reg-empty { margin: 0; }
.reg-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 14px; }
.reg-form { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line2); padding-top: 12px; }
.arm-test h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.arm-form { display: flex; flex-direction: column; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; }
.arm-form h3 { margin: 0; font-size: 13px; font-weight: 600; }
.arm-fields { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; }
.arm-fields .select, .arm-fields .input { width: 100%; min-width: 0; }
.arm-form .check { flex-wrap: wrap; }
.arm-runs { display: flex; flex-direction: column; gap: 12px; }
.arm-run { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.arm-run-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.arm-run-meta { font-size: 13px; overflow-wrap: anywhere; }
.arm-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.arm-step { font-size: 13px; padding: 3px 10px; border-radius: 99px; color: var(--mute); background: var(--line2); }
.arm-step.past { color: var(--ok); background: var(--okSoft); }
.arm-step.now { color: var(--fake); background: var(--fakeSoft); font-weight: 600; }
.arm-step.stop { color: var(--bad); background: var(--badSoft); font-weight: 600; }
.arm-older summary { cursor: pointer; font-size: 13px; color: var(--ink2); }
.arm-older ul { margin: 6px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink2); }

.empty { padding: 18px 0 6px; color: var(--mute); font-size: 13px; border-top: 1px solid var(--line2); }

pre.code {
  margin: 0; background: var(--code); color: var(--codeInk); border-radius: 10px;
  padding: 12px 14px; font-family: var(--mono); font-size: 11px; line-height: 1.6;
  white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto;
}

.wait { cursor: help; text-decoration: underline dotted var(--wall); text-underline-offset: 3px; }

/* ── 감시 ─────────────────────────────────────────────── */

.map-warn { margin: 16px 16px 0; }
.acs-main .map-warn { margin: 0; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 16px 16px 0; }
.kpi { padding: 14px 18px; display: flex; flex-direction: column; }
.kpi .label { font-size: 13px; color: var(--mute); }
.kpi .value { font-family: var(--mono); font-size: 20px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: 13px; color: var(--ink2); }

.monitor-body { display: flex; flex-wrap: wrap; gap: 16px; padding: 16px; flex-grow: 1; }
.map-card { flex: 999 1 560px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.map-wrap { background: var(--map); flex-grow: 1; display: flex; align-items: center; }
.map-wrap svg { width: 100%; height: auto; display: block; }
/* 감시 지도는 1440×900 첫 화면에 틀째 들어온다. 그림이 쓸 수 있는 높이(--map-room)는 app.mjs fitMonitorMap 이 지도 위의
   것(알림 띠·숫자 칸·로봇 카드 줄)을 재어 준다. 값이 없을 때만 어림값(머리 62 + 숫자 칸 + 지도 머리·도구 ≈ 340)을 쓴다.
   자리가 모자라면 그림은 240 아래로 줄지 않고 페이지가 스크롤된다. */
@media (min-width: 901px) {
  .monitor-body .map-wrap svg { max-height: max(240px, var(--map-room, calc(100vh - 340px))); }
  /* 옆 칸(로봇 상세·임무)이 길어도 지도 틀은 그림 높이만큼만: 늘어나면 틀 아래가 첫 화면 밖으로 나가고 그림이 가운데로 내려간다. */
  .monitor-body .map-card { align-self: flex-start; }
}
/* 081 지도 도구: 머리 둘째 줄(층·맞추기·확대·레이어). 좁으면 다음 줄로 */
.map-head { flex-wrap: wrap; row-gap: 8px; }
.map-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; width: 100%; font-size: 13px; }
.map-tools .map-zoom { display: inline-flex; gap: 4px; }
.map-tools .map-zoom .btn { min-width: 36px; }
.map-floor { display: inline-flex; align-items: center; gap: 6px; color: var(--ink2); }
.map-floor select { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; }
.map-layers { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.map-layers .muted { margin-right: 4px; }
.layer-toggle { font: inherit; font-size: 13px; color: var(--ink2); background: transparent; border: 1px solid var(--line); border-radius: 999px; padding: 4px 11px; cursor: pointer; }
.layer-toggle::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 2px; border: 1.5px solid currentColor; }
.layer-toggle[aria-pressed="true"] { color: var(--acc); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 10%, transparent); font-weight: 600; }
.layer-toggle[aria-pressed="true"]::before { background: currentColor; }
.layer-toggle:focus-visible { outline: 2px solid var(--acc); outline-offset: 2px; }
svg[data-map="monitor"][data-zoomed] { touch-action: none; }
/* 081 경로 선: 색은 그 로봇 카드와 같은 상태 갈래. 지나온 구간 흐린 실선, 남은 구간 진한 점선 */
.m-route { fill: none; stroke: var(--idle); stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.m-route.done { stroke-width: 5; opacity: 0.3; }
.m-route.ahead { stroke-width: 4; stroke-dasharray: 11 7; opacity: 0.95; }
.m-route[data-kind="drive"] { stroke: var(--drive); }
.m-route[data-kind="charge"] { stroke: var(--charge); }
.m-route[data-kind="work"] { stroke: var(--work); }
.m-route[data-kind="wait"] { stroke: var(--wait); }
.m-route[data-kind="warn"] { stroke: var(--warn); }
.m-route[data-kind="estop"] { stroke: var(--estop); }
.m-route[data-kind="bad"] { stroke: var(--bad); }
.m-route[data-kind="ok"] { stroke: var(--ok); }
.map-empty { flex-grow: 1; display: flex; align-items: center; justify-content: center; color: var(--mute); padding: 60px 20px; text-align: center; }

.side { flex: 1 1 320px; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.list-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.list-card > .card-title { margin-bottom: 4px; }
.live-rows { display: contents; } /* 살아 있는 칸 묶음. 줄들은 카드의 간격을 그대로 받는다 */

/* 로봇 카드 줄(080, 원본 현황 화면). 카드가 많으면 다음 줄로 넘어간다(안쪽 가로 스크롤 없음) */
.cards-card { margin: 16px 16px 0; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cards-card .hint { font-size: 13px; font-weight: 500; margin-left: 6px; }
.robot-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.robot-cards > .empty { grid-column: 1 / -1; }
.robot-row {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); cursor: pointer;
}
.robot-row[aria-current="true"] { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); background: var(--sel); }
.card-top { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.card-name { border: 0; background: none; padding: 0; font: inherit; color: var(--ink); cursor: pointer; }
.card-name:hover b { text-decoration: underline; }
.card-mission { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; flex-wrap: wrap; }
.card-mission .mname { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-mission .step { color: var(--mute); white-space: nowrap; }
.card-mission .pct { margin-left: auto; font-family: var(--mono); font-weight: 600; color: var(--ink2); }
.task {
  display: inline-flex; align-items: center; gap: 4px; flex: none; padding: 2px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--acc); background: var(--sel);
}
.task svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.task[data-task="charge"] { color: var(--charge); }
.task[data-task="charge"] svg { fill: currentColor; }
.task[data-task="wait"], .task[data-task="paused"] { color: var(--warn); background: var(--warnSoft); }
.task[data-task="idle"] { color: var(--mute); background: var(--line2); }
.bar { height: 6px; border-radius: 99px; background: var(--line2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 99px; background: var(--acc); }
.bat-bar { height: 10px; }
.bat-bar > i { background: var(--ok); }
.bat-bar.low > i { background: var(--warn); }
.card-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.card-acts .btn { flex: 1 1 auto; white-space: nowrap; word-break: keep-all; }
.estop-note { flex: 1 1 auto; font-size: 13px; font-weight: 600; color: var(--estop); padding: 9px 0; }

/* 고른 로봇 상세 패널 */
.detail { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.detail-head { display: flex; align-items: baseline; gap: 10px; }
.detail-head .st { font-size: 13px; font-weight: 600; margin-left: auto; }
.detail-box { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; }
.detail-box .label { font-size: 11px; font-weight: 600; color: var(--mute); }
.detail-line { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; font-size: 13px; }
.detail-line .ahead { font-size: 11px; text-align: right; overflow-wrap: anywhere; }
.route { list-style: none; margin: 4px 0 0; padding: 0; display: flex; }
.route-dot { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; position: relative; font-size: 11px; color: var(--mute); }
.route-dot::before { content: ""; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.route-dot:first-child::before { display: none; }
.route-dot.done::before, .route-dot.now::before { background: var(--ok); }
.route-dot .dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--idle); background: var(--panel); position: relative; }
.route-dot.done .dot { border-color: var(--ok); background: var(--ok); }
.route-dot.now .dot { border-color: var(--drive); background: var(--drive); box-shadow: 0 0 0 3px var(--sel); }
.route-dot.now { color: var(--drive); font-weight: 600; }
.route-dot .lbl { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pose { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: 13px; }
.pose dt { color: var(--mute); }
.pose dd { margin: 0; text-align: right; font-family: var(--mono); }

/* 알람 띠(080): 모든 화면 위. 줄을 누르면 감시 화면에서 그 로봇을 고른다 */
.alarms {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 24px;
  background: var(--warnSoft); border-bottom: 1px solid var(--warn); font-size: 13px;
}
.alarms[hidden] { display: none; }
.alarm-count { color: var(--warn); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.alarm-count::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.alarm-list { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.alarm-list > li { display: inline-flex; align-items: center; gap: 6px; }
.alarm-force { padding: 3px 10px; font-size: 12px; }
.alarm {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--warn); color: var(--ink); background: var(--panel); text-decoration: none;
}
.alarm.bad { border-color: var(--bad); }
.alarm.bad > span:not(.go) { color: var(--bad); }
.alarm.warn > span:not(.go) { color: var(--warn); }
.alarm .go { font-size: 11px; color: var(--mute); }
.alarm:hover .go { color: var(--acc); }
.side-badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; margin-left: 8px; padding: 0 6px;
  border-radius: 99px; background: var(--bad); color: var(--onAcc); font-size: 11px; font-weight: 600; vertical-align: 1px;
}
.robot-no {
  width: 34px; height: 34px; border-radius: 50%; color: var(--onDot);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 600;
  background: var(--idle);
}
.bg-acc { background: var(--acc); }
.bg-ok { background: var(--ok); }
.bg-warn { background: var(--warn); }
.bg-bad { background: var(--bad); }
.bg-idle { background: var(--idle); }
/* 로봇 상태 색 갈래(render.mjs KINDS). 원 안 번호는 onAcc(밝게 흰색, 어둡게 검정)라 밝은 색 위에서도 읽힌다 */
.robot-no[class*="k-"] { color: var(--onAcc); }
.k-idle { background: var(--idle); }
.k-drive { background: var(--drive); }
.k-charge { background: var(--charge); }
.k-work { background: var(--work); }
.k-wait { background: var(--wait); }
.k-warn { background: var(--warn); }
.k-estop { background: var(--estop); }
.k-bad { background: var(--bad); }
.k-ok { background: var(--ok); }
.robot-row[data-kind] { border-left: 4px solid var(--idle); }
.robot-row[data-kind="drive"] { border-left-color: var(--drive); }
.robot-row[data-kind="charge"] { border-left-color: var(--charge); }
.robot-row[data-kind="work"] { border-left-color: var(--work); }
.robot-row[data-kind="wait"] { border-left-color: var(--wait); }
.robot-row[data-kind="warn"] { border-left-color: var(--warn); }
.robot-row[data-kind="estop"] { border-left-color: var(--estop); }
.robot-row[data-kind="bad"] { border-left-color: var(--bad); }
.robot-row[data-kind="ok"] { border-left-color: var(--ok); }
.robot-text { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.robot-text b { font-weight: 600; }
.robot-text .st { font-weight: 500; font-size: 13px; word-break: keep-all; overflow-wrap: break-word; } /* 상태·까닭 글은 자르지 않고 줄을 바꾸되 낱말 중간은 끊지 않는다(11-20: anywhere 가 "있/음"처럼 낱말 중간을 끊음) */
.robot-text .cmd-bad { font-size: 13px; font-weight: 600; }
.robot-text .fatal-badge, .detail .fatal-badge { font-size: 13px; font-weight: 600; padding: 3px 8px; border-radius: 6px; border: 1px solid currentColor; align-self: flex-start; overflow-wrap: anywhere; }
.robot-text .what { font-size: 13px; color: var(--mute); word-break: keep-all; overflow-wrap: break-word; } /* 하는 일은 자르지 않고 줄을 바꾸되 낱말 중간은 끊지 않는다(p2 0005) */
.robot-text .arm { font-size: 13px; color: var(--ink2); }
.robot-text .proc { word-break: keep-all; overflow-wrap: break-word; } /* 공정 줄도 자르지 않고 줄을 바꾸되 낱말 중간은 끊지 않는다(p2 polish 1280: "2회차(1회 끝)" 가 잘렸다) */
.what-cell .proc { font-size: 11px; margin-top: 2px; }
/* 서 있는 까닭 한 줄(상부 오류 뒤 운영자 고름 기다림, p2 01065). 글만이다. */
.stand-why { display: block; font-size: 13px; font-weight: 600; word-break: keep-all; overflow-wrap: break-word; }
.bat { font-family: var(--mono); font-size: 13px; text-align: right; color: var(--ink2); }
.bat.low { color: var(--warn); }
/* 상부 배터리가 하한(lowUpperBattery) 이하일 때 빨강(W5). .bat 의 ink2 를 덮게 두 짝으로. */
.bat.c-bad { color: var(--bad); }
/* 배터리 둘(하부·상부). 줄이 바뀌지 않게 한 줄씩 */
.bats { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.bats .bat { white-space: nowrap; }
.bats small { font-family: var(--sans, inherit); font-size: 11px; color: var(--mute); margin-right: 2px; }

/* 배터리 아이콘(하부·상부, 사장 11-19 15:40). 글자 라벨("Base"/"Upper") 대신 아이콘 + 작은 "하"/"상" + % 다. */
.bat-icon { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--ink2); }
.bat-icon .bat-glyph { width: 22px; height: 12px; flex: none; }
.bat-icon .bat-glyph .bg, .bat-icon .bat-glyph .nub { fill: none; stroke: currentColor; stroke-width: 1.1; }
.bat-icon .bat-glyph .fill { fill: var(--ok); }
.bat-icon.low .bat-glyph .fill { fill: var(--bad); }
.bat-icon.low { color: var(--bad); }
.bat-icon.unknown, .bat-icon.c-stale { color: var(--mute); }
.bat-icon .bat-glyph .bolt { fill: var(--bg); }
.bat-icon .bat-mark { font-family: var(--sans, inherit); font-size: 10px; font-weight: 700; color: var(--mute); }
.bat-icon.low .bat-mark { color: var(--bad); }
.bat-icon .bat-num { font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.bat-icon.unknown .bat-num { color: var(--mute); }
.detail-line.bat-detail { justify-content: flex-start; }

.mission-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--line2); }
.mission-row .top-line { display: flex; gap: 8px; align-items: baseline; }
.mission-row .title { font-size: 13px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.mission-row .state { font-size: 13px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.mission-row .sub { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.mission-row .jid { font-family: var(--mono); font-size: 11px; color: var(--mute); cursor: pointer; overflow-wrap: anywhere; }
.mission-row .tpl { font-size: 11px; color: var(--mute); white-space: nowrap; }
.mission-row .why { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }

.foot {
  background: var(--panel); border-top: 1px solid var(--line); padding: 8px 24px;
  display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--mute); flex-wrap: wrap;
}
.foot .mono { color: var(--ink2); }

/* 지도 SVG: 색은 클래스로 */
.m-floor { fill: var(--floor); stroke: var(--wall); stroke-width: 4; }
.m-lane { stroke: var(--lane); stroke-width: 3; fill: none; stroke-dasharray: 8 6; }
.m-res { stroke: var(--acc); stroke-width: 6; fill: none; stroke-linecap: round; }
.m-resnode { fill: none; stroke: var(--acc); stroke-width: 3; }
.m-dot { fill: var(--lane); }
/* 노드 점은 기본으로 숨기고, 확대했을 때(data-zoomed)만 보인다(총괄 11-20 디자인 규칙 2절). */
.m-dot { opacity: 0; }
[data-map="monitor"][data-zoomed] .m-dot, .m-dot.m-dot-ref { opacity: 1; }
.m-box { fill: var(--panel); stroke: var(--wall); stroke-width: 2; }
.m-box.acc { stroke: var(--acc); }
.m-box.ok { stroke: var(--ok); }
.m-label { font-size: 13px; font-weight: 600; fill: var(--ink2); font-family: var(--sans); }
.m-label.acc { fill: var(--acc); }
.m-label.ok { fill: var(--ok); }
/* 로봇: 흰 몸통 + 방향 아이콘 + 상태색 테두리(4 상태: 정상 초록·주의 주황·오류 빨강·꺼짐 회색). 몸통은 중립(바탕색),
   상태는 g[data-kind] 의 테두리(m-robot-ring)로만. 색이 다른 것은 몸통이 아니라 테두리다(총괄 11-20 디자인 규칙 2절). */
.m-robot { fill: var(--panel); stroke: var(--wall); stroke-width: 1; }
.m-robot-no { font-size: 13px; font-weight: 600; fill: var(--ink); font-family: var(--sans); }
.m-robot-ring { fill: none; stroke: var(--idle); stroke-width: 3; }
.m-robot-sel { fill: none; stroke: var(--acc); stroke-width: 3; stroke-dasharray: 5 4; }
.m-robot-dir { fill: var(--ink); stroke: var(--panel); stroke-width: 1.5; }
g[data-kind="drive"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="drive"]) { stroke: var(--drive); }
g[data-kind="charge"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="charge"]) { stroke: var(--charge); }
g[data-kind="work"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="work"]) { stroke: var(--work); }
g[data-kind="wait"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="wait"]) { stroke: var(--wait); }
g[data-kind="warn"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="warn"]) { stroke: var(--warn); }
g[data-kind="estop"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="estop"]) { stroke: var(--estop); }
g[data-kind="bad"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="bad"]) { stroke: var(--bad); }
g[data-kind="ok"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="ok"]) { stroke: var(--ok); }
g[data-kind="idle"] .m-robot-ring,
.m-robot-ring:has(+ .m-robot[data-kind="idle"]) { stroke: var(--idle); }

/* ── 임무 템플릿 ──────────────────────────────────────── */

.tpl-main { padding: 20px 24px 24px; display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.tpl-list { flex: 1 1 360px; max-width: 440px; overflow: hidden; }
.tpl-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 0 16px 0 0; border-top: 1px solid var(--line2);
}
.tpl-row:first-child { border-top: 0; }
.tpl-row[aria-current="true"] { background: var(--sel); }
.tpl-pick {
  display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: center;
  text-align: left; background: transparent; border: 0; padding: 14px 0 14px 16px; color: inherit;
}
.tpl-pick:hover .name { text-decoration: underline; text-decoration-color: var(--wall); }
.tpl-pick .no { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.tpl-pick .txt { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
/* 목록 줄의 세 글은 저마다 한 줄: 좁은 화면(목록이 위)에서 긴 이름을 쳐도 줄이 접혀 이름 칸이 밀리지 않게(전체는 .txt 의 title) */
.tpl-pick .name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-pick .rule { font-family: var(--mono); font-size: 13px; color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-pick .what { font-size: 13px; color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-moves { display: flex; gap: 4px; }
.tpl-add { padding: 14px 16px; border-top: 1px solid var(--line2); }
.tpl-none { padding: 18px 16px; color: var(--mute); font-size: 13px; }

.tpl-right { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.tpl-form { padding: 22px 24px; display: flex; flex-direction: column; gap: 16px; container-type: inline-size; }
/* 제목 줄은 한 줄: 긴 이름을 쳐도 줄이 접혀 아래 칸·단추가 밀리지 않게(전체 이름은 아래 이름 칸에 있다) */
.form-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: nowrap; min-width: 0; }
.form-head .title { font-size: 15px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-head .meta { font-size: 13px; color: var(--mute); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.form-head .dirty { font-size: 13px; color: var(--warn); font-weight: 600; flex-shrink: 0; white-space: nowrap; }
/* 고치기 칸이 좁으면 제목은 한 줄 통째, 저장 때·고침 표시는 둘째 줄. 줄 수는 칸 폭으로만 정한다(치는 동안 안 바뀜) */
@container (max-width: 520px) {
  .form-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .form-head .title { grid-column: 1 / -1; }
}
.site-differs { display: block; font-size: 13px; color: var(--ink2); background: var(--warnSoft); border-radius: 8px; padding: 8px 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
h3.sub { font-size: 13px; margin: 18px 0 8px; color: var(--ink2); }
.inline { display: flex; gap: 8px; }
.inline .input { flex-grow: 1; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.actions .left { margin-right: auto; }
.preview { padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.preview-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.preview-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); }
.preview-row .input { width: 160px; padding: 9px 12px; }

/* ── 남경 연결 ────────────────────────────────────────── */

.acs-main { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.acs-top { display: flex; flex-wrap: wrap; gap: 16px; }
.conn { flex: 1 1 380px; padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.conn-title { display: flex; align-items: center; gap: 10px; }
.conn-title i { width: 12px; height: 12px; border-radius: 50%; background: var(--idle); display: inline-block; }
.conn-title i.ok { background: var(--ok); }
.conn-title i.warn { background: var(--warn); animation: blink 1.2s ease-in-out infinite; }
.conn-title i.bad { background: var(--bad); }
.conn-title b { font-size: 15px; font-weight: 600; }
.conn-grid { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; font-size: 13px; margin: 0; }
.conn-grid dt { color: var(--mute); }
.conn-grid dd { margin: 0; overflow-wrap: anywhere; }
.stats { flex: 1 1 520px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; display: flex; flex-direction: column; justify-content: center; }
.stat .label { font-size: 13px; color: var(--mute); }
.stat .value { font-family: var(--mono); font-size: 20px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat .sub { font-size: 13px; color: var(--ink2); margin-top: 4px; word-break: keep-all; }

.acs-bottom { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.msgs { flex: 999 1 640px; min-width: 0; overflow: hidden; }
.msgs .card-head { padding: 14px 18px; }
.msgs .card-head label { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; color: var(--ink2); cursor: pointer; }
.msgs .card-head input { width: 16px; height: 16px; accent-color: var(--acc); }
.msg-list { max-height: 560px; overflow: auto; }
.msg {
  display: grid; grid-template-columns: 86px 54px minmax(0, 1fr) 76px; gap: 12px; align-items: center;
  padding: 11px 18px; border-top: 1px solid var(--line2);
}
.msg:first-child { border-top: 0; }
.msg.rejected { background: var(--badRow); }
.msg .t { font-family: var(--mono); font-size: 13px; color: var(--mute); }
.msg .dir { font-size: 13px; font-weight: 600; color: var(--mute); }
.msg .dir.in { color: var(--acc); }
.msg .body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.msg .body .what { font-size: 13px; overflow-wrap: anywhere; }
.msg .body .topic { font-family: var(--mono); font-size: 11px; color: var(--mute); }
.msg-empty { padding: 22px 18px; color: var(--mute); font-size: 13px; }

.reject { flex: 1 1 360px; max-width: 460px; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.reject .box a { font-size: 13px; font-weight: 600; }
.reject-count { font-size: 13px; font-weight: 600; color: var(--ink2); }
.reject-raw > summary { cursor: pointer; font-size: 13px; color: var(--ink2); }
.reject-raw > .code { margin-top: 6px; }
.reject .box { overflow-wrap: anywhere; }

/* ── 레이아웃 ─────────────────────────────────────────── */

.lay-main { padding: 20px 24px 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.lay-map { flex: 999 1 640px; min-width: 0; overflow: hidden; display: flex; flex-direction: column; }
.lay-map .map-wrap { min-height: 420px; }
/* 오른쪽 칸이 길어도(임무 템플릿 맞추기 등) 지도는 화면에 붙어 있다. 고치기 단계에서 사람이 노드를 보며 고른다(087).
   창이 낮으면 그림만 줄여 지도 상자가 창 안에 다 들어오게 한다. 좁은 화면(위아래로 쌓임)에서는 붙이지 않는다. */
@media (min-width: 901px) {
  .lay-map { position: sticky; top: 70px; }
  .lay-map .map-wrap { min-height: 0; }
  .lay-map .map-wrap svg { max-height: calc(100vh - 62px - 190px); }
}
.lay-side { flex: 1 1 380px; max-width: 460px; display: flex; flex-direction: column; gap: 16px; }
.panel { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel h2 { margin: 0; font-size: 15px; font-weight: 600; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink2); font-weight: 500; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--acc); }
/* 높이를 묶지 않는다. 묶어 안쪽만 스크롤하면 맥의 숨은 스크롤 막대로는 아래 줄이 있는 줄 몰라 넷째 줄부터 [속성] 이 잘려 보였다. */
.stations { display: flex; flex-direction: column; gap: 10px; }
.station-row { display: grid; grid-template-columns: 84px minmax(0, 1fr) 92px auto; gap: 8px; align-items: center; font-size: 13px; }
/* "속성" 단추는 둘째 줄 이름 칸 밑에 둔다(한 줄에 다섯을 두면 이름 칸이 찌그러진다). */
.station-row > [data-act="lay-select"] { grid-row: 2; grid-column: 2; justify-self: start; }
.station-row label { font-family: var(--mono); color: var(--ink2); }
.station-row .st-many { font-size: 11px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--mute); padding: 8px 16px; border-top: 1px solid var(--line2); }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 3px solid var(--lane); vertical-align: middle; margin-right: 6px; }
.legend i.narrow { border-top-color: var(--warn); }
.legend i.norot { border-top: 3px dotted var(--bad); }
.legend i.costly { border-top: 4px dashed var(--mute); }
.legend i.new { border-top-color: var(--ok); }
.legend i.sel { border-top-color: var(--acc); }
.legend i.bad { border-top: 5px solid var(--bad); }
.legend i.warnmark { border-top: 5px dashed var(--warn); }
.legend i.robot { width: 12px; height: 12px; border: 2px solid var(--acc); border-radius: 50%; background: var(--idle); }
.issues { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.issues li { display: flex; gap: 8px; align-items: baseline; color: var(--ink2); }

.l-edge { stroke: var(--lane); stroke-width: 3; fill: none; }
.l-edge.costly { stroke: var(--mute); stroke-width: 4; stroke-dasharray: 12 4; }
.l-edge.narrow { stroke: var(--warn); }
.l-edge.norot { stroke-dasharray: 3 5; stroke: var(--bad); }
.l-edge.narrow.norot { stroke: var(--warn); }
.l-edge.new { stroke: var(--ok); }
.l-edge.sel { stroke: var(--acc); stroke-width: 6; stroke-dasharray: none; }
.l-hit { stroke: transparent; stroke-width: 16; fill: none; cursor: pointer; }
.l-edge.curved:not(.sel) { stroke-dasharray: 8 3; }
.l-bend { fill: var(--floor); stroke: var(--acc); stroke-width: 3; cursor: grab; }
.l-bend:focus-visible { outline: none; stroke-width: 5; }
.l-robot { pointer-events: none; }
.l-seltop { pointer-events: none; fill: none; stroke: var(--acc); stroke-width: 3; }
/* 검사의 맵 항목에 걸린 노드·엣지(벽·회색·맵 밖·벽 지남): 빨강. 맵 그림(검은 벽·회색·흰 바닥) 어디에 놓여도 보이게
   패널 색 띠(l-badcase)를 밑에 깐다. 고른 것(.sel)이어도 빨강은 남는다 — 고른 표시는 바깥 고리(l-seltop)·굵기가 한다. */
.l-badcase { pointer-events: none; fill: none; stroke: var(--panel); stroke-width: 10; stroke-linecap: round; stroke-linejoin: round; }
circle.l-badcase { stroke-width: 9; }
.l-node.bad, .l-node.bad.sel, .l-node.bad.station, .l-node.bad.new { stroke: var(--bad); stroke-width: 4; fill: var(--badSoft); }
.l-edge.bad, .l-edge.bad.sel, .l-edge.bad.narrow, .l-edge.bad.norot, .l-edge.bad.costly, .l-edge.bad.new, .l-edge.bad.curved:not(.sel) { stroke: var(--bad); stroke-width: 5; stroke-dasharray: none; }
.l-edge.bad.sel { stroke-width: 7; }
.l-edge.warn, .l-edge.warn.sel, .l-edge.warn.narrow, .l-edge.warn.norot, .l-edge.warn.costly, .l-edge.warn.new, .l-edge.warn.curved:not(.sel) { stroke: var(--warn); stroke-width: 5; stroke-dasharray: 10 5; }
.l-edge.warn.sel { stroke-width: 7; }
.l-badmark { pointer-events: none; fill: var(--bad); font-size: 11px; font-weight: 800; }
.l-badspot { pointer-events: none; fill: none; stroke: var(--bad); stroke-width: 3; stroke-linecap: round; paint-order: stroke; filter: drop-shadow(0 0 1.5px var(--panel)); }
.l-badspot.warn { stroke: var(--warn); }
g.pick.flash .l-node, g.pick.flash .l-edge { animation: l-flash 0.9s ease-out 1; }
@keyframes l-flash { 0% { stroke-width: 14; } 100% { stroke-width: 5; } }
@media (prefers-reduced-motion: reduce) { g.pick.flash .l-node, g.pick.flash .l-edge { animation: none; } }
.issues li.issue-go { cursor: pointer; border-radius: 6px; margin: -2px -4px; padding: 2px 4px; }
.issues li.issue-go:hover { background: var(--badSoft); }
.issues li.issue-go:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.lay-robots { margin: 0 16px 12px; }
.lay-robots span { white-space: nowrap; }
/* home(충전 자리) 노드가 레이아웃에서 없어진 로봇의 줄: 빨강 + 까닭. 문제 줄을 누르면 짚는다(flash). 좁으면 줄 안에서 꺾는다. */
.lay-robots span.bad { color: var(--bad); font-weight: 600; white-space: normal; border-radius: 4px; padding: 0 3px; }
.lay-robots span.bad.flash { outline: 2px solid var(--bad); outline-offset: 0; }
/* Mission Map 이 쓰는 스테이션 노드가 없어짐: 고치기 전 자리의 빨간 점선 고리(누름은 받지 않는다)와 지도 밑 줄(누르면 그 공정·템플릿). */
.l-lost { pointer-events: none; }
.l-lostring { fill: var(--badSoft); stroke: var(--bad); stroke-width: 3; stroke-dasharray: 4 3; }
.l-losttext { fill: var(--bad); font-weight: 700; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.lay-lost span.bad { cursor: pointer; }
.lay-lost span.bad:hover { background: var(--badSoft); }
.lay-lost span.bad:focus-visible { outline: 2px solid var(--acc); outline-offset: 1px; }
.proc-station-row.flash, .tpl-row.flash { outline: 2px solid var(--bad); outline-offset: 2px; border-radius: 6px; }
.issues .issue-en, .issues .issue-ko { display: block; }
.issues .issue-ko { font-size: 12px; }
.l-node { fill: var(--panel); stroke: var(--wall); stroke-width: 2; cursor: pointer; }
.l-node.station { stroke: var(--ink2); stroke-width: 2.5; }
.l-node.new { stroke: var(--ok); stroke-width: 3; }
.l-nowait { fill: #f59e0b; stroke: var(--panel); stroke-width: 1.5; pointer-events: none; }
#lay-heading-error:empty { display: none; }
.l-heading { fill: var(--acc); stroke: var(--panel); stroke-width: 1.5; stroke-linejoin: round; pointer-events: none; }
.l-node.sel { stroke: var(--acc); stroke-width: 4; fill: var(--sel); }
/* 맞추기에서 고른(또는 목록에서 가리킨) 노드: 굵은 주황 테두리와 바깥 고리 */
.l-node.hi, .l-node.hov { stroke: var(--warn); stroke-width: 6; fill: var(--warnSoft); paint-order: stroke; filter: drop-shadow(0 0 6px var(--warn)); }
.l-text { font-size: 11px; fill: var(--ink2); font-family: var(--mono); pointer-events: none; }
.l-text.role { font-family: var(--sans); font-size: 11px; fill: var(--mute); }
.l-text.station { font-family: var(--sans); font-weight: 600; font-size: 13px; fill: var(--ink); }
.l-elabel { font-size: 11px; fill: var(--ink2); font-family: var(--sans); pointer-events: none; paint-order: stroke; stroke: var(--floor); stroke-width: 4px; stroke-linejoin: round; }
.l-text { paint-order: stroke; stroke: var(--floor); stroke-width: 3px; stroke-linejoin: round; }
g.pick { cursor: pointer; }
g.pick[data-drag="node"] { cursor: grab; touch-action: none; }
#lay-map:active g.pick[data-drag="node"] { cursor: grabbing; }
g.pick:focus { outline: none; }
g.pick:focus-visible .l-node, g.pick:focus-visible .l-edge { stroke: var(--acc); stroke-width: 5; }

/* ── 표(임무·로봇) ──────────────────────────────────────── */

.table-wrap { padding: 20px 24px 24px; }
.table-card { overflow: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 13px; color: var(--mute); font-weight: 500; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 16px; border-top: 1px solid var(--line2); vertical-align: middle; word-break: keep-all; overflow-wrap: break-word; }
.jobs-tbl td:nth-child(1) { white-space: nowrap; }
.jobs-tbl td.id-long { white-space: normal; }
.jobs-tbl td:nth-child(6) { white-space: nowrap; }
.tbl tr:first-child td { border-top: 0; }
.tbl td.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.tbl .ended td { color: var(--mute); }

/* ── 설정 ─────────────────────────────────────────────── */

.settings-main { padding: 20px 24px 24px; display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.settings-main .panel { flex: 1 1 420px; max-width: 620px; padding: 22px 24px; }
.radios { display: flex; gap: 8px; flex-wrap: wrap; border: 0; padding: 0; margin: 0; }
.roles { border: 0; margin: 0; padding: 0; display: flex; gap: 16px; flex-wrap: wrap; }
.bends { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bends legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; padding: 0; }
.bend-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.bend-row .btn { white-space: nowrap; }
.roles legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; padding: 0; width: 100%; }
.radios legend { font-size: 13px; font-weight: 600; color: var(--ink2); margin-bottom: 6px; padding: 0; }
.radio { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 99px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.radio:has(input:checked) { border-color: var(--acc); background: var(--sel); color: var(--acc); font-weight: 600; }
.radio input { accent-color: var(--acc); }

/* ── 대화상자·알림 ────────────────────────────────────── */

dialog.login {
  border: 1px solid var(--line); border-radius: 14px; padding: 0; background: var(--panel); color: var(--ink);
  box-shadow: var(--shadow); width: min(380px, calc(100vw - 32px));
}
dialog.login::backdrop { background: var(--backdrop); }
dialog.login form { padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; }
dialog.login h2 { margin: 0; font-size: 15px; font-weight: 600; }
dialog.login p { margin: 0; font-size: 13px; color: var(--ink2); }
dialog.login .err { color: var(--bad); font-size: 13px; min-height: 1em; }
dialog.start-ask p { color: var(--ink); font-size: 14px; line-height: 1.5; }
dialog.start-ask p.start-ask-where { font-weight: 600; }
dialog.start-ask p.start-ask-where[hidden] { display: none; }
dialog.map-ask { width: min(460px, calc(100vw - 32px)); }
dialog.map-ask .map-ask-lines { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--warn); }
dialog.map-ask .map-ask-lines:empty { display: none; }
dialog.map-ask #map-ask-tail { font-size: 13px; color: var(--ink2); }

.offline { position: sticky; top: 0; z-index: 9; margin: 0; padding: 10px 24px; font-size: 13px; color: var(--bad); background: var(--badSoft); border-bottom: 1px solid var(--bad); }
.offline[hidden] { display: none; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px);
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 10px 18px;
  font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: opacity 0.18s ease, transform 0.18s ease; z-index: 20;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.load-err { margin: 16px 16px 0; }

@media (max-width: 900px) {
  .kpis, .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .side, .tpl-list, .reject, .lay-side { max-width: none; }
  .top { padding: 0 16px; position: static; }
  /* 좁은 화면: 왼쪽 메뉴를 위 가로 줄로 접는다(묶음 이름은 숨김) */
  .shell { flex-direction: column; }
  .sidenav {
    width: auto; position: static; height: auto; align-self: stretch; flex-direction: row; flex-wrap: wrap; gap: 2px;
    padding: 6px 12px; border-right: 0; border-bottom: 1px solid var(--line);
  }
  .side-group { flex-direction: row; flex-wrap: wrap; }
  .side-title { display: none; }
  .sidenav a { border-left: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
  .sidenav a[aria-current="page"] { border-bottom-color: var(--acc); }
  .status { padding: 4px 16px; }
  .alarms { padding: 8px 16px; }
  .arm-fields { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* 085 현장 레이아웃 만들기: SLAM 지도 바탕, 지도 눌러 노드 찍기, 적용 막음, 템플릿 맞추기, 레이아웃 먼저 */
.l-slam { opacity: 0.55; image-rendering: pixelated; }
:root[data-theme="dark"] .l-slam { opacity: 0.4; filter: invert(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .l-slam { opacity: 0.4; filter: invert(1); } }
#lay-map.placing [data-place] { cursor: crosshair; }
.card-head .btn.on { background: var(--acc, #2f6fed); color: #fff; border-color: transparent; }
ol.steps { margin: 8px 0 12px; padding-left: 22px; display: flex; flex-direction: column; gap: 4px; line-height: 1.5; }
ul.blocks { margin: 4px 0 0; padding-left: 18px; }
.tpl-check { margin-top: 12px; }
.tpl-fix-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.tpl-fix-row label { flex: 1 1 100%; }
.layout-first { max-width: 760px; }

/* ── 모니터링(그래프, 097) ── 손으로 그린 SVG. 색은 감시 카드의 상태 갈래(--drive 등)와 같다. */
.stats-page { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.stats-page .card-head { padding: 0 0 10px; }
.stats-page .card-head h2 { flex: 1; }
.stats-page .card-head > span { font-size: 13px; color: var(--mute); }
.stats-page .card-head b { color: var(--ink); }
.chart-empty { padding: 22px 0; color: var(--mute); font-size: 13px; }
.util-plot { display: grid; grid-template-columns: auto 1fr; gap: 8px; height: 140px; }
.util-plot .axis { display: flex; flex-direction: column; justify-content: space-between; font: 11px var(--mono); color: var(--mute); }
.util-plot .axis i { font-style: normal; }
.util-plot svg { width: 100%; height: 100%; display: block; }
.util-plot .grid { stroke: var(--line2); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.util-plot .area { fill: var(--acc); opacity: 0.12; }
.util-plot .line { fill: none; stroke: var(--acc); stroke-width: 2; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.mission-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--line2); }
.mission-bar .seg { display: block; height: 100%; }
.chart-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--ink2); }
.chart-legend li { display: flex; align-items: center; gap: 8px; }
.chart-legend li span { flex: 1; }
.chart-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--idle); }
.chart-legend.legend-row { flex-direction: row; flex-wrap: wrap; gap: 8px 24px; }
.chart-legend.legend-row li span { flex: none; }
.mission-bar .seg[data-phase="active"], .chart-legend .sw[data-phase="active"] { background: var(--drive); }
.mission-bar .seg[data-phase="queued"], .chart-legend .sw[data-phase="queued"] { background: var(--idle); }
.mission-bar .seg[data-phase="done"], .chart-legend .sw[data-phase="done"] { background: var(--ok); }
.mission-bar .seg[data-phase="failed"], .chart-legend .sw[data-phase="failed"] { background: var(--bad); }
.mission-bar .seg[data-phase="canceled"], .chart-legend .sw[data-phase="canceled"] { background: var(--warn); }
.stats-row { display: grid; grid-template-columns: minmax(280px, 2fr) minmax(0, 3fr); gap: 16px; align-items: start; }
.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { width: 140px; height: 140px; flex-shrink: 0; }
.donut-wrap .chart-legend { flex: 1; }
.donut-bg { fill: none; stroke: var(--line2); stroke-width: 14; }
.donut .slice { fill: none; stroke-width: 14; stroke: var(--idle); }
.donut-n { font: 800 24px var(--mono); fill: var(--ink); text-anchor: middle; dominant-baseline: middle; }
.donut-sub { font-size: 11px; fill: var(--mute); text-anchor: middle; }
.donut .slice[data-kind="drive"] { stroke: var(--drive); } .chart-legend [data-kind="drive"] .sw { background: var(--drive); }
.donut .slice[data-kind="work"] { stroke: var(--work); } .chart-legend [data-kind="work"] .sw { background: var(--work); }
.donut .slice[data-kind="wait"] { stroke: var(--wait); } .chart-legend [data-kind="wait"] .sw { background: var(--wait); }
.donut .slice[data-kind="charge"] { stroke: var(--charge); } .chart-legend [data-kind="charge"] .sw { background: var(--charge); }
.donut .slice[data-kind="ok"] { stroke: var(--ok); } .chart-legend [data-kind="ok"] .sw { background: var(--ok); }
.donut .slice[data-kind="warn"] { stroke: var(--warn); } .chart-legend [data-kind="warn"] .sw { background: var(--warn); }
.donut .slice[data-kind="estop"] { stroke: var(--estop); } .chart-legend [data-kind="estop"] .sw { background: var(--estop); }
.donut .slice[data-kind="bad"] { stroke: var(--bad); } .chart-legend [data-kind="bad"] .sw { background: var(--bad); }
.donut .slice[data-kind="off"] { stroke: var(--line); } .chart-legend [data-kind="off"] .sw { background: var(--line); border: 1px solid var(--mute); }
.health-wrap { border: 0; overflow-x: auto; }
.health-tbl { width: 100%; }
.health-tbl th, .health-tbl td { padding: 9px 10px; }
.health-tbl .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
@media (max-width: 900px) {
  .stats-page { padding: 16px; }
  .stats-row { grid-template-columns: minmax(0, 1fr); }
}

/* 공정 카드(098, 옛 이름 "남경 공정 위치"): 공정마다 작업대·충전 위치 고르기 */
.proc-station-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; align-items: start; padding-bottom: 12px; border-bottom: 1px solid var(--line, rgba(128,128,128,.25)); }
.proc-station-row .proc-name { grid-column: 1 / -1; }
.proc-station-row .select.is-missing { border-color: var(--bad, #d33); }
.proc-station-row .proc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.proc-station-row .proc-row-act { margin-left: auto; }
.proc-station-row .proc-err { grid-column: 1 / -1; }
.proc-station-row .proc-pct { grid-column: 1 / -1; max-width: 160px; }
.proc-tag { display: inline-block; font-size: 11px; font-weight: 500; padding: 1px 8px; border-radius: 999px; background: var(--chip, rgba(128,128,128,.15)); }
.map-warn-more { margin-top: 6px; font-size: 13px; }
.map-warn-more summary { cursor: pointer; }
@media (max-width: 560px) { .proc-station-row { grid-template-columns: 1fr; } }

/* 로그 화면(099): 거르기 줄 + 시간순 표 */
.logs-page { padding: 20px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.log-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 14px 16px; }
.log-bar .select { min-width: 150px; }
.log-bar .select, .log-bar .input { height: 44px; box-sizing: border-box; }
.log-bar .log-q { flex: 1 1 260px; max-width: 420px; }
.log-count { font-size: 13px; color: var(--mute); padding-bottom: 12px; }
.log-warn { margin: 0; }
.log-tbl td { vertical-align: top; }
.log-tbl .log-at { white-space: nowrap; color: var(--ink2); }
.log-tbl .log-src { white-space: nowrap; color: var(--ink2); }
.log-tbl .log-msg { overflow-wrap: anywhere; }
.log-ko { font-weight: 600; color: var(--ink); }
.log-raw { margin-top: 4px; font-size: 11px; color: var(--mute); }
.log-raw summary { cursor: pointer; width: fit-content; }
.log-raw[open] > .mono { margin-top: 4px; padding: 6px 8px; border-radius: 6px; background: color-mix(in srgb, var(--mute) 10%, transparent); max-height: 220px; overflow: auto; }
.log-attrs { margin-top: 2px; font-size: 11px; color: var(--mute); }
.log-row.lv-error td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
.log-row.lv-warning td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pill.lv-error { color: var(--bad); background: var(--badSoft); }
.pill.lv-warning { color: var(--warn); background: var(--warnSoft); }
.pill.lv-info { color: var(--ok); background: var(--okSoft); }
.pill.lv-debug { color: var(--mute); background: var(--line2); }
@media (max-width: 900px) { .logs-page { padding: 16px; } .log-bar .log-q { max-width: none; } }

/* ══ 맥 스타일 틀(총괄 시안 2026-11-12) ══ 사이드바 · 툴바 · 목록 · 인스펙터. 위 규칙을 덮는다. 치수는 시안의 값이다:
   본문 13px, 작은 글 11px, 단추 28px(로봇 단추 44px), 모서리 6px(묶음 8px). 그림자·알약·큰 숫자 타일은 쓰지 않는다. */
body { display: block; }
.app { display: flex; align-items: stretch; min-height: 100vh; }
.main { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; min-height: 100vh; }
.sidenav {
  flex: none; width: 208px; padding: 14px 10px; gap: 1px; background: var(--side); border-right: 1px solid var(--sideLine);
  position: sticky; top: 0; align-self: flex-start; height: 100vh; overflow-y: auto;
}
.side-brand { padding: 2px 8px 12px; font-size: 15px; font-weight: 600; }
.side-group { gap: 1px; }
.side-title { margin: 0; padding: 4px 8px 6px; font-size: 11px; font-weight: 600; letter-spacing: 0; color: var(--mute); }
.side-group + .side-group .side-title { padding-top: 16px; }
.side-spacer { flex: 1 1 0; min-height: 12px; }
.sidenav a {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: 6px; border-left: 0;
  font-weight: 400; color: var(--ink);
}
.sidenav a svg { flex: none; stroke: var(--acc); }
.sidenav a.quiet svg { stroke: var(--mute); }
.sidenav a:hover { background: var(--line2); text-decoration: none; }
.sidenav a[aria-current="page"] { background: var(--sideSel); font-weight: 500; }
.side-count { margin-left: auto; color: var(--mute); font-weight: 400; }
.side-badge { margin-left: auto; min-width: 18px; height: 18px; font-size: 11px; background: var(--stop); color: #FFFFFF; }
.side-badge + .side-count { margin-left: 6px; }

.top { min-height: 52px; padding: 6px 20px; gap: 12px; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-title { display: flex; flex-direction: column; min-width: 0; }
.top-title b { font-size: 15px; font-weight: 600; }
.top-title span, .top-title a { font-size: 11px; color: var(--mute); }
.top-title a.unset { text-decoration: underline dotted; text-underline-offset: 3px; }
.top-title .sub-line { display: flex; gap: 8px; flex-wrap: wrap; }
.top-stat { color: var(--mute); white-space: nowrap; }
.chip { padding: 0; background: none !important; font-size: 13px; font-weight: 400; color: var(--mute) !important; border-radius: 0; }
.chip::before { display: none; }
.chip svg { flex: none; }
.btn-theme { height: 28px; min-height: 28px; padding: 0 10px; border: 1px solid var(--ctlLine); border-radius: 6px; background: var(--ctl); color: var(--ink); font-size: 13px; box-shadow: var(--ctlShadow); }
.btn-pause, .btn-resume {
  height: 28px; min-height: 28px; padding: 0 12px; border: 1px solid var(--ctlLine); border-radius: 6px; background: var(--ctl);
  color: var(--ink); font-weight: 400; box-shadow: var(--ctlShadow); white-space: nowrap;
}
.btn-resume { border: 1px solid var(--line); background: transparent; color: var(--ink); font-weight: 500; }
.btn-stop { height: 28px; padding: 0 14px; border: 0; border-radius: 6px; background: var(--stop); color: #FFFFFF; font-weight: 600; white-space: nowrap; }
.estop-why { font-size: 11px; color: var(--mute); }
/* 받는 곳이 아직 없는 정지 단추: 자리는 지키되 흐린 빨강으로 누를 수 없음을 보인다 */
/* 흐린 비상정지 단추는 밝음·어둠 모두 다른 흐린 단추와 같은 중립 모양이다(빨강을 배경과 섞으면 어둠에서만 진해져 눌릴 것처럼 보였다). */
.btn-stop:disabled { background: var(--group); color: var(--mute); border: 1px solid var(--line); opacity: 1; cursor: not-allowed; }
button:disabled { opacity: 1; }
.status { min-height: 26px; padding: 2px 20px; font-size: 11px; background: var(--bg); }
.status-link { font-weight: 500; }
.status-link::before { width: 7px; height: 7px; }

/* 공통 부품 */
a:hover { text-decoration: none; color: color-mix(in srgb, var(--acc) 80%, var(--ink)); }
.card { border-radius: 8px; background: var(--panel); }
.card-title { font-size: 13px; font-weight: 600; }
.pagehead { padding: 14px 20px 0; }
.pagehead h1 { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.pagehead p { font-size: 11px; color: var(--mute); max-width: 900px; }
.btn, .btn-sm {
  height: 28px; min-height: 28px; padding: 0 12px; border: 1px solid var(--ctlLine); border-radius: 6px; background: var(--ctl);
  color: var(--ink); box-shadow: var(--ctlShadow); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover:not(:disabled) { border-color: var(--wall); }
.btn:disabled, .btn-primary:disabled { background: var(--group); color: var(--mute); border: 1px solid var(--line); box-shadow: none; }
.btn-primary {
  height: 28px; min-height: 28px !important; padding: 0 14px; border: 0; border-radius: 6px; background: var(--accBg); color: #FFFFFF;
  font-weight: 500; display: inline-flex; align-items: center; justify-content: center;
}
a.btn-primary:hover { color: #FFFFFF; }
.btn-danger { color: var(--bad); }
.btn-icon { width: 28px; height: 28px; border-color: var(--ctlLine); background: var(--ctl); }
.btn-dashed { min-height: 28px; padding: 5px; border-radius: 6px; font-weight: 500; }
.field { gap: 4px; font-size: 11px; font-weight: 400; color: var(--mute); }
.field small { font-size: 11px; }
.input, .select {
  height: 28px; padding: 0 8px; font-size: 13px; border: 1px solid var(--ctlLine); border-radius: 5px; background: var(--field); color: var(--ink);
}
textarea.input, .input[type="file"] { height: auto; padding: 4px 8px; }
.input-sm { height: 24px; padding: 0 8px; font-size: 13px; }
.input:focus, .select:focus { border-color: var(--acc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--acc) 30%, transparent); }
.note { font-size: 11px; }
.box { border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.box ul { font-size: 13px; }
.badge, .pill, .proc-tag, .arm-step { border-radius: 4px; padding: 1px 6px; font-size: 11px; font-weight: 500; }
.radio { border-radius: 6px; padding: 4px 10px; font-size: 13px; }
.radio:has(input:checked) { font-weight: 500; }
.panel { padding: 14px; gap: 10px; }
.panel h2, .reg-card h2 { font-size: 13px; font-weight: 600; }
h3.sub, .reg-card h3 { font-size: 11px; font-weight: 600; color: var(--mute); margin: 10px 0 4px; }
.check { font-size: 13px; font-weight: 400; color: var(--ink); }
.empty, .msg-empty, .tpl-none { font-size: 13px; }
pre.code { border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 11px; line-height: 1.5; }
dialog.login { border-radius: 10px; }
dialog.login h2 { font-size: 15px; }
.toast { border-radius: 8px; font-size: 13px; }
.alarms { padding: 6px 20px; font-size: 13px; }
.alarm { border-radius: 6px; padding: 2px 8px; }
.offline { padding: 8px 20px; font-size: 13px; }

/* 분절 단추(도구·레이어) */
.seg { display: inline-flex; padding: 2px; border-radius: 7px; background: var(--seg); }
.seg > button, .seg > .layer-toggle {
  height: 24px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--ink); font-size: 13px; font-weight: 400;
}
.seg > button[aria-pressed="true"], .seg > .layer-toggle[aria-pressed="true"] {
  background: var(--segOn); color: var(--ink); font-weight: 500; box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.16); border: 0;
}
.seg > button:disabled { color: var(--mute); background: transparent; border: 0; }
.layer-toggle::before { display: none; }

/* 표: 머리 24px(11px 흐린 글), 줄 28px */
.table-wrap { padding: 0; }
.table-card { border: 0; border-radius: 0; }
table.tbl { font-size: 13px; }
.tbl th { height: 24px; padding: 0 16px; font-size: 11px; font-weight: 400; color: var(--mute); border-bottom: 1px solid var(--line); }
.tbl td { padding: 5px 16px; border-top: 0; }
.tbl tbody tr:nth-child(even) td { background: var(--group); }
.tbl td.num { font-family: inherit; }
.mono { font-family: inherit; }
pre.code, .log-raw .mono, .msg .body .topic, textarea.mono { font-family: var(--mono); }
.sec-title { padding: 16px 16px 6px; font-size: 11px; font-weight: 600; color: var(--mute); }

/* 인스펙터(오른쪽 칸) */
.insp {
  flex: 1 1 250px; max-width: 300px; border-left: 1px solid var(--line); background: var(--insp); padding: 14px 14px 18px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0;
}
.insp .card { border: 0; background: transparent; padding: 0; border-radius: 0; }
.insp-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.insp-head b { font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.insp-head > span { flex: none; white-space: nowrap; }
.insp-grid { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 6px 0; margin: 0; }
.insp-grid > :nth-child(odd) { color: var(--mute); }
.insp-grid > :nth-child(even) { margin: 0; overflow-wrap: anywhere; }
.insp-title { font-size: 11px; font-weight: 600; color: var(--mute); }
.insp hr, .rule { height: 1px; border: 0; margin: 0; background: var(--line); }

/* Monitor: 가운데 지도, 아래 Robots 표, 오른쪽 인스펙터 */
.monitor-body { display: flex; flex-wrap: wrap; gap: 0; padding: 0; flex-grow: 1; align-items: stretch; }
.mon-main { flex: 999 1 460px; min-width: 0; display: flex; flex-direction: column; }
.map-card { flex: none; border: 0; border-radius: 0; position: relative; background: var(--map); }
.monitor-body .map-card { align-self: stretch; }
.map-wrap { background: var(--map); min-height: 320px; }
@media (min-width: 901px) {
  .monitor-body .map-wrap svg { max-height: max(300px, calc(var(--map-room, 100vh - 340px) - 150px)); }
}
.map-over { position: absolute; z-index: 2; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.map-over.tr { right: 12px; top: 12px; justify-content: flex-end; max-width: calc(100% - 24px); }
.map-over.tl { left: 12px; top: 12px; }
.map-tools { width: auto; gap: 6px; font-size: 13px; }
/* 1024·1280 태블릿(p2 0186 하루 일 걷기 헷갈림 1번): 지도가 좁으면 도구가 두 줄로 접혀 지도 윗줄(작업대 2·충전소 2 와 거기서 일하는
   로봇)을 가렸다. 그 폭에서는 도구를 지도 위 띠로 내려 그림을 가리지 않는다(시험 scripts/gui-tablet-1024-map.mjs). */
@media (min-width: 901px) and (max-width: 1399px) {
  .monitor-body .map-over.tr { position: static; max-width: none; justify-content: flex-start; padding: 8px 12px 6px; }
}
.map-tools .map-zoom .btn { min-width: 28px; padding: 0 8px; }
.map-layers .muted { display: none; }
.map-cap {
  position: absolute; left: 12px; bottom: 10px; z-index: 2; padding: 2px 8px; border-radius: 5px; font-size: 11px;
  background: color-mix(in srgb, var(--tag) 92%, transparent); color: var(--ink2);
}
.map-cap i { display: inline-block; width: 28px; border-top: 2px solid currentColor; vertical-align: middle; }
.layer-box {
  display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line);
  background: color-mix(in srgb, var(--tag) 94%, transparent);
}
.layer-box label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.layer-box input { accent-color: var(--accBg); }
.kpis { display: flex; flex-wrap: wrap; gap: 4px 20px; padding: 6px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); }
.kpi { border: 0; padding: 0; flex-direction: row; align-items: baseline; gap: 6px; background: none; }
.kpi .label { font-size: 11px; }
.kpi .value { font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink); }
.kpi .sub { font-size: 11px; color: var(--mute); }
/* p2 0190: 거절·ACS 끊김 고리(빨강, ACS Link 로). 글이 길어 칸 안에서 접힐 수 있다. */
.kpi .kpi-alert { font-size: 12px; font-weight: 600; color: var(--bad); text-decoration: none; }
.kpi .kpi-alert:hover { text-decoration: underline; }
.cards-card { margin: 0; padding: 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; gap: 0; overflow-x: auto; }
/* State 칸 112px: 상태 칩 말 "Software E-Stop" 이 한 줄에 든다(96px 에서 "E-" 뒤로 꺾였다, backlog 52). */
.rt-head, .robot-row {
  display: grid; grid-template-columns: 88px 64px 112px 104px minmax(140px, 1fr) 132px 52px minmax(56px, auto);
  align-items: center; column-gap: 8px; min-width: 800px; padding: 0 16px;
}
.rt-head { height: 24px; font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--line); }
.robot-cards { display: block; }
.robot-row { min-height: 28px; padding-top: 3px; padding-bottom: 3px; border: 0 !important; border-radius: 0; background: transparent; gap: 0 8px; flex-direction: row; }
.robot-row:nth-of-type(even) { background: var(--group); }
.robot-row[aria-current="true"] { background: var(--accBg); color: #FFFFFF; box-shadow: none; }
.robot-row[aria-current="true"] :is(.st, .what, .arm, .bat, .bat-icon, .bat-num, .bat-mark, .step, .pct, .mname, .muted, [class^="c-"], [class*=" c-"], .card-name, small) { color: #FFFFFF; }
.robot-row[aria-current="true"] .task { color: #FFFFFF; background: rgba(255, 255, 255, 0.2); }
.robot-row[aria-current="true"] .bar { background: rgba(255, 255, 255, 0.3); }
.robot-row[aria-current="true"] .bar > i { background: #FFFFFF; }
.robot-row[aria-current="true"] .btn { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.5); color: #FFFFFF; box-shadow: none; }
/* 고른 줄(파란 바탕)에서도 다음에 누를 단추 하나는 달라 보인다: 흰 바탕에 파란 글(p2 0127). 꺼진 것은 다른 단추와 같다. */
.robot-row[aria-current="true"] .btn-primary:not(:disabled) { background: #FFFFFF; border-color: #FFFFFF; color: var(--accBg); font-weight: 600; }
.robot-row > span, .robot-row > div { min-width: 0; }
.rc-name { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; }
.rc-name .badge-fake { font-size: 10px; padding: 0 6px; }
.rc-name .card-name b { font-weight: 500; }
.robot-no { width: 18px; height: 18px; border-radius: 5px; font-size: 11px; font-weight: 600; flex: none; }
.rc-step { display: flex; flex-direction: column; gap: 2px; padding: 2px 0; }
.rc-step .what { color: var(--mute); overflow-wrap: anywhere; }
.rc-alert { font-size: 11px; font-weight: 600; }
.card-mission { font-size: 13px; }
.card-mission .mname { font-weight: 400; }
.card-mission .pct { font-family: inherit; font-weight: 400; }
.task { padding: 1px 6px; border-radius: 4px; font-size: 11px; font-weight: 500; }
.bar { height: 4px; }
.bats { flex-direction: row; gap: 8px; align-items: baseline; }
.bat { font-family: inherit; font-size: 13px; color: inherit; }
.bats small { font-size: 11px; }
.card-acts { gap: 6px; flex-wrap: nowrap; justify-content: flex-end; }
.card-acts .btn { flex: none; height: 22px; min-height: 22px; padding: 0 8px; font-size: 11px; }
.card-acts .btn-primary { height: 22px; min-height: 22px !important; padding: 0 8px; }
.estop-note { font-size: 11px; padding: 0; }
.detail { padding: 0; gap: 14px; }
.detail-head .st { font-size: 13px; font-weight: 400; }
.detail-box { border: 0; border-radius: 0; padding: 0; gap: 6px; }
.detail-box + .detail-box { border-top: 1px solid var(--line); padding-top: 14px; }
.detail-box .label { font-size: 13px; font-weight: 400; color: var(--mute); }
.detail-line { font-size: 13px; }
.bat-bar { height: 6px; }
.pose { font-size: 13px; gap: 6px 12px; }
.pose dd { font-family: inherit; text-align: left; }
.list-card { padding: 0; }
.mission-row { padding: 8px 0; gap: 3px; }
.mission-row .title { font-size: 13px; font-weight: 400; }
.mission-row .state { font-size: 11px; font-weight: 500; }
.mission-row .jid { font-family: inherit; font-size: 11px; }
.foot { padding: 0; border: 0; background: none; font-size: 11px; gap: 6px; }
.m-floor { fill: var(--floor); stroke: var(--mapWall); stroke-width: 2; }
.m-floor.slam { fill: transparent; stroke: none; }
.m-lane { stroke: var(--lane); stroke-width: 2; stroke-dasharray: none; opacity: 0.75; }
.m-dot { fill: var(--lane); }
.m-box { fill: var(--tag); stroke: var(--tagLine); stroke-width: 1; }
.m-label { font-size: 12px; font-weight: 500; fill: var(--ink); }
.m-grid { stroke: var(--block); stroke-width: 1; opacity: 0.6; }
.l-slam, :root[data-theme="dark"] .l-slam { opacity: 1; image-rendering: pixelated; filter: var(--slamFilter); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .l-slam { opacity: 1; filter: var(--slamFilter); } }
.hide-slam .l-slam, .hide-graph .l-edge, .hide-graph .l-hit, .hide-graph .l-elabel, .hide-graph .l-bend, .hide-graph .l-heading,
.hide-graph g.pick, .hide-stations .l-text.station, .hide-stations .l-text.role, .hide-robots .l-robot { display: none; }

/* Robots: 로봇마다 한 칸(상태 목록 + 단추 7개). 로봇이 늘면 칸이 는다. 좁으면 한 줄씩 쌓인다. */
.rb-grid { padding: 20px 24px 24px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(380px, 100%), 1fr)); gap: 24px; align-content: start; }
.rb { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.rb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.rb-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.rb-head .sub { color: var(--mute); min-width: 0; overflow-wrap: anywhere; }
.rb-head .st { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.rb-list { border: 1px solid var(--line); border-radius: 8px; background: var(--group); margin: 0; }
.rb-line, .res-line { display: flex; align-items: center; gap: 10px; min-height: 34px; padding: 4px 12px; }
.rb-line + .rb-line { box-shadow: inset 0 1px 0 var(--line); margin-left: 12px; padding-left: 0; }
.rb-line dt, .res-line dt { width: 120px; flex: none; color: var(--mute); }
.rb-line dd, .res-line dd { margin: 0; min-width: 0; flex: 1 1 0; overflow-wrap: anywhere; }
.rb-line .meter { flex: 1 1 0; height: 6px; border-radius: 3px; background: var(--line); position: relative; min-width: 40px; }
.rb-line .meter > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--ok); }
.rb-line .meter.low > i { background: var(--warn); }
.rb-btns { display: grid; gap: 8px; }
.rb-btns.r1 { grid-template-columns: minmax(0, 1fr); }
.stand-cause { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.rb-btns.r3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.rb-btns.r2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rb-btns.r21 { grid-template-columns: 2fr 1fr; }
.rb-btn, .res-btn {
  height: 44px; border: 1px solid var(--ctlLine); border-radius: 8px; background: var(--ctl); color: var(--ink); font-size: 14px;
  font-weight: 500; box-shadow: var(--ctlShadow);
}
.rb-btn.primary { border: 0; background: var(--accBg); color: #FFFFFF; font-weight: 600; }
.rb-btn.stop, .res-btn.stop { border: 0; background: var(--stop); color: #FFFFFF; font-weight: 600; }
.rb-btn:disabled, .res-btn:disabled { border: 1px solid var(--line); background: var(--group); color: var(--mute); font-weight: 400; box-shadow: none; cursor: not-allowed; }
.rb-btn.stop:disabled, .res-btn.stop:disabled { border: 1px solid var(--line); background: var(--group); color: var(--mute); font-weight: 400; }
.rb-why, .rb-work-fail, .rb-start-hold, .rb-pick { font-size: 12px; overflow-wrap: anywhere; }
.rb-pick { display: flex; align-items: center; gap: 8px; }
.rb-why { white-space: pre-line; }
.rb-next { font-size: 14px; overflow-wrap: anywhere; }
.rb-next b { margin-right: 6px; padding: 1px 7px; border-radius: 5px; background: var(--accBg); color: #FFFFFF; font-size: 12px; font-weight: 600; }
.rb-next[data-next="none"] b { background: var(--group); color: var(--mute); border: 1px solid var(--line); }
.rb-res { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.rb-res .res-state { font-weight: 700; }
.res-list { margin: 0; }
.res-act { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.res-act .res-btn { flex: 0 0 auto; min-width: 9em; padding: 0 14px; }
.res-note, .res-why { font-size: 12px; overflow-wrap: anywhere; }
.rb-note { grid-column: 1 / -1; margin: 0; font-size: 11px; color: var(--mute); }
.rb-more { padding: 0 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.rb-more .table-card { border: 1px solid var(--line); border-radius: 8px; }
.arm-test, .reg-card, .book-card { margin-top: 0; }

/* Missions: ACS 요청 표 + 인스펙터 */
.ms { display: flex; flex-wrap: wrap; flex-grow: 1; align-items: stretch; }
.ms-main { flex: 999 1 460px; min-width: 0; }
.ms-scroll { overflow-x: auto; }
.ms-head, .ms-row { display: grid; grid-template-columns: 78px minmax(120px, 190px) 96px 96px 150px minmax(160px, 1fr); align-items: center; column-gap: 8px; min-width: 756px; padding: 0 16px; }
.ms-head { height: 24px; font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--line); }
.ms-row { min-height: 28px; width: 100%; border: 0; background: transparent; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.ms-row:nth-of-type(even) { background: var(--group); }
.ms-row[aria-current="true"] { background: var(--accBg); color: #FFFFFF; }
.ms-row[aria-current="true"] :is(.muted, svg) { color: #FFFFFF; }
.ms-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-res { display: inline-flex; align-items: center; gap: 6px; }
.ms-foot { display: flex; align-items: center; gap: 12px; min-height: 30px; padding: 0 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); }
.ms-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--line); }
.insp-card { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: flex; flex-direction: column; gap: 6px; }
.insp-card span { font-size: 12px; color: var(--mute); }

/* Layout: 툴바(도구 · Revert·Check·Apply) · 지도 · 아래 줄(개수·검사 결과) · 오른쪽 인스펙터 */
.lay-main { padding: 0; gap: 0; align-items: stretch; flex-grow: 1; }
.lay-map { border: 0; border-radius: 0; position: relative; }
.lay-map .card-head { padding: 8px 16px; flex-wrap: wrap; gap: 8px 12px; border-bottom: 1px solid var(--line); }
.lay-map .map-wrap { position: relative; }
@media (min-width: 901px) {
  /* 위 relative 가 087 의 sticky 를 덮지 않게 넓은 창에서는 다시 붙인다(sticky 도 안쪽 절대 위치의 기준이 된다) */
  .lay-map { position: sticky; top: 52px; }
  .lay-map .map-wrap svg { max-height: calc(100vh - 52px - 170px); }
}
.lay-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; min-height: 30px; padding: 4px 16px; border-top: 1px solid var(--line); font-size: 11px; color: var(--mute); }
.lay-toolbar .lay-acts { gap: 8px; margin: 0 0 0 auto; } /* 좁아서 줄이 넘치면 둘째 줄 오른쪽(시안의 자리) */
.lay-side { flex: 1 1 300px; max-width: 380px; gap: 0; border-left: 1px solid var(--line); background: var(--insp); }
.lay-side .card { border: 0; border-radius: 0; background: transparent; border-bottom: 1px solid var(--line); }
.legend { font-size: 11px; padding: 6px 16px; border-top: 1px solid var(--line); }
.l-node { fill: var(--map); stroke: var(--lane); stroke-width: 2; }
.l-node.station { stroke: var(--mapWall); }
.l-node.sel { fill: var(--accBg); stroke: #FFFFFF; stroke-width: 2.5; }
.l-edge { stroke: var(--lane); stroke-width: 2; }
.l-edge.sel { stroke: var(--accBg); stroke-width: 5; }
.l-text, .l-elabel { stroke: var(--map); }
.l-text { font-family: var(--sans); font-size: 11px; }
.l-text.station { font-size: 12px; font-weight: 500; }
.card-head .btn.on { background: var(--accBg); }
.station-row { font-size: 13px; }
.station-row label { font-family: inherit; }

/* 그 밖의 화면: 같은 틀 안에서 여백·모서리만 맞춘다 */
.tpl-main, .settings-main, .stats-page { padding: 16px 20px 20px; gap: 16px; }
.tpl-form, .preview, .settings-main .panel { padding: 14px 16px; gap: 12px; }
.form-head .title, .conn-title b { font-size: 15px; font-weight: 600; }
.tpl-pick { padding: 8px 0 8px 12px; }
.tpl-pick .name { font-weight: 500; }
.tpl-pick .rule, .tpl-pick .no { font-family: inherit; }
.stat { padding: 10px 12px; }
.stat .value { font-family: inherit; font-size: 17px; font-weight: 600; }
.conn { padding: 14px 16px; }
.msg { padding: 6px 16px; }
.msg .t { font-family: inherit; }
.msg .body .what { font-size: 13px; }
.reject { padding: 14px 16px; }
.log-bar { padding: 10px 12px; }
.log-bar .select, .log-bar .input { height: 28px; }
.donut-n { font: 600 20px var(--sans); }
.util-plot .axis { font: 11px var(--sans); }

/* 좁은 화면(태블릿 세로 768): 사이드바는 위 가로 줄, 인스펙터는 아래로 쌓인다 */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .main { min-height: 0; }
  .sidenav {
    width: auto; position: static; height: auto; align-self: stretch; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--sideLine);
  }
  .side-brand { padding: 0 8px; }
  .side-spacer { display: none; }
  .sidenav a { border-bottom: 0; border-radius: 6px; }
  .side-count { margin-left: 4px; }
  .top { position: static; padding: 6px 16px; }
  .insp, .lay-side { max-width: none; border-left: 0; border-top: 1px solid var(--line); }
  .rb-grid { padding: 16px; }
  .rb-more { padding: 0 16px 16px; }
}

/* 덧: 틀의 줄들은 줄어들지 않는다(좁은 화면에서 툴바가 두 줄이 되어도 겹치지 않게) */
.top, .status, .alarms, .offline { flex: none; }
/* 태블릿 폭(700~1279)의 위 띠는 한 줄이다(p2 0127, 1024 가로는 p2 0155 — 왼쪽 메뉴 옆 816px 에서 두 줄이 됐다): Resume All 이 생겨도
   E-Stop All 이 둘째 줄로 내려가지 않게 사이·단추 안쪽을 줄이고, 모자라면 제목 밑 작은 글이 말줄임으로 준다(단추·상태 글은 줄지 않는다).
   더 좁은 폭은 전처럼 줄을 바꾼다. */
@media (min-width: 700px) and (max-width: 1279px) {
  .top { flex-wrap: nowrap; gap: 8px; }
  .top > * { flex: none; }
  .top > .top-title { flex: 0 1 auto; min-width: 48px; overflow: hidden; }
  .top > .grow { flex: 1 1 0; min-width: 0; }
  .top .estop-why { flex: 0 1 auto; min-width: 0; }
  .top-title b, .top-title .sub-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .top-title .sub-line { flex-wrap: nowrap; }
  .top-title .sub-line > * { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .top .btn-theme, .top .btn-pause, .top .btn-resume, .top .btn-stop { padding: 0 9px; }
}
.layer-box { align-items: flex-start; }
.lay-map { align-self: flex-start; }
.lay-main > .lay-side { align-self: stretch; }
/* 1024 가로(901~1199): 지도 640 + 옆 칸 300 이 왼쪽 메뉴 옆(816px)에 안 들어가 옆 칸이 지도 아래로 내려가는데, 지도는 붙어 있어(sticky)
   내려간 옆 칸의 Add Edge 등을 지도 그림이 덮어 누를 수 없었다(오늘 평가 20261114 1'). 쌓이는 폭에서는 768 처럼 지도를 붙이지 않는다.
   지도를 옆 칸 몫만큼 좁히면 한 칸이 1px 아래가 되어 노드를 누른 칸에 찍지 못한다(설치 걷기 TC-LF-ORIGIN) — 그래서 좁히지 않는다. */
@media (min-width: 901px) and (max-width: 1199px) {
  .lay-map { position: relative; top: auto; }
  .lay-main > .lay-side { max-width: none; border-left: 0; border-top: 1px solid var(--line); } /* 쌓이면 768 처럼 폭을 채운다 */
}
.l-text, .l-elabel { stroke: var(--floor); }
.lay-page-note { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
#missions .insp { max-width: 330px; flex-basis: 280px; }

/* 좁은 화면의 Robots 표(감시): 옆으로 미는 대신 로봇마다 두세 줄로 접는다. 칸 이름은 작은 글로 앞에 붙는다.
   1024 가로(901~1199)도 접는다(p2 0188, 0186 태블릿 하루 일 걷기 헷갈림 5번: 인스펙터 옆 566~741px 상자에 800px 표가 들어가
   Battery·Repeats 칸이 잘렸다). 시험 scripts/gui-monitor-robots-width.mjs. */
@media (max-width: 1199px) {
  .cards-card { overflow-x: visible; }
  .rt-head { display: none; }
  .robot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-width: 0; padding: 8px 16px; }
  .robot-row + .robot-row { box-shadow: inset 0 1px 0 var(--line); }
  .robot-row .rc-step { flex: 1 1 100%; order: 5; }
  .robot-row .card-acts { margin-left: auto; }
  .rc-work::before { content: "일 "; font-size: 11px; color: var(--mute); }
  .rc-rep::before { content: "반복 "; font-size: 11px; color: var(--mute); }
  .robot-row[aria-current="true"] :is(.rc-work, .rc-rep)::before { color: #FFFFFF; }
}
@media (max-width: 900px) {
  .map-over.tr { position: static; padding: 8px 12px; justify-content: flex-start; max-width: none; background: var(--bg); border-bottom: 1px solid var(--line); }
}

/* Robots 표의 Upper Arm·공정 칸: 칸 이름이 머리에 있어 "양팔:"·"공정:" 머리말은 화면에 보이지 않게 한다(읽어 주는 도구에는 남는다) */
.robot-row .arm { font-size: 0; }
.robot-row .arm > span { font-size: 13px; }

/* ── 맵 화면에 늘 보이는 것(mapview.mjs, UR-MAP 5절 3번): 눈금·원점·축척·맵 이름과 판·커서 좌표 ── */
.mv-grid-layer, .mv-origin, .mv-scale, .mv-badge, .mv-cursor { pointer-events: none; }
.mv-grid { stroke: var(--mute); stroke-width: 0.6; opacity: 0.22; }
.mv-grid.axis { display: none; }
.mv-ax { stroke-width: 2.5; fill: none; }
.mv-ax.x { stroke: var(--mute); } .mv-ax.x.head { fill: var(--mute); stroke: none; }
.mv-ax.y { stroke: var(--mute); } .mv-ax.y.head { fill: var(--mute); stroke: none; }
.mv-origin-dot { fill: var(--ink); }
.mv-origin { display: none; }
.mv-ax-text, .mv-scale-text, .mv-badge, .mv-cursor { font-size: 12px; fill: var(--ink); paint-order: stroke; stroke: var(--floor); stroke-width: 3px; }
.mv-badge.none { fill: var(--mute); }
.mv-badge.nofp { fill: var(--warn); }
.mv-scale-bar { fill: none; stroke: var(--ink); stroke-width: 2; }
.mv-cursor { font-variant-numeric: tabular-nums; }
.maps-panel .maps-scroll { overflow-x: auto; }
/* 맵 보관함·판 기록 표: 메모·달라진 것 칸이 좁아 한 글자씩 세로로 깨지지 않게 열에 최소 너비를 둔다(사장 11-19). */
.maps-tbl { min-width: 560px; }
.maps-tbl th:nth-child(4) { min-width: 150px; }
.maps-rel { border: 0; padding: 0; margin: 8px 0; display: grid; gap: 4px; }
.maps-actions { display: flex; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
/* 로봇에서 맵 가져오기(p2 0140 초안) — 좁은 인스펙터 칸 안에 줄 목록으로 */
.robot-import { min-width: 0; overflow-wrap: anywhere; }
.rmaps-pickrow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; }
.rmaps-pickrow select { min-width: 0; max-width: 100%; }
.rmaps-nopath { margin-left: 6px; font-size: 12px; align-self: center; }
.rmaps-more { align-self: center; margin-left: 6px; font-size: 12px; }
.rmaps-raw { max-width: 70vw; white-space: pre-wrap; word-break: break-all; margin: 4px 0 0; }
.rmaps-rows { list-style: none; margin: 4px 0 8px; padding: 0; border: 1px solid var(--line); border-radius: 8px; }
.rmaps-row { display: grid; gap: 2px; padding: 8px 10px; border-top: 1px solid var(--line); }
.rmaps-row:first-child { border-top: 0; }
.rmaps-row.on { background: var(--sel, rgba(37, 99, 235, 0.08)); }
.rmaps-row.off .rmaps-name { opacity: 0.7; }
.rmaps-top { display: flex; gap: 6px; align-items: center; min-width: 0; }
.rmaps-top .rmaps-name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rmaps-sub, .rmaps-why { font-size: 12px; padding-left: 22px; }
.rmaps-rel { border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 6px 0; display: grid; gap: 4px; min-width: 0; }
.rmaps-rel legend { font-size: 12px; padding: 0 4px; }
.rmaps-note { display: flex; gap: 6px; align-items: center; margin: 6px 0; }
.rmaps-note input { flex: 1; min-width: 0; }
.maps-frame { font-size: 11px; }
/* 맵을 되돌린 뒤의 물음 카드와 들이기 짐작 줄(UR-MAP S9·S3) */
.maps-restore { gap: 4px; margin: 8px 0; overflow-wrap: anywhere; }
.maps-restore .mr-en { color: var(--ink); }
.maps-restore .mr-ko { font-size: 12px; }
.maps-restore .maps-actions { margin: 6px 0 0; }
.maps-insp > .maps-restore, .maps-insp > .maps-restore-skipped { margin: 8px 12px; }
.maps-restore-skipped .btn { margin-left: 6px; }
.maps-guess { font-weight: 600; margin-top: 4px; }
.maps-pairrev { display: block; font-size: 11px; }

/* 로봇 준비 점검표(readiness.mjs, UR-MAP 9.11) */
.ready-cell { min-width: 180px; max-width: 320px; }
.ready-cell .ready-detail, .ready-box .ready-detail { font-size: 12px; margin-top: 2px; }
.ready-cell .ready-fix, .ready-box .ready-fix { font-size: 12px; margin-top: 2px; }
.ready-score { font-size: 11px; margin-left: 6px; opacity: 0.75; }
.ready-act { margin-top: 6px; }
.ready-next { display: inline-block; margin-top: 6px; font-size: 12px; }
.ready-run { font-size: 12px; margin-top: 4px; }
/* 노드로 보내기(Off Path, UR-MAP S16): 노드 고르기 + 단추 한 줄, 그 아래 못 누르는 까닭·서버 답. */
.ready-go { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.ready-go-pick { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.ready-go-pick .select { min-width: 0; max-width: 190px; min-height: 32px; padding-top: 2px; padding-bottom: 2px; font-size: 12px; }
.ready-go-why, .ready-go-result { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
.ready-go-result { font-weight: 600; }
/* 적용 도우미: 로봇마다 한 줄(됨·안 됨·까닭). Finish 를 보내지 못한 로봇은 빨간 띠. */
.ah-robots { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 4px; }
.ah-robot { font-size: 13px; padding: 4px 8px; border-left: 3px solid var(--line); overflow-wrap: anywhere; }
.ah-robot.ah-failed { border-left-color: var(--bad); }
.ah-robot .ah-head { font-weight: 600; }
.ah-robot .ah-state { font-size: 12px; font-weight: 600; }
.ah-robot .ah-why { font-size: 12px; margin-top: 2px; }
.ready-checks { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; }
.ready-checks .chk-ok { color: var(--ok); }
.ready-checks .chk-bad { color: var(--bad); font-weight: 700; }
.ready-checks .chk-wait { opacity: 0.55; }
/* ACS Link·Logs(0101): Missions 와 같은 틀 — 표(머리 24px·줄 28px) + 오른쪽 인스펙터. 새 색 없이 위 변수만 쓴다. */
.logs-page { padding: 0; gap: 0; flex-direction: row; }
.ax .insp, #logs .insp { max-width: 340px; flex-basis: 290px; }
.ax-conn { padding: 12px 16px 14px; border-bottom: 1px solid var(--line); gap: 10px; flex: none; }
.ax-conn .conn-title { flex-wrap: wrap; gap: 4px 8px; }
.ax-conn .conn-title i { width: 8px; height: 8px; }
.ax-conn .conn-title b { font-size: 13px; font-weight: 600; }
.ax-conn .conn-title .muted { font-size: 11px; }
.acs-addr { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acs-addr .input { flex: 1 1 220px; min-width: 0; max-width: 340px; }
.ax-conn .conn-grid { grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; font-variant-numeric: tabular-nums; }
.ax-reject { max-width: none; flex: none; padding: 10px 16px 12px; gap: 8px; border-bottom: 1px solid var(--line); }
.ax-reject .reject-row { max-width: 760px; }
.ax-calm { margin: 0; font-size: 11px; color: var(--mute); }
.ax-calm b { font-weight: 500; color: var(--ink2); }
.ax-sum { display: inline-flex; flex-wrap: wrap; gap: 2px 14px; font-size: 11px; color: var(--mute); font-variant-numeric: tabular-nums; }
.ax-stat { display: inline-flex; align-items: baseline; gap: 5px; }
.ax-stat .value { font-size: 13px; font-weight: 500; color: var(--ink); }
.ax-stat .value.c-bad { color: var(--bad); }
.ax-stat .sub::before { content: "("; }
.ax-stat .sub::after { content: ")"; }
.ax .ms-head, .ax .ms-row { grid-template-columns: 78px 36px minmax(200px, 1fr) minmax(120px, 170px) 104px; min-width: 640px; }
.ax .msg-list { max-height: none; overflow: visible; }
.ax .ms-row.msg { padding: 0 16px; border-top: 0; }
.ax .ms-row .t, .ax .ms-row .dir, .ax .ms-row .topic { font-family: inherit; font-size: 13px; font-weight: 400; color: inherit; }
.ax .ms-row .topic { color: var(--mute); }
.ax .ms-row[aria-current="true"] .topic { color: #FFFFFF; }
.ax .ms-row .t, .log-tbl .log-at { font-variant-numeric: tabular-nums; }
.log-bar { padding: 8px 16px; align-items: center; }
.log-bar .select { min-width: 0; }
.log-bar .log-q { flex: 0 1 240px; max-width: 240px; min-width: 140px; }
.log-count { padding: 0; font-size: 11px; font-variant-numeric: tabular-nums; }
.log-warn { margin: 10px 16px; }
#logs .ms-scroll { flex-grow: 1; }
.log-tbl { width: 100%; }
.log-tbl .log-row { cursor: default; }
.log-tbl .log-row[aria-selected="true"] td { background: var(--sel); }
.log-tbl .log-row:focus-visible { outline: 2px solid var(--acc); outline-offset: -2px; }
.log-ko { font-weight: 400; }
.log-raw summary { font-size: 11px; }
.insp pre.code { max-height: 420px; }
.ax-reject pre.code { max-width: 760px; max-height: 112px; }
@media (max-width: 900px) {
  .ax .ms-main, #logs .ms-main { flex-basis: 100%; }
  .ax .insp, #logs .insp { max-width: none; }
  .log-bar .log-q { flex: 1 1 160px; max-width: none; }
}

/* Mission Map·Settings(0102): Missions 와 같은 틀 — 표(머리 24px·줄 28px) + 오른쪽 인스펙터, 설정은 묶음마다 목록 줄.
   새 색 없이 위 변수만 쓴다. */
.mm .ms-main { display: flex; flex-direction: column; }
.mm-title { font-size: 13px; font-weight: 600; }
.mm-desc, .set-note { font-size: 11px; color: var(--mute); }
.mm-notes { padding: 10px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.mm .tpl-list { flex: none; max-width: none; overflow-x: auto; }
.mm-head, .mm .tpl-row {
  display: grid; grid-template-columns: 28px minmax(110px, 190px) 96px minmax(150px, 1fr) minmax(100px, 170px) 56px;
  align-items: center; column-gap: 8px; min-width: 700px; padding: 0 16px;
}
.mm-head { height: 24px; font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--line); }
.mm .tpl-row { min-height: 28px; border-top: 0; gap: 0 8px; }
.mm .tpl-row:nth-child(even) { background: var(--group); }
.mm .tpl-row[aria-current="true"] { background: var(--accBg); color: #FFFFFF; }
.mm .tpl-pick {
  grid-column: 1 / 6; display: grid; grid-template-columns: subgrid; align-items: center; gap: 0 8px;
  min-height: 28px; padding: 0; font: inherit; cursor: pointer;
}
.mm .tpl-pick .txt { display: contents; }
.mm .tpl-pick :is(.no, .name, .rule, .work, .what) {
  grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px; font-weight: 400; color: inherit; font-variant-numeric: tabular-nums;
}
.mm .tpl-pick .no { grid-column: 1; color: var(--mute); }
.mm .tpl-pick .rule { grid-column: 2; }
.mm .tpl-pick .work { grid-column: 3; }
.mm .tpl-pick .what { grid-column: 4; }
.mm .tpl-pick .name { grid-column: 5; color: var(--mute); }
.mm .tpl-row[aria-current="true"] .tpl-pick :is(.no, .name) { color: #FFFFFF; }
.mm .tpl-pick:hover .name { text-decoration: none; }
.mm .tpl-moves { grid-column: 6; gap: 2px; }
.mm .tpl-moves .btn-icon { width: 24px; height: 22px; min-height: 0; padding: 0; font-size: 12px; }
.mm .tpl-none { padding: 14px 16px; }
.mm .tpl-add { padding: 6px 16px; border-top: 1px solid var(--line); }
.mm .tpl-add .btn { height: 24px; font-size: 12px; }
.mm-try { padding: 8px 16px 10px; gap: 8px; border-top: 1px solid var(--line); border-radius: 0; }
.mm-try .preview-row { gap: 8px; }
.mm-try .preview-row label { font-size: 11px; color: var(--mute); }
.mm-try .preview-row .input { width: 180px; padding: 4px 8px; }
.mm-try .box { max-width: 760px; }
.mm .insp .tpl-form { padding: 0; gap: 12px; }
.mm .insp .grid2 { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.mm .insp .actions { flex-wrap: wrap; gap: 8px; }
.mm-works { border-bottom: 1px solid var(--line); padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mm-works .sec-title, .set-group .sec-title { margin: 0; padding: 14px 0 0; }
.mm-works .set-note, .set-group .set-note { margin: 0; }
.mm-works form { display: flex; flex-direction: column; gap: 10px; max-width: 880px; }
.mm-wlist .proc-station-row {
  grid-template-columns: minmax(150px, 1fr) minmax(130px, 220px) minmax(130px, 220px); gap: 6px 12px; align-items: center;
  padding: 6px 12px; border-bottom: 0;
}
.mm-wlist .proc-station-row + .proc-station-row { box-shadow: inset 0 1px 0 var(--line); }
.mm-wlist .proc-station-row .proc-name { grid-column: auto; gap: 2px 8px; }
.mm-wlist .proc-station-row .proc-name b { font-weight: 500; }
.mm-wlist .proc-new-row { grid-template-columns: repeat(4, minmax(0, 1fr)); align-items: start; }
.mm-wlist .proc-new-row .proc-name { grid-column: 1 / -1; }
.mm-works .actions { justify-content: flex-start; }

.set-page { padding: 4px 20px 24px; max-width: 680px; display: flex; flex-direction: column; gap: 4px; }
.set-group { display: flex; flex-direction: column; gap: 6px; }
.set-group form { display: flex; flex-direction: column; gap: 6px; }
.set-list.conn-grid { display: block; }
.set-list .rb-line { justify-content: space-between; }
.set-list .rb-line :is(dt, .set-name) { width: auto; flex: none; color: var(--ink); }
.set-list .rb-line dd, .set-val { margin: 0; min-width: 0; flex: 1 1 0; display: flex; justify-content: flex-end; align-items: center; gap: 8px; text-align: right; color: var(--mute); overflow-wrap: anywhere; }
.set-list .rb-line dd.mono { font-family: inherit; font-variant-numeric: tabular-nums; }
.set-val .input { max-width: 260px; min-width: 0; flex: 1 1 120px; padding: 4px 8px; text-align: left; color: var(--ink); }
.set-val .radios { flex-wrap: nowrap; gap: 0; }
.set-val .radio { border: 0; border-radius: 5px; padding: 2px 12px; color: var(--ink); position: relative; }
.set-val .radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.set-val .radio:has(input:checked) { background: var(--segOn); color: var(--ink); box-shadow: 0 0.5px 2px rgba(0, 0, 0, 0.16); }
.set-val .radio:has(input:focus-visible) { outline: 2px solid var(--acc); outline-offset: 1px; }
@media (max-width: 900px) {
  .mm-wlist .proc-station-row, .mm-wlist .proc-new-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mm-wlist .proc-station-row .proc-name { grid-column: 1 / -1; }
  .set-page { padding: 4px 16px 20px; }
}
@media (max-width: 560px) { .mm-wlist .proc-station-row, .mm-wlist .proc-new-row { grid-template-columns: minmax(0, 1fr); } }
.mm .tpl-pick .rule { height: auto; background: none; }
.mm .insp #tpl-mode { flex: none; width: 104px; }
/* Mission Map 틀(backlog 61): 인스펙터는 DOM 에서 표 바로 뒤다. 왼쪽 칸 상자(.ms-main)는 풀고(display: contents) 바깥을
   grid 로 둔다. 넓으면 오른쪽 칸 "insp"(옛 flex 와 같은 250px, ACS Link·Logs 와 같음)가 위에서 아래까지(마지막 1fr 줄이 남는 높이를 받는다), 폭 900 아래면 한 칸에
   표 → 인스펙터 → Try → Works 차례로 쌓인다(Tab 차례와 같다). */
.ms.mm {
  display: grid; min-width: 0; grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto auto auto auto auto 1fr;
  grid-template-areas: "works works" "bar insp" "notes insp" "list insp" "try insp" ". insp"; align-items: start;
}
.mm .ms-main { display: contents; }
.mm .ms-main > .ms-bar { grid-area: bar; }
.mm .ms-main > .mm-notes { grid-area: notes; }
.mm .ms-main > #tpl-list { grid-area: list; }
.mm .ms-main > .mm-try { grid-area: try; }
.mm .ms-main > .mm-works { grid-area: works; }
.mm .ms-main > .insp { grid-area: insp; align-self: stretch; max-width: none; }
@media (max-width: 900px) {
  .ms.mm { display: flex; flex-direction: column; flex-wrap: nowrap; align-items: stretch; }
  .mm .ms-main > .insp { flex: none; border-left: 0; border-top: 1px solid var(--line); }
}
.mm .input.mono { font-family: inherit; }

/* 로봇 짝 표(p2 0106): 줄마다 화면 이름·Can Do·집을 고친다. 보관 줄은 글만. */
.book-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.book-card h2 { margin: 0; font-size: 15px; font-weight: 600; }
.book-card h3 { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ink2); }
.book-card h3 small { font-weight: 500; margin-left: 6px; }
.book-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line2); }
.book-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 14px; }
.book-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.book-why { font-size: 12px; overflow-wrap: anywhere; }
.book-ask { display: flex; flex-direction: column; gap: 8px; }
.book-ask p { margin: 0; font-size: 13px; overflow-wrap: anywhere; }
.book-mode .btn[aria-pressed="true"] { color: var(--acc); border-color: var(--acc); background: color-mix(in srgb, var(--acc) 10%, transparent); font-weight: 600; }
.book-wait { border-top: 1px solid var(--line2); padding-top: 12px; font-size: 13px; }
.book-wait ul { margin: 6px 0; padding-left: 18px; }
.book-wait p { margin: 4px 0 0; font-size: 12px; }
.book-add { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line2); padding-top: 12px; }
/* ROBOT-ADD-ONE-PLACE: 옛 "로봇 추가" 칸 자리의 안내 한 줄과 [자세히](로봇 짝 표·배정 대기) 접힘. */
.book-add-moved { margin: 12px 0 6px; color: var(--muted); }
.book-add-moved a { margin-left: 8px; }
.book-more > summary { cursor: pointer; padding: 6px 0; color: var(--muted); }
.book-more[open] > summary { margin-bottom: 8px; }
.book-fill { display: flex; flex-direction: column; gap: 8px; }
/* 맵 화면 셋(p2 0110, 시안 MapSend·MapMismatch·MapRealign): Layout 의 Editor·Maps·History 탭, Maps(목록 + 그림 + 인스펙터),
   감시 인스펙터의 Map Mismatch 상자, 다시 맞추기(겹친 그림 + 결과 인스펙터). 새 색 없이 위 변수만 쓴다. */
.lay-tabbar { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--line); }
.lay-tabs > button { min-width: 64px; }
.lay-tab-sub { font-size: 11px; }
.map-band { border: 0; background: transparent; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.map-band.c-warn { color: var(--warn); }
.maps-page { display: grid; grid-template-columns: minmax(220px, 250px) minmax(0, 1fr) minmax(300px, 380px); min-height: calc(100vh - 140px); }
.maps-list { display: flex; flex-direction: column; border-right: 1px solid var(--line); min-width: 0; }
.maps-list-head, .maps-row .mr-top { display: grid; grid-template-columns: minmax(0, 1fr) 34px 76px 40px; gap: 6px; align-items: baseline; }
.maps-list-head { padding: 4px 12px; font-size: 11px; color: var(--mute); border-bottom: 1px solid var(--line); }
.maps-rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 1 auto; }
.maps-row { display: flex; flex-direction: column; gap: 2px; padding: 7px 12px; border-bottom: 1px solid var(--line2); cursor: pointer; }
.maps-row:hover { background: var(--line2); }
.maps-row.on { background: var(--accBg); color: #FFFFFF; }
.maps-row.on .mr-sub, .maps-row.on .c-warn { color: #FFFFFF; }
.maps-row .mr-name { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maps-row .mr-fp { font-family: var(--mono); font-size: 12px; }
.maps-row .mr-day { font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
.maps-row .mr-sub { font-size: 11px; color: var(--mute); overflow-wrap: anywhere; }
.maps-row.active:not(.on) .mr-sub { color: var(--ok); }
.maps-list-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.maps-list-foot .note { margin: 0; color: var(--mute); }
.maps-list-act { display: flex; flex-wrap: wrap; gap: 6px; }
.maps-view { display: flex; flex-direction: column; min-width: 0; background: var(--map); }
.maps-canvas { position: relative; flex: 1 1 auto; min-height: 360px; display: flex; align-items: center; justify-content: center; padding: 16px 16px 40px; }
.maps-svg, .ra-svg { width: 100%; height: 100%; max-height: calc(100vh - 290px); display: block; }
.maps-svg .maps-img { image-rendering: pixelated; }
.maps-origin path { stroke: var(--acc); stroke-width: 2; fill: none; }
.maps-origin text { fill: var(--acc); }
.maps-scale path { stroke: var(--ink); stroke-width: 2; }
.maps-svg .mv-cursor, .ra-svg .mv-cursor { fill: var(--ink2); }
.maps-noimg { padding: 40px; }
.maps-meta { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; padding: 12px 16px; background: var(--bg); border-top: 1px solid var(--line); }
.maps-meta dt { font-size: 11px; color: var(--mute); }
.maps-meta dd { margin: 2px 0 0; overflow-wrap: anywhere; }
.maps-meta .wide { grid-column: span 2; }
.maps-insp { max-width: none; border-left: 1px solid var(--line); }
.maps-insp .note { margin: 0; }
.maps-robots { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.maps-robots .tbl td, .maps-robots .tbl th { padding-left: 10px; padding-right: 10px; }
.maps-robots tr[data-act] { cursor: pointer; }
.maps-robots tr.on td { background: var(--sel); }
.send-panel { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.send-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.send-head b { font-weight: 600; }
.send-bar { height: 4px; }
.send-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.send-step { display: flex; gap: 8px; align-items: flex-start; }
.send-step .step-mark { width: 16px; height: 16px; flex: none; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; margin-top: 1px; border: 1.5px solid var(--line); color: var(--mute); }
.send-step .step-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.send-step .step-sub { font-size: 11px; color: var(--mute); }
.send-step .step-msg { font-size: 12px; font-weight: 500; }
.send-step.st-done .step-mark { background: var(--ok); border-color: var(--ok); color: var(--bg); }
.send-step.st-pass .step-mark { border-color: var(--ok); color: var(--ok); }
.send-step.st-pass .step-pass { color: var(--ok); font-weight: 400; }
.send-step.st-now .step-mark { border-color: var(--acc); border-top-color: transparent; color: transparent; animation: send-spin 0.9s linear infinite; }
.send-step.st-now .step-title { font-weight: 600; }
.send-step.st-fail .step-mark { background: var(--bad); border-color: var(--bad); color: var(--bg); }
.send-step.st-fail .step-title { font-weight: 600; }
.send-step.st-nopath .step-mark { border-color: var(--warn); color: var(--warn); }
.send-step.st-held .step-mark { border-color: var(--warn); color: var(--warn); }
.send-step.st-held .step-title { font-weight: 600; }
.send-step.st-wait .step-title { color: var(--mute); }
@keyframes send-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .send-step.st-now .step-mark { animation: none; border-top-color: var(--acc); } }
.send-act { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.send-act .note { align-self: stretch; }
/* 감시 인스펙터: Map Mismatch 상자와 점검표 줄의 값 */
.mm-box { border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line)); background: var(--warnSoft); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.mm-box .mm-title { color: var(--warn); font-weight: 600; }
.mm-box p { margin: 0; font-size: 12px; color: var(--ink2); }
.mm-maps { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 2px 8px; margin: 0; font-size: 12px; }
.mm-maps dt { color: var(--mute); }
.mm-maps dd { margin: 0; overflow-wrap: anywhere; }
.mm-act { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 2px; }
.ready-box .ready-checks { flex-direction: column; flex-wrap: nowrap; gap: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.ready-box .ready-checks .chk { display: flex; align-items: baseline; gap: 6px; padding: 5px 10px; border-top: 1px solid var(--line2); color: var(--ink); font-weight: 400; }
.ready-box .ready-checks .chk:first-child { border-top: 0; }
.ready-box .ready-checks .chk > span[aria-hidden] { width: 14px; text-align: center; }
.ready-box .ready-checks .chk-ok > span[aria-hidden] { color: var(--ok); }
.ready-box .ready-checks .chk-bad > span[aria-hidden], .ready-box .ready-checks .chk-bad .chk-v { color: var(--bad); }
.ready-box .ready-checks .chk-bad { font-weight: 600; }
.ready-box .ready-checks .chk-wait { opacity: 1; color: var(--mute); }
.ready-checks .chk-na, .ready-box .ready-checks .chk-na { color: var(--mute); }
/* 교체 답의 글 상자(p5 041): 글 옆에 작은 "닫기" — 상자 폭으로 늘이지 않는다 */
.book-swap { display: flex; flex-direction: row; flex-wrap: wrap; align-items: flex-start; gap: 6px 12px; }
.book-swap > p { flex: 1 1 260px; margin: 0; }
.book-swap > .btn { flex: none; width: auto; }
.chk-v { margin-left: auto; font-size: 12px; color: var(--mute); text-align: right; }
.ready-start-note { margin: 2px 0 0; font-size: 11px; }
.ready-why { display: inline-block; margin-left: 6px; font-size: 12px; font-weight: 500; }
/* 다시 맞추기 */
.ra-page { display: flex; flex-direction: column; min-height: calc(100vh - 140px); }
.ra-head { display: flex; align-items: center; gap: 12px; padding: 8px 20px; border-bottom: 1px solid var(--line); }
.ra-head > div { display: flex; flex-direction: column; }
.ra-head > div b { font-weight: 600; }
.ra-head > div .muted { font-size: 11px; }
.ra-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 330px); flex: 1 1 auto; }
.ra-view { display: flex; flex-direction: column; min-width: 0; background: var(--map); }
.ra-canvas { position: relative; flex: 1 1 auto; min-height: 420px; padding: 16px 16px 40px; display: flex; align-items: center; justify-content: center; }
.ra-svg .ra-img { image-rendering: pixelated; }
.ra-graph line { stroke: var(--lane); vector-effect: non-scaling-stroke; stroke-width: 1.5; }
.ra-graph circle { fill: var(--lane); }
.ra-graph circle.ra-block { fill: var(--bad); stroke: var(--bad); stroke-width: 3; vector-effect: non-scaling-stroke; }
.ra-stations rect { fill: var(--tag); stroke: var(--ink); vector-effect: non-scaling-stroke; stroke-width: 1; }
.ra-stations text { fill: var(--ink); font-weight: 600; }
.ra-layers .ra-key { width: 10px; height: 10px; border-radius: 2px; display: inline-block; background: var(--wall); }
.ra-layers .ra-key.new { background: var(--acc); }
.ra-layers .ra-key.graph { background: var(--lane); border-radius: 50%; }
.ra-layers .ra-key.st { background: var(--tag); border: 1px solid var(--ink); }
.ra-opacity { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--mute); border-top: 1px solid var(--line); padding-top: 6px; cursor: default !important; }
.ra-opacity input { accent-color: var(--accBg); width: 150px; }
.ra-foot { background: var(--bg); }
.ra-insp { max-width: none; }
.ra-nums dd { text-align: right; font-variant-numeric: tabular-nums; }
.ra-far { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; background: var(--bg); }
.ra-far-v b { font-size: 20px; font-weight: 600; }
.ra-far-v span { font-size: 12px; }
.ra-far .ra-why { font-size: 12px; color: var(--ink2); }
.ra-after dd { text-align: right; }
.ra-insp .note { margin: 0; }
.ra-act { display: flex; flex-direction: column; gap: 8px; }
.ra-act .btn-primary { width: 100%; }
.ra-act2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ra-manual { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 8px; }
.ra-manual legend { font-size: 11px; color: var(--mute); padding: 0 4px; }
@media (max-width: 1100px) {
  .maps-page { grid-template-columns: minmax(200px, 230px) minmax(0, 1fr); }
  .maps-insp { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .ra-body { grid-template-columns: minmax(0, 1fr); }
  .ra-insp { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 800px) {
  .maps-page { grid-template-columns: minmax(0, 1fr); }
  .maps-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 320px; }
  .maps-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lay-tabbar { flex-wrap: wrap; }
}
.maps-robots .tbl td { white-space: nowrap; }
.ready-box > .mm-box { margin-bottom: 8px; }

/* 레이아웃 지도 Edge 도구(p2 backlog 0006): 잇는 동안 노드에 손 모양, 시작 노드는 점선 고리. 커서 자리는 고정 폭. */
.map-wrap.edging .pick[data-kind="node"] { cursor: crosshair; }
.l-node.from { stroke: var(--acc); stroke-width: 4; stroke-dasharray: 4 3; fill: var(--accBg, var(--sel)); paint-order: stroke; }
.lay-cursor { width: 22ch; white-space: nowrap; } /* 아래 줄, 고정 폭: 커서를 옮겨도 줄이 흔들리지 않는다("x -12.35 · y -10.25 m") */

/* 하루 일 화면 다듬기(p2 0113): Missions 화면은 남경 요청 표가 비어도 화면을 다 먹지 않는다(아래 Jobs 가 첫 화면에 보인다).
   Active Missions 줄의 "단계 n/N". */
#missions { flex-grow: 0; min-height: 260px; }
.mission-row .stepn { font-size: 11px; font-weight: 600; color: var(--mute); white-space: nowrap; margin-left: auto; }
.mission-row .stepn + .state { margin-left: 0; }
/* 감시 인스펙터 맨 아래 Pause(또는 Resume) · To Charger(시안 Main 인스펙터) */
.insp-acts { display: flex; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.insp-acts .btn { flex: 1 1 0; }

/* Works(공정 카드): 할 수 있는 로봇이 없는 공정은 "배정 대기" 로 보인다. 새 공정은 할 수 있는 로봇(Robots, Can Do)을 체크로 고른다. */
.proc-wait { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--warn); }
.proc-wait a { color: inherit; text-decoration: underline; }
/* 다음 회차가 안 나가는 까닭(공정 모습의 waitReason): 공정 이름 줄 밑에 한 줄 */
.proc-reason { flex-basis: 100%; font-size: 12px; font-weight: 500; color: var(--warn); overflow-wrap: anywhere; }
.proc-robots-title { color: var(--mute); }
.proc-robot-list { display: flex; flex-wrap: wrap; gap: 4px 14px; font-weight: 500; }
.proc-robot-opt { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.mm-wlist .proc-new-row .proc-robots { grid-column: 1 / -1; }
/* 검사에 걸린 것은 키보드 초점이 가도 빨강이다(초점은 굵기로 알린다). */
g.pick:focus-visible .l-node.bad, g.pick:focus-visible .l-edge.bad { stroke: var(--bad); stroke-width: 6; }
g.pick:focus-visible .l-edge.warn { stroke: var(--warn); stroke-width: 6; }

/* 저장 못 함 띠(p2 0131): 공정 줄의 storeError 글을 줄 밖, 모든 화면 위에 한 번. 일하는 줄만 있어도 보인다 */
.storeerr { flex: none; margin: 0; padding: 8px 20px; font-size: 13px; color: var(--bad); background: var(--badSoft); border-bottom: 1px solid var(--bad); overflow-wrap: anywhere; }
.storeerr[hidden] { display: none; }
.storeerr b { margin-right: 6px; }
.storeerr span + span::before { content: " · "; }
/* 위치 알람 띠(p2 0142, p5 044): 일하던 로봇이 위치를 잃어 선 줄. 저장 못 함 띠 아래·알람 띠 위에 따로 쌓인다(겹치지 않음) */
.posalarms { flex: none; display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; margin: 0; padding: 8px 20px; font-size: 13px; color: var(--ink); background: var(--badSoft); border-bottom: 1px solid var(--bad); }
.posalarms[hidden] { display: none; }
.pos-head { color: var(--bad); font-weight: 600; white-space: nowrap; }
.pos-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; flex: 1 1 320px; min-width: 0; }
.pos-alarm { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; color: inherit; text-decoration: none; border-radius: 6px; padding: 2px 6px; }
.pos-alarm:hover, .pos-alarm:focus-visible { background: var(--bg); }
.pos-alarm b { color: var(--bad); white-space: nowrap; }
.pos-msg { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.pos-after { white-space: nowrap; font-weight: 600; color: var(--warn); border: 1px solid var(--warn); border-radius: 999px; padding: 0 8px; }
.pos-log { margin: 12px 20px 0; padding: 10px 14px; font-size: 13px; }
.pos-log summary { cursor: pointer; font-weight: 600; }
.pos-log ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; overflow-wrap: anywhere; }
/* 충전 재시도 기다림 까닭(p2 0131, GET /mc/api/charge-waits): 로봇 칸 Step 줄과 All Robots 표의 한 줄 */
.charge-wait { display: block; font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }

/* p2 0136: 어느 로봇 폭으로 보는지(robot_width_text) 한 줄 · 낡은 화면 거절 상자 · 768 All Robots 표의 Step 칸 폭 */
.lay-robot-width { font-size: 12px; color: var(--ink2); margin: 6px 0 0; }
.lay-changed .lay-changed-keep { display: block; font-size: 12px; margin-top: 4px; }
.lay-changed .actions { margin-top: 8px; }
.ready-go-how { font-size: 12px; margin-top: 2px; }
.robots-tbl td.what-cell { min-width: 180px; }

/* p2 0150: All Robots 표가 좁은 상자(태블릿 768·1024, 옆 막대가 있는 폭)에서 오른쪽 칸을 잘라 먹지 않게 —
   Link(4째) 는 Robot 이름 아래, Position(9째) 은 Battery 아래로 접고 칸 안쪽을 줄인다(State·Link 칸 글 꼴은 그대로 — 그리기 시험들이 `…">글</td>` 꼴을 읽음). 칸을 감추지 않는다(정보는 그대로). 넓으면 아홉 칸 그대로 */
.rb-more .table-wrap { container-type: inline-size; }
.robots-tbl .tbl-fold { display: none; }
@container (max-width: 960px) {
  .robots-tbl th:nth-child(4), .robots-tbl td:nth-child(4), .robots-tbl th:nth-child(9), .robots-tbl td:nth-child(9) { display: none; }
  .robots-tbl .tbl-fold { display: block; }
  .robots-tbl th, .robots-tbl td { padding-left: 10px; padding-right: 10px; }
  .robots-tbl th .tbl-fold { font-size: 11px; }
  .robots-tbl td.what-cell { min-width: 150px; }
  .robots-tbl td .tbl-fold { font-size: 12px; margin-top: 2px; white-space: nowrap; }
}

/* 상부 리셋 단추(로봇 칸)와 충전 뒤 기준 칸(설정) — p2 0146 */
.rb-arm-reset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; font-size: 13px; }
.rb-arm-reset .muted { min-width: 0; overflow-wrap: anywhere; }
.cr-edited { margin-left: 8px; padding: 1px 8px; border-radius: 999px; font-size: 12px; color: var(--warn); background: var(--warnSoft); }
.set-val .input.num { flex: 0 0 6em; width: 6em; }

/* 준비 점검 걷기 2·5·6·10번(p2 0159): 줄마다 고치기 →, ③④ 기다림 한 줄, 지금 할 일 하나, 서버 글은 "자세히" 안, Robots 카드 준비 한 줄 */
.ready-box .ready-checks .chk { flex-wrap: wrap; }
.ready-checks .chk-fix { flex-basis: 100%; padding-left: 20px; font-size: 12px; font-weight: 600; color: var(--acc); text-decoration: none; }
.ready-checks a.chk-fix:hover, .ready-fix-go:hover { text-decoration: underline; }
.ready-checks span.chk-fix { color: var(--ink); font-weight: 500; }
.ready-box .ready-wait { font-size: 12px; margin: 4px 0 0; }
.ready-todo { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--group); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.ready-todo > b { display: block; font-size: 12px; color: var(--mute); margin-bottom: 2px; }
.ready-todo .ready-todo-how { font-size: 12px; margin-top: 2px; }
.ready-fix-go.btn { margin-top: 4px; font-weight: 500; color: var(--ink); }
.map-warn > summary { cursor: pointer; font-weight: 600; }
.map-warn[open] > summary { margin-bottom: 6px; }
.ready-fix-go { display: inline-block; margin-top: 4px; font-weight: 600; color: var(--acc); text-decoration: none; }
span.ready-fix-go { color: var(--ink); }
.ready-more { margin-top: 6px; font-size: 12px; }
.ready-more > summary { cursor: pointer; font-size: 12px; }
.rb-ready { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--group); }
.rb-ready > b { margin-right: 6px; font-size: 12px; color: var(--mute); }
.rb-ready .ready-fix-go { margin-top: 0; margin-left: 4px; }

/* ── 로봇 관리(care.mjs, m7) ───────────────────────────────── */
.care { padding: 14px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.care-empty { padding: 24px; }
.care-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.care-segs, .care-speed { display: inline-flex; gap: 2px; padding: 2px; background: var(--seg); border-radius: 8px; }
.care-seg { border: 0; background: transparent; color: var(--ink2); border-radius: 6px; padding: 0 14px; min-height: 30px; font-weight: 500; }
.care-seg.on { background: var(--segOn); color: var(--ink); box-shadow: var(--ctlShadow); font-weight: 600; }
.care-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.care-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--line2); color: var(--ink2); }
.care-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.care-ok { color: var(--ok); background: var(--okSoft); }
.care-bad { color: var(--bad); background: var(--badSoft); }
.care-warn { color: var(--warn); background: var(--warnSoft); }
.care-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.care-map { overflow: hidden; }
.care-map-head { display: flex; align-items: baseline; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line2); }
.care-title { margin: 0; font-size: 13px; font-weight: 600; }
.care-cap { color: var(--mute); font-size: 12px; }
.care-map-body { background: var(--map); min-height: 360px; display: flex; align-items: center; justify-content: center; }
.care-svg { display: block; width: 100%; height: auto; max-height: calc(100vh - 360px); min-height: 300px; touch-action: none; user-select: none; }
.care-map-body.is-pick .care-svg { cursor: crosshair; outline: 2px solid var(--acc); outline-offset: -2px; }
.care-nomap { color: var(--mute); padding: 40px; }
.care-robot circle { fill: var(--acc); fill-opacity: 0.85; }
.care-robot path { stroke: var(--acc); stroke-linecap: round; }
.care-pick circle { fill: var(--warn); fill-opacity: 0.8; }
.care-pick path { stroke: var(--warn); stroke-linecap: round; }
.care-side { display: flex; flex-direction: column; gap: 12px; }
.care-card { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.care-card.is-attn { border-color: var(--warn); }
.care-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.care-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.care-k { flex: 1; }
.care-v { color: var(--ink2); font-variant-numeric: tabular-nums; }
.care-v.c-bad { color: var(--bad); font-weight: 600; }
.care-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
.care-dot.ok { background: var(--ok); }
.care-dot.bad { background: var(--bad); }
.care-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.care-actions .btn, .care-actions .btn-primary { flex: 1 1 auto; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.care-name { display: flex; flex-direction: column; gap: 4px; width: 100%; font-size: 12px; color: var(--mute); }
/* 상부 로봇 칸(UPPER-ARM-SETUP) */
.care-armf { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.care-armf > .care-name:first-child { grid-column: 1 / -1; }
.care-armf .input, .care-armst .input { width: 100%; min-width: 0; box-sizing: border-box; }
.care-armsts { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 6px 8px; }
.care-armst { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mute); min-width: 0; }
.care-armst > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.care-armres { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.care-next { color: var(--ink2); font-weight: 600; }
.care-cells { width: 100%; color: var(--mute); font-size: 12px; font-variant-numeric: tabular-nums; }
.btn-quiet { border-color: transparent; color: var(--mute); }
.btn-attn { border-color: var(--warn); color: var(--warn); }
.care-msg { margin: 0; }
.care-log { margin: 0; max-height: 220px; overflow: auto; background: var(--code); color: var(--codeInk); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: 11px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; }
.care-dock { position: sticky; bottom: 0; z-index: 6; background: var(--panel); border-top: 1px solid var(--line); box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.06); }
.care-dock[hidden] { display: none; }
.care-dock-in { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 10px 20px; }
.care-pads { display: grid; grid-template-columns: repeat(3, 52px); grid-template-rows: repeat(2, 44px); gap: 4px; }
.care-pad-f { grid-column: 2; grid-row: 1; }
.care-pad-l { grid-column: 1; grid-row: 2; }
.care-pad-b { grid-column: 2; grid-row: 2; }
.care-pad-r { grid-column: 3; grid-row: 2; }
.care-who { font-weight: 600; font-size: 15px; min-width: 40px; }
.care-pad { border: 1px solid var(--ctlLine); background: var(--ctl); border-radius: 8px; font-size: 16px; color: var(--ink); touch-action: none; user-select: none; box-shadow: var(--ctlShadow); }
.care-pad:disabled { opacity: 0.4; }
.care-pad.down, .care-pad:active:not(:disabled) { background: var(--acc); color: var(--onAcc); border-color: var(--acc); }
.care-stops { display: flex; gap: 8px; margin-left: auto; }
.care-stop { background: var(--stop); color: #FFFFFF; border: 0; font-weight: 700; min-width: 116px; }
.care-stop:hover:not(:disabled) { filter: brightness(1.1); }
.care-padmsg { flex-basis: 100%; min-height: 16px; font-size: 12px; color: var(--bad); }
.care-padmsg:empty { display: none; }
@media (max-width: 900px) {
  .care { padding: 12px 14px 20px; }
  .care-grid { grid-template-columns: minmax(0, 1fr); }
  .care-svg { max-height: 60vh; }
  .care-stops { margin-left: 0; }
}
.care-sensors { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.care-sensors .care-row { min-width: 0; }
.care-img { filter: var(--slamFilter); image-rendering: pixelated; }
.btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
/* 미션 꾸리기(Works): 작업대 순서·상부 배터리 하한·단계 칩 */
.proc-station-row .proc-mission { grid-column: 1 / -1; display: grid; gap: 8px; }
.proc-mission .proc-more { display: flex; flex-wrap: wrap; align-items: end; gap: 4px 10px; }
.proc-mission .proc-more .field { flex: 1 1 14rem; }
.proc-mission .proc-more .proc-row-act { margin-left: 0; display: flex; gap: 4px; }
.proc-mission .proc-mission-edit { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 14px; }
.proc-mission .proc-mission-edit .field { flex: 0 1 12rem; }
.mm-steps { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; list-style: none; margin: 0; padding: 0; }
.mm-steps li { padding: 2px 10px; border: 1px solid var(--line, rgba(128,128,128,.4)); border-radius: 999px; font-size: 0.9em; white-space: nowrap; }
.mm-steps li + li::before { content: "→ "; opacity: .6; }
.c-stale, .bat.c-stale { color: var(--mute); }

/* 미션 꾸리기(Mission Map 위쪽): 가운데 지도 + 오른쪽 단계 목록. 지도 노드를 누르는 차례로 단계가 쌓인다. */
.mb { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 0; border-bottom: 1px solid var(--line); }
.mb-map { min-width: 0; padding: 8px 12px; }
.mb-svg { width: 100%; height: auto; max-height: 520px; display: block; }
.mb-edge { stroke: var(--mute); stroke-width: 2; opacity: .35; }
.mb-node { cursor: pointer; outline: none; }
.mb-dot { fill: var(--panel); stroke: var(--acc); stroke-width: 2; }
.mb-node.charge .mb-dot { stroke: var(--ok); }
.mb-node.on .mb-dot, .mb-node:hover .mb-dot, .mb-node:focus-visible .mb-dot { fill: var(--accBg); stroke-width: 3; }
.mb-node.charge.on .mb-dot, .mb-node.charge:hover .mb-dot { fill: var(--okSoft); }
.mb-bench { fill: var(--acc); }
.mb-bolt { fill: var(--ok); }
.mb-tag { fill: var(--panel); stroke: var(--line); }
.mb-text { font-size: 12px; fill: currentColor; pointer-events: none; }
.mb-badge { fill: var(--acc); }
.mb-badge-text { font-size: 11px; font-weight: 700; fill: #FFFFFF; pointer-events: none; }
.mb-side { border-left: 1px solid var(--line); padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.mb-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.mb-step { display: grid; grid-template-columns: 22px minmax(0, 1fr) 24px; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.mb-step[draggable="true"] { cursor: grab; }
.mb-step.charge { border-color: var(--ok); }
.mb-no { font-size: 11px; color: var(--mute); text-align: center; }
.mb-what { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-side .actions { margin-top: auto; justify-content: flex-end; }
@media (max-width: 760px) { .mb { grid-template-columns: minmax(0, 1fr); } .mb-side { border-left: 0; border-top: 1px solid var(--line); } }
.mm-works > form { padding: 8px 16px 12px; }
.mm-works .mb-side { max-width: none; padding: 12px 16px; }
.mm-works .mb-side .actions { justify-content: flex-end; }
.mb-hit { fill: transparent; stroke: none; }
/* ── 업데이트 · 로봇 소프트웨어 · 알림(siteops.mjs, UI-ONE: 옛 8091 위쪽 탭에서 옮김) ── */
.sop-page { display: flex; flex-direction: column; gap: 14px; padding: 16px 24px 24px; max-width: 1200px; }
.sop-page .card { padding: 14px 16px; }
.small { font-size: 13px; }
.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 6px 12px; font-size: 14px; }
.kv > span:nth-child(odd) { color: var(--mute); }
.sop-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line2); }
.sop-row .body { display: flex; flex-direction: column; line-height: 1.4; min-width: 0; }
.sop-row .name { font-size: 14px; overflow-wrap: anywhere; }
.sop-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sop-wrap { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--line2); }
.sop-wrap .sop-row { border-top: 0; }
.sop-wrap > .sop-progress, .sop-wrap > .note { padding: 0 0 10px; }
.sop-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 24px 4px; }
.sop-chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.sop-progress { display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink2); }
.pbar { height: 8px; background: var(--line2); border-radius: 99px; overflow: hidden; }
.pfill { display: block; height: 100%; background: var(--acc); border-radius: 99px; }
.presult.c-ok { color: var(--ok); }
.presult.c-bad { color: var(--bad); }
.nt-row { display: grid; grid-template-columns: 64px 150px 90px 170px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); font-size: 14px; }
.nt-row.acked { opacity: .62; }
.nt-row .nt-text { overflow-wrap: anywhere; }
.nt-row .nt-raw summary { cursor: pointer; display: inline; color: var(--muted, #667); font-size: 12px; }
.nt-row .nt-raw[open] > span { display: block; margin-top: 4px; }
.nt-row .nt-count { color: var(--acc); }
.nt-row .nt-link { font-weight: 600; }
.nt-row .nt-time { color: var(--mute); }
.nt-row .nt-robot, .nt-row .nt-kind { color: var(--ink2); }

/* DESIGN-RULES 4: 주요 파란 단추는 화면당 하나 — 첫 줄의 것만 파랑, 뒤 줄은 흰 테두리 */
.rb:has(.rb-btn.primary:not(:disabled)) ~ .rb .rb-btn.primary { border: 1px solid var(--ctlLine); background: var(--ctl); color: var(--ink); font-weight: 500; }
.robot-row:has(.btn-primary:not(:disabled)) ~ .robot-row .btn-primary { background: var(--ctl); color: var(--ink); border: 1px solid var(--ctlLine); font-weight: 500; }
.care-upaddr { color: var(--mute); font-size: 12px; margin-left: auto; white-space: nowrap; }

/* 작업대 순서(dockseq.mjs) */
.ds-wrap { display: flex; flex-direction: column; gap: 12px; max-width: 1200px; }
.ds-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ds-bar .grow { flex: 1; }
.ds-tpl { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-pal { display: flex; gap: 8px; flex-wrap: wrap; }
.ds-chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); cursor: grab; font: inherit; }
.ds-chip:hover { border-color: var(--acc); }
.ds-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; min-height: 56px; }
.ds-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.ds-row[draggable="true"] { cursor: grab; }
.ds-no { width: 24px; height: 24px; border-radius: 50%; background: var(--sel); color: var(--acc); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.ds-kind { min-width: 72px; font-weight: 600; }
.ds-fields { display: flex; align-items: center; gap: 6px; flex: 1; }
.ds-num { width: 80px; }
.ds-node { width: 130px; }
.ds-unit { color: var(--mute, var(--ink)); font-size: 13px; }
.ds-ops { display: flex; gap: 4px; }
.ds-empty { padding: 18px; text-align: center; color: var(--mute, var(--ink)); border: 1px dashed var(--line); border-radius: 10px; }
.ds-cycles { display: inline-flex; align-items: center; gap: 4px; }

/* 작업대 미리보기(dockpreview.mjs): 큰 그림 하나 + 단계 띠. 색은 벽(회색)·로봇(파랑)·빨강 셋 */
.ds-main { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 500px); gap: 16px; align-items: start; }
@media (max-width: 900px) { .ds-main { grid-template-columns: 1fr; } }
.ds-prev { border: 1px solid var(--line); border-radius: 10px; background: var(--group); padding: 8px; position: sticky; top: 8px; min-width: 0; }
.ds-prevbar { display: flex; justify-content: flex-end; margin-bottom: 4px; }
.dp-wrap { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.dp-big { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 8px; }
.dp-bigcap { position: absolute; left: 10px; top: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.dp-svg { width: 100%; height: auto; max-height: 460px; display: block; color: var(--mute); }
.dp-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; padding: 2px; }
.dp-cell { min-width: 0; position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 4px 3px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.dp-cell.dp-ghost { opacity: .45; cursor: default; border-style: dashed; }
.dp-cell.dp-ghost:hover { border-color: var(--line); }
.dp-cell:hover { border-color: var(--acc); }
.dp-cell.dp-now { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc); background: var(--sel); }
.dp-cell.dp-bad { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.dp-cell.dp-bad.dp-now { box-shadow: 0 0 0 2px var(--bad); }
.dp-no { position: absolute; left: 6px; top: 4px; z-index: 1; font-size: 11px; font-weight: 600; color: var(--mute); font-variant-numeric: tabular-nums; }
.dp-badge { position: absolute; right: 4px; top: 3px; z-index: 2; font-size: 11px; line-height: 1.3; padding: 0 5px; }
.dp-cell.dp-ghost.dp-bad { opacity: 1; }
.dp-cs { width: 100%; height: auto; max-height: 190px; display: block; color: var(--mute); }
.dp-cap { font-size: 12px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dp-bench { fill: var(--line2); }
.dp-wall { stroke: var(--ink2); stroke-width: 4px; vector-effect: non-scaling-stroke; stroke-linecap: round; }
.dp-trail { stroke: var(--mute); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.dp-dash { stroke-dasharray: 5 4; fill: none; stroke: var(--mute); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.dp-dim line { stroke: var(--mute); stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.dp-dim .dp-ext { stroke-dasharray: 2 2; }
.dp-arc { fill: none; stroke: var(--acc); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.dp-fwd { stroke: var(--acc); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.dp-ahp { fill: var(--acc); }
.dp-up circle { fill: var(--acc); }
.dp-up text { fill: #fff; font-weight: 600; }
.dp-spot circle { fill: var(--mute); }
.dp-spot text { fill: var(--mute); font-weight: 600; }
.dp-spot.dp-now circle { fill: var(--acc); }
.dp-spot.dp-now text { fill: var(--acc); }
.dp-node circle, circle.dp-node { fill: var(--ink2); }
.dp-ret { stroke: var(--acc); stroke-width: 2px; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.dp-bodyold rect { fill: var(--acc); fill-opacity: .12; stroke: var(--acc); stroke-opacity: .45; stroke-width: 1.2px; vector-effect: non-scaling-stroke; }
.dp-bodyold path { fill: var(--acc); fill-opacity: .4; }
circle.dp-retnode { fill: var(--acc); }
circle.dp-retfrom { fill: var(--acc); fill-opacity: .6; }
.dp-body rect, .dp-robot rect { fill: var(--acc); fill-opacity: .35; stroke: var(--acc); stroke-width: 1.6px; vector-effect: non-scaling-stroke; }
.dp-body path, .dp-robot path { fill: var(--acc); }
.dp-robot rect { fill-opacity: .55; stroke-width: 2px; }
.dp-robot.dp-bad rect { stroke: var(--bad); fill: var(--bad); fill-opacity: .25; }
.dp-robot.dp-bad path { fill: var(--bad); }
.dp-wdim line { stroke: var(--ink2); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.dp-wdim text { fill: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.dp-scale line { stroke: var(--mute); stroke-width: 1.5px; vector-effect: non-scaling-stroke; }
.dp-scale text { fill: var(--mute); }
.ds-row.ds-sel { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); background: var(--sel); }
.ds-row { cursor: pointer; }
.ds-row.ds-auto { opacity: .45; border-style: dashed; background: transparent; }
.maps-rotate { display: flex; gap: 12px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.rot-dial { width: 160px; height: 160px; overflow: hidden; border: 1px solid var(--line, #ccc); border-radius: 4px; display: grid; place-items: center; cursor: grab; touch-action: none; user-select: none; }
.rot-dial img { max-width: 100%; max-height: 100%; pointer-events: none; image-rendering: pixelated; }
.rot-num { display: flex; gap: 6px; align-items: center; }
.rot-num .input { width: 88px; }
.ds-row.ds-auto:has(.ds-bad) { opacity: 1; }
.ds-row.ds-auto:has(.ds-bad) .ds-kind, .ds-row.ds-auto:has(.ds-bad) .ds-fields { opacity: .55; }

/* UI-ONE-3: 알림 줄 — 확인 단추는 줄 오른쪽 끝, 한 줄 높이. 날짜 칸은 연-월-일 글자 칸. */
.nt-row .btn-sm { white-space: nowrap; justify-self: end; }
.nt-row .btn-sm, .nt-row > .small { align-self: center; }
.nt-date { width: 110px; }
.nt-date.bad { border-color: var(--bad); }

/* 계속 일하기(AUTO-CYCLE-B): 배지 줄·미션 편집 체크박스. 색은 기존 badge-ok/bad/warn 만 쓴다. */
.keep-badges { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.keep-now { margin: 6px 0; }
.keep-opt { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; margin-left: 8px; }
.keep-opt.is-dim { opacity: .5; }
.keep-opt.is-dim small { opacity: 1; }

/* 로봇 지도 줄(MAP-IN-FMS) */
.rmap-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 10px; }
.rmap-bar .rmap-why { font-size: 12px; }
.map-wrap.posing { cursor: crosshair; }
.rmap-arrow { stroke: var(--acc); stroke-width: 3; pointer-events: none; }
/* 처음 유선 연결(ROBOT-FIRST-WIRED): 단계 줄. 색은 기존 배지만, 다음 단계만 굵게. */
.sop-wired-box { display: flex; flex-direction: column; padding: 4px 0 4px 12px; border-left: 2px solid var(--line2); }
.sop-wired { padding: 5px 0; border-top: 0; gap: 8px; flex-wrap: wrap; }
.sop-wired .wd-name { min-width: 110px; font-size: 13px; color: var(--muted, inherit); }
.sop-wired.is-next .wd-name { font-weight: 600; color: inherit; }
.sop-wired .wd-next { font-size: 12px; color: var(--muted, inherit); }

.stats-bar { display: flex; }
.stats-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stats-range .input { height: 36px; box-sizing: border-box; }
.stats-figs { display: flex; gap: 40px; margin: 0; }
.stats-figs dt { font-size: 13px; color: var(--mute); }
.stats-figs dd { margin: 4px 0 0; font-size: 28px; font-weight: 600; color: var(--ink); }

/* ═══════════════════════════════════════════════════════════════════════════════════════════════
   UI-A 틀 개편(11-26 시원 님 지적 1·2·3·5·12·13, harness/proposed/ui-redesign-1126.md). 위 규칙을 덮는다.
   · 페이지는 뷰포트 높이에 딱 맞고(body 스크롤 0), 본문(#view)·지도·표만 제 칸 안에서 스크롤한다.
   · 사이드바는 접으면 아이콘만 56px(html[data-side="folded"], 저장은 localStorage "mc-side").
   · 오른쪽 속성 패널(.insp)은 1100px 아래에서 아래 서랍이다(맨 위 띠를 누르면 열림, html[data-insp="open"]).
   · 상태 칩(.sv): IDLE · RUN · CHARGING · MANUAL · NEEDS HELP · FAULT · OFFLINE(+PAUSED) — 정상은 조용하게, 문제만 튀게.
   ═══════════════════════════════════════════════════════════════════════════════════════════════ */
:root { --sidew: 208px; --statush: 28px; }
html[data-side="folded"] { --sidew: 56px; }
html, body { height: 100%; overflow: hidden; }
.app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; flex-direction: row; }
.main { height: 100%; min-height: 0; overflow: hidden; position: relative; }
main.view { flex: 1 1 0; min-height: 0; overflow: auto; overscroll-behavior: contain; }
main.view:focus { outline: none; }
#place-pad { display: none; }
.status { height: var(--statush); min-height: var(--statush); flex: none; overflow: hidden; white-space: nowrap; }
.top { position: relative; }

/* ── 사이드바 ── */
.sidenav { width: var(--sidew); height: 100%; position: relative; align-self: stretch; overflow-x: hidden; overflow-y: auto; transition: width .15s ease; }
.side-brand { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 30px; }
.sb-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-fold { flex: none; width: 28px; height: 28px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--mute); cursor: pointer; }
.side-fold:hover { background: var(--line2); color: var(--ink); }
.side-fold svg { stroke: currentColor; }
.sidenav a { position: relative; white-space: nowrap; }
.sidenav a .sl { overflow: hidden; text-overflow: ellipsis; }
html[data-side="folded"] .sidenav { padding: 12px 8px; }
html[data-side="folded"] .sb-name, html[data-side="folded"] .sidenav a .sl, html[data-side="folded"] .side-title, html[data-side="folded"] .side-count { display: none; }
html[data-side="folded"] .side-brand { justify-content: center; padding: 0 0 8px; }
html[data-side="folded"] .sidenav a { justify-content: center; padding: 0; }
html[data-side="folded"] .sidenav a .side-badge { position: absolute; top: 1px; right: 1px; margin: 0; min-width: 14px; height: 14px; font-size: 9px; padding: 0 3px; }
html[data-side="folded"] .side-group + .side-group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sideLine); }
html[data-side="folded"] .side-group + .side-group .side-title { padding-top: 0; }
/* 사이드바는 1280 아래에서 처음부터 좁게 시작하는 편이 본문에 낫지만 저장한 값을 우선한다. 700 아래만 늘 접힘이다. */
@media (max-width: 760px) {
  :root { --sidew: 56px; }
  .sidenav { padding: 12px 8px; }
  .sb-name, .sidenav a .sl, .side-title, .side-count { display: none; }
  .side-brand { justify-content: center; padding: 0 0 8px; }
  .sidenav a { justify-content: center; padding: 0; }
}
@media (min-width: 761px) and (max-width: 900px) {
  /* 옛 규칙(900 아래 = 위 가로 줄)을 되돌린다: 세로 사이드바 그대로. */
  .app { flex-direction: row; }
  .sidenav { width: var(--sidew); height: 100%; position: relative; flex-direction: column; flex-wrap: nowrap; align-items: stretch; padding: 14px 10px; border-right: 1px solid var(--sideLine); border-bottom: 0; gap: 1px; }
  .side-spacer { display: block; }
}
@media (max-width: 760px) { .app { flex-direction: row; } .sidenav { width: var(--sidew); height: 100%; position: relative; flex-direction: column; flex-wrap: nowrap; align-items: stretch; border-right: 1px solid var(--sideLine); border-bottom: 0; } .side-spacer { display: block; } }

/* ── 위 줄: 늘 같은 자리의 모두 일시정지·모두 비상정지는 아이콘 + 글자, 좁으면 아이콘만(풍선에 이름) ── */
.top { min-height: 46px; padding-top: 4px; padding-bottom: 4px; }
.top .hdr-ico { flex: none; }
.btn-pause, .btn-resume, .btn-stop { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; min-height: 32px; padding: 0 12px; font-size: 13px; }
@media (max-width: 1279px) {
  .top .lbl { display: none; }
  .top .btn-pause, .top .btn-resume, .top .btn-stop { width: 34px; padding: 0; }
  .top .btn-resume { width: auto; padding: 0 10px; }
  .top .btn-resume .lbl { display: inline; }
  .top .btn-theme { padding: 0 8px; }
  .top .estop-why { display: none; }
}

/* ── 상태 칩(색 + 아이콘 + 영어 이름). 정상은 조용하게, 문제만 튄다 ── */
.sv { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px 0 5px; border-radius: 10px; font-size: 11px; line-height: 1; letter-spacing: .03em; white-space: nowrap; border: 1px solid transparent; }
.sv b { font-weight: 600; }
.sv .sv-ico { flex: none; }
.sv-idle { color: var(--mute) !important; background: transparent; border-color: var(--line); }
.sv-run { color: var(--drive, var(--acc)) !important; background: color-mix(in srgb, var(--drive, var(--acc)) 10%, transparent); }
.sv-charging { color: var(--ok) !important; background: color-mix(in srgb, var(--ok) 12%, transparent); }
.sv-manual { color: var(--acc) !important; background: color-mix(in srgb, var(--acc) 12%, transparent); }
.sv-paused { color: var(--warn) !important; background: transparent; border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.sv-needs-help { color: #fff !important; background: var(--warn); }
.sv-fault { color: #fff !important; background: var(--bad, var(--stop)); }
.sv-offline { color: var(--mute) !important; background: transparent; border-color: var(--line); border-style: dashed; }
.sv-fault-text { font-size: 11px; margin-left: 4px; }
.robot-row[aria-current="true"] .sv { filter: none; }
.robot-row[aria-current="true"] .sv-idle, .robot-row[aria-current="true"] .sv-offline { color: inherit !important; border-color: currentColor; }

/* ── 로봇 그림(탑뷰 실루엣 하나에 하부·상부 배터리) ── */
.bats { align-items: center; }
.rfig { display: inline-flex; align-items: center; gap: 8px; }
.rf { flex: none; }
.rf-base rect, .rf-up rect { fill: var(--panel); stroke: var(--mute); stroke-width: 1.2; }
.rf-up.none rect { stroke-dasharray: 2 2; opacity: .5; fill: none; }
.rf-fill { fill: var(--ok); }
.rf-fill.low { fill: var(--warn); }
.rf-fill.stale { fill: var(--mute); }
.rf-head { fill: var(--mute); }
.rf-bolt { fill: #fff; stroke: var(--ink); stroke-width: .6; }
.rf-nums { display: inline-flex; flex-direction: column; gap: 1px; font-size: 11px; line-height: 1.15; color: var(--ink2); }
.rf-n { display: inline-flex; gap: 4px; white-space: nowrap; }
.rf-n .bat-mark { color: var(--mute); font-weight: 400; }
.rf-n.low .bat-num { color: var(--warn); font-weight: 600; }
.rf-n.unknown { color: var(--mute); }
.robot-row[aria-current="true"] .rf-nums, .robot-row[aria-current="true"] .rf-n .bat-mark { color: inherit; }
.bat-detail .rfig { gap: 12px; }
.bat-detail .rf { width: 52px; height: 52px; }
.bat-detail .rf-nums { font-size: 13px; gap: 4px; }

/* ── 지도 위에 떠 있는 작은 아이콘 묶음(감시) ── */
.map-tools { gap: 4px; padding: 3px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--panel) 92%, transparent); box-shadow: 0 1px 4px rgba(0,0,0,.12); align-items: center; flex-wrap: nowrap; }
.map-tools .map-zoom, .map-tools .map-layers { display: inline-flex; gap: 1px; padding: 0; border: 0; background: none; }
.map-tools .map-zoom + .map-layers { margin-left: 2px; padding-left: 4px; border-left: 1px solid var(--line); }
.map-tools .ib { width: 28px; height: 28px; min-width: 28px; padding: 0; display: inline-grid; place-items: center; border: 0; border-radius: 6px; background: transparent; color: var(--ink2); box-shadow: none; }
.map-tools .ib:hover { background: var(--line2); }
.map-tools .layer-toggle[aria-pressed="true"] { background: var(--sel); color: var(--acc); }
.map-tools .layer-toggle[aria-pressed="false"] { color: var(--mute); opacity: .7; }
.map-legend { position: relative; margin-left: 2px; }
.map-legend summary { list-style: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 6px; cursor: pointer; color: var(--mute); }
.map-legend summary::-webkit-details-marker { display: none; }
.map-legend summary:hover, .map-legend[open] summary { background: var(--line2); color: var(--ink); }
.map-legend ul { position: absolute; right: 0; top: 32px; z-index: 6; margin: 0; padding: 8px 10px; list-style: none; display: flex; flex-direction: column; gap: 6px; min-width: 110px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); box-shadow: 0 4px 14px rgba(0,0,0,.18); font-size: 12px; }
.map-legend li { display: flex; align-items: center; gap: 8px; }
.map-legend i { width: 18px; height: 0; border-top: 3px solid var(--drive); border-radius: 2px; }
.map-legend i[data-kind="charge"] { border-top-color: var(--charge); }
.map-legend i[data-kind="work"] { border-top-color: var(--work); border-top-style: double; }
.map-legend i[data-kind="wait"] { border-top-color: var(--wait); border-top-style: dashed; }
.map-legend i[data-kind="estop"] { border-top-color: var(--estop); }
.map-legend i[data-kind="robot"] { width: 12px; height: 12px; border: 2px solid var(--drive); border-radius: 4px; background: var(--panel); }
.map-legend i[data-kind="station"] { width: 16px; height: 10px; border: 2px solid var(--wall); border-radius: 3px; background: var(--panel); }
.map-legend i[data-kind="done"] { border-top-color: var(--mute); }
.map-legend i[data-kind="ahead"] { border-top-color: var(--mute); border-top-style: dotted; }
/* 지도 위 띠: 1399 아래에서 위로 내려 지도를 가리던 옛 규칙을 되돌려 늘 지도 위에 뜬다 */
.monitor-body .map-over.tr { position: absolute; right: 10px; top: 10px; max-width: calc(100% - 20px); padding: 0; justify-content: flex-end; background: none; border: 0; }
/* "맵 없음" 같은 안내는 세로로 늘어서지 않고 한 줄 칩이다 */
.map-cap, .map-empty { white-space: nowrap; max-width: calc(100% - 24px); overflow: hidden; text-overflow: ellipsis; writing-mode: horizontal-tb; }

/* ── 감시: 한 화면 안에서 끝낸다(지도 · 로봇 표는 제 칸에서만 스크롤) ── */
main.view > .monitor-body { flex: 1 1 0; min-height: 360px; flex-wrap: nowrap; align-items: stretch; }
.monitor-body > .mon-main { flex: 1 1 0; min-width: 0; min-height: 0; flex-direction: column; overflow: hidden; }
.monitor-body > .mon-main > .map-card { flex: 1 1 52%; min-height: 150px; align-self: stretch; display: flex; flex-direction: column; overflow: hidden; }
.monitor-body .map-wrap { flex: 1 1 0; min-height: 0; overflow: hidden; align-items: stretch; justify-content: center; }
.monitor-body .map-wrap svg { width: 100%; height: 100%; max-height: none; }
.monitor-body .map-cap { z-index: 3; }
.monitor-body .kpis { flex: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.monitor-body .kpis::-webkit-scrollbar { display: none; }
.monitor-body .cards-card { flex: 1 1 36%; min-height: 96px; overflow: auto; }
.monitor-body .insp { flex: 0 0 300px; min-height: 0; overflow-y: auto; }

/* ── 속성 패널: 1100px 아래는 오른쪽 서랍(왼쪽 28px 띠가 손잡이) ── */
@media (max-width: 1099px) {
  .insp, .lay-side { position: absolute; top: 0; right: 0; bottom: var(--statush); z-index: 30; max-width: none !important; width: min(360px, 88%); flex: none !important;
    overflow-y: auto; padding-left: 36px; border-top: 0; border-left: 1px solid var(--line); box-shadow: -6px 0 18px rgba(0,0,0,.18);
    transform: translateX(calc(100% - 28px)); transition: transform .18s ease; }
  html[data-insp="open"] .insp, html[data-insp="open"] .lay-side { transform: none; }
  .insp::before, .lay-side::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 28px; cursor: pointer; background:
    linear-gradient(var(--mute), var(--mute)) 12px center / 3px 36px no-repeat, var(--insp, var(--panel)); border-right: 1px solid var(--line2); }
  .insp > *:first-child, .lay-side > *:first-child { margin-top: 0; }
  main.view:has(.insp), main.view:has(.lay-side) { padding-right: 36px; }
  .monitor-body { display: flex; }
  .monitor-body .insp { flex: none; }
}

/* ── 1280×720 이하 낮은 창: 위 줄·표를 더 빽빽하게 ── */
@media (max-height: 760px) {
  .top { min-height: 40px; }
  .kpis { padding: 4px 12px; }
  .robot-row { padding-top: 6px; padding-bottom: 6px; }
}
.sv-unknown { color: var(--mute) !important; background: transparent; border-color: var(--line); border-style: dotted; }
.sv-note { margin-left: 6px; font-size: 11px; color: var(--mute); }
.robot-row[aria-current="true"] .sv-note { color: inherit; opacity: .85; }
td .sv-note, .insp-head .sv-note { display: inline; }

/* ── UI-B 지도와 경로 편집기: 아이콘 도구 · 우클릭 메뉴 · 종류 줄 · 단계 번호 ── */
.step-n { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; background: var(--line2, rgba(128,128,128,.25)); color: inherit; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1; }
.lay-steps > button[aria-pressed="true"] .step-n, .lay-acts .btn-primary .step-n { background: rgba(255,255,255,.28); }
.lay-acts [data-step]::before { content: attr(data-step); display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 6px; border-radius: 50%; background: var(--line2, rgba(128,128,128,.25)); font-size: 10px; font-weight: 700; line-height: 1; vertical-align: 1px; }
.lay-acts .btn-primary[data-step]::before { background: rgba(255,255,255,.28); }
.lay-acts .step-done::after, .lay-steps .step-done::after { content: " ✓"; margin-left: 4px; }
.lay-tools > .ib { width: 32px; height: 28px; min-width: 32px; padding: 0; display: inline-grid; place-items: center; }
.lay-tools > .ib svg, .kind-btn svg, .ctx-item svg, .lay-counts svg, .lay-foot svg, .lay-mode svg, .lay-main h2 svg, .lay-fold summary svg { flex: none; width: 16px; height: 16px; }
.lay-main h2 { display: flex; align-items: center; gap: 6px; }
.lay-main h2 svg { color: var(--mute); }
.kindbar { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin: 4px 0 10px; }
.kind-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 48px; padding: 6px 4px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--ink2); font-size: 11px; cursor: pointer; }
.kind-btn:hover { background: var(--line2); }
.kind-btn[aria-pressed="true"] { background: var(--sel); color: var(--acc); border-color: var(--acc); }
.lay-counts { display: flex; gap: 14px; color: var(--ink2); font-size: 13px; font-variant-numeric: tabular-nums; }
.lay-counts span, .lay-foot span { display: inline-flex; align-items: center; gap: 4px; }
.lay-mode { display: flex; align-items: center; gap: 6px; padding: 6px 16px 0; font-size: 12px; }
.ctx-menu { position: absolute; z-index: 6; min-width: 148px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); box-shadow: 0 6px 22px rgba(0,0,0,.28); display: flex; flex-direction: column; }
.ctx-menu hr { width: 100%; margin: 4px 0; border: 0; border-top: 1px solid var(--line2); }
.ctx-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; text-align: left; cursor: pointer; }
.ctx-item:hover, .ctx-item:focus-visible { background: var(--sel); }
.ctx-item span { flex: 1; }
.ctx-item.on b { color: var(--acc); }
.lay-legend-row { padding: 2px 12px; }
.lay-legend > summary { list-style: none; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 6px; cursor: pointer; color: var(--mute); }
.lay-legend > summary::-webkit-details-marker { display: none; }
.lay-legend[open] > summary { color: var(--acc); }
.lay-legend .legend { border-top: 0; padding: 4px 4px 6px; display: flex; flex-wrap: wrap; gap: 6px 14px; }
details.lay-fold > summary { list-style: none; cursor: pointer; display: flex; align-items: center; }
details.lay-fold > summary::-webkit-details-marker { display: none; }
details.lay-fold > summary h2 { margin: 0; flex: 1; }
details.lay-fold > summary::after { content: "▾"; color: var(--mute); transition: transform .12s; }
details.lay-fold:not([open]) > summary::after { transform: rotate(-90deg); }
details.lay-fold[open] > summary { margin-bottom: 8px; }
#lay-map [data-place] { cursor: crosshair; }
#lay-map:not(.placing) [data-place] { cursor: default; }
.lay-tabbar .lay-tab-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 0 1 auto; }
.lay-tabbar .rmaps-nopath { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; max-width: 28ch; flex: 0 1 auto; }
.lay-steps > button { min-width: 0; padding: 0 12px; white-space: nowrap; display: inline-flex; align-items: center; }
.lay-steps > button.step-done .step-n { background: var(--ok, #2e9d5b); color: #fff; }
