/* 안티바이오 내비 · 독립 개발 관제판 (cdss) — 병동 차트 톤 */

:root {
  --bg: #F3F6F7;
  --surface: #FFFFFF;
  --text: #0F2A33;
  --muted: #5E7480;
  --line: #D5DEE2;
  --primary: #0E6B7A;
  --accent: #F2B84B;
  --ok: #1E9C6B;
  --warn: #D98E04;
  --danger: #C2362B;
  --protect: #7A1F1F;

  --ok-ink: #12704C;
  --warn-ink: #7A4E00;
  --primary-soft: #E2F0F2;
  --ok-soft: #E3F4EC;
  --warn-soft: #FDF2DC;
  --danger-soft: #FBEAE8;
  --protect-soft: #F7EBEB;
  --line-strong: #B9C8CE;
  --hatch: repeating-linear-gradient(135deg, rgba(122, 31, 31, .11) 0 5px, transparent 5px 11px);

  --radius: 8px;
  --sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --wrap: 1200px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body.cdss {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: break-word;
}

:where(.cdss) :is(h1, h2, h3, p) { margin: 0; }
:where(.cdss) code { font-family: var(--mono); }
:where(.cdss) button { font: inherit; color: inherit; }
.cdss [hidden] { display: none !important; }
.cd-mono { font-family: var(--mono); letter-spacing: -.01em; }
.cd-ico { flex: none; display: inline-block; vertical-align: middle; }

/* 잠금 표시 공통: 자물쇠 + 사선 무늬 */
.locked { background-image: var(--hatch); }
.locked-edge {
  background-color: var(--surface);
  background-image: linear-gradient(90deg, transparent 0 var(--edge, 12px), var(--surface) var(--edge, 12px)), var(--hatch);
}

/* ───────── 헤더 ───────── */

.cd-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(6px);
}

.cd-header__inner {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.cd-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  flex: none;
}
.cd-brand__mark { display: block; }
.cd-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.cd-brand__name { font-weight: 700; font-size: 16px; }
.cd-brand__sub { font-size: 13px; color: var(--muted); }

.cd-nav { display: flex; gap: 4px; height: 100%; }
.cd-nav__link {
  display: flex;
  align-items: center;
  padding: 0 14px;
  height: 100%;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
}
.cd-nav__link:hover { color: var(--text); }
.cd-nav__link.is-active { color: var(--primary); border-bottom-color: var(--primary); }

.cd-header__tools { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.cd-prod {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(122, 31, 31, .35);
  border-radius: var(--radius);
  color: var(--protect);
  font-size: 14px;
  font-weight: 600;
  background-color: var(--surface);
}
.cd-prod b { font-weight: 600; }

/* ───────── 버튼·태그 ───────── */

.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.cd-btn:focus-visible, .cd-node__btn:focus-visible, .cd-cell:focus-visible, .cd-scn:focus-visible,
.cd-segs__tab:focus-visible, .cd-scope__tab:focus-visible, .cd-fab:focus-visible, .cd-map__where:focus-visible {
  outline: 3px solid rgba(14, 107, 122, .45);
  outline-offset: 2px;
}
.cd-btn--sm { min-height: 40px; padding: 0 12px; font-size: 14px; }
.cd-btn--lg { min-height: 48px; padding: 0 22px; }
.cd-btn--primary { background: var(--primary); color: #fff; }
.cd-btn--primary:hover { background: #0B5A67; }
.cd-btn--warn { background: var(--accent); color: var(--text); border-color: #D9A23D; }
.cd-btn--warn:hover { background: #EDAA2E; }
.cd-btn--ghost { background: var(--surface); border-color: var(--line-strong); color: var(--text); }
.cd-btn--ghost:hover { border-color: var(--primary); color: var(--primary); }
.cd-btn--outline { background: var(--surface); border-color: var(--primary); color: var(--primary); }
.cd-btn:disabled { background: #E4EAED; color: #5B6F79; border-color: #E4EAED; cursor: not-allowed; }

.cd-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  border: 1px solid transparent;
}
.cd-tag--ok { background: var(--ok-soft); color: var(--ok-ink); }
.cd-tag--warn { background: var(--warn-soft); color: var(--warn-ink); }
.cd-tag--danger { background: var(--danger-soft); color: var(--danger); }
.cd-tag--muted { background: #EDF2F4; color: #4E636D; }
.cd-tag--live { background: var(--primary); color: #fff; }
.cd-tag--protect { background: var(--protect-soft); color: var(--protect); border-color: rgba(122, 31, 31, .25); }
.cd-tag--protect-solid { background: var(--protect); color: #fff; }

.cd-mock {
  display: inline-block;
  padding: 1px 7px;
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #4E636D;
  background: var(--surface);
  vertical-align: 2px;
  letter-spacing: 0;
}

/* ───────── 본문 틀 ───────── */

.cd-main {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 40px 24px 48px;
}

.cd-head { max-width: 820px; margin-bottom: 28px; }
.cd-eyebrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: .02em;
  margin-bottom: 8px;
}
.cd-head h1 { font-size: 28px; line-height: 1.35; font-weight: 700; letter-spacing: -.02em; }
.cd-lead { margin-top: 10px; color: #3F5862; font-size: 17px; }

.cd-section-title { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }

.cd-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}
.cd-card__head { margin-bottom: 16px; }
.cd-card__head h2 { font-size: 20px; display: flex; align-items: center; gap: 8px; }
.cd-card__head p { margin-top: 4px; color: var(--muted); font-size: 15px; }

.cd-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 32px; }

.cd-note {
  margin-top: 16px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  background: var(--warn-soft);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
  color: #45391F;
}

/* ───────── 변경 실습: 시나리오 ───────── */

.cd-scenarios { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

.cd-scn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background-color: var(--surface);
  cursor: pointer;
  min-height: 44px;
}
.cd-scn:hover { border-color: var(--line-strong); }
.cd-scn.is-selected { border: 2px solid var(--primary); padding: 17px 19px; box-shadow: 0 0 0 4px var(--primary-soft); }
.cd-scn--locked { --band: 76px; background-image: linear-gradient(90deg, var(--surface) 0 calc(100% - var(--band)), transparent calc(100% - var(--band))), var(--hatch); padding-right: calc(var(--band) + 20px); }
.cd-scn--locked.is-selected { padding-right: calc(var(--band) + 19px); }
.cd-scn__band { position: absolute; top: 0; right: 0; bottom: 0; width: var(--band); display: grid; place-items: center; border-left: 1px dashed rgba(122, 31, 31, .35); }
.cd-scn__band span { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--protect); color: #fff; }
.cd-scn--locked.is-selected { border-color: var(--protect); box-shadow: 0 0 0 4px var(--protect-soft); }
.cd-scn__top { display: flex; align-items: center; gap: 10px; }
.cd-scn__no { font-size: 20px; font-weight: 700; color: var(--primary); }
.cd-scn--locked .cd-scn__no { color: var(--protect); }
.cd-scn__title { font-size: 18px; font-weight: 700; }
.cd-scn__path { font-size: 14px; color: #3F5862; }
.cd-scn__sum { font-size: 15px; color: var(--muted); }

/* ───────── 변경 실습: 레일 카드 ───────── */

.cd-railcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.cd-railcard__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}
.cd-railcard__meta { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.cd-railcard__head h2 { font-size: 20px; margin-top: 2px; }

.cd-tape {
  display: grid;
  grid-template-columns: auto auto;
  column-gap: 10px;
  align-items: baseline;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(122, 31, 31, .3);
  background-color: var(--surface);
  background-image: var(--hatch);
  text-align: right;
}
.cd-tape__label { font-size: 13px; font-weight: 600; color: var(--protect); }
.cd-tape__ver { font-size: 24px; font-weight: 600; color: var(--protect); line-height: 1.1; }
.cd-tape__note { grid-column: 1 / -1; font-size: 13px; color: #4E636D; }
.cd-tape.is-live .cd-tape__ver { color: var(--primary); }
.cd-tape.is-restored .cd-tape__note { color: var(--warn-ink); font-weight: 600; }

/* 레일 */
.cd-railwrap { position: relative; padding: 28px 16px 22px; background: #F8FAFB; border-bottom: 1px solid var(--line); }
.cd-rail { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); position: relative; z-index: 1; }

.cd-rail__track {
  position: absolute;
  z-index: 0;
  top: calc(28px + 21px);
  left: calc(16px + (100% - 32px) / 14);
  right: calc(16px + (100% - 32px) / 14);
  height: 6px;
  border-radius: 3px;
  background: #DCE4E8;
  overflow: hidden;
}
.cd-rail__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: calc(var(--fill, 0) * 100%);
  background: var(--primary);
  border-radius: 3px;
  transition: width .7s cubic-bezier(.3, .7, .2, 1);
}
.cd-rail__return {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(90deg, var(--accent) 0 10px, transparent 10px 16px);
  opacity: 0;
  transition: opacity .35s ease .65s;
}
.cd-railwrap.is-rewound .cd-rail__return { opacity: 1; }
.cd-railwrap.is-rewound .cd-rail__fill { transition-duration: 1.1s; }
.cd-railwrap.is-blocked .cd-rail__fill { background: var(--danger); }
.cd-railwrap.is-instant .cd-rail__fill,
.cd-railwrap.is-instant .cd-rail__return { transition: none; }

.cd-node { display: flex; justify-content: center; min-width: 0; }
.cd-node__btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 150px;
  padding: 0 4px 8px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  cursor: pointer;
  text-align: center;
}
.cd-node__btn:disabled { cursor: default; }
.cd-node--locked .cd-node__btn {
  background-image: var(--hatch);
  box-shadow: inset 0 0 0 1px rgba(122, 31, 31, .28);
  padding-top: 0;
}

.cd-node__dot {
  position: relative;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--surface);
  color: #4E636D;
  transition: background-color .2s, border-color .2s, color .2s;
}
.cd-node__num { font-size: 16px; font-weight: 600; }
.cd-node__i { display: none; }
.cd-node__lock {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--protect);
  color: #fff;
  border: 2px solid var(--surface);
}
.cd-node__text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cd-node__label { font-size: 15px; font-weight: 700; line-height: 1.3; }
.cd-node__state { font-size: 13px; font-weight: 600; color: #4E636D; }

.cd-node[data-status="done"] .cd-node__dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.cd-node[data-status="done"] .cd-node__num { display: none; }
.cd-node[data-status="done"] .cd-node__i--done { display: block; }
.cd-node[data-status="done"] .cd-node__state { color: var(--primary); }

.cd-node[data-status="current"] .cd-node__dot { border: 3px solid var(--primary); color: var(--primary); box-shadow: 0 0 0 5px var(--primary-soft); }
.cd-node[data-status="current"] .cd-node__state { color: var(--primary); }

.cd-node[data-status="blocked"] .cd-node__dot { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 0 0 5px var(--danger-soft); }
.cd-node[data-status="blocked"] .cd-node__num { display: none; }
.cd-node[data-status="blocked"] .cd-node__i--blocked { display: block; }
.cd-node[data-status="blocked"] .cd-node__state { color: var(--danger); }

.cd-node[data-status="halted"] .cd-node__dot { border-style: dashed; background-color: #F1F4F5; background-image: var(--hatch); }
.cd-node[data-status="halted"] .cd-node__num { display: none; }
.cd-node[data-status="halted"] .cd-node__i--halted { display: block; }
.cd-node[data-status="halted"] .cd-node__label { color: #4E636D; }

.cd-node[data-status="rewound"] .cd-node__dot { border-style: dashed; border-color: #C79A3C; color: var(--warn-ink); }
.cd-node[data-status="rewound"] .cd-node__num { display: none; }
.cd-node[data-status="rewound"] .cd-node__i--rewound { display: block; }
.cd-node[data-status="rewound"] .cd-node__state { color: var(--warn-ink); }

.cd-node[data-status="recovered"] .cd-node__dot { background: var(--accent); border-color: #D9A23D; color: var(--text); box-shadow: 0 0 0 5px var(--warn-soft); }
.cd-node[data-status="recovered"] .cd-node__num { display: none; }
.cd-node[data-status="recovered"] .cd-node__i--rewound { display: block; }
.cd-node[data-status="recovered"] .cd-node__state { color: var(--warn-ink); }

.cd-node.is-viewing .cd-node__label { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--primary); }

/* 단계 패널 */
.cd-stage { padding: 28px 24px 8px; }
.cd-panel { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 32px; }
.cd-panel[hidden] { display: none; }
.cd-panel--wide { grid-template-columns: minmax(0, 1fr); }
.cd-panel__main { min-width: 0; }
.cd-panel__step { font-size: 14px; font-weight: 700; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cd-panel h3 { font-size: 20px; line-height: 1.4; margin-bottom: 16px; }
.cd-panel__text { color: #3F5862; margin: 16px 0 0; }

.cd-panel__aside { border-left: 1px solid var(--line); padding-left: 24px; }
.cd-who { margin: 0; display: grid; gap: 14px; }
.cd-who dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.cd-who dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }

.cd-ask {
  margin: 0 0 16px;
  padding: 16px 18px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  border: 1px solid #C5DFE3;
  font-size: 17px;
  line-height: 1.65;
}
.cd-ask__who { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }

.cd-facts { margin: 0; display: grid; gap: 10px; }
.cd-facts > div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: baseline; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.cd-facts > div:last-child { border-bottom: 0; padding-bottom: 0; }
.cd-facts dt { font-size: 14px; color: var(--muted); font-weight: 600; }
.cd-facts dd { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cd-facts dd code { font-size: 14px; }
.cd-facts--tight > div { grid-template-columns: 100px minmax(0, 1fr); }

.cd-diff { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cd-diff__head { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; background: #F1F5F6; border-bottom: 1px solid var(--line); font-size: 14px; }
.cd-plus { color: var(--ok-ink); }
.cd-minus { color: var(--danger); }
.cd-diff__body { margin: 0; padding: 8px 0; font-size: 14px; line-height: 1.75; overflow-x: auto; background: var(--surface); }
.cd-ln { display: block; padding: 0 14px; white-space: pre; }
.cd-ln i { display: inline-block; width: 28px; color: #7C8E97; font-style: normal; user-select: none; }
.cd-ln--del { background: var(--danger-soft); color: #8E2219; }
.cd-ln--add { background: var(--ok-soft); color: #0E5A3D; }

.cd-mini-checks { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.cd-mini-checks li { display: flex; align-items: flex-start; gap: 8px; font-size: 15px; }
.cd-mini-checks .cd-ico { color: var(--ok); margin-top: 3px; }
.cd-mini-checks code { font-size: 14px; }

.cd-checks { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); }
.cd-check { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.cd-check:last-child { border-bottom: 0; }
.cd-check__icon { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok-ink); }
.cd-check__spin { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--primary); }
.cd-check__main { display: flex; flex-direction: column; gap: 2px; }
.cd-check__main code { font-size: 14px; color: #3F5862; }
.cd-check__note { font-size: 14px; color: var(--muted); }
.cd-check__res { text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.cd-check__label { font-weight: 700; color: var(--ok-ink); }
.cd-check__time { font-size: 13px; color: var(--muted); }
.cd-check[data-state="wait"] .cd-check__icon { background: #EDF2F4; color: transparent; }
.cd-check[data-state="wait"] .cd-check__ok { display: none; }
.cd-check[data-state="wait"] .cd-check__label, .cd-check[data-state="wait"] .cd-check__time { visibility: hidden; }
.cd-check[data-state="run"] .cd-check__icon { background: var(--primary-soft); }
.cd-check[data-state="run"] .cd-check__ok { display: none; }
.cd-check[data-state="run"] .cd-check__spin { display: block; }
.cd-check__running { display: none; font-weight: 700; color: var(--primary); }
.cd-check[data-state="run"] .cd-check__label { display: none; }
.cd-check[data-state="run"] .cd-check__running { display: inline; }
.cd-check[data-state="run"] .cd-check__time { visibility: hidden; }

.cd-browser { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; max-width: 560px; }
.cd-browser__bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #EEF3F4; border-bottom: 1px solid var(--line); }
.cd-browser__dots { display: flex; gap: 5px; }
.cd-browser__dots i { width: 9px; height: 9px; border-radius: 50%; background: #C3CFD4; }
.cd-browser__url { flex: 1; min-width: 0; font-size: 13px; padding: 4px 10px; background: var(--surface); border-radius: 6px; border: 1px solid var(--line); color: #3F5862; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cd-browser__page { position: relative; padding: 28px 20px 30px; background: linear-gradient(180deg, #F6F9FA, #EAF1F3); }
.cd-login { width: min(280px, 100%); margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; flex-direction: column; gap: 8px; align-items: stretch; text-align: center; }
.cd-login svg { margin: 0 auto; }
.cd-login__title { font-weight: 700; margin-bottom: 4px; }
.cd-login__field { display: block; text-align: left; height: 38px; line-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; font-size: 14px; color: #7C8E97; }
.cd-login__btn { display: block; height: 40px; line-height: 40px; border-radius: 6px; background: var(--primary); color: #fff; font-weight: 600; font-size: 15px; }
.cd-login__help { font-size: 14px; margin-top: 4px; }
.cd-login__help mark { background: #FCE7B6; color: var(--text); padding: 1px 3px; border-radius: 3px; }
.cd-browser__pin { position: absolute; right: 14px; bottom: 12px; font-size: 13px; font-weight: 700; color: var(--warn-ink); background: var(--warn-soft); border: 1px solid #EBC676; border-radius: 6px; padding: 2px 8px; }

.cd-approve { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: grid; gap: 14px; }
.cd-approve__sum { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cd-approve__sum li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 15px; }
.cd-approve__sum code { font-size: 13px; }
.cd-confirm { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 14px; border: 2px solid var(--primary); border-radius: var(--radius); background: var(--primary-soft); font-weight: 700; cursor: pointer; }
.cd-confirm input { width: 22px; height: 22px; accent-color: var(--primary); flex: none; margin: 0; }
.cd-approve__who { display: flex; gap: 6px; align-items: flex-start; font-size: 14px; color: var(--protect); }
.cd-approve__who .cd-ico { margin-top: 3px; }

.cd-prodbox { --edge: 14px; border: 2px solid var(--protect); border-radius: var(--radius); padding: 18px 20px 18px 34px; }
.cd-prodbox__tag { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: #fff; background: var(--protect); border-radius: 6px; padding: 2px 8px; margin-bottom: 10px; }
.cd-prodbox h3 { margin-bottom: 12px; }
.cd-prodbox .cd-facts > div { border-bottom-color: rgba(122, 31, 31, .2); }

.cd-flip { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 10px; }
.cd-flip__from { font-size: 24px; color: #7C8E97; text-decoration: line-through; text-decoration-thickness: 2px; }
.cd-flip__icon { color: var(--warn); }
.cd-flip__to { font-size: 32px; font-weight: 600; color: var(--text); }

/* 시나리오 ②: 차단 */
.cd-blocked {
  border: 2px solid var(--protect);
  border-radius: var(--radius);
  background-color: var(--protect-soft);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.cd-blocked__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 18px; font-weight: 700; color: var(--protect); }
.cd-blocked__title code { background: #fff; padding: 0 6px; border-radius: 4px; }
.cd-blocked__ai { margin-top: 10px; padding: 12px 14px; border-radius: 6px; background: var(--surface); font-size: 15px; border: 1px solid rgba(122, 31, 31, .2); }
.cd-blocked__ai b { display: block; font-size: 13px; color: var(--muted); }
.cd-guards__title { margin-bottom: 4px !important; }
.cd-guards { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.cd-guard { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.cd-guard.is-fired { --edge: 10px; border: 2px solid var(--protect); padding: 15px 15px 15px 25px; background-image: linear-gradient(90deg, transparent 0 10px, var(--surface) 10px), var(--hatch); }
.cd-guard__no { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: #EDF2F4; font-weight: 600; font-size: 14px; }
.cd-guard.is-fired .cd-guard__no { background: var(--protect); color: #fff; }
.cd-guard__main { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.cd-guard__main b { font-size: 16px; }
.cd-guard__main code { font-size: 13px; color: #3F5862; word-break: break-all; }
.cd-guard__rule { font-size: 14px; font-weight: 600; }
.cd-guard__detail { font-size: 14px; color: #3F5862; }
.cd-guard .cd-tag { align-self: flex-start; white-space: normal; }

.cd-request { margin-top: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cd-request__done { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; color: var(--ok-ink); background: var(--ok-soft); padding: 10px 14px; border-radius: var(--radius); }
.cd-request__done[hidden] { display: none; }

/* 실행 줄 */
.cd-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px 24px 24px; }
.cd-actions__hint { font-size: 15px; color: #3F5862; }

/* 보호 영역·버전 */
.cd-protect { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cd-protect__row { --edge: 58px; display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px 26px; align-items: center; padding: 12px 14px 12px 12px; border-radius: var(--radius); border: 1px solid rgba(122, 31, 31, .25); }
.cd-protect__lock { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--protect); color: #fff; }
.cd-protect__main { display: flex; flex-direction: column; min-width: 0; }
.cd-protect__main code { font-size: 14px; font-weight: 600; word-break: break-all; }
.cd-protect__main span { font-size: 14px; color: #3F5862; }

.cd-versions { list-style: none; margin: 0; padding: 0; }
.cd-versions__row { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.cd-versions__row:last-child { border-bottom: 0; }
.cd-versions__ver { font-weight: 600; font-size: 16px; }
.cd-versions__main { display: flex; flex-direction: column; }
.cd-versions__main span { font-size: 14px; color: var(--muted); }

/* ───────── 접근권한 시험 ───────── */

.cd-access__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.cd-segs { display: inline-flex; padding: 4px; background: #E3EAED; border-radius: 10px; gap: 4px; max-width: 100%; overflow-x: auto; }
.cd-segs__tab { min-height: 44px; padding: 0 16px; border: 0; border-radius: var(--radius); background: transparent; font-weight: 600; font-size: 15px; color: #3F5862; cursor: pointer; white-space: nowrap; }
.cd-segs__tab.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 2px rgba(15, 42, 51, .12); }

.cd-pane__top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.cd-pane__how { color: #3F5862; font-size: 15px; }
.cd-summary { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.cd-summary__item { padding: 3px 10px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); font-weight: 600; }
.cd-summary__item--ok b { color: var(--ok-ink); }
.cd-summary__item--bad b { color: var(--danger); }

.cd-mx { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cd-mx__head, .cd-mx__row { display: grid; grid-template-columns: 190px repeat(5, minmax(0, 1fr)); }
.cd-mx__head { background: #F1F5F6; border-bottom: 1px solid var(--line); }
.cd-mx__corner, .cd-mx__col { padding: 12px 12px; font-size: 14px; font-weight: 700; color: #3F5862; line-height: 1.35; }
.cd-mx__col { border-left: 1px solid var(--line); }
.cd-mx__col small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.cd-mx__row { border-bottom: 1px solid var(--line); }
.cd-mx__row:last-child { border-bottom: 0; }
.cd-mx__user { display: flex; gap: 10px; align-items: center; padding: 12px; }
.cd-mx__user b { display: block; font-size: 15px; }
.cd-mx__user .cd-mono { font-size: 13px; color: var(--muted); }
.cd-mx__avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }

.cd-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 12px;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  cursor: pointer;
  min-height: 92px;
  transition: background-color .15s;
}
.cd-cell:hover { background: #F7FAFB; }
.cd-cell.is-selected { box-shadow: inset 0 0 0 2px var(--primary); }
.cd-cell__target { display: none; }
.cd-cell__lines { display: flex; flex-direction: column; gap: 2px; font-size: 14px; color: #3F5862; }
.cd-cell__badge { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 5px; background: #EDF2F4; color: #4E636D; }
.cd-verdict { font-weight: 700; color: var(--text); margin-left: 2px; }
.cd-verdict--deny { color: var(--protect); }
.cd-verdict--allow { color: var(--primary); }
.cd-cell[data-state="run"] { background: var(--primary-soft); }
.cd-cell[data-state="run"] .cd-cell__badge { background: var(--primary); color: #fff; }
.cd-cell[data-state="ok"] .cd-cell__badge { background: var(--ok-soft); color: var(--ok-ink); }
.cd-cell[data-state="ok"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ok); }
.cd-cell[data-state="bad"] { background: var(--danger-soft); }
.cd-cell[data-state="bad"] .cd-cell__badge { background: var(--danger); color: #fff; }
.cd-cell[data-state="bad"]::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--danger); }

.cd-fix { margin-top: 16px; display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 16px 18px; border: 2px solid var(--danger); border-radius: var(--radius); background: var(--surface); }
.cd-fix[hidden] { display: none; }
.cd-fix__text { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 15px; }
.cd-fix__title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--danger); }
.cd-fix code { font-size: 13px; background: #F1F5F6; padding: 6px 10px; border-radius: 6px; overflow-x: auto; white-space: nowrap; display: block; }
.cd-fixed { margin-top: 16px; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok-ink); background: var(--ok-soft); padding: 12px 14px; border-radius: var(--radius); }
.cd-fixed[hidden] { display: none; }

.cd-detail { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px; }
.cd-detail__head { margin-bottom: 12px; }
.cd-detail__head .cd-eyebrow { margin-bottom: 2px; font-size: 13px; }
.cd-detail__head h2 { font-size: 20px; }
.cd-detail__grid { margin: 0; display: grid; grid-template-columns: 160px minmax(0, 2.4fr) 100px 1fr 150px; gap: 16px; }
.cd-detail__grid dt { font-size: 13px; color: var(--muted); font-weight: 700; }
.cd-detail__grid dd { margin: 4px 0 0; font-size: 15px; font-weight: 600; }
.cd-code { display: block; font-size: 13px; background: #0F2A33; color: #DDEBEE; padding: 8px 10px; border-radius: 6px; overflow-x: auto; white-space: nowrap; font-weight: 400; }

.cd-how { margin-top: 40px; }
.cd-how__list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cd-how__list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.cd-how__list p { font-size: 15px; color: #3F5862; }
.cd-how__no { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; }

/* ───────── 환경·인수인계 ───────── */

.cd-scope { margin-bottom: 28px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cd-scope__band { display: grid; grid-template-columns: 1fr 1fr; }
.cd-scope__tab { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 20px; min-height: 64px; border: 0; border-bottom: 1px solid var(--line); background: #F1F5F6; cursor: pointer; text-align: left; }
.cd-scope__tab b { font-size: 17px; }
.cd-scope__tab span { font-size: 14px; color: var(--muted); }
.cd-scope__tab + .cd-scope__tab { border-left: 1px solid var(--line); }
.cd-scope__tab--a.is-active { background: var(--surface); border-bottom-color: transparent; box-shadow: inset 0 4px 0 var(--primary); }
.cd-scope__tab--b.is-active { background: var(--surface); border-bottom-color: transparent; box-shadow: inset 0 4px 0 var(--accent); }
.cd-scope__pane { padding: 20px 24px 22px; }
.cd-scope__pane[hidden] { display: none; }
.cd-scope__plus { font-size: 15px; color: var(--warn-ink); font-weight: 600; margin-bottom: 12px !important; }
.cd-scope__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cd-scope__list li { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: #F6F9FA; border: 1px solid var(--line); }
.cd-scope__list b { font-size: 15px; }
.cd-scope__list span { font-size: 14px; color: #3F5862; }
.cd-scope__lock { margin-top: 14px !important; display: inline-flex; align-items: flex-start; gap: 8px; font-size: 14px; font-weight: 600; color: var(--protect); padding: 6px 12px; border-radius: 6px; border: 1px solid rgba(122, 31, 31, .25); }

.cd-envs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cd-env { background-color: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cd-env__head { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.cd-env__name { display: flex; align-items: center; gap: 6px; font-size: 20px; font-weight: 700; }
.cd-env__sub { font-size: 14px; color: var(--muted); }
.cd-env--dev .cd-env__head { box-shadow: inset 0 4px 0 #7FA9B1; }
.cd-env--preview .cd-env__head { box-shadow: inset 0 4px 0 var(--primary); }
.cd-env--prod { --edge: 12px; border: 2px solid var(--protect); }
.cd-env--prod .cd-env__rows { padding-left: 32px; }
.cd-env--prod .cd-env__head { background: var(--protect); color: #fff; border-bottom: 0; }
.cd-env--prod .cd-env__sub { color: #F3DADA; }
.cd-env__rows { margin: 0; padding: 4px 20px 12px; }
.cd-env__rows > div { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cd-env__rows > div:last-child { border-bottom: 0; }
.cd-env__rows dt { font-size: 13px; font-weight: 700; color: var(--muted); }
.cd-env__rows dd { margin: 2px 0 0; font-size: 15px; font-weight: 600; }
.cd-env__lockline { display: flex !important; align-items: center; gap: 6px; color: var(--protect); }

.cd-block { margin-top: 40px; }
.cd-block__head { margin-bottom: 16px; }
.cd-block__head p { margin-top: 4px; color: #3F5862; }
.cd-recovery { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; counter-reset: rec; }
.cd-recovery__card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; display: flex; flex-direction: column; gap: 8px; }
.cd-recovery__card p { font-size: 15px; color: #3F5862; flex: 1; }
.cd-recovery__card .cd-tag { align-self: flex-start; }
.cd-recovery__no { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--text); font-weight: 600; }
.cd-recovery__card:not(:last-child)::after { content: ""; position: absolute; right: -10px; top: 34px; width: 8px; height: 8px; border-top: 2px solid var(--line-strong); border-right: 2px solid var(--line-strong); transform: rotate(45deg); }

.cd-toc { list-style: none; margin: 0; padding: 0; }
.cd-toc li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cd-toc li:last-child { border-bottom: 0; }
.cd-toc__no { width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.cd-toc__main { display: flex; flex-direction: column; }
.cd-toc__main b { font-size: 16px; }
.cd-toc__main span { font-size: 14px; color: #3F5862; }

.cd-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.cd-progress__bar { flex: 1; height: 8px; border-radius: 4px; background: #E3EAED; overflow: hidden; --p: 0; }
.cd-progress__bar i { display: block; height: 100%; width: calc(var(--p) * 100%); background: var(--primary); border-radius: 4px; }
.cd-progress b { font-size: 14px; color: var(--primary); }

.cd-practice { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cd-practice__item { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; min-height: 44px; }
.cd-practice__item:hover { border-color: var(--line-strong); }
.cd-practice__item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cd-practice__item input:focus-visible + .cd-practice__box { outline: 3px solid rgba(14, 107, 122, .45); outline-offset: 2px; }
.cd-practice__box { width: 26px; height: 26px; border-radius: 6px; border: 2px solid var(--line-strong); display: grid; place-items: center; color: transparent; background: var(--surface); margin-top: 1px; }
.cd-practice__text { display: flex; flex-direction: column; gap: 2px; }
.cd-practice__text b { font-size: 16px; }
.cd-practice__text b .cd-mono { color: var(--primary); margin-right: 4px; }
.cd-practice__text > span { font-size: 14px; color: #3F5862; }
.cd-practice li.is-done .cd-practice__item { border-color: var(--primary); background: #F4FAFB; }
.cd-practice li.is-done .cd-practice__box { background: var(--primary); border-color: var(--primary); color: #fff; }
.cd-practice__done { margin-top: 12px !important; display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ok-ink); background: var(--ok-soft); padding: 10px 14px; border-radius: var(--radius); font-size: 15px; }
.cd-practice__done[hidden] { display: none; }

/* ───────── 공고 대응표 ───────── */

.cd-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 22px;
  background: var(--text);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(15, 42, 51, .22);
}
.cd-fab:hover { background: #17404D; }

.cd-sheet {
  margin: 0 0 0 auto;
  width: min(460px, 100vw);
  max-width: 100vw;
  height: 100vh;
  max-height: 100vh;
  padding: 0;
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}
.cd-sheet::backdrop { background: rgba(15, 42, 51, .38); }
.cd-sheet__body { padding: 24px; }
.cd-sheet__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 18px; }
.cd-sheet__head h2 { font-size: 20px; }
.cd-sheet__head p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.cd-iconbtn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); cursor: pointer; flex: none; }
.cd-map { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: map; }
.cd-map__item { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; counter-increment: map; }
.cd-map__need { font-size: 15px; font-weight: 700; line-height: 1.45; }
.cd-map__need::before { content: counter(map) ". "; color: var(--primary); font-family: var(--mono); }
.cd-map__where { margin-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 6px; background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: 15px; text-decoration: none; }
.cd-map__where:hover { background: #D3E8EB; }

/* ───────── 시연 안내 ───────── */

.demo-notice {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 16px 24px 84px;
  font-size: 12px;
  color: #4E636D;
  text-align: center;
  border-top: 1px solid var(--line);
}

/* ───────── 반응형 ───────── */

@media (max-width: 1100px) {
  .cd-guards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cd-recovery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cd-recovery__card::after { display: none; }
  .cd-detail__grid { grid-template-columns: 1fr 1fr 1fr; }
  .cd-detail__wide { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .cd-header__inner { flex-wrap: wrap; height: auto; padding: 10px 16px 0; gap: 8px 12px; }
  .cd-nav { order: 3; width: 100%; height: 44px; overflow-x: auto; margin: 0 -8px; }
  .cd-nav__link { padding: 0 10px; font-size: 15px; white-space: nowrap; }
  .cd-twocol { grid-template-columns: 1fr; }
  .cd-envs { grid-template-columns: 1fr; }
  .cd-how__list { grid-template-columns: 1fr; }
  .cd-panel { grid-template-columns: 1fr; gap: 20px; }
  .cd-panel__aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .cd-who { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .cd-main { padding: 24px 16px 32px; }
  .cd-head h1 { font-size: 24px; }
  .cd-lead { font-size: 16px; }
  .cd-header { position: static; }
  .cd-header__inner { flex-wrap: nowrap; padding: 10px 16px 0; height: auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .cd-nav { grid-column: 1 / -1; margin: 0 -8px; }
  .cd-brand__sub { display: none; }
  .cd-prod { display: none; }
  .cd-btn--sm { min-height: 44px; padding: 0 12px; }

  .cd-scenarios { grid-template-columns: 1fr; gap: 10px; }
  .cd-scn { padding: 14px 16px; }
  .cd-scn.is-selected { padding: 13px 15px; }
  .cd-scn__sum { display: none; }
  .cd-scn--locked { --band: 56px; }
  .cd-scn__band span { width: 34px; height: 34px; }

  .cd-railcard__head { flex-direction: column; align-items: stretch; padding: 16px; }
  .cd-tape { text-align: left; grid-template-columns: auto 1fr; }

  /* 레일: 세로 타임라인 */
  .cd-railwrap { padding: 16px; }
  .cd-rail { grid-template-columns: 1fr; gap: 4px; }
  .cd-rail__track {
    top: calc(16px + 28px);
    bottom: calc(16px + 28px);
    left: calc(16px + 8px + 24px - 3px);
    right: auto;
    width: 6px;
    height: auto;
  }
  .cd-rail__fill { inset: 0 0 auto 0; width: 100%; height: calc(var(--fill, 0) * 100%); transition-property: height; }
  .cd-rail__return { background: repeating-linear-gradient(180deg, var(--accent) 0 10px, transparent 10px 16px); }
  .cd-node { justify-content: stretch; }
  .cd-node__btn { flex-direction: row; max-width: none; gap: 14px; padding: 4px 8px; min-height: 56px; text-align: left; }
  .cd-node__text { flex-direction: row; align-items: baseline; justify-content: space-between; flex: 1; gap: 8px; }
  .cd-node__label { font-size: 16px; }
  .cd-node__state { font-size: 14px; }

  .cd-stage { padding: 20px 16px 4px; }
  .cd-who { grid-template-columns: 1fr; gap: 10px; }
  .cd-facts > div { grid-template-columns: 1fr; gap: 2px; }
  .cd-guards { grid-template-columns: 1fr; }
  .cd-check { grid-template-columns: 28px minmax(0, 1fr); }
  .cd-check__res { grid-column: 2; align-items: flex-start; text-align: left; flex-direction: row; gap: 8px; align-items: baseline; }
  .cd-actions { padding: 16px; }
  .cd-actions .cd-btn { width: 100%; }
  .cd-card { padding: 18px 16px; }
  .cd-protect__row { grid-template-columns: 32px minmax(0, 1fr); }
  .cd-protect__row .cd-tag { grid-column: 2; justify-self: start; }
  .cd-versions__row { grid-template-columns: 60px minmax(0, 1fr); }
  .cd-versions__row .cd-tag { grid-column: 2; justify-self: start; }

  /* 시험표: 사용자별 카드 */
  .cd-access__bar { flex-direction: column; align-items: stretch; }
  .cd-access__bar .cd-btn { width: 100%; }
  .cd-segs { display: flex; }
  .cd-segs__tab { flex: 1; padding: 0 10px; font-size: 14px; }
  .cd-mx { background: transparent; border: 0; border-radius: 0; overflow: visible; display: grid; gap: 12px; }
  .cd-mx__head { display: none; }
  .cd-mx__row { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .cd-mx__row:last-child { border-bottom: 1px solid var(--line); }
  .cd-mx__user { border-bottom: 1px solid var(--line); background: #F6F9FA; }
  .cd-cell { width: 100%; border-left: 0; border-bottom: 1px solid var(--line); min-height: 56px; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "target badge" "lines lines"; gap: 4px 8px; padding: 10px 14px; }
  .cd-cell:last-child { border-bottom: 0; }
  .cd-cell__target { display: block; grid-area: target; font-weight: 700; font-size: 15px; }
  .cd-cell__badge { grid-area: badge; align-self: center; }
  .cd-cell__lines { grid-area: lines; flex-direction: row; gap: 16px; }
  .cd-fix { flex-direction: column; align-items: stretch; }
  .cd-detail { padding: 18px 16px; }
  .cd-detail__grid { grid-template-columns: 1fr 1fr; }

  .cd-scope__band { grid-template-columns: 1fr 1fr; }
  .cd-scope__tab { padding: 12px 14px; }
  .cd-scope__tab span { font-size: 13px; }
  .cd-scope__pane { padding: 16px; }
  .cd-recovery { grid-template-columns: 1fr; }

  .cd-sheet { margin: auto 0 0; width: 100vw; height: auto; max-height: 86vh; border-left: 0; border-top: 1px solid var(--line); border-radius: 12px 12px 0 0; }
  .cd-sheet__body { padding: 20px 16px 28px; }
  .cd-fab { right: 16px; bottom: 16px; }
  .demo-notice { padding: 16px 16px 80px; }
}

@media (prefers-reduced-motion: reduce) {
  .cdss *, .cdss *::before, .cdss *::after { transition: none !important; animation: none !important; }
}

.cd-scope__lock .cd-ico { margin-top: 3px; }
