/* MSP 보안 점검 콘솔
   레이아웃: 고정 상단 바 + 섹션 탭 → 요약 타일 → (승인 대기 | 최근 요약) → 전체 FAIL → 추이 → (조치 이력 | 탐지)
   강조색(청록 계열 남색)은 조작 요소에만, 상태 색(위험/주의/정상)은 심각도에만 쓴다. */
:root {
  --bg: #f3f5f7;
  --panel: #ffffff;
  --raise: #fbfcfd;
  --fg: #142130;
  --muted: #5a6877;
  --faint: #8794a2;
  --line: #dfe4ea;
  --accent: #1b5e86;
  --accent-soft: #e6f0f6;
  --accent-fg: #ffffff;
  --bad: #c33a2e;
  --bad-soft: #fbecea;
  --warn: #a86400;
  --warn-soft: #fbf1e1;
  --ok: #217a4b;
  --ok-soft: #e6f4ec;
  --fix: #1b5e86;
  --grid: #e8ecf0;
  --shadow: 0 1px 2px rgba(20, 33, 48, .05), 0 4px 14px rgba(20, 33, 48, .05);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Segoe UI", "Noto Sans KR", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e141a; --panel: #151d25; --raise: #19232c; --fg: #e2e8ee; --muted: #97a4b1; --faint: #6c7a87; --line: #25313c;
    --accent: #62acd9; --accent-soft: #17303f; --accent-fg: #06141e;
    --bad: #ee7166; --bad-soft: #3a1f1d; --warn: #e2a443; --warn-soft: #36291a; --ok: #55c08a; --ok-soft: #173326; --fix: #62acd9;
    --grid: #1f2a34; --shadow: 0 1px 2px rgba(0,0,0,.3); color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { scroll-padding-top: 120px; }
body { background: var(--bg); color: var(--fg); font: 14px/1.55 var(--font); }
h1, h2 { margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1rem; font-weight: 650; }
.muted, .hint { color: var(--muted); }
.hint { font-size: 12px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* 상단 바 */
.bar { position: sticky; top: 0; z-index: 10; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-inner, .tabs-inner, .page { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.bar-inner { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding-block: 10px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.mark { width: 20px; height: 20px; border-radius: 5px; background: var(--accent); box-shadow: inset 0 0 0 4px var(--panel), inset 0 0 0 7px var(--accent); flex: none; }
.mark.big { width: 36px; height: 36px; border-radius: 9px; box-shadow: inset 0 0 0 7px var(--panel), inset 0 0 0 12px var(--accent); }
.env { font-size: 11px; font-weight: 650; color: var(--accent); background: var(--accent-soft); padding: 1px 7px; border-radius: 999px; letter-spacing: .04em; }
.bar-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.who { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12px; }
.role { font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.tabs { border-top: 1px solid var(--line); }
.tabs-inner { display: flex; gap: 2px; overflow-x: auto; }
.tabs a { color: var(--muted); text-decoration: none; font-size: 13px; padding: 9px 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--fg); border-bottom-color: var(--line); }

select, input[type="search"], textarea, .btn { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; }
select, input[type="search"] { padding: 6px 10px; }
input[type="search"] { min-width: 0; width: 220px; max-width: 100%; }
.btn { cursor: pointer; padding: 6px 12px; transition: border-color .15s, background .15s; }
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 650; }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.ghost { border-color: transparent; color: var(--muted); }
.btn.sm { padding: 4px 10px; font-size: 12px; }

/* 페이지 */
.page { padding-block: 22px 48px; }
#app { display: grid; gap: 18px; }
.center { display: grid; place-items: center; min-height: 60vh; }
.login-card { display: grid; gap: 14px; justify-items: start; max-width: 460px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: var(--shadow); }
.head { display: grid; gap: 6px; }
.head-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.posture { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.posture.bad { background: var(--bad-soft); color: var(--bad); }
.posture.warn { background: var(--warn-soft); color: var(--warn); }
.posture.ok { background: var(--ok-soft); color: var(--ok); }
.lede { margin: 0; max-width: 78ch; font-size: 15px; }
.lede b { font-variant-numeric: tabular-nums; }
.meta { margin: 0; font-size: 12px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px 13px; display: grid; gap: 1px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.tile::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--line); }
.tile.t-bad::before { background: var(--bad); }
.tile.t-warn::before { background: var(--warn); }
.tile.t-ok::before { background: var(--ok); }
.tile .k { font-size: 12px; color: var(--muted); }
.tile .v { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .s { font-size: 12px; color: var(--faint); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; min-width: 0; box-shadow: var(--shadow); align-content: start; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.split { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .split, .two { grid-template-columns: 1fr; } }

/* 승인 대기 큐 */
.queue { display: grid; gap: 10px; }
.qcard { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--raise); }
.qcard .what { display: grid; gap: 3px; min-width: 0; }
.qcard .title { font-weight: 650; }
.qcard .res { font-family: var(--mono); font-size: 12px; color: var(--muted); word-break: break-all; }
.qcard .impact-line { font-size: 12px; color: var(--warn); }
.qcard .go { display: grid; gap: 4px; justify-items: end; }
@media (max-width: 520px) { .qcard { grid-template-columns: 1fr; } .qcard .go { justify-items: start; } }

.ai-text { margin: 0; white-space: pre-line; line-height: 1.65; }

/* 표 */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { font: inherit; font-size: 12px; border: 0; background: transparent; color: var(--muted); padding: 5px 11px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 650; }
.scroll { overflow-x: auto; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 7px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--raise); }
.grid td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.grid tbody tr:hover td { background: var(--raise); }
.grid tr:last-child td { border-bottom: 0; }
.grid .r { text-align: right; }
.grid td.num { text-align: right; font-variant-numeric: tabular-nums; }
.grid td.when { white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 12px; }
.grid td.res { font-family: var(--mono); font-size: 12px; word-break: break-all; min-width: 16ch; max-width: 34ch; }
.grid td.act { text-align: right; white-space: nowrap; }
.mono { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.cmd { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 4px; word-break: break-all; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; letter-spacing: .02em; }
.c-CRITICAL, .c-HIGH, .c-FAILED { background: var(--bad-soft); color: var(--bad); }
.c-MEDIUM, .c-DRY_RUN, .c-SKIPPED { background: var(--warn-soft); color: var(--warn); }
.c-LOW, .c-INFO { background: var(--grid); color: var(--muted); }
.c-APPLIED { background: var(--ok-soft); color: var(--ok); }
.c-RUNNING { background: var(--accent-soft); color: var(--accent); }
.c-PARTIAL, .c-UNKNOWN { background: var(--warn-soft); color: var(--warn); }
.c-REJECTED { background: var(--grid); color: var(--muted); text-decoration: line-through; }
.via { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; margin-left: 4px; background: var(--grid); color: var(--muted); }
.tierlabel { font-size: 12px; font-weight: 650; white-space: nowrap; }
.tierlabel.appr { color: var(--warn); } .tierlabel.man { color: var(--muted); } .tierlabel.auto { color: var(--ok); }
.empty { margin: 0; color: var(--muted); font-size: 13px; }
.foot { font-size: 12px; color: var(--faint); }

/* 차트 */
.chart { position: relative; min-height: 230px; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .gl { stroke: var(--grid); }
.chart .ln-fail { stroke: var(--bad); fill: none; stroke-width: 2; }
.chart .ln-pass { stroke: var(--ok); fill: none; stroke-width: 2; }
.chart .area-fail { fill: var(--bad); opacity: .07; }
.chart .dot-fail { fill: var(--bad); } .chart .dot-pass { fill: var(--ok); }
.chart .bar-fix { fill: var(--fix); opacity: .8; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .end { font-weight: 700; font-size: 12px; }
.chart .end.f { fill: var(--bad); } .chart .end.p { fill: var(--ok); }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.sw.bad { background: var(--bad); } .sw.ok { background: var(--ok); } .sw.fix { background: var(--fix); }
.tip { position: absolute; top: 0; pointer-events: none; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font-size: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.14); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 승인 대화상자 */
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--panel); color: var(--fg); box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 18, 26, .45); }
dialog form { display: grid; gap: 12px; padding: 20px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; word-break: break-word; }
.impact { display: grid; gap: 2px; background: var(--warn-soft); color: var(--warn); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
textarea { width: 100%; padding: 8px 10px; resize: vertical; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; }
.check input { margin-top: 3px; }
.err { margin: 0; color: var(--bad); font-size: 13px; }
.dlg-actions { display: flex; gap: 8px; justify-content: flex-end; }

.toast { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 20; max-width: min(440px, calc(100vw - 32px)); background: var(--fg); color: var(--bg); border-radius: 10px; padding: 12px 14px; font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast.bad { background: var(--bad); color: #fff; }

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: rise .2s ease-out; }
  @keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
}
@media (max-width: 520px) {
  .tile .v { font-size: 26px; }
  input[type="search"] { width: 100%; }
}

.plan summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.plan pre { margin: 8px 0 4px; padding: 10px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 220px; overflow: auto; }
.exec-badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-right: 6px; background: var(--accent-soft); color: var(--accent); }

/* 실행 중 · 갱신 표시 */
.synced { font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.spin { display: inline-block; width: 10px; height: 10px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
@media (prefers-reduced-motion: no-preference) { .spin { animation: spin .8s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } } }
.btn.running { background: var(--accent-soft); color: var(--accent); border-color: transparent; opacity: 1; }

/* 이력 클릭 */
#rems tr { cursor: pointer; }
#rems tr:focus-visible td { background: var(--accent-soft); }

/* 최근 탐지 */
.feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.feed li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raise); }
.feed .t { font-family: var(--mono); font-size: 12px; word-break: break-all; }
.feed .r { font-size: 12px; color: var(--muted); word-break: break-all; }
.feed .when { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.page-badge { font-size: 10px; font-weight: 700; color: var(--bad); margin-left: 6px; }
.subhead { margin: 6px 0 0; font-size: 13px; font-weight: 650; color: var(--muted); }

/* 상세 패널 (오른쪽 서랍) */
dialog.drawer { margin: 0 0 0 auto; height: 100vh; max-height: 100vh; width: min(640px, 100vw); border-radius: 0; border-width: 0 0 0 1px; }
.drawer-body { display: grid; gap: 14px; padding: 20px max(20px, env(safe-area-inset-right)) 32px 20px; align-content: start; min-height: 100%; }
.drawer-head { display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.drawer h3 { margin: 0; font-size: 13px; font-weight: 650; color: var(--muted); }
.dt-sec { display: grid; gap: 6px; min-width: 0; }
.dt-row { display: flex; justify-content: space-between; align-items: center; }
.dt-sec pre { margin: 0; padding: 10px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.dt-states { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .dt-states { grid-template-columns: 1fr; } }
.drawer a { color: var(--accent); }

/* 실시간 토글 */
.live { display: inline-flex; gap: 6px; align-items: center; font: inherit; font-size: 12px; font-weight: 650; padding: 5px 10px; border-radius: 999px; cursor: pointer; border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.live[aria-pressed="true"] { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, transparent); background: var(--ok-soft); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live[aria-pressed="false"] .live-dot { background: var(--faint); }

/* 처리 흐름 */
.flow { gap: 16px; }
.stages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 18px; }
.stage { position: relative; display: grid; gap: 2px; padding: 12px 14px; background: var(--raise); border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.stage:not(:last-child)::after { content: "›"; position: absolute; right: -15px; top: 50%; transform: translateY(-55%); font-size: 20px; line-height: 1; color: var(--faint); }
.stage-top { display: flex; align-items: center; gap: 6px; }
.stage-label { font-size: 12px; font-weight: 650; color: var(--muted); }
.stage-n { font-size: 26px; font-weight: 700; line-height: 1.15; font-variant-numeric: tabular-nums; color: var(--faint); }
.stage-sub { font-size: 11px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stage.has .stage-n { color: var(--fg); }
.stage.live { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.stage.live .stage-n, .stage.live .stage-label { color: var(--accent); }
.stage.waiting { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.stage.waiting .stage-n, .stage.waiting .stage-label { color: var(--warn); }
.stage.okay .stage-n { color: var(--ok); }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
@media (max-width: 980px) {
  .stages { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stage::after { display: none; }
}
@media (max-width: 520px) { .stages { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.flow-body { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 980px) { .flow-body { grid-template-columns: 1fr; } }
.flow .subhead { margin: 0 0 8px; }

.cases { display: grid; gap: 8px; }
.case { display: grid; gap: 10px; padding: 12px 14px; border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 9px; background: var(--raise); }
.case.st-active { border-left-color: var(--accent); }
.case.st-wait { border-left-color: var(--warn); }
.case.st-fail { border-left-color: var(--bad); }
.case.st-done { border-left-color: var(--ok); opacity: .85; }
.case-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.case-head > .chip:first-child { margin-top: 2px; }
.case-title .t { font-weight: 650; overflow-wrap: anywhere; }
.case-title .r { font: 11px/1.4 var(--mono); color: var(--muted); word-break: break-all; }
.case-when { display: grid; justify-items: end; gap: 2px; }
.case-st { font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.case-st.st-active { background: var(--accent-soft); color: var(--accent); }
.case-st.st-wait { background: var(--warn-soft); color: var(--warn); }
.case-st.st-fail { background: var(--bad-soft); color: var(--bad); }
.case-st.st-done { background: var(--ok-soft); color: var(--ok); }
.case-st.st-idle { background: var(--grid); color: var(--muted); }
.elapsed { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }

.track { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.step { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; min-width: 0; }
.step::before { content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.step:first-child::before { display: none; }
.step.done::before, .step.active::before, .step.wait::before, .step.fail::before, .step.warn::before, .step.skip::before { background: var(--ok); }
.node { position: relative; z-index: 1; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800;
  background: var(--panel); border: 2px solid var(--line); color: var(--faint); }
.step.done .node { background: var(--ok); border-color: var(--ok); color: #fff; }
.step.skip .node { border-color: var(--ok); color: var(--ok); }
.step.active .node { border-color: var(--accent); background: var(--accent-soft); }
.step.active .node::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.step.wait .node { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.step.fail .node, .step.warn .node { border-color: var(--bad); background: var(--bad); color: #fff; }
.step.warn .node { border-color: var(--warn); background: var(--warn); }
.step-label { font-size: 11px; color: var(--faint); white-space: nowrap; }
.step.done .step-label, .step.skip .step-label { color: var(--muted); }
.step.active .step-label { color: var(--accent); font-weight: 700; }
.step.wait .step-label { color: var(--warn); font-weight: 700; }
.step.fail .step-label { color: var(--bad); font-weight: 700; }
.case-now { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.case-now b { margin-right: 4px; color: var(--fg); }
.case-now.active b { color: var(--accent); } .case-now.wait b { color: var(--warn); } .case-now.fail b { color: var(--bad); }
.case-go { display: flex; justify-content: flex-end; margin-top: -4px; }

.activity { list-style: none; margin: 0; padding: 0; display: grid; max-height: 560px; overflow-y: auto; }
.act { display: grid; grid-template-columns: 42px 14px minmax(0, 1fr); gap: 6px; align-items: start; padding: 6px 4px; border-radius: 6px; position: relative; }
.act::before { content: ""; position: absolute; left: 54px; top: 0; bottom: 0; width: 2px; background: var(--grid); }
.act:first-child::before { top: 14px; }
.act:last-child::before { bottom: calc(100% - 14px); }
.act-time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; }
.act-dot { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; margin: 5px 0 0 2px; background: var(--faint); box-shadow: 0 0 0 3px var(--panel); }
.act.t-bad .act-dot { background: var(--bad); } .act.t-warn .act-dot { background: var(--warn); } .act.t-ok .act-dot { background: var(--ok); }
.act.t-acc .act-dot, .act.t-ai .act-dot { background: var(--accent); }
.act-line { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.act-kind { font-size: 10px; font-weight: 700; padding: 0 6px; border-radius: 999px; background: var(--grid); color: var(--muted); white-space: nowrap; }
.act.t-ai .act-kind { background: var(--accent-soft); color: var(--accent); }
.act-text { font-size: 13px; overflow-wrap: anywhere; }
.act-sub { font-size: 11px; color: var(--muted); overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.act.fresh { background: var(--accent-soft); }

@media (prefers-reduced-motion: no-preference) {
  .pulse, .step.active .node::after, .live[aria-pressed="true"] .live-dot { animation: pulse 1.4s ease-in-out infinite; }
  @keyframes pulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
  .act.fresh { animation: fresh 6s ease-out forwards; }
  @keyframes fresh { from { background: var(--accent-soft); } to { background: transparent; } }
}

/* 계정 · 계정 추가 */
.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.p-ok { background: var(--ok-soft); color: var(--ok); } .p-warn { background: var(--warn-soft); color: var(--warn); }
.p-bad { background: var(--bad-soft); color: var(--bad); } .p-acc { background: var(--accent-soft); color: var(--accent); }
.p-muted { background: var(--grid); color: var(--muted); }
.warn-t { color: var(--warn); }
dialog.drawer.wide { width: min(820px, 100vw); }
.ob-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.ob-steps li { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--faint); padding: 8px 10px; border-radius: 8px; background: var(--raise); border: 1px solid var(--line); }
.ob-steps i { font-style: normal; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; border: 2px solid var(--line); flex: none; }
.ob-steps li.cur { color: var(--accent); font-weight: 700; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.ob-steps li.cur i { border-color: var(--accent); }
.ob-steps li.done { color: var(--muted); }
.ob-steps li.done i { background: var(--ok); border-color: var(--ok); color: #fff; font-size: 0; }
.ob-steps li.done i::after { content: "✓"; font-size: 11px; }
@media (max-width: 640px) { .ob-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ob-pane { display: grid; gap: 14px; }
.ob-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
@media (max-width: 640px) { .ob-grid { grid-template-columns: 1fr; } }
.ob-grid label, .ob-pane > label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ob-grid input, .ob-grid select { font: inherit; color: var(--fg); background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 7px 10px; }
.ob-grid input:invalid:not(:placeholder-shown) { border-color: var(--bad); }
fieldset { border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px 12px; margin: 0; display: grid; gap: 6px; }
legend { font-size: 12px; font-weight: 650; color: var(--muted); padding: 0 4px; }
#ob-extra { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.check.inline { font-family: var(--mono); font-size: 12px; }
.dlg-actions.start { justify-content: flex-start; align-items: center; }
.lead-t { margin: 0; font-size: 14px; }
.ob-check { margin: 0; padding: 0 0 0 22px; display: grid; gap: 16px; }
.ob-check > li { display: grid; gap: 8px; justify-items: start; }
.ob-check > li::marker { font-weight: 700; color: var(--accent); }
.ck-t { font-weight: 650; }
.ck-d { margin: 0; font-size: 13px; color: var(--muted); }
.ck-list { margin: 0; padding-left: 18px; font-size: 13px; display: grid; gap: 2px; }
table.params { font-size: 12px; }
table.params td { padding: 5px 8px; vertical-align: middle; }
table.params td.k { color: var(--muted); white-space: nowrap; }
table.params td.mono { word-break: break-all; }
table.params td.r { white-space: nowrap; text-align: right; }
table.params .btn + .btn { margin-left: 4px; }
.cmd-block { position: relative; width: 100%; }
.cmd-block pre { margin: 0; padding: 10px 12px; padding-right: 92px; background: var(--raise); border: 1px solid var(--line); border-radius: 8px; font: 11.5px/1.55 var(--mono); white-space: pre-wrap; word-break: break-all; }
.cmd-block .btn { position: absolute; top: 8px; right: 8px; }
.probe { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.probe li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--raise); }
.pr-ic { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--faint); }
.pr-ok .pr-ic { background: var(--ok); } .pr-warn .pr-ic { background: var(--warn); } .pr-fail .pr-ic { background: var(--bad); }
.pr-info .pr-ic { background: var(--grid); color: var(--muted); }
.pr-fail { border-color: color-mix(in srgb, var(--bad) 45%, transparent) !important; }
.pr-t { font-weight: 650; font-size: 13px; display: flex; gap: 8px; align-items: baseline; }
.pr-r { font: 11px var(--mono); color: var(--faint); font-weight: 400; }
.pr-need { font-size: 12px; color: var(--warn); margin-top: 2px; }
.ob-state { padding: 10px 12px; border-radius: 8px; font-size: 13px; }
.ob-state.s-busy { background: var(--accent-soft); color: var(--accent); }
.ob-state.s-done { background: var(--ok-soft); color: var(--ok); }
.ob-state.s-fail { background: var(--bad-soft); color: var(--bad); }

/* 자율운영 지표 */
.auto-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; }
.auto-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.auto-kpi { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 2px; }
.auto-kpi .k { font-size: 12px; color: var(--muted); }
.auto-kpi .v { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.auto-kpi .s { font-size: 12px; color: var(--muted); }
.auto-kpi.bad .v { color: var(--bad); } .auto-kpi.ok .v { color: var(--ok); }
.auto-crit { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.auto-crit li { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; padding: 6px 10px; border-radius: 8px; background: var(--bad-soft); }
.auto-crit li.ok { background: var(--ok-soft); }
.auto-crit li b { font-variant-numeric: tabular-nums; }
.auto-verdict { margin: 8px 0 0; font-size: 13.5px; }
@media (max-width: 760px) { .auto-grid { grid-template-columns: minmax(0, 1fr); } }
.ob-pane > label.check { display: flex; color: var(--fg); }
.ob-grid label .hint { font-size: 11px; color: var(--faint); }

/* 카드 버튼 · 확인 처리 */
.case-go { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: -2px; }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); background: var(--bad-soft); }
.btn.primary.danger, #act-ok.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.btn.ok:hover:not(:disabled) { border-color: var(--ok); background: var(--ok-soft); }
.case.st-rejected { border-left-color: var(--faint); }
.case.st-acked { border-left-color: var(--ok); opacity: .8; }
.case.st-idle { border-left-color: var(--warn); }
.case-st.st-rejected { background: var(--grid); color: var(--muted); }
.case-st.st-acked { background: var(--ok-soft); color: var(--ok); }
.case-st.st-idle { background: var(--warn-soft); color: var(--warn); }
.step.rej .node { border-color: var(--faint); background: var(--grid); color: var(--muted); }
.step.rej .step-label { color: var(--muted); font-weight: 700; }
.step.rej::before { background: var(--ok); }
.case-now.rej b { color: var(--muted); }
.case-ack { font-size: 12px; color: var(--muted); padding: 6px 10px; border-radius: 7px; background: var(--ok-soft); overflow-wrap: anywhere; }
.case-ack b { color: var(--ok); margin-right: 4px; }
#act-target { margin: 0; color: var(--muted); }

/* 카드 작업 진행 · 재점검 결과 */
.case.busy { border-left-color: var(--accent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.case-job { display: grid; gap: 6px; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); }
.job-line { display: flex; gap: 8px; align-items: center; font-size: 13px; }
.job-sec { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 700; }
.job-detail { font-size: 12px; color: var(--muted); }
.job-bar { position: relative; height: 3px; border-radius: 3px; background: color-mix(in srgb, var(--accent) 20%, transparent); overflow: hidden; }
.job-bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 35%; border-radius: 3px; background: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
  .job-bar::after { animation: indet 1.3s ease-in-out infinite; }
  @keyframes indet { from { left: -35%; } to { left: 100%; } }
}
.case-rc { font-size: 12px; padding: 6px 10px; border-radius: 7px; overflow-wrap: anywhere; color: var(--muted); }
.case-rc.pass { background: var(--ok-soft); } .case-rc.pass b { color: var(--ok); }
.case-rc.fail { background: var(--bad-soft); } .case-rc.fail b { color: var(--bad); }
.case-rc b { margin-right: 4px; }

/* 기록 탭 (조치 이력 · 탐지 · 유형별) — 전체 폭 한 패널 */
.records { gap: 10px; }
.rtabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rtabs button { font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 12px 8px; cursor: pointer; margin-bottom: -1px; }
.rtabs button:hover { color: var(--fg); }
.rtabs button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); }
.rtabs .cnt { font-size: 11px; font-weight: 700; padding: 0 7px; border-radius: 999px; background: var(--grid); color: var(--muted); margin-left: 4px; }
.rtabs .cnt:empty { display: none; }
.rtable { table-layout: fixed; }
.rtable col.c-when { width: 108px; } .rtable col.c-item { width: 30%; } .rtable col.c-mode { width: 170px; } .rtable col.c-res { width: 120px; } .rtable col.c-sev { width: 96px; }
.rtable td { font-size: 13px; }
.rtable td.item { min-width: 0; }
.it-t { font-weight: 600; overflow-wrap: anywhere; }
.it-id { font: 11px/1.4 var(--mono); color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.it-res { font: 12px/1.4 var(--mono); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rtable td.detail { overflow-wrap: anywhere; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.has-rb { font-size: 11px; color: var(--accent); margin-top: 4px; }
#rems tr { cursor: pointer; }
@media (max-width: 860px) { .rtable { table-layout: auto; } .rtable col { width: auto !important; } }

/* 승인 전 변경 미리보기 */
#approve-dlg, #act-dlg { width: min(820px, calc(100vw - 32px)); }
.pv { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--raise); }
.pv-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.pv-loading { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--accent); }
.pv-err { margin: 0; font-size: 12px; color: var(--warn); }
.pv-sum { display: flex; gap: 6px; flex-wrap: wrap; }
.pv-chip { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--grid); color: var(--muted); }
.pv-chip.k-remove { background: var(--bad-soft); color: var(--bad); }
.pv-chip.k-change { background: var(--accent-soft); color: var(--accent); }
.pv-chip.k-add { background: var(--ok-soft); color: var(--ok); }
.pv-chip.k-check { background: var(--warn-soft); color: var(--warn); }
.pv-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.pv-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.pv-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pv-table tr:last-child td { border-bottom: 0; }
.pv-table .arr { width: 18px; color: var(--faint); text-align: center; padding-inline: 0; }
.pv-item { display: grid; gap: 3px; justify-items: start; }
.pv-item .mono { word-break: break-all; }
.pv-table tr.k-remove .pv-after { color: var(--bad); font-weight: 700; }
.pv-table tr.k-remove .pv-before { text-decoration: line-through; color: var(--muted); }
.pv-table tr.k-change .pv-after, .pv-table tr.k-add .pv-after { color: var(--accent); font-weight: 700; }
.pv-table tr.k-check .pv-after { color: var(--warn); font-weight: 600; }
.pv-table tr.k-keep td { color: var(--muted); }
.pv-calls, .pv-rb { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.pv-calls b { color: var(--fg); }
.auto-note { font-size: 12.5px; color: var(--ok); background: var(--ok-soft); padding: 4px 10px; border-radius: 999px; }
