/* ── 구역 4: 순수 CSS :has() 비교 카드 <-> 관련 모듈 연동 (중첩 :has 없음) ── */
.one-hub .cmp {
  position: relative;
  cursor: pointer;
  border-radius: 8px;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.one-hub .cmp-pick {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}
.one-hub .cmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.one-hub .cmp-hint {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
}
.one-hub .cmp:has(.cmp-pick:checked),
.one-hub .cmp:hover,
.one-hub .cmp:focus-within {
  border-color: var(--accent);
}
.one-hub .cmp:has(.cmp-pick:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.one-hub .cmp:has(.cmp-pick:checked) .cmp-hint {
  color: var(--accent);
}
.one-hub .module {
  border-radius: 8px;
  transition: opacity 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

/* 주제가 선택·호버·포커스되면 관련 없는 모듈을 살짝 낮추고 관련 모듈을 강조 */
.one-hub:has(.cmp[data-topic="due"]:hover, .cmp[data-topic="due"]:focus-within, .cmp[data-topic="due"] .cmp-pick:checked) .module:not([data-topics~="due"]),
.one-hub:has(.cmp[data-topic="talk"]:hover, .cmp[data-topic="talk"]:focus-within, .cmp[data-topic="talk"] .cmp-pick:checked) .module:not([data-topics~="talk"]),
.one-hub:has(.cmp[data-topic="meeting"]:hover, .cmp[data-topic="meeting"]:focus-within, .cmp[data-topic="meeting"] .cmp-pick:checked) .module:not([data-topics~="meeting"]),
.one-hub:has(.cmp[data-topic="report"]:hover, .cmp[data-topic="report"]:focus-within, .cmp[data-topic="report"] .cmp-pick:checked) .module:not([data-topics~="report"]) {
  opacity: 0.42;
}

.one-hub:has(.cmp[data-topic="due"]:hover, .cmp[data-topic="due"]:focus-within, .cmp[data-topic="due"] .cmp-pick:checked) .module[data-topics~="due"],
.one-hub:has(.cmp[data-topic="talk"]:hover, .cmp[data-topic="talk"]:focus-within, .cmp[data-topic="talk"] .cmp-pick:checked) .module[data-topics~="talk"],
.one-hub:has(.cmp[data-topic="meeting"]:hover, .cmp[data-topic="meeting"]:focus-within, .cmp[data-topic="meeting"] .cmp-pick:checked) .module[data-topics~="meeting"],
.one-hub:has(.cmp[data-topic="report"]:hover, .cmp[data-topic="report"]:focus-within, .cmp[data-topic="report"] .cmp-pick:checked) .module[data-topics~="report"] {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* ── 구역 5: 회사 서버 경계 도식 (boundary.js) ── */
.gw-boundary {
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-top: 22px;
}
.gw-bound-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  font-size: 0.8rem;
  color: var(--ink-3);
}
.gw-bound-stage {
  padding: 8px;
  background: var(--surface);
}
.gw-bound-svg {
  display: block;
  width: 100%;
  height: auto;
}
.gwb-chamber-in {
  fill: var(--surface-2);
  stroke: var(--line-strong);
  stroke-width: 1.25;
}
.gwb-chamber-out {
  fill: var(--ground-2);
  stroke: var(--line);
  stroke-width: 1.25;
  stroke-dasharray: 4 3;
}
.gwb-zone-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--ink-3);
}
.gwb-wall {
  stroke: var(--ink-3);
  stroke-width: 2;
}
.gwb-wall-sub {
  stroke: var(--line-strong);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
}
.gwb-wall-label {
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  fill: var(--ink-3);
}
.gwb-wire {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.3;
}
.gwb-ext-wire {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.4;
  stroke-dasharray: 4 4;
  opacity: 0.45;
}
.gw-boundary[data-gate="open"] .gwb-ext-wire {
  stroke: var(--accent);
  opacity: 1;
}
.gwb-gate-box {
  fill: var(--surface);
  stroke: var(--teal);
  stroke-width: 1.6;
}
.gwb-gate-bar {
  stroke: var(--teal);
  stroke-width: 2.5;
  stroke-linecap: round;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.25s ease, stroke 0.2s ease;
}
.gw-boundary[data-gate="open"] .gwb-gate-box {
  stroke: var(--accent);
  fill: var(--accent-soft);
}
.gw-boundary[data-gate="open"] .gwb-gate-bar {
  stroke: var(--accent);
  transform: rotate(90deg);
}
.gwb-gate-txt {
  font-family: var(--font);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--teal);
}
.gw-boundary[data-gate="open"] .gwb-gate-txt {
  fill: var(--accent);
}
.gwb-node {
  cursor: pointer;
}
.gwb-node:focus-visible .gwb-node-box {
  stroke: var(--accent);
  stroke-width: 2.2;
}
.gwb-node-box {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}
.gwb-node-dot {
  fill: var(--teal);
}
.gwb-node[data-active="1"] .gwb-node-box {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.8;
}
.gwb-node[data-active="1"] .gwb-node-dot {
  fill: var(--accent);
}
.gw-boundary[data-alarm="on"] .gwb-node[data-node="export"] .gwb-node-box {
  fill: var(--coral-soft);
  stroke: var(--coral);
  stroke-width: 1.9;
}
.gw-boundary[data-alarm="on"] .gwb-node[data-node="export"] .gwb-node-dot {
  fill: var(--coral);
}
.gwb-node-title {
  font-family: var(--font);
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--ink);
}
.gwb-node-sub {
  font-family: var(--font);
  font-size: 9.8px;
  fill: var(--ink-2);
}
.gwb-meter-seg {
  fill: var(--line);
}
.gwb-meter-seg[data-lit="1"] {
  fill: var(--teal);
}
.gw-boundary[data-alarm="on"] .gwb-meter-seg[data-lit="1"] {
  fill: var(--coral);
}
.gwb-ext-box {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1.1;
  opacity: 0.65;
}
.gw-boundary[data-gate="open"] .gwb-ext-box {
  stroke: var(--accent);
  opacity: 1;
}
.gwb-ext-note {
  font-family: var(--mono);
  font-size: 9.8px;
  fill: var(--ink-3);
}
.checks li[data-bound-key] {
  cursor: pointer;
  border-radius: 6px;
  padding: 4px 6px;
  margin-inline: -6px;
}
.checks li[data-bound-key]:hover,
.checks li[data-bound-key]:focus-visible {
  background: var(--surface-2);
}

/* ── 기능 페이지: 상단 읽기 진행 막대(scroll-driven) + 순수 CSS :has() 필터 ── */
.feat-progress {
  display: none;
}
@media (prefers-reduced-motion: no-preference) {
  @supports (animation-timeline: scroll()) {
    @keyframes gw-read-progress {
      from { transform: scaleX(0); }
      to { transform: scaleX(1); }
    }
    .feat-progress {
      display: block;
      position: sticky;
      top: 64px;
      z-index: 19;
      height: 3px;
      width: 100%;
      background: var(--accent);
      transform-origin: left center;
      animation: gw-read-progress linear both;
      animation-timeline: scroll(root block);
    }
  }
}

.feat-filter {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 20px;
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-2);
}
.feat-page:has(input[name="feat-mode"][value="ai"]:checked) .feat-group:not([data-has-ai]):not([data-ai-group]) {
  display: none;
}
.feat-page:has(input[name="feat-mode"][value="ai"]:checked) .feat-group[data-has-ai] .feat-item:not([data-ai]) {
  display: none;
}
.feat-page:has(input[name="feat-mode"][value="core"]:checked) .feat-group[data-ai-group],
.feat-page:has(input[name="feat-mode"][value="core"]:checked) .feat-item[data-ai] {
  display: none;
}

/* ── 구역 9 마무리: 비대칭 좌측 문구 + 우측 정지 기록 대장 도면 ── */
.closing {
  text-align: left;
}
.closing .lede {
  margin-inline: 0;
}
.closing .actions {
  justify-content: flex-start;
  margin-top: 28px;
}
.closing-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
}
.closing-frame {
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.gw-ledger-svg {
  display: block;
  width: 100%;
  height: auto;
}
.gwl-frame {
  fill: var(--surface-2);
  stroke: var(--line);
  stroke-width: 1;
}
.gwl-tick,
.gwl-rule {
  stroke: var(--line-strong);
  stroke-width: 1;
}
.gwl-mono {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  fill: var(--ink-3);
}
.gwl-ring {
  fill: var(--surface);
  stroke: var(--line-strong);
  stroke-width: 1.4;
}
.gwl-ring-soft {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 3;
}
.gwl-blade {
  fill: var(--accent-soft);
  stroke: var(--accent);
  stroke-width: 1.1;
}
.gwl-core {
  fill: var(--accent);
}
.gwl-flow {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.25;
  stroke-dasharray: 3 2;
}
.gwl-row {
  fill: var(--surface);
  stroke: var(--line);
  stroke-width: 1;
}
.gwl-row-hi {
  stroke: var(--accent);
  fill: var(--accent-soft);
}
.gwl-id {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 700;
  fill: var(--accent);
}
.gwl-txt {
  font-family: var(--font);
  font-size: 10px;
  fill: var(--ink);
}
.gwl-badge {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  fill: var(--teal);
}
@media (max-width: 860px) {
  .closing-grid {
    grid-template-columns: 1fr;
  }
}

/* ── 검토 지적 반영: 구형 Popover 폴백 · 어두운 판 마스킹 대비 · 모바일 컨트롤 정렬 ── */
.gw-popover-legacy {
  margin-top: 12px;
  max-width: 100%;
}
.gw-redacted {
  color: var(--ink-2);
}
@container (max-width: 420px) {
  .gw-aperture-bar {
    gap: 6px 8px;
  }
  .gw-range-wrap input[type="range"] {
    width: 86px;
  }
}
