/* 참모 요구사항정의서 뷰어(/command/requirements.html). 공개 홈과 같은 라이트 세계다.
   바탕은 한 단 낮은 책상 면(surface-subtle), 그 위에 흰 쪽 한 장씩. 네이비는 표지와 부 표지에만 깔고,
   금색은 네이비 위의 '지금 여기' 표지(부 번호 밑줄) 한 곳에만 쓴다. 코발트는 링크와 현재 위치에만.
   쪽은 1280×800 판으로 짜고 창에 맞춰 줄인다(requirements.js). 좁은 창·스크립트 없음에서는 판을 풀어
   위에서 아래로 흐른다. 값은 전부 lm-tokens.css 변수다(hex 없음). CSP 때문에 인라인 스타일이 없다. */

.rq {
  --rq-w: 1280px;
  --rq-h: 800px;
  --rq-scale: 1;
  --rq-bar: 64px;
  --rq-foot: 52px;
  margin: 0;
  background: var(--lm-bg-subtle);
  color: var(--lm-text);
  font-size: 16px;
  line-height: 1.65;
}

.rq ::selection {
  background: var(--lm-trust-soft);
  color: var(--lm-text-strong);
}

.rq a {
  text-underline-offset: 4px;
}

.rq :focus-visible {
  outline: var(--lm-focus-ring);
  outline-offset: 3px;
}

.rq h1,
.rq h2,
.rq h3 {
  text-wrap: balance;
}

.rq p,
.rq li {
  text-wrap: pretty;
}

.rq-skip {
  position: absolute;
  top: -80px;
  left: 16px;
  z-index: var(--lm-z-overlay);
  padding: 10px 14px;
  border-radius: var(--lm-radius);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink-strong);
  font-weight: 700;
  text-decoration: none;
}

.rq-skip:focus {
  top: 12px;
}

/* ── 상단 막대 ── */

.rq-bar {
  position: sticky;
  top: 0;
  z-index: var(--lm-z-bar);
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--rq-bar);
  padding: 0 24px;
  background: var(--lm-bg-page);
  border-bottom: 1px solid var(--lm-hairline);
}

.rq-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--lm-text-strong);
  text-decoration: none;
}

.rq-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--lm-radius-inner);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-accent);
}

.rq-brand__mark svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.rq-brand__name {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.rq-bar__doc {
  margin: 0;
  padding-left: 12px;
  border-left: 1px solid var(--lm-hairline);
  color: var(--lm-text-strong);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.rq-bar__doc span {
  margin-left: 8px;
  color: var(--lm-text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rq-bar__tools {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.rq-count {
  min-width: 72px;
  margin: 0;
  color: var(--lm-text-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  white-space: nowrap;
}

.rq-count b {
  color: var(--lm-text-strong);
  font-weight: 750;
}

.rq-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--lm-border-strong);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  color: var(--lm-text-strong);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out), border-color var(--lm-duration-fast) var(--lm-ease-out), color var(--lm-duration-fast) var(--lm-ease-out);
}

.rq-btn:hover {
  background: var(--lm-bg-subtle);
}

.rq-btn:active {
  background: var(--lm-bg-selected);
}

.rq-btn[disabled] {
  border-color: var(--lm-border);
  background: transparent;
  color: var(--lm-text-muted);
  cursor: default;
}

.rq-btn--icon {
  padding: 0;
}

.rq-btn--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--lm-primary);
}

.rq-btn--quiet:hover {
  background: var(--lm-bg-subtle);
  color: var(--lm-primary-pressed);
}

.rq-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── 무대와 판 ── */

.rq-stage {
  padding: 24px;
}

.rq-deck {
  display: grid;
  gap: 24px;
  max-width: var(--rq-w);
  margin: 0 auto;
}

/* 쪽은 넘길 때 초점을 받지만(화면 읽기 프로그램용) 쪽 전체에 초점 테두리를 두르지 않는다 */
.rq-page:focus {
  outline: none;
}

.rq-page {
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  overflow: hidden;
}

/* 스크립트가 판을 켜면 한 쪽씩 보인다 */
.rq--paged {
  height: 100dvh;
  overflow: hidden;
}

.rq--paged .rq-stage {
  position: relative;
  height: calc(100dvh - var(--rq-bar) - var(--rq-foot));
  padding: 0;
  overflow: hidden;
}

.rq--paged .rq-deck {
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  width: var(--rq-w);
  height: var(--rq-h);
  max-width: none;
  margin: 0;
  transform: translate(-50%, -50%) scale(var(--rq-scale));
  transform-origin: center;
}

.rq--paged .rq-page {
  position: absolute;
  inset: 0;
}

.rq--paged .rq-page.is-off,
.rq--flow .rq-page.is-off {
  display: none;
}

.rq--paged .rq-page.is-entering,
.rq--flow .rq-page.is-entering {
  animation: rq-enter var(--lm-duration) var(--lm-ease-out) both;
}

.rq--paged .rq-page.is-entering.is-back,
.rq--flow .rq-page.is-entering.is-back {
  animation-name: rq-enter-back;
}

@keyframes rq-enter {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

@keyframes rq-enter-back {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
}

/* 좁은 창: 판을 풀고 한 쪽을 세로로 읽는다 */
.rq--flow .rq-stage {
  padding: 12px 12px calc(var(--rq-foot) + 24px);
}

/* ── 쪽 머리(달린 머리) ── */

.rq-run {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 56px;
  margin: 0 72px;
  border-bottom: 1px solid var(--lm-hairline);
  color: var(--lm-text-muted);
  font-size: 13px;
  flex: 0 0 auto;
}

.rq-run__doc {
  color: var(--lm-text);
  font-weight: 650;
}

.rq-run__sec {
  margin-left: auto;
}

.rq-run__no {
  min-width: 28px;
  color: var(--lm-text-strong);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rq-body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 0;
  padding: 40px 72px 48px;
  flex: 1 1 auto;
}

.rq-title {
  margin: 0;
  max-width: 30em;
  color: var(--lm-text-strong);
  font-size: 34px;
  font-weight: 740;
  line-height: 1.28;
  letter-spacing: -0.03em;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.rq-lead {
  max-width: 50em;
  margin: -8px 0 0;
  color: var(--lm-text);
  font-size: 18px;
  line-height: 1.65;
  word-break: keep-all;
}

.rq-body p,
.rq-body li,
.rq-body td,
.rq-body th,
.rq-body dd {
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.rq-body p {
  margin: 0;
}

.rq-body h3 {
  margin: 0 0 8px;
  color: var(--lm-text-strong);
  font-size: 17px;
  font-weight: 720;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.rq-body h3:not(:first-child) {
  margin-top: 20px;
}

.rq-body strong {
  color: var(--lm-text-strong);
  font-weight: 700;
}

.rq-body code,
.rq-code {
  padding: 1px 5px;
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-subtle);
  color: var(--lm-text-strong);
  font-family: var(--lm-font-mono);
  font-size: 0.86em;
  overflow-wrap: anywhere;
}

/* 경로의 한 마디(파일 이름 등)는 한 줄에 둔다. 줄은 '/' 뒤에서만 바뀐다 */
.rq-nobr {
  white-space: nowrap;
}

.rq-text {
  display: grid;
  gap: 12px;
  align-content: start;
}

.rq-text p + p {
  margin-top: 0;
}

.rq-small {
  color: var(--lm-text-muted);
  font-size: 14px;
  line-height: 1.6;
}

/* ── 단 나누기 ── */

.rq-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 48px;
  min-height: 0;
  flex: 1 1 auto;
  align-items: start;
}

.rq-cols--5-7 {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

.rq-cols--7-5 {
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
}

.rq-cols--4-8 {
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
}

.rq-cols--8-4 {
  grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
}

.rq-cols--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 40px;
}

.rq-cols--center {
  align-items: center;
}

/* ── 헤어라인 목록 ── */

.rq-list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--lm-border-strong);
  list-style: none;
}

.rq-list > li {
  display: grid;
  gap: 4px;
  padding: 14px 0;
  border-bottom: 1px solid var(--lm-hairline);
}

.rq-list > li > b,
.rq-list > li > strong {
  color: var(--lm-text-strong);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
}

.rq-list > li > p,
.rq-list > li > span {
  color: var(--lm-text);
  font-size: 15px;
  line-height: 1.6;
}

.rq-list--row > li {
  grid-template-columns: minmax(0, 11em) minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
}

.rq-list--tight > li {
  padding: 10px 0;
}

/* 수용 기준: 번호가 곧 추적 ID다 */
.rq-ac {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--lm-border-strong);
}

.rq-ac > li {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--lm-hairline);
  font-size: 15px;
  line-height: 1.6;
}

.rq-ac__id {
  padding-top: 2px;
  color: var(--lm-text-muted);
  font-family: var(--lm-font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.rq-label {
  margin: 0 0 8px;
  color: var(--lm-text-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.4;
}

/* 요구사항 머리: ID 표지 + 제목 한 줄 */
.rq-fr-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
}

.rq-id {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: var(--lm-radius-inner);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink-strong);
  font-family: var(--lm-font-mono);
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  position: relative;
  top: -5px;
}

.rq-meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 6px 16px;
  margin: 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--lm-hairline);
  font-size: 14px;
  line-height: 1.55;
}

.rq-meta dt {
  color: var(--lm-text-muted);
  font-weight: 650;
}

.rq-meta dd {
  margin: 0;
  color: var(--lm-text);
}

/* ── 표 ── */

.rq-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid var(--lm-border-strong);
  font-size: 14.5px;
  line-height: 1.5;
}

.rq-table th {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--lm-border);
  color: var(--lm-text-muted);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  vertical-align: bottom;
}

.rq-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--lm-hairline);
  color: var(--lm-text);
  vertical-align: top;
}

.rq-table td:first-child {
  color: var(--lm-text-strong);
  font-weight: 650;
}

.rq-table .rq-num {
  font-variant-numeric: tabular-nums;
  text-align: right;
  white-space: nowrap;
}

.rq-table .rq-mono {
  font-family: var(--lm-font-mono);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.rq-table--compact {
  font-size: 13.5px;
}

/* 첫 열이 항목 이름인 표: 이름을 한 줄에 둔다 */
.rq-table--names td:first-child {
  padding-right: 20px;
  white-space: nowrap;
}

.rq-table--compact td,
.rq-table--compact th {
  padding-top: 7px;
  padding-bottom: 7px;
}

/* 여러 줄을 묶는 행 머리(2.8절 차원 열). 머리 줄의 th와 달리 위에 붙이고 본문 굵기로 둔다 */
.rq-table tbody th {
  color: var(--lm-text-strong);
  font-size: 13.5px;
  vertical-align: top;
  white-space: nowrap;
}

/* 행 머리 바로 뒤 칸은 그 줄의 항목 이름이다. 행 머리가 없는 줄의 첫 칸과 같게 둔다 */
.rq-table tbody th + td {
  color: var(--lm-text-strong);
  font-weight: 650;
}

.rq-table--names tbody th + td {
  padding-right: 20px;
  white-space: nowrap;
}

.rq-table a {
  color: var(--lm-primary);
  font-weight: 650;
  text-decoration: none;
}

.rq-table a:hover {
  text-decoration: underline;
}

/* ── 칩 ── */

.rq-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 9px;
  border-radius: var(--lm-radius-pill);
  background: var(--lm-bg-subtle);
  color: var(--lm-text);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.6;
  white-space: nowrap;
  vertical-align: 1px;
}

.rq-chip--ok {
  background: var(--lm-success-surface);
  color: var(--lm-success-text);
}

.rq-chip--warn {
  background: var(--lm-warning-surface);
  color: var(--lm-warning-text);
}

.rq-chip--bad {
  background: var(--lm-danger-surface);
  color: var(--lm-danger);
}

.rq-chip--unknown {
  border: 1px dashed var(--lm-border-strong);
  background: transparent;
  color: var(--lm-text-muted);
}

.rq-chip--sel {
  background: var(--lm-bg-selected);
  color: var(--lm-primary-pressed);
}

/* ── 알림 상자 ── */

.rq-note {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-page);
  font-size: 14.5px;
  line-height: 1.6;
}

.rq-note .lm-icon {
  margin-top: 3px;
  color: var(--lm-trust);
}

.rq-note--warn {
  border-color: var(--lm-warning-surface);
  background: var(--lm-warning-surface);
  color: var(--lm-warning-text);
}

.rq-note--warn .lm-icon {
  color: var(--lm-warning-accent);
}

.rq-note--warn strong {
  color: var(--lm-warning-text);
}

/* ── 원문 인용 ── */

.rq-quote {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-page);
}

.rq-quote p {
  color: var(--lm-text-strong);
  font-size: 15px;
  line-height: 1.6;
}

.rq-quote cite {
  display: block;
  margin-top: 4px;
  color: var(--lm-text-muted);
  font-size: 12.5px;
  font-style: normal;
}

/* ── 화면 캡처 ── */

.rq-shot {
  display: grid;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.rq-shot__frame {
  position: relative;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius);
  background: var(--lm-bg-page);
  overflow: hidden;
}

.rq-shot__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border-bottom: 1px solid var(--lm-hairline);
  background: var(--lm-bg-surface);
  color: var(--lm-text-muted);
  font-family: var(--lm-font-mono);
  font-size: 12px;
}

.rq-shot__bar .lm-icon {
  width: 14px;
  height: 14px;
}

.rq-shot__tag {
  margin-left: auto;
  padding: 0 8px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-pill);
  background: var(--lm-bg-page);
  color: var(--lm-text-muted);
  font-family: var(--lm-font-ui);
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.6;
}

.rq-shot img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--lm-bg-page);
}

.rq-shot figcaption {
  color: var(--lm-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* 캡처를 누르면 전체 화면을 크게 연다(requirements.js). 스크립트가 없으면 그림 파일로 간다 */
.rq-shot__zoom {
  display: block;
  border-radius: var(--lm-radius);
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}

.rq-shot__zoom:hover .rq-shot__frame {
  border-color: var(--lm-border-strong);
}

.rq-shot__zoom:focus-visible {
  outline: var(--lm-focus-ring);
  outline-offset: 3px;
}

.rq-shot__hint {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  color: var(--lm-text-muted);
  font-family: var(--lm-font-ui);
  font-size: 11.5px;
  font-weight: 650;
}

.rq-shot__hint + .rq-shot__tag {
  margin-left: 8px;
}

.rq-shot__zoom:hover .rq-shot__hint {
  color: var(--lm-primary-pressed);
}

.rq-zoom {
  width: min(1600px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--lm-radius);
  background: var(--lm-bg-surface);
  color: var(--lm-text);
  box-shadow: var(--lm-shadow-overlay);
  overflow: hidden;
}

.rq-zoom[open] {
  display: flex;
  flex-direction: column;
  animation: rq-zoom-in var(--lm-duration) var(--lm-ease-out);
}

@keyframes rq-zoom-in {
  from {
    opacity: 0;
    transform: scale(0.98);
  }
}

.rq-zoom::backdrop {
  background: var(--lm-scrim);
}

.rq-zoom__head {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 56px;
  padding: 0 8px 0 20px;
  border-bottom: 1px solid var(--lm-hairline);
  flex: 0 0 auto;
}

.rq-zoom__title {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: 14.5px;
  font-weight: 650;
  line-height: 1.45;
  word-break: keep-all;
}

.rq-zoom__head .rq-btn {
  margin-left: auto;
}

.rq-zoom__body {
  min-height: 0;
  overflow: auto;
  background: var(--lm-bg-page);
  flex: 1 1 auto;
}

.rq-zoom__body img {
  display: block;
  width: 100%;
  height: auto;
}

/* 화면의 한 부분만 보여 줄 때: 판 비율을 정하고 기준 모서리에서 자른다 */
.rq-shot--main .rq-shot__frame img,
.rq-shot--side .rq-shot__frame img,
.rq-shot--top .rq-shot__frame img {
  object-fit: cover;
}

/* 왼쪽 레일을 빼고 본문만(1270×1000 부분) */
.rq-shot--main .rq-shot__frame img {
  aspect-ratio: 127 / 100;
  object-position: 100% 0;
}

/* 오른쪽 곁패널만(640×1000 부분) */
.rq-shot--side .rq-shot__frame img {
  aspect-ratio: 64 / 100;
  object-position: 100% 0;
}

/* 위쪽 절반(1600×800 부분) */
.rq-shot--top .rq-shot__frame img {
  aspect-ratio: 2 / 1;
  object-position: 0 0;
}

.rq-phones {
  display: flex;
  gap: 24px;
  justify-content: center;
}

.rq-shot--phone {
  width: 236px;
}

.rq-shot--phone .rq-shot__frame {
  border-radius: 14px;
}

.rq-shot--phone .rq-shot__bar {
  display: none;
}

/* ── 그림 문법: 흐름·층·묶음·칸 ── */

.rq-fig {
  margin: 0;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rq-fig > figcaption {
  color: var(--lm-text-muted);
  font-size: 13px;
  line-height: 1.55;
}

/* 흐름: 가로 단계, 사이에 화살표 */
.rq-flow {
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-flow > li {
  position: relative;
  display: grid;
  gap: 6px;
  align-content: start;
  padding: 14px 14px 16px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
  font-size: 14px;
  line-height: 1.5;
}

.rq-flow > li > b {
  color: var(--lm-text-strong);
  font-size: 15px;
  font-weight: 720;
}

.rq-flow > li > span {
  color: var(--lm-text-muted);
}

.rq-flow > li > code {
  justify-self: start;
}

.rq-flow > li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 24px;
  right: -22px;
  width: 16px;
  height: 1px;
  background: var(--lm-border-strong);
}

.rq-flow > li:not(:last-child)::before {
  content: "";
  position: absolute;
  top: 21px;
  right: -22px;
  width: 7px;
  height: 7px;
  border-top: 1px solid var(--lm-border-strong);
  border-right: 1px solid var(--lm-border-strong);
  transform: rotate(45deg);
}

.rq-flow > li.is-key {
  border-color: var(--lm-rail-bg);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink);
}

.rq-flow > li.is-key > b {
  color: var(--lm-rail-ink-strong);
}

.rq-flow > li.is-key > span {
  color: var(--lm-rail-muted);
}

.rq-flow > li.is-sel {
  border-color: var(--lm-primary);
  background: var(--lm-bg-selected);
}

.rq-flow > li.is-dim {
  border-style: dashed;
  background: transparent;
}

/* 세로 흐름 */
.rq-flow--v {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  gap: 20px;
}

.rq-flow--v > li:not(:last-child)::after {
  top: auto;
  right: auto;
  bottom: -15px;
  left: 28px;
  width: 1px;
  height: 11px;
}

.rq-flow--v > li:not(:last-child)::before {
  top: auto;
  right: auto;
  bottom: -15px;
  left: 25px;
  transform: rotate(135deg);
}

.rq-flow--v > li {
  grid-template-columns: minmax(0, 9em) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 11px 14px;
}

/* 층: 위에서 아래로 쌓인 구성 */
.rq-stack {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-stack > li {
  display: grid;
  grid-template-columns: minmax(0, 11em) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
  font-size: 14px;
  line-height: 1.5;
}

.rq-stack > li > b {
  color: var(--lm-text-strong);
  font-size: 15px;
  font-weight: 720;
}

.rq-stack > li.is-key {
  border-color: var(--lm-rail-bg);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink);
}

.rq-stack > li.is-key > b {
  color: var(--lm-rail-ink-strong);
}

.rq-stack__split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.rq-stack__split > div {
  display: grid;
  gap: 2px;
  padding: 8px 12px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-page);
}

.rq-stack__split b {
  color: var(--lm-text-strong);
  font-weight: 700;
}

/* 묶음: 이름 붙은 상자 안에 태그들 */
.rq-groups {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.rq-groups--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.rq-groups--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.rq-group {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 14px 16px 16px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
}

.rq-group > b {
  color: var(--lm-text-strong);
  font-size: 15px;
  font-weight: 720;
}

.rq-group > p {
  color: var(--lm-text-muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.rq-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-tags > li {
  padding: 2px 10px;
  border: 1px solid var(--lm-hairline);
  border-radius: var(--lm-radius-pill);
  background: var(--lm-bg-page);
  color: var(--lm-text);
  font-size: 13px;
  line-height: 1.6;
}

.rq-tags--mono > li {
  font-family: var(--lm-font-mono);
  font-size: 12px;
}

/* 칸 지도: 무리 머리 + 칸 이름 */
.rq-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.rq-fields > section {
  display: grid;
  gap: 8px;
  align-content: start;
}

.rq-fields > section > h3 {
  display: flex;
  justify-content: space-between;
  margin: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lm-border-strong);
  font-size: 15px;
}

.rq-fields > section > h3 span {
  color: var(--lm-text-muted);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.rq-fields ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-fields li {
  display: grid;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
  font-size: 13.5px;
  line-height: 1.5;
}

.rq-fields li > b {
  color: var(--lm-text-strong);
  font-size: 14.5px;
  font-weight: 700;
}

.rq-fields li > span {
  color: var(--lm-text-muted);
}

/* 권한 표: 칸 안의 가능·불가 표시 */
.rq-yes,
.rq-no {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
}

.rq-yes {
  color: var(--lm-success-text);
}

.rq-no {
  color: var(--lm-text-muted);
}

.rq-yes .lm-icon,
.rq-no .lm-icon {
  width: 16px;
  height: 16px;
}

/* ── 대화 중심 + 도구 그림 ── */

.rq-hub {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-rows: auto auto auto;
  gap: 36px 44px;
  align-items: center;
}

.rq-hub__lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.rq-hub__lines line {
  stroke: var(--lm-border-strong);
  stroke-width: 1;
  stroke-dasharray: 4 4;
}

.rq-hub__core {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 24px 20px;
  border-radius: var(--lm-radius);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink);
  text-align: center;
}

.rq-hub__core .lm-icon {
  width: 28px;
  height: 28px;
  color: var(--lm-rail-accent);
}

.rq-hub__core b {
  color: var(--lm-rail-ink-strong);
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.02em;
}

.rq-hub__core span {
  color: var(--lm-rail-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.rq-hub__tool {
  position: relative;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-content: start;
  gap: 4px 10px;
  min-height: 96px;
  padding: 14px 16px;
  border: 1px solid var(--lm-border);
  border-radius: var(--lm-radius-inner);
  background: var(--lm-bg-surface);
  font-size: 13.5px;
  line-height: 1.5;
}

.rq-hub__tool .lm-icon {
  grid-row: span 2;
  color: var(--lm-text-muted);
  margin-top: 2px;
}

.rq-hub__tool b {
  color: var(--lm-text-strong);
  font-size: 15px;
  font-weight: 720;
}

.rq-hub__tool span {
  color: var(--lm-text-muted);
}

.rq-hub__tool--a { grid-column: 1; grid-row: 1; }
.rq-hub__tool--b { grid-column: 3; grid-row: 1; }
.rq-hub__tool--c { grid-column: 1; grid-row: 3; }
.rq-hub__tool--d { grid-column: 3; grid-row: 3; }
.rq-hub__tool--e { grid-column: 1; grid-row: 2; }
.rq-hub__tool--f { grid-column: 3; grid-row: 2; }
.rq-hub__tool--g { grid-column: 2; grid-row: 1; }
.rq-hub__tool--h { grid-column: 2; grid-row: 3; }

/* ── 표지·부 표지(네이비) ── */

.rq-page--cover,
.rq-page--part {
  border-color: var(--lm-rail-bg);
  background: var(--lm-rail-bg);
  color: var(--lm-rail-ink);
}

.rq-page--cover .rq-run,
.rq-page--part .rq-run {
  border-bottom-color: var(--lm-rail-line);
  color: var(--lm-rail-muted);
}

.rq-page--cover .rq-run__doc,
.rq-page--part .rq-run__doc,
.rq-page--cover .rq-run__no,
.rq-page--part .rq-run__no {
  color: var(--lm-rail-ink-strong);
}

.rq-cover {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: end;
  min-height: 0;
  padding: 72px 72px 64px;
  flex: 1 1 auto;
}

.rq-cover__mark {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 40px;
  border-radius: var(--lm-radius);
  background: var(--lm-rail-hover);
  color: var(--lm-rail-accent);
}

.rq-cover__mark svg {
  width: 44px;
  height: 44px;
  fill: currentColor;
}

.rq-cover h1 {
  margin: 0;
  color: var(--lm-rail-ink-strong);
  font-size: 64px;
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -0.04em;
  word-break: keep-all;
}

.rq-cover__sub {
  max-width: 30em;
  margin: 20px 0 0;
  color: var(--lm-rail-ink);
  font-size: 19px;
  line-height: 1.65;
  word-break: keep-all;
}

.rq-cover__meta {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border-top: 1px solid var(--lm-rail-line);
  font-size: 14.5px;
  line-height: 1.5;
}

.rq-cover__meta dt,
.rq-cover__meta dd {
  margin: 0;
  padding: 11px 0;
  border-bottom: 1px solid var(--lm-rail-line);
}

.rq-cover__meta dt {
  padding-right: 24px;
  color: var(--lm-rail-muted);
}

.rq-cover__meta dd {
  color: var(--lm-rail-ink-strong);
  font-variant-numeric: tabular-nums;
}

.rq-part {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 64px;
  align-items: center;
  min-height: 0;
  padding: 56px 72px;
  flex: 1 1 auto;
}

/* 쪽이 많은 부(기능 요구사항 19쪽)는 차례를 두 단으로 세운다 */
.rq-part--long {
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
}

/* 부 번호는 제목과 한 줄에 선다(제목 위 소제목을 두지 않는다) */
.rq-part__no {
  margin-right: 0.35em;
  color: var(--lm-rail-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.rq-part h2 {
  margin: 0;
  color: var(--lm-rail-ink-strong);
  font-size: 52px;
  font-weight: 760;
  line-height: 1.15;
  letter-spacing: -0.04em;
  word-break: keep-all;
}

.rq-part__sum {
  max-width: 28em;
  margin: 20px 0 0;
  color: var(--lm-rail-ink);
  font-size: 18px;
  line-height: 1.65;
  word-break: keep-all;
}

.rq-part__list {
  display: grid;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--lm-rail-line);
  list-style: none;
}

.rq-part__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 16px;
  align-items: center;
  min-height: 44px;
  padding: 8px 4px;
  border-bottom: 1px solid var(--lm-rail-line);
  color: var(--lm-rail-ink);
  font-size: 15.5px;
  text-decoration: none;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out), color var(--lm-duration-fast) var(--lm-ease-out);
}

.rq-part__list a:hover {
  background: var(--lm-rail-hover);
  color: var(--lm-rail-ink-strong);
}

.rq-part__list a span {
  color: var(--lm-rail-muted);
  font-variant-numeric: tabular-nums;
}

.rq-part__list--2 {
  display: block;
  columns: 2;
  column-gap: 24px;
}

.rq-part__list--2 li {
  break-inside: avoid;
}

.rq-part__list--2 a {
  font-size: 14px;
}

.rq-page--cover :focus-visible,
.rq-page--part :focus-visible {
  outline: var(--lm-focus-ring-dark);
}

/* ── 문서 안 목차 ── */

.rq-toc-grid {
  columns: 3;
  column-gap: 40px;
}

.rq-toc-part {
  display: grid;
  gap: 0;
  align-content: start;
  margin-bottom: 20px;
  break-inside: avoid;
}

.rq-toc-part > h3 {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 !important;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--lm-border-strong);
  font-size: 15px;
}

.rq-toc-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-toc-list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--lm-hairline);
  color: var(--lm-text);
  font-size: 13.5px;
  line-height: 1.45;
  text-decoration: none;
}

.rq-toc-list a:hover {
  color: var(--lm-primary-pressed);
}

.rq-toc-list a span,
.rq-toc-part > h3 span {
  color: var(--lm-text-muted);
  font-variant-numeric: tabular-nums;
}

/* ── 아래 막대: 부별 진행 ── */

.rq-foot {
  display: none;
}

.rq--paged .rq-foot,
.rq--flow .rq-foot {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: var(--lm-z-bar);
  display: flex;
  align-items: stretch;
  gap: 16px;
  height: var(--rq-foot);
  padding: 0 24px;
  border-top: 1px solid var(--lm-hairline);
  background: var(--lm-bg-page);
}

.rq-parts {
  display: flex;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.rq-parts button {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding: 0 0 6px;
  border: 0;
  background: transparent;
  color: var(--lm-text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  transition: color var(--lm-duration-fast) var(--lm-ease-out);
}

.rq-parts button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rq-parts button::before,
.rq-parts button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 12px;
  left: 0;
  height: 3px;
  border-radius: var(--lm-radius-pill);
  background: var(--lm-border);
}

.rq-parts button::after {
  background: var(--lm-primary);
  transform: scaleX(var(--rq-fill, 0));
  transform-origin: left center;
  transition: transform var(--lm-duration) var(--lm-ease-out);
}

.rq-parts button:hover {
  color: var(--lm-text-strong);
}

.rq-parts button[aria-current="true"] {
  color: var(--lm-text-strong);
}

.rq-parts button > span {
  position: relative;
  top: -5px;
}

.rq-foot__nav {
  display: none;
}

/* ── 목차 서랍 ── */

.rq-drawer {
  width: min(420px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--lm-bg-surface);
  color: var(--lm-text);
  box-shadow: var(--lm-shadow-drawer);
}

.rq-drawer::backdrop {
  background: var(--lm-scrim);
}

.rq-drawer[open] {
  animation: rq-drawer-in var(--lm-duration) var(--lm-ease-out);
}

@keyframes rq-drawer-in {
  from {
    transform: translateX(-24px);
    opacity: 0;
  }
}

.rq-drawer__head {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--rq-bar);
  padding: 0 12px 0 24px;
  border-bottom: 1px solid var(--lm-hairline);
  background: var(--lm-bg-surface);
}

.rq-drawer__head h2 {
  margin: 0;
  color: var(--lm-text-strong);
  font-size: 17px;
  font-weight: 720;
}

.rq-drawer__body {
  padding: 8px 24px 32px;
}

.rq-drawer__part {
  margin: 20px 0 4px;
  color: var(--lm-text-muted);
  font-size: 12.5px;
  font-weight: 650;
}

.rq-drawer ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rq-drawer a {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: var(--lm-radius-inner);
  color: var(--lm-text);
  font-size: 14.5px;
  line-height: 1.4;
  text-decoration: none;
  transition: background-color var(--lm-duration-fast) var(--lm-ease-out);
}

.rq-drawer a:hover {
  background: var(--lm-bg-subtle);
}

.rq-drawer a span {
  color: var(--lm-text-muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.rq-drawer a[aria-current="page"] {
  background: var(--lm-bg-selected);
  color: var(--lm-primary-pressed);
  font-weight: 650;
}

.rq-drawer a[aria-current="page"] span {
  color: var(--lm-primary-pressed);
}

/* ── 좁은 창 ── */

@media (max-width: 760px) {
  .rq {
    --rq-bar: 56px;
  }

  .rq-bar {
    gap: 8px;
    padding: 0 8px 0 12px;
  }

  .rq-brand__name,
  .rq-bar__doc span,
  .rq-bar__nav {
    display: none;
  }

  .rq-bar__doc {
    padding-left: 0;
    border-left: 0;
  }

  .rq-count {
    min-width: 0;
  }

  .rq-stage {
    padding: 12px;
  }

  .rq-deck {
    gap: 12px;
  }

  .rq-run {
    margin: 0 16px;
    height: 44px;
    font-size: 12px;
  }

  .rq-run__doc {
    display: none;
  }

  .rq-run__sec {
    margin-left: 0;
  }

  .rq-run__no {
    margin-left: auto;
  }

  .rq-body {
    gap: 20px;
    padding: 24px 16px 32px;
  }

  .rq-title {
    font-size: 25px;
    line-height: 1.32;
    letter-spacing: -0.025em;
  }

  .rq-lead {
    margin-top: -6px;
    font-size: 16.5px;
  }

  .rq-fr-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .rq-id {
    top: 0;
  }

  .rq-cols,
  .rq-cols--5-7,
  .rq-cols--7-5,
  .rq-cols--4-8,
  .rq-cols--8-4,
  .rq-cols--3,
  .rq-groups,
  .rq-groups--2,
  .rq-groups--4,
  .rq-fields,
  .rq-stack__split {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .rq-list--row > li,
  .rq-stack > li,
  .rq-flow--v > li {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .rq-flow {
    grid-auto-flow: row;
    grid-auto-columns: auto;
    gap: 20px;
  }

  .rq-flow > li:not(:last-child)::after {
    top: auto;
    right: auto;
    bottom: -15px;
    left: 24px;
    width: 1px;
    height: 11px;
  }

  .rq-flow > li:not(:last-child)::before {
    top: auto;
    right: auto;
    bottom: -15px;
    left: 21px;
    transform: rotate(135deg);
  }

  .rq-toc-grid,
  .rq-part__list--2 {
    columns: 1;
  }

  .rq-hub {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

  .rq-hub__lines {
    display: none;
  }

  .rq-hub__core,
  .rq-hub__tool {
    grid-column: 1;
    grid-row: auto;
  }

  .rq-hub__core {
    order: -1;
  }

  .rq-table {
    font-size: 13.5px;
  }

  .rq-table .rq-mono,
  .rq-table .rq-num {
    white-space: normal;
    word-break: break-all;
  }

  /* 2.8절 근거표는 다섯 열이라 좁은 창에서는 칸마다 한 묶음으로 세워 읽는다. 열 이름은 data-label로 붙인다 */
  .rq-table--grounds,
  .rq-table--grounds tbody,
  .rq-table--grounds tr,
  .rq-table--grounds th,
  .rq-table--grounds td {
    display: block;
  }

  .rq-table--grounds thead {
    display: none;
  }

  .rq-table--grounds tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--lm-hairline);
  }

  .rq-table--grounds tbody th {
    padding: 0 0 4px;
    border: 0;
    color: var(--lm-text-muted);
    font-size: 12.5px;
  }

  .rq-table--grounds td,
  .rq-table--names.rq-table--grounds tbody th + td {
    padding: 2px 0;
    border: 0;
    white-space: normal;
  }

  .rq-table--grounds td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-top: 6px;
    color: var(--lm-text-muted);
    font-size: 12.5px;
    font-weight: 650;
  }

  .rq-cover,
  .rq-part {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 32px 16px 40px;
  }

  .rq-cover__mark {
    margin-bottom: 24px;
  }

  .rq-cover h1 {
    font-size: 38px;
  }

  .rq-cover__sub,
  .rq-part__sum {
    font-size: 16.5px;
  }

  .rq-part h2 {
    font-size: 34px;
  }

  .rq-phones {
    flex-wrap: wrap;
  }

  /* 좁은 창의 크게 보기는 잘라 낸 그림을 원래 크기(앱 글씨 그대로)로 열고 좌우로 밀어 본다 */
  .rq-zoom__body img {
    width: 840px;
    max-width: none;
  }

  .rq-shot--phone {
    width: min(260px, 100%);
  }

  .rq--flow .rq-foot {
    gap: 8px;
    padding: 0 8px env(safe-area-inset-bottom);
    height: calc(var(--rq-foot) + env(safe-area-inset-bottom));
  }

  .rq--flow .rq-parts button span {
    display: none;
  }

  .rq--flow .rq-foot__nav {
    display: flex;
    gap: 8px;
    align-items: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rq *,
  .rq *::before,
  .rq *::after,
  .rq-drawer,
  .rq-drawer[open],
  .rq-zoom[open] {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .rq-bar,
  .rq-foot,
  .rq-drawer {
    display: none !important;
  }

  .rq,
  .rq--paged {
    height: auto;
    overflow: visible;
    background: var(--lm-bg-surface);
  }

  .rq .rq-stage {
    position: static;
    height: auto;
    padding: 0;
  }

  .rq .rq-deck {
    position: static;
    display: block;
    width: auto;
    height: auto;
    transform: none;
  }

  .rq .rq-page,
  .rq .rq-page.is-off {
    position: relative;
    display: flex;
    inset: auto;
    min-height: 0;
    break-after: page;
  }
}

/* 2.12 루만 이론과 판정 설계의 대응 표 */
.rq-table--luhmann td:first-child {
  width: 31%;
  font-weight: 400;
}

.rq-table--luhmann td:nth-child(2) {
  width: 40%;
  color: var(--lm-text-muted);
}

.rq-table--luhmann td b {
  display: block;
  font-weight: 650;
  color: var(--lm-text-strong);
}

/* FR-19 처리 예시 표 */
.rq-table--judge td:last-child,
.rq-table--judge th:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rq-table--judge tr.is-hold td {
  background: var(--lm-bg-page);
}
