/* OpenLearningLab — 분석 사이트 디자인 시스템 (기관급 톤) */
/* 디자인 토큰 — `plan/A_DESIGN_SYSTEM.md` §2 일관 */

:root {
  /* 색상 */
  --lab-primary: #0B2E5C;      /* Navy — 학술 권위 */
  --lab-accent: #0FA3B1;       /* Cyan — 데이터 친화 */
  --lab-highlight: #F5A623;    /* Amber — 핵심 강조 (CK 색맹 호환) */
  --lab-critical: #C5283D;     /* Red — 사각지대·위험 */
  --lab-success: #27AE60;
  --lab-warn: #E67E22;
  --lab-violet: #7C3AED;        /* 평생교육·강좌·보조 지표 보라 */
  --lab-text: #1F2937;
  --lab-text-secondary: #5A6470;
  --lab-bg: #FAFAF6;           /* Cream */
  --lab-bg-alt: #F0F2F5;
  --lab-border: #E5E7EB;
  --lab-card: #ffffff;

  /* 간격 */
  --lab-xs: 4px;
  --lab-sm: 8px;
  --lab-md: 16px;
  --lab-lg: 24px;
  --lab-xl: 32px;
  --lab-2xl: 48px;

  /* 둥근 모서리·그림자 */
  --lab-radius-sm: 4px;
  --lab-radius-md: 8px;
  --lab-radius-lg: 12px;
  --lab-shadow-card: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --lab-shadow-hover: 0 4px 12px rgba(0,0,0,0.12);

  /* 폰트 크기 */
  --lab-font-display: 48px;
  --lab-font-h1: 32px;
  --lab-font-h2: 24px;
  --lab-font-h3: 18px;
  --lab-font-body: 14px;
  --lab-font-body-sm: 12px;

  /* ───────────────────────────────────────────────────────────────────
   * /lab/diagnosis 재구성 (10 요소 통합 패키지) 디자인 토큰
   * 학술 출처: CRAN viridis vignette + Okabe & Ito (2002) + ColorBrewer
   * 적용: 격차 진단 (Heatmap/Beeswarm/Lorenz/Choropleth) 시각화 전용
   * 회귀 보호: 기존 토큰 미변경, 신규 토큰만 추가
   * ──────────────────────────────────────────────────────────────────*/

  /* Viridis sequential 11단계 (CIELAB perceptually uniform).
   * 격차 지수 0-1 매핑. 0=보라(낮음) → 0.5=청록 → 1=노랑(높음).
   * Plotly colorscale 호환 (--lab-viridis-N 형식, N=0..10). */
  --lab-viridis-0:  #440154;
  --lab-viridis-1:  #482878;
  --lab-viridis-2:  #3E4989;
  --lab-viridis-3:  #31688E;
  --lab-viridis-4:  #26828E;
  --lab-viridis-5:  #1F9E89;
  --lab-viridis-6:  #35B779;
  --lab-viridis-7:  #6DCD59;
  --lab-viridis-8:  #B4DE2C;
  --lab-viridis-9:  #FDE725;
  --lab-viridis-10: #FFFFA0;

  /* Okabe-Ito (2002) 색맹 친화 categorical 8색.
   * deuteranopia + protanopia + tritanopia 모두 구분 가능.
   * 카테고리 시각화 (군집 5종, Beeswarm facet 등) 용. */
  --lab-okabe-1: #000000;  /* black */
  --lab-okabe-2: #E69F00;  /* orange */
  --lab-okabe-3: #56B4E9;  /* sky blue */
  --lab-okabe-4: #009E73;  /* bluish green */
  --lab-okabe-5: #F0E442;  /* yellow */
  --lab-okabe-6: #0072B2;  /* blue */
  --lab-okabe-7: #D55E00;  /* vermilion */
  --lab-okabe-8: #CC79A7;  /* reddish purple */

  /* 격차 진단 시맨틱 색상 — 학술 표준 임계.
   * Gini 0.0-0.3 (낮음·녹색) · 0.3-0.5 (중간·앰버) · 0.5+ (높음·적색).
   * OECD social inequality threshold 0.3 기준. */
  --lab-gap-low:    var(--lab-viridis-7);  /* 0.0-0.3 */
  --lab-gap-mid:    var(--lab-highlight);   /* 0.3-0.5 */
  --lab-gap-high:   var(--lab-critical);    /* 0.5+ */
  --lab-gap-extreme: #7A0F26;               /* 0.65+ (population/lifelong 등) */

  /* 접근성 alt 색상 (WCAG AAA, 7:1 대비) — high-contrast 모드용. */
  --lab-hc-bg:     #FFFFFF;
  --lab-hc-text:   #000000;
  --lab-hc-accent: #0050B3;
  --lab-hc-warn:   #B00020;

  /* ───────────────────────────────────────────────────────────────────
   * 지도 모드별 단색 grade (사이트 색 system 통합) — 2026 디자인 정합
   * /lab/availability choropleth 의 3 모드 색 일관성.
   * util/rate (방송대) = 청록 grade · public (공공) = 진청록 grade.
   * 9 단계 (0=가장 밝음 → 8=가장 진함). ColorBrewer sequential luminance step 일관.
   * 회귀 차단: viridis var 그대로 유지 (diagnosis·shap 사용 중).
   * ──────────────────────────────────────────────────────────────────*/
  --lab-grade-knou-0: #E6F4F6;
  --lab-grade-knou-1: #C6E8EC;
  --lab-grade-knou-2: #95D3D9;
  --lab-grade-knou-3: #5FBCC4;
  --lab-grade-knou-4: #2EA8B0;
  --lab-grade-knou-5: #0FA3B1;
  --lab-grade-knou-6: #0C8089;
  --lab-grade-knou-7: #0A5F66;
  --lab-grade-knou-8: #074348;

  --lab-grade-public-0: #E6ECF5;
  --lab-grade-public-1: #C2D0E5;
  --lab-grade-public-2: #94AECF;
  --lab-grade-public-3: #6586B3;
  --lab-grade-public-4: #345E92;
  --lab-grade-public-5: #0B2E5C;
  --lab-grade-public-6: #082549;
  --lab-grade-public-7: #061B36;
  --lab-grade-public-8: #041223;

  /* Bivariate 3×3 매트릭스 (활용률 X × 학우 수 Y) — Stevens 2015 표준 톤.
   * cell-{x}-{y} : x=활용률(0=낮음, 2=높음), y=학우(0=적음, 2=많음).
   * (0,0)=중립 회색 / (2,2)=강한 청보라 (양쪽 ↑) / (0,2)=진청록 (학우 ↑·활용 ↓ = 정책 우선)
   * (2,0)=청록 (학우 ↓·활용 ↑ = 효율 운영) */
  --lab-bivariate-0-0: #E8E8E8;
  --lab-bivariate-1-0: #B0D6D6;
  --lab-bivariate-2-0: #6FBCBC;
  --lab-bivariate-0-1: #B8B8D9;
  --lab-bivariate-1-1: #85B5C5;
  --lab-bivariate-2-1: #4F9CB0;
  --lab-bivariate-0-2: #6F6FBF;
  --lab-bivariate-1-2: #5085AF;
  --lab-bivariate-2-2: #2E5F8E;
}

/* ───────────────────────────────────────────────────────────────────
 * /lab/availability choropleth 지도 (2026 디자인 전면 검토)
 * Datawrapper 9 기법 + Stevens 2015 Bivariate + WCAG 2.2 + 모바일 first
 * 회귀 차단: 신규 클래스만 (.avail-poly-*, .avail-map-*)
 * ──────────────────────────────────────────────────────────────────*/
.leaflet-overlay-pane svg path.avail-poly-data,
.leaflet-overlay-pane svg path.avail-poly-empty {
  transition: stroke-width 0.2s ease, filter 0.25s ease, fill-opacity 0.25s ease;
}
.leaflet-overlay-pane svg path.avail-poly-data:hover,
.leaflet-overlay-pane svg path.avail-poly-empty:hover {
  filter: drop-shadow(0 2px 6px rgba(11, 46, 92, 0.35));
  stroke-width: 2 !important;
  cursor: pointer;
}
.leaflet-overlay-pane svg path.avail-poly-data:focus-visible,
.leaflet-overlay-pane svg path.avail-poly-empty:focus-visible {
  outline: none;   /* 사각형 테두리 제거 — 폴리곤 모양 글로우로 대체 (a11y 유지) */
  filter: drop-shadow(0 0 8px var(--lab-highlight));
}
/* 전 lab 지도 폴리곤 클릭/포커스 시 브라우저 기본 사각형 outline 제거 — 단일 source (reset.css 전역 override·전 지도 일관) */
.leaflet-container .leaflet-interactive:focus,
.leaflet-container .leaflet-interactive:focus-visible {
  outline: none !important;
}
/* D-LINK 연동 강조 — 자치구 선택·표 클릭 등 선택 시 연동된 영역에 '방금 갱신됨' 펄스 (전 페이지 공통 단일 source) */
@keyframes lab-link-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15,163,177,0.5); }
  70%  { box-shadow: 0 0 0 12px rgba(15,163,177,0); }
  100% { box-shadow: 0 0 0 0 rgba(15,163,177,0); }
}
.lab-link-flash { animation: lab-link-pulse 1.4s ease-out 1; }
@media (prefers-reduced-motion: reduce) { .lab-link-flash { animation: none; } }
/* 💡 정책 활용 — 표·지표별 정책담당자 핵심 인사이트·핵심값 (전 페이지 공통 단일 source) */
.lab-policy-tip { margin:8px 0 16px; border:1px solid #D6EEF0; border-left:3px solid #0FA3B1; border-radius:8px; background:#F4FAFB; }
.lab-policy-tip > summary { cursor:pointer; list-style:none; padding:9px 14px; font-size:12.5px; font-weight:700; color:#0B2E5C; line-height:1.6; }
.lab-policy-tip > summary::-webkit-details-marker { display:none; }
.lab-policy-tip > summary::before { content:"▶"; font-size:10px; color:#0FA3B1; margin-right:6px; }
.lab-policy-tip[open] > summary::before { content:"▼"; }
.lab-policy-tip > summary:focus-visible { outline:2px solid var(--lab-accent); outline-offset:2px; }
.lab-policy-tip-body { padding:2px 14px 12px; font-size:12px; color:#5A6470; line-height:1.8; }
.leaflet-overlay-pane svg path.avail-poly-empty {
  fill: url(#avail-hatch-gray) !important;
}
.leaflet-overlay-pane svg path.avail-poly-linked {
  stroke-width: 3 !important;
  filter: drop-shadow(0 0 8px var(--lab-accent));
}

/* 지도 legend bar — 색 grade + 평균 marker */
.avail-map-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--lab-card);
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-md);
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
}
.avail-map-legend .legend-label {
  font-weight: 600;
  color: var(--lab-primary);
  min-width: 90px;
}
.avail-map-legend .legend-bar {
  position: relative;
  flex: 1;
  min-width: 200px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(to right, var(--lab-grade-knou-0), var(--lab-grade-knou-8));
}
.avail-map-legend .legend-bar.public {
  background: linear-gradient(to right, var(--lab-grade-public-0), var(--lab-grade-public-8));
}
.avail-map-legend .legend-marker {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: var(--lab-highlight);
  box-shadow: 0 0 0 1px var(--lab-card);
}
.avail-map-legend .legend-marker::after {
  content: attr(data-label);
  position: absolute;
  top: -18px; left: 50%; transform: translateX(-50%);
  font-size: 10px; color: var(--lab-highlight); font-weight: 700;
  white-space: nowrap;
}
.avail-map-legend .legend-minmax {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--lab-text-secondary);
  margin-top: 2px;
}
.avail-map-legend .legend-bivariate {
  display: grid;
  grid-template-columns: repeat(3, 26px);
  grid-template-rows: repeat(3, 26px);
  gap: 1px;
  background: var(--lab-border);
  padding: 1px;
}
.avail-map-legend .legend-bivariate-cell {
  width: 26px; height: 26px;
}
.avail-map-legend .legend-bivariate-axes {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 10px; color: var(--lab-text-secondary);
}

/* 모바일 — 토글 큰 tap target (44pt+) 유지. position: sticky 제거
 * (body 전체 sticky → 첫 화면 부터 떠보이는 부작용. NN/g thumb zone 이론은
 * 단일 nav bar 에 적합하고, 페이지 내부 컨트롤은 inline 이 자연). */
@media (max-width: 768px) {
  .avail-map-toggle {
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
  }
  .avail-map-btn {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px !important;
  }
  /* Bottom sheet popup — Leaflet popup 의 모바일 fullscreen */
  .leaflet-popup.avail-popup-bottomsheet .leaflet-popup-content-wrapper {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    max-height: 60vh;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.2);
    margin: 0;
  }
  .leaflet-popup.avail-popup-bottomsheet .leaflet-popup-tip-container,
  .leaflet-popup.avail-popup-bottomsheet .leaflet-popup-close-button {
    display: none;
  }
}

/* 기본 reset · base */
.lab-body {
  margin: 0;
  background: var(--lab-bg);
  color: var(--lab-text);
  font-family: 'Pretendard', -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', sans-serif;
  font-size: var(--lab-font-body);
  line-height: 1.6;
}

.lab-container,
.lab-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: var(--lab-lg);
}

/* 헤더 */
.lab-header {
  background: var(--lab-primary);
  color: #fff;
  padding: var(--lab-lg) var(--lab-xl);
  box-shadow: var(--lab-shadow-card);
}

.lab-header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lab-brand {
  font-size: var(--lab-font-h2);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lab-brand-sub {
  font-size: var(--lab-font-body-sm);
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}

.lab-nav {
  display: flex;
  gap: var(--lab-md);
}

.lab-nav a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  font-size: var(--lab-font-body);
  padding: var(--lab-xs) var(--lab-sm);
  border-radius: var(--lab-radius-sm);
  transition: background 0.15s;
}

.lab-nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.lab-nav a.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 600; }

/* 참고도서 통합검색(홈 사이트) 강조 링크 — 네이비 헤더에서 시안 강조색을
   채운 칩으로 확연히 부각. 기존 강조색(--lab-accent) 그대로라 위화감 없음. */
.lab-nav a.lab-nav-home {
  background: var(--lab-accent); color: #fff; font-weight: 700;
  box-shadow: 0 1px 6px rgba(15, 163, 177, 0.42);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.lab-nav a.lab-nav-home:hover,
.lab-nav a.lab-nav-home:focus-visible {
  background: #0c8a96; color: #fff; transform: translateY(-1px);
  box-shadow: 0 2px 9px rgba(15, 163, 177, 0.55);
}

/* 히어로 */
.lab-hero {
  background: linear-gradient(135deg, var(--lab-primary) 0%, #1a4a8a 100%);
  color: #fff;
  padding: var(--lab-2xl) var(--lab-xl);
  text-align: center;
}

.lab-hero-tagline {
  font-size: var(--lab-font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 0 0 var(--lab-md);
}

.lab-hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.8);
  max-width: 800px;
  margin: 0 auto;
}

/* KPI 카드 */
.lab-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--lab-md);
  margin: var(--lab-xl) 0;
}

.lab-kpi-card {
  background: var(--lab-card);
  border-radius: var(--lab-radius-md);
  padding: var(--lab-lg);
  box-shadow: var(--lab-shadow-card);
  border-top: 3px solid var(--lab-accent);
  /* L2: <a class="lab-kpi-card"> 사용 시 anchor 기본 스타일 reset */
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

/* anchor 일 때만 hover 효과 — clickable indication */
a.lab-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(15, 163, 177, 0.18);
}

.lab-kpi-card.kpi-critical { border-top-color: var(--lab-critical); }
.lab-kpi-card.kpi-highlight { border-top-color: var(--lab-highlight); }
.lab-kpi-card.kpi-success { border-top-color: var(--lab-success); }

.lab-kpi-label {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.lab-kpi-value {
  font-size: 36px;
  font-weight: 800;
  color: var(--lab-primary);
  margin: var(--lab-xs) 0;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.lab-kpi-unit {
  font-size: var(--lab-font-body);
  font-weight: 500;
  color: var(--lab-text-secondary);
}

.lab-kpi-foot {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  margin-top: var(--lab-sm);
}

/* 섹션 */
.lab-section {
  background: var(--lab-card);
  border-radius: var(--lab-radius-md);
  padding: var(--lab-xl);
  margin: var(--lab-xl) auto;
  box-shadow: var(--lab-shadow-card);
  min-width: 0;
  max-width: 1400px;
  box-sizing: border-box;       /* outer = max-width 1400 (padding 포함) — margin auto 정공 작동 */
  overflow-x: clip;
}

.lab-section-title {
  font-size: var(--lab-font-h2);
  font-weight: 700;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-md);
  border-bottom: 2px solid var(--lab-accent);
  padding-bottom: var(--lab-sm);
  display: inline-block;
}

.lab-section-lead {
  font-size: 16px;
  color: var(--lab-text-secondary);
  margin: 0 0 var(--lab-lg);
}

/* 표 */
.lab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--lab-font-body);
}

.lab-table th {
  background: var(--lab-bg-alt);
  color: var(--lab-text);
  font-weight: 600;
  text-align: left;
  padding: var(--lab-sm) var(--lab-md);
  border-bottom: 2px solid var(--lab-border);
}

.lab-table td {
  padding: var(--lab-sm) var(--lab-md);
  border-bottom: 1px solid var(--lab-border);
}

/* 사용자 fb 정공 (2026-05-28): 표 컬럼·데이터 정렬 일치 — 숫자 컬럼 th·td 일관 right
   /lab/access-siting 전면 개선 벤치마크 결정. .num class 적용 시 정공 자동 일관. */
.lab-table th.num,
.lab-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.lab-table tr:hover td {
  background: var(--lab-bg-alt);
}

/* 인사이트 박스 */
.lab-insight {
  background: linear-gradient(135deg, rgba(15,163,177,0.08) 0%, rgba(15,163,177,0.02) 100%);
  border-left: 4px solid var(--lab-accent);
  padding: var(--lab-md) var(--lab-lg);
  margin: var(--lab-md) 0;
  border-radius: 0 var(--lab-radius-md) var(--lab-radius-md) 0;
}

.lab-insight-title {
  font-weight: 700;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}

/* 푸터 */
.lab-footer {
  background: var(--lab-bg-alt);
  padding: var(--lab-xl) var(--lab-lg);
  margin-top: var(--lab-2xl);
  border-top: 1px solid var(--lab-border);
}

.lab-footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  line-height: 1.8;
}

.lab-footer a { color: var(--lab-accent); }

/* ──────────────────────────────────────────────────────────────
 * 데이터 출처 카드 (Phase L4)
 * 7 provider 그룹 + 기타 합산 → 8 카드 max
 * ────────────────────────────────────────────────────────────── */
.lab-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.lab-source-card {
  background: #FDFDF8;
  border-left: 3px solid var(--lab-accent);
  border-radius: 4px;
  padding: 10px 12px 12px;
  line-height: 1.5;
}

.lab-source-card-other {
  border-left-color: var(--lab-text-secondary);
  background: #F8F8F2;
}

.lab-source-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--lab-primary);
  margin-bottom: 4px;
}

.lab-source-rows {
  font-size: 18px;
  font-weight: 700;
  color: var(--lab-text);
  font-variant-numeric: tabular-nums;
}

.lab-source-unit {
  font-size: 10.5px;
  color: var(--lab-text-secondary);
  margin-top: 2px;
}

/* ──────────────────────────────────────────────────────────────
 * 분석 흐름 다이어그램 — 5 Phase pipeline (Phase L3)
 * 가로 흐름 (반응형: 768px 이하 세로 stack)
 * ────────────────────────────────────────────────────────────── */
.lab-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 16px 0;
}

.lab-flow-step {
  flex: 1 1 0;
  min-width: 160px;
  background: var(--lab-card, #fff);
  border-top: 4px solid var(--lab-accent);
  border-radius: var(--lab-radius-sm, 6px);
  padding: 14px 14px 16px;
  text-decoration: none;
  color: var(--lab-text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex;
  flex-direction: column;
}

.lab-flow-step:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15, 163, 177, 0.18);
  border-top-color: var(--lab-primary);
}

.lab-flow-num {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background: var(--lab-primary);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.lab-flow-step h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  color: var(--lab-primary);
}

.lab-flow-method {
  margin: 0 0 4px;
  font-size: 11.5px;
  color: var(--lab-text);
  line-height: 1.4;
}

.lab-flow-input {
  margin: 4px 0 0;
  font-size: 10.5px;
  color: var(--lab-text-secondary);
  line-height: 1.4;
}

.lab-flow-arrow {
  align-self: center;
  font-size: 22px;
  color: var(--lab-accent);
  font-weight: 700;
  padding: 0 2px;
}

@media (max-width: 768px) {
  .lab-flow {
    flex-direction: column;
  }
  .lab-flow-arrow {
    align-self: center;
    transform: rotate(90deg);
  }
}

/* ──────────────────────────────────────────────────────────────
 * 이중 설명 토글 — 대학생용 (기본 표시) + 중학생용 (펼침)
 * 표준 <details>/<summary> 요소 활용 (접근성 OK, JS 불필요)
 * ────────────────────────────────────────────────────────────── */
.lab-explain {
  margin: 12px 0;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-sm, 6px);
  background: #FDFDF8;
  font-size: 13px;
  line-height: 1.65;
}

.lab-explain[open] {
  border-color: #C7E8E8;
  background: #F0FAFA;
}

.lab-explain > summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--lab-accent);
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.lab-explain > summary::before {
  content: '🌱';
  font-size: 14px;
}

.lab-explain > summary::after {
  content: '▶';
  margin-left: auto;
  font-size: 10px;
  transition: transform 0.15s ease;
  color: var(--lab-text-secondary);
}

.lab-explain[open] > summary::after {
  transform: rotate(90deg);
}

.lab-explain > summary:hover {
  background: rgba(15, 163, 177, 0.06);
}

.lab-explain-body {
  padding: 4px 16px 14px;
  color: var(--lab-text);
}

.lab-explain-body p {
  margin: 8px 0;
}

.lab-explain-body strong {
  color: var(--lab-primary);
}

/* 일상 예시 박스 (선택, 중학생 설명 안에서) */
.lab-explain-example {
  margin-top: 10px;
  padding: 8px 12px;
  background: #FFF8E8;
  border-left: 3px solid var(--lab-warn, #F5A623);
  font-size: 12.5px;
  color: var(--lab-text);
  border-radius: 0 4px 4px 0;
}

.lab-explain-example::before {
  content: '💡 예: ';
  font-weight: 600;
  color: #92400E;
}

/* 4요소 해설 박스 — 계산법·근거·유의미·실현가능 */
.lab-explain-four {
  margin: 16px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.lab-explain-four-item {
  padding: 12px 14px;
  background: var(--lab-card, #fff);
  border-top: 3px solid var(--lab-accent);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
  font-size: 12.5px;
  line-height: 1.55;
}

.lab-explain-four-item h5 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--lab-primary);
}

.lab-explain-four-item .num {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  background: var(--lab-accent);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  margin-right: 4px;
}

/* navigation cards (홈 페이지) */
.lab-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--lab-md);
  margin: var(--lab-lg) 0;
}

.lab-page-card {
  background: var(--lab-card);
  border-radius: var(--lab-radius-md);
  padding: var(--lab-lg);
  box-shadow: var(--lab-shadow-card);
  text-decoration: none;
  color: var(--lab-text);
  transition: all 0.2s;
  border: 1px solid transparent;
}

.lab-page-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--lab-shadow-hover);
  border-color: var(--lab-accent);
}

.lab-page-card-num {
  display: inline-block;
  background: var(--lab-primary);
  color: #fff;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  border-radius: 50%;
  font-size: var(--lab-font-body-sm);
  font-weight: 700;
  margin-bottom: var(--lab-sm);
}

.lab-page-card-title {
  font-size: var(--lab-font-h3);
  font-weight: 700;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}

.lab-page-card-desc {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  margin: 0;
}

/* 반응형 */
@media (max-width: 767px) {
  .lab-hero-tagline { font-size: 28px; }
  .lab-hero-sub { font-size: 14px; }
  .lab-header-inner { flex-direction: column; gap: var(--lab-sm); }
  .lab-nav { flex-wrap: wrap; gap: var(--lab-sm); }
  .lab-section { padding: var(--lab-md); }
  .lab-kpi-value { font-size: 28px; }
}

/* 출처·법적 표기 */
.lab-source-note {
  font-size: 11px;
  color: var(--lab-text-secondary);
  font-style: italic;
}

/* ───────────────────────────────────────────────────────────────────
 * /lab/diagnosis 재구성 (P4.x) — diag-* 신규 클래스
 * 패턴: KOSIS e-지방지표 Big Number + IMF DataMapper + OWID grapher
 * 회귀: diag-* prefix 로 다른 페이지 클래스 충돌 0
 * ──────────────────────────────────────────────────────────────────*/

/* P4.1 Hero Big Number 3-카드 (KOSIS 패턴) */
.diag-hero {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lab-md);
  margin: var(--lab-xl) 0 var(--lab-lg);
  container-type: inline-size;
}
@container (max-width: 720px) {
  .diag-hero { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* @container 미지원 환경 fallback */
  .diag-hero { grid-template-columns: 1fr; }
}
.diag-hero-card {
  background: var(--lab-card);
  padding: var(--lab-xl) var(--lab-lg);
  border-radius: var(--lab-radius-lg);
  box-shadow: var(--lab-shadow-card);
  border-left: 4px solid var(--lab-accent);
  display: flex;
  flex-direction: column;
}
.diag-hero-card--max { border-left-color: var(--lab-gap-high); }
.diag-hero-card--min { border-left-color: var(--lab-gap-low); }
.diag-hero-label {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: var(--lab-sm);
}
.diag-hero-value {
  font-size: 56px;
  font-weight: 700;
  color: var(--lab-primary);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: 0;
}
.diag-hero-card--max .diag-hero-value { color: var(--lab-gap-high); }
.diag-hero-card--min .diag-hero-value { color: var(--lab-gap-low); }
.diag-hero-sub {
  font-size: var(--lab-font-h3);
  color: var(--lab-text);
  margin-top: 6px;
  font-weight: 600;
}
.diag-hero-narrative {
  margin-top: var(--lab-sm);
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  line-height: 1.5;
}
.diag-hero-skeleton {
  background: linear-gradient(90deg, var(--lab-bg-alt) 25%, var(--lab-border) 50%, var(--lab-bg-alt) 75%);
  background-size: 200% 100%;
  animation: diag-skel 1.2s ease-in-out infinite;
  height: 1em;
  border-radius: 4px;
}
@keyframes diag-skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* P4.2 IMF 3-view linked dashboard (imf.org/external/datamapper) */
.diag-imf {
  margin: var(--lab-2xl) 0 var(--lab-xl);
  container-type: inline-size;
}
.diag-imf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--lab-md);
  margin-bottom: var(--lab-md);
}
.diag-imf-title {
  font-size: var(--lab-font-h2);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0;
}
.diag-imf-selector {
  font-size: var(--lab-font-body);
  font-family: inherit;
  padding: 8px 14px;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-md);
  background: var(--lab-card);
  min-width: 280px;
  color: var(--lab-text);
  cursor: pointer;
}
.diag-imf-selector:focus {
  outline: 2px solid var(--lab-accent);
  outline-offset: 1px;
}
.diag-imf-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: auto auto;
  gap: var(--lab-md);
  grid-template-areas:
    "map     ranking"
    "violin  ranking";
}
@container (max-width: 960px) {
  .diag-imf-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "map" "violin" "ranking";
  }
}
@media (max-width: 768px) {
  .diag-imf-grid {
    grid-template-columns: 1fr;
    grid-template-areas: "map" "violin" "ranking";
  }
}
.diag-imf-view {
  background: var(--lab-card);
  padding: var(--lab-md);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
}
.diag-imf-view--map { grid-area: map; }
.diag-imf-view--violin { grid-area: violin; }
.diag-imf-view--ranking { grid-area: ranking; max-height: 760px; overflow-y: auto; }
.diag-imf-view h4 {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--lab-sm);
  font-weight: 600;
}
.diag-imf-rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: var(--lab-sm);
  padding: 5px 8px;
  border-radius: var(--lab-radius-sm);
  align-items: center;
  transition: background 0.15s;
}
.diag-imf-rank-row:hover { background: var(--lab-bg-alt); }
/* P4.6 cross-filter — 지도 polygon hover 시 표 row 강조 (양방향) */
.diag-imf-rank-row.diag-xf-active {
  background: var(--lab-okabe-5);
  border-left: 3px solid var(--lab-accent);
  padding-left: 5px;
}
.diag-imf-rank-num {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.diag-imf-rank-sgg { font-size: var(--lab-font-body); }
.diag-imf-rank-val {
  font-size: var(--lab-font-body);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--lab-primary);
}
.diag-imf-rank-section-title {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: var(--lab-sm) 0 4px;
  font-weight: 600;
}
.diag-imf-rank-divider {
  text-align: center;
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  padding: var(--lab-sm) 0;
  letter-spacing: 4px;
}

/* P4.3 OWID Lorenz multi-chart (ourworldindata.org/economic-inequality) */
.diag-lorenz {
  margin: var(--lab-2xl) 0 var(--lab-xl);
  container-type: inline-size;
}
.diag-lorenz-title {
  font-size: var(--lab-font-h2);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}
.diag-lorenz-sub {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  margin: 0 0 var(--lab-md);
  line-height: 1.55;
}
.diag-lorenz-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--lab-md);
}
@container (max-width: 800px) {
  .diag-lorenz-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .diag-lorenz-grid { grid-template-columns: 1fr; }
}
.diag-lorenz-view {
  background: var(--lab-card);
  padding: var(--lab-md);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
}
.diag-lorenz-view h4 {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--lab-sm);
  font-weight: 600;
}
.diag-lorenz-svg {
  width: 100%;
  height: 380px;
  display: block;
}
.diag-palma {
  display: flex;
  flex-direction: column;
  gap: var(--lab-sm);
}
.diag-palma-card {
  padding: var(--lab-md);
  background: var(--lab-bg-alt);
  border-radius: var(--lab-radius-md);
  border-left: 3px solid var(--lab-accent);
}
.diag-palma-label {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: 4px;
}
.diag-palma-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--lab-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.diag-palma-narr {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  margin-top: 4px;
  line-height: 1.45;
}

/* P4.4 19×6 Heatmap — 격차 매트릭스 일람 (Viridis) */
.diag-heatmap {
  margin: var(--lab-2xl) 0 var(--lab-xl);
  container-type: inline-size;
}
.diag-heatmap-title {
  font-size: var(--lab-font-h2);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}
.diag-heatmap-sub {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  margin: 0 0 var(--lab-md);
  line-height: 1.55;
}
.diag-heatmap-container {
  background: var(--lab-card);
  padding: var(--lab-md);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
}

/* POST-1.3 accessibility catchment chip selector */
.access-chips {
  display: inline-flex;
  gap: 4px;
  background: var(--lab-bg-alt);
  padding: 4px;
  border-radius: var(--lab-radius-md);
}
.access-chip {
  background: transparent;
  border: 0;
  padding: 8px 16px;
  border-radius: var(--lab-radius-sm);
  font-family: inherit;
  font-size: var(--lab-font-body);
  font-weight: 600;
  color: var(--lab-text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.access-chip:hover { background: var(--lab-card); color: var(--lab-text); }
.access-chip.active {
  background: var(--lab-primary);
  color: #fff;
}
.access-chip:focus { outline: 2px solid var(--lab-accent); outline-offset: 1px; }

/* P4.5 Beeswarm + Dumbbell small multiples
 * 학술: Pew Research 2025 best 4 + Evergreen "4 chart types fight equality" */
.diag-distribution {
  margin: var(--lab-2xl) 0 var(--lab-xl);
  container-type: inline-size;
}
.diag-distribution-title {
  font-size: var(--lab-font-h2);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}
.diag-distribution-sub {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  margin: 0 0 var(--lab-md);
  line-height: 1.55;
}
.diag-distribution-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--lab-md);
}
@container (max-width: 800px) {
  .diag-distribution-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .diag-distribution-grid { grid-template-columns: 1fr; }
}
.diag-distribution-view {
  background: var(--lab-card);
  padding: var(--lab-md);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
}
.diag-distribution-view h4 {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 var(--lab-sm);
  font-weight: 600;
}

/* P4.8 Theil-L vs Theil-T 분해 패널 (Bourguignon 1979) */
.diag-theil {
  margin: var(--lab-2xl) 0 var(--lab-xl);
}
.diag-theil-title {
  font-size: var(--lab-font-h2);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-xs);
}
.diag-theil-sub {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  margin: 0 0 var(--lab-md);
  line-height: 1.55;
}
.diag-theil-container {
  background: var(--lab-card);
  padding: var(--lab-md);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
}

/* FR-1.1 /lab Flagship 3-카드 — KOSIS e-지방지표 + Tableau Public 2025 #1
 * 대상 수상 임팩트 핵심 강조: 학우 + 학술 + 사회 가치 3 측면 */
.lab-flagship {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--lab-md);
  margin: var(--lab-xl) auto;
  max-width: 1400px;
  padding: 0 var(--lab-lg);
  container-type: inline-size;
}
/* 5-카드 / 4-카드 / 3-카드 modifier (페이지별 Hero) */
.lab-flagship--5col { grid-template-columns: repeat(5, 1fr); }
.lab-flagship--4col { grid-template-columns: repeat(4, 1fr); }
.lab-flagship--3col { grid-template-columns: repeat(3, 1fr); }
@container (max-width: 1200px) {
  .lab-flagship--5col { grid-template-columns: repeat(3, 1fr); }
}
@container (max-width: 960px) {
  .lab-flagship--5col { grid-template-columns: repeat(2, 1fr); }
  .lab-flagship--4col { grid-template-columns: repeat(2, 1fr); }
  .lab-flagship--3col { grid-template-columns: 1fr; }
}
@container (max-width: 760px) {
  .lab-flagship { grid-template-columns: 1fr; }
  .lab-flagship--5col { grid-template-columns: 1fr; }
  .lab-flagship--4col { grid-template-columns: 1fr; }
  .lab-flagship--3col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .lab-flagship { grid-template-columns: 1fr; }
  .lab-flagship--5col { grid-template-columns: 1fr; }
  .lab-flagship--4col { grid-template-columns: 1fr; }
  .lab-flagship--3col { grid-template-columns: 1fr; }
}

/* G KNOU 가중 — TOP/BOTTOM 10 2 컬럼 grid */
.knou-weighted-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 12px 0;
}
.knou-weighted-grid h5 { font-size: 13px; font-weight: 700; }
@media (max-width: 880px) {
  .knou-weighted-grid { grid-template-columns: 1fr; }
}
.lab-flagship-card {
  background: var(--lab-card);
  padding: var(--lab-xl) var(--lab-lg);
  border-radius: var(--lab-radius-lg);
  box-shadow: var(--lab-shadow-card);
  border-top: 4px solid var(--lab-accent);
  display: flex;
  flex-direction: column;
  position: relative;
  /* overflow: hidden 제거 — tooltip pseudo-element 가 카드 밖으로 자유롭게 표시되도록.
     모서리 ::before 배지 (Flow/Stock/공공/방송대) 도 잘리지 않고 정상 표시됨. */
}
.lab-flagship-card--learner { border-top-color: var(--lab-primary); }
.lab-flagship-card--gap { border-top-color: var(--lab-gap-high); }
.lab-flagship-card--value { border-top-color: var(--lab-okabe-4); }
.lab-flagship-label {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
  margin-bottom: var(--lab-sm);
}
.lab-flagship-value {
  font-size: 56px;
  font-weight: 800;
  color: var(--lab-primary);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
  margin: 0;
  letter-spacing: -1px;
}
.lab-flagship-card--gap .lab-flagship-value { color: var(--lab-gap-high); }
.lab-flagship-card--value .lab-flagship-value { color: var(--lab-okabe-4); }
.lab-flagship-unit {
  font-size: var(--lab-font-h3);
  font-weight: 600;
  color: var(--lab-text);
  margin: 4px 0 var(--lab-sm);
}
.lab-flagship-narr {
  font-size: var(--lab-font-body);
  color: var(--lab-text-secondary);
  line-height: 1.55;
  margin: 0;
}
.lab-flagship-source {
  font-size: 11px;
  color: var(--lab-text-secondary);
  font-style: italic;
  margin-top: var(--lab-md);
}

/* P4.10 접근성 — alt 데이터 테이블 (W4A 2025 + WCAG AAA) */
.diag-a11y-details {
  margin: var(--lab-xl) 0;
  background: var(--lab-card);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
  border: 1px solid var(--lab-border);
}
.diag-a11y-details > summary {
  padding: var(--lab-md);
  cursor: pointer;
  font-weight: 600;
  color: var(--lab-primary);
  font-size: var(--lab-font-body);
}
.diag-a11y-details > summary:hover { background: var(--lab-bg-alt); }
.diag-a11y-body {
  padding: 0 var(--lab-md) var(--lab-md);
  font-size: var(--lab-font-body);
}
.diag-a11y-body p {
  color: var(--lab-text-secondary);
  margin: var(--lab-sm) 0 var(--lab-md);
}
.diag-a11y-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--lab-font-body-sm);
}
.diag-a11y-body th,
.diag-a11y-body td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--lab-border);
}
.diag-a11y-body th {
  background: var(--lab-bg-alt);
  font-weight: 600;
  color: var(--lab-primary);
}
.diag-a11y-body td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.diag-a11y-section {
  margin-top: var(--lab-lg);
}
.diag-a11y-section h5 {
  font-size: var(--lab-font-body);
  color: var(--lab-primary);
  margin: 0 0 var(--lab-sm);
}

/* P4.7 Scrollytelling narrative — 학우 학습 곡선 완화
 * 학술: Scrollama 3.2.0 + Vis & Society 2026 */
.diag-narrative {
  margin: var(--lab-2xl) 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--lab-md);
  container-type: inline-size;
}
@container (max-width: 800px) {
  .diag-narrative { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .diag-narrative { grid-template-columns: 1fr; }
}
.diag-narr-step {
  background: var(--lab-card);
  padding: var(--lab-lg);
  border-radius: var(--lab-radius-md);
  box-shadow: var(--lab-shadow-card);
  border-left: 4px solid var(--lab-border);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease,
              border-left-color 0.4s;
}
.diag-narr-step.active {
  opacity: 1;
  transform: translateY(0);
  border-left-color: var(--lab-accent);
}
.diag-narr-num {
  font-size: var(--lab-font-body-sm);
  color: var(--lab-accent);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: var(--lab-sm);
}
.diag-narr-title {
  font-size: var(--lab-font-h3);
  font-weight: 600;
  color: var(--lab-primary);
  margin: 0 0 var(--lab-sm);
}
.diag-narr-body {
  font-size: var(--lab-font-body);
  color: var(--lab-text);
  line-height: 1.6;
  margin: 0;
}
.diag-narr-emphasis {
  color: var(--lab-accent);
  font-weight: 600;
}
/* ──────── Region picker (2-step chip cascade: 광역 → 시·군·구) ──────── */
.region-picker {
  display: flex;
  flex-direction: column;
  gap: var(--lab-md);
  margin: var(--lab-lg) 0;
  padding: var(--lab-md);
  background: var(--lab-bg-alt);
  border-radius: var(--lab-radius-md);
}
.region-picker-step { display: flex; flex-direction: column; gap: var(--lab-sm); }
.region-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-text-secondary);
  display: flex; justify-content: space-between; align-items: center;
}
.region-picker-back {
  background: none; border: 0;
  color: var(--lab-accent);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  padding: 4px 8px;
  border-radius: var(--lab-radius-sm);
}
.region-picker-back:hover { background: rgba(15, 163, 177, 0.1); }
.region-picker-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.region-chip {
  background: #fff;
  border: 1px solid var(--lab-border);
  color: var(--lab-text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  min-height: 38px;
}
.region-chip:hover { border-color: var(--lab-accent); color: var(--lab-accent); }
.region-chip[aria-checked="true"] {
  background: var(--lab-accent);
  border-color: var(--lab-accent);
  color: #fff;
}
.region-chip:focus-visible {
  outline: 2px solid var(--lab-accent);
  outline-offset: 2px;
}
.region-search {
  display: flex; gap: 8px; align-items: center;
  margin-top: var(--lab-sm);
  padding-top: var(--lab-md);
  border-top: 1px dashed var(--lab-border);
}
.region-search-label {
  font-size: 13px;
  color: var(--lab-text-secondary);
  white-space: nowrap;
}
.region-search-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--lab-border);
  border-radius: var(--lab-radius-md);
  font-size: 14px;
  font-family: inherit;
}
.region-search-btn {
  background: var(--lab-primary);
  color: #fff;
  border: 0;
  padding: 8px 16px;
  border-radius: var(--lab-radius-md);
  font-size: 14px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}
@media (max-width: 600px) {
  .region-search { flex-wrap: wrap; }
  .region-search-label { width: 100%; }
  .region-chip { padding: 7px 12px; font-size: 13px; }
}

/* prefers-reduced-motion: 사용자가 모션 줄임 선택 시 즉시 표시 */
@media (prefers-reduced-motion: reduce) {
  .diag-narr-step {
    opacity: 1; transform: none; transition: none;
  }
  .region-chip { transition: none; }
}

/* D15 a11y 공통 — screen reader 전용 (시각 0, semantic 보존) */
.lab-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* B WCAG 2.2 hover tooltip (정공) — title 속성 회피, data-tooltip + CSS ::after */
.lab-help {
  position: relative;
  cursor: help;
  border-bottom: 1px dotted var(--lab-text-secondary, #888);
}
.lab-help[data-tooltip]:hover::after,
.lab-help[data-tooltip]:focus::after,
.lab-help[data-tooltip]:focus-within::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 360px;
  width: max-content;
  padding: 10px 12px;
  background: #0B2E5C;
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: 0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  white-space: normal;
  z-index: 9999;
  pointer-events: auto;     /* WCAG 2.1 Hoverable */
}
.lab-help[data-tooltip]:hover::before,
.lab-help[data-tooltip]:focus::before,
.lab-help[data-tooltip]:focus-within::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 2px);
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #0B2E5C;
  z-index: 9999;
}
.lab-help:focus { outline: 2px solid var(--lab-accent, #0FA3B1); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  .lab-help[data-tooltip]::after,
  .lab-help[data-tooltip]::before { transition: none; }
}

/* 사용자 fb 정공 (2026-05-29): 표 안 lab-help tooltip clip 해결.
   근본 원인 = 표 wrapping div overflow-x:auto → W3C spec 상 양쪽 axis 자동 clip.
   정공 = 표 안 lab-help tooltip 위 → 아래 띄움 (표 첫 행 th 위쪽 clip 회피). */
.lab-table th .lab-help[data-tooltip]:hover::after,
.lab-table th .lab-help[data-tooltip]:focus::after,
.lab-table th .lab-help[data-tooltip]:focus-within::after,
.lab-table td .lab-help[data-tooltip]:hover::after,
.lab-table td .lab-help[data-tooltip]:focus::after,
.lab-table td .lab-help[data-tooltip]:focus-within::after {
  bottom: auto;
  top: calc(100% + 8px);
}
.lab-table th .lab-help[data-tooltip]:hover::before,
.lab-table th .lab-help[data-tooltip]:focus::before,
.lab-table th .lab-help[data-tooltip]:focus-within::before,
.lab-table td .lab-help[data-tooltip]:hover::before,
.lab-table td .lab-help[data-tooltip]:focus::before,
.lab-table td .lab-help[data-tooltip]:focus-within::before {
  bottom: auto;
  top: calc(100% + 2px);
  border-top-color: transparent;
  border-bottom-color: #0B2E5C;
}

/* 사용자 fb 정공 (2026-05-29): 표 마지막 column tooltip 가 가운데 정렬 시
   표 우측 wrapping div overflow 경계에 가려짐 → 우측 정렬 정공 (last-child).
   첫 column 도 같은 이유로 좌측 정렬 정공 (first-child). */
.lab-table th:last-child .lab-help[data-tooltip]:hover::after,
.lab-table th:last-child .lab-help[data-tooltip]:focus::after,
.lab-table th:last-child .lab-help[data-tooltip]:focus-within::after,
.lab-table td:last-child .lab-help[data-tooltip]:hover::after,
.lab-table td:last-child .lab-help[data-tooltip]:focus::after,
.lab-table td:last-child .lab-help[data-tooltip]:focus-within::after {
  left: auto;
  right: 0;
  transform: none;
}
.lab-table th:last-child .lab-help[data-tooltip]:hover::before,
.lab-table th:last-child .lab-help[data-tooltip]:focus::before,
.lab-table th:last-child .lab-help[data-tooltip]:focus-within::before,
.lab-table td:last-child .lab-help[data-tooltip]:hover::before,
.lab-table td:last-child .lab-help[data-tooltip]:focus::before,
.lab-table td:last-child .lab-help[data-tooltip]:focus-within::before {
  left: auto;
  right: 8px;
  transform: none;
}
.lab-table th:first-child .lab-help[data-tooltip]:hover::after,
.lab-table th:first-child .lab-help[data-tooltip]:focus::after,
.lab-table th:first-child .lab-help[data-tooltip]:focus-within::after,
.lab-table td:first-child .lab-help[data-tooltip]:hover::after,
.lab-table td:first-child .lab-help[data-tooltip]:focus::after,
.lab-table td:first-child .lab-help[data-tooltip]:focus-within::after {
  left: 0;
  right: auto;
  transform: none;
}
.lab-table th:first-child .lab-help[data-tooltip]:hover::before,
.lab-table th:first-child .lab-help[data-tooltip]:focus::before,
.lab-table th:first-child .lab-help[data-tooltip]:focus-within::before,
.lab-table td:first-child .lab-help[data-tooltip]:hover::before,
.lab-table td:first-child .lab-help[data-tooltip]:focus::before,
.lab-table td:first-child .lab-help[data-tooltip]:focus-within::before {
  left: 8px;
  right: auto;
  transform: none;
}

/* D 가용성 = 보유율 (Stock) + 대출률 (Flow) 두 측면 동등 강조 */
.avail-hero-stock {
  position: relative;
  box-shadow: 0 4px 14px rgba(11, 46, 92, 0.14);
  border: 2px solid #0B2E5C !important;
}
.avail-hero-stock::before {
  content: 'Stock';
  position: absolute;
  top: -10px; left: 10px;
  background: #0B2E5C;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.avail-hero-flow {
  position: relative;
  box-shadow: 0 4px 14px rgba(15, 163, 177, 0.14);
  border: 2px solid #0FA3B1 !important;
}
.avail-hero-flow::before {
  content: '방송대';
  position: absolute;
  top: -10px; left: 10px;
  background: #0FA3B1;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.avail-hero-public {
  position: relative;
  box-shadow: 0 4px 14px rgba(11, 46, 92, 0.14);
  border: 2px solid #0B2E5C !important;
}
.avail-hero-public::before {
  content: '공공';
  position: absolute;
  top: -10px; left: 10px;
  background: #0B2E5C;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.avail-map-toggle {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px 0;
}
.avail-map-btn {
  padding: 8px 18px;
  border: 2px solid var(--lab-border, #E5E7EB);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--lab-text-secondary, #555);
  transition: all 0.12s ease;
}
.avail-map-btn:hover { border-color: #0FA3B1; color: #0FA3B1; }
.avail-map-btn.is-active {
  background: #0FA3B1;
  border-color: #0FA3B1;
  color: #fff;
}
@media (prefers-reduced-motion: reduce) { .avail-map-btn { transition: none; } }

/* A-3 /lab/availability 활용도 frame 토큰 */
.avail-academic-frame {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin: 16px 0 24px 0;
}
.avail-academic-card {
  padding: 14px 16px;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 10px;
  background: var(--lab-bg-surface, #fafbfc);
  font-size: 13px;
  line-height: 1.55;
}
.avail-academic-card--why    { border-left: 4px solid #C5283D; }
.avail-academic-card--metric { border-left: 4px solid #0FA3B1; }
.avail-academic-card--band   { border-left: 4px solid #C99700; }
.avail-academic-card--global { border-left: 4px solid #0B2E5C; }
.avail-academic-h {
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--lab-primary, #0B2E5C);
  font-size: 13px;
}
.avail-academic-card p { margin: 0; font-size: 12.5px; color: var(--lab-text, #1F2937); }

/* band tag */
.band-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  margin: 0 2px;
}
/* 청록 sequential — 의미 충돌 0 (적극 활용 = 진청록 = 긍정 최강). 부정 색 톤 회피. */
.band-tag--under   { background: rgba(11, 46, 92, 0.10); color: #0B2E5C; }
.band-tag--healthy { background: rgba(15, 163, 177, 0.12); color: #0FA3B1; }
.band-tag--over    { background: rgba(94, 116, 132, 0.12); color: #5A6470; }

/* 체크리스트 input */
.avail-checklist-input {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 16px 0 12px 0;
  padding: 14px 16px;
  background: var(--lab-bg-muted, #f0f3f6);
  border-radius: 10px;
}
.avail-checklist-input label {
  font-weight: 600;
  color: var(--lab-primary, #0B2E5C);
  font-size: 13px;
}
.avail-checklist-input input {
  flex: 1 1 280px;
  padding: 8px 12px;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 6px;
  font: inherit;
  font-size: 14px;
}
.avail-checklist-input button {
  padding: 8px 18px;
  background: var(--lab-primary, #0B2E5C);
  color: #fff;
  border: none;
  border-radius: 6px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.avail-checklist-input button:hover { background: #08234a; }

/* 체크리스트 결과 */
.avail-checklist-result { margin-top: 8px; }
.checklist-summary {
  padding: 12px 16px;
  background: #fff;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 10px;
  margin-bottom: 12px;
}
.checklist-summary-h { font-size: 15px; margin-bottom: 6px; }
.checklist-summary-stat { font-size: 12px; color: var(--lab-text-secondary, #555); margin-bottom: 4px; }
.checklist-summary-counts { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.checklist-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 8px;
}
.checklist-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--lab-border, #E5E7EB);
  background: #fff;
}
.checklist-item--ok   { border-left: 4px solid #0FA3B1; }
.checklist-item--warn { border-left: 4px solid #C99700; }
.checklist-item--fail { border-left: 4px solid #C5283D; }
.checklist-item--na   { border-left: 4px solid #94A3B8; opacity: 0.85; }
.checklist-item-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 4px;
}
.checklist-item-status { font-size: 16px; font-weight: 700; }
.checklist-item-name   { font-weight: 600; color: var(--lab-primary, #0B2E5C); flex: 1; }
.checklist-item-value  { font-size: 12px; color: var(--lab-text-secondary, #555); font-variant-numeric: tabular-nums; }
.checklist-item-narr   { font-size: 11.5px; color: var(--lab-text, #1F2937); line-height: 1.5; }

/* ISO 표 */
.avail-iso-table { width: 100%; margin: 12px 0; }
.avail-iso-table th { background: var(--lab-bg-muted, #f0f3f6); }

/* D14 /lab/shap SHAP vs Permutation Robustness card */
.shap-robust-card {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  margin: 4px 0 12px 0;
  background: var(--lab-bg-muted, #f0f3f6);
  border: 1px solid var(--lab-border, #E5E7EB);
  border-left: 4px solid #94A3B8;
  border-radius: 8px;
  font-size: 13px;
}
.shap-robust-label {
  font-size: 12px;
  color: var(--lab-text-secondary, #555);
  letter-spacing: 0.2px;
}
.shap-robust-value {
  font-weight: 700;
  font-size: 16px;
  color: var(--lab-primary, #0B2E5C);
  font-variant-numeric: tabular-nums;
}
.shap-robust-judge {
  font-weight: 600;
  font-size: 13px;
  color: var(--lab-text, #1F2937);
}
.shap-robust-strong { border-left-color: #0FA3B1; background: rgba(15, 163, 177, 0.06); }
.shap-robust-strong .shap-robust-judge { color: #0FA3B1; }
.shap-robust-mid    { border-left-color: #C99700; background: rgba(201, 151, 0, 0.06); }
.shap-robust-mid    .shap-robust-judge { color: #B88A0F; }
.shap-robust-weak   { border-left-color: #C5283D; background: rgba(197, 40, 61, 0.06); }
.shap-robust-weak   .shap-robust-judge { color: #C5283D; }

/* D11 /lab/siting 실용 정보 cell */
.siting-cell-addr {
  display: inline-block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
  color: var(--lab-text, #1F2937);
}
.siting-cell-link {
  color: var(--lab-accent, #0FA3B1);
  text-decoration: none;
  white-space: nowrap;
}
.siting-cell-link:hover { text-decoration: underline; }

/* D13 /lab/pjr 우리 동네 vs 전국 평균 비교 라벨 */
.pjr-natavg {
  margin-top: 2px;
  font-size: 10px;
  color: var(--lab-text-secondary, #555);
  font-weight: 400;
  letter-spacing: 0;
}
.pjr-cmp {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 10px;
}
.pjr-cmp-up { color: #0FA3B1; background: rgba(15, 163, 177, 0.1); }
.pjr-cmp-down { color: #C5283D; background: rgba(197, 40, 61, 0.08); }

/* D9 /lab 홈 카드 미리보기 chip + 가용성 sparkline */
.lab-page-card-preview {
  margin-top: 10px;
  padding: 6px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--lab-bg-muted, #f0f3f6);
  border-radius: 999px;
  font-size: 12px;
}
.lab-page-preview-label {
  color: var(--lab-text-secondary, #555);
  font-size: 11px;
}
.lab-page-preview-value {
  color: var(--lab-primary, #0B2E5C);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.lab-page-card-preview--spark {
  display: flex;
  width: 100%;
  border-radius: 8px;
  padding: 6px 10px;
}
.lab-page-spark-svg {
  flex: 1 1 auto;
  height: 28px;
  min-width: 60px;
}

/* D8 /lab/clusters drill-down — chip 토글 + sgg 리스트 */
.cluster-drill-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.cluster-drill-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 2px solid var(--lab-border, #E5E7EB);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--lab-text, #1F2937);
  transition: transform 0.1s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.cluster-drill-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.cluster-drill-chip.is-active {
  border-color: var(--chip-c, var(--lab-primary, #0B2E5C));
  background: color-mix(in srgb, var(--chip-c, #0B2E5C) 12%, #fff);
  font-weight: 700;
}
.cluster-drill-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.cluster-drill-count {
  font-size: 11px;
  color: var(--lab-text-secondary, #555);
  background: var(--lab-bg-muted, #f0f3f6);
  padding: 2px 8px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.cluster-drill-card {
  margin: 8px 0;
  padding: 10px 12px;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 8px;
  background: var(--lab-bg-surface, #fafbfc);
}
.cluster-drill-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}
.cluster-drill-lbl {
  color: var(--lab-text-secondary, #555);
  font-size: 12px;
}
.cluster-drill-sggs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cluster-drill-sgg {
  display: inline-block;
  padding: 3px 9px;
  background: #fff;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 4px;
  font-size: 11px;
  color: var(--lab-text, #1F2937);
}
@media (prefers-reduced-motion: reduce) {
  .cluster-drill-chip { transition: none; }
  .cluster-drill-chip:hover { transform: none; }
}

/* D7 /lab/methodology 5 단계 분석 파이프라인 흐름도 */
.meth-pipeline {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 12px 0 4px 0;
}
.meth-pipe-node {
  flex: 1 1 150px;
  min-width: 140px;
  padding: 12px 10px;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 8px;
  background: var(--lab-bg-surface, #fff);
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.meth-pipe-src {
  background: linear-gradient(180deg, #F0F4F8 0%, #E5EBF0 100%);
  border-color: #9CA3AF;
}
.meth-pipe-p1 {
  background: linear-gradient(180deg, #DBE9F4 0%, #C3D9EE 100%);
  border-color: #4D90C9;
}
.meth-pipe-p2 {
  background: linear-gradient(180deg, #D6F2F1 0%, #B3E6E3 100%);
  border-color: #0FA3B1;
}
.meth-pipe-p3 {
  background: linear-gradient(180deg, #FDEFD3 0%, #FBDFA8 100%);
  border-color: #C99700;
}
.meth-pipe-q {
  background: linear-gradient(180deg, #F4DDE3 0%, #E9BEC9 100%);
  border-color: #C5283D;
}
.meth-pipe-num {
  font-size: 11px;
  font-weight: 600;
  color: var(--lab-text-secondary, #555);
  margin-bottom: 4px;
  letter-spacing: 0.3px;
}
.meth-pipe-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--lab-primary, #0B2E5C);
  margin-bottom: 4px;
}
.meth-pipe-sub {
  font-size: 11px;
  color: var(--lab-text-secondary, #555);
  line-height: 1.4;
}
.meth-pipe-arrow {
  align-self: center;
  font-size: 24px;
  color: var(--lab-text-secondary, #888);
  font-weight: 300;
  user-select: none;
}
@media (max-width: 780px) {
  .meth-pipeline { flex-direction: column; }
  .meth-pipe-arrow { transform: rotate(90deg); padding: 4px 0; }
  .meth-pipe-node { flex: 1 1 100%; }
}

/* D6 /lab/value 자치구 229 Choropleth — legend (지도 직접 노출, wrap 제거)
   다른 lab 페이지 (clusters/accessibility/availability) 와 동일 직접 노출 패턴.
   grid wrap 가 Leaflet tile 인식을 방해한 근본 원인 fix. */
.value-choropleth-legend {
  margin: 8px 0;
  padding: 10px 14px;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 8px;
  background: var(--lab-bg-surface, #fafbfc);
  font-size: 12px;
  color: var(--lab-text, #1F2937);
}
.value-choropleth-legend strong {
  display: block;
  margin-bottom: 8px;
  color: var(--lab-primary, #0B2E5C);
  font-size: 12px;
}
.value-cp-scale {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  font-size: 11px;
}
.value-cp-scale > span:nth-child(odd) {
  display: inline-block;
  width: 16px;
  height: 14px;
  border: 1px solid #555;
  border-radius: 2px;
}

/* D4/D5 페이지 내 sticky TOC — diagnosis / accessibility */
.lab-page-toc {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin: 12px 0 20px 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--lab-border, #E5E7EB);
  border-left: 4px solid var(--lab-primary, #0B2E5C);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  font-size: 13px;
}
.lab-page-toc-label {
  font-weight: 700;
  color: var(--lab-primary, #0B2E5C);
  margin-right: 4px;
  font-size: 12px;
  letter-spacing: 0.2px;
}
.lab-page-toc-link {
  padding: 5px 10px;
  border-radius: 6px;
  color: var(--lab-text-secondary, #555);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.12s ease, color 0.12s ease;
}
.lab-page-toc-link:hover {
  background: var(--lab-bg-muted, #f0f3f6);
  color: var(--lab-primary, #0B2E5C);
}
.lab-page-toc-link.is-active {
  background: var(--lab-primary, #0B2E5C);
  color: #fff;
}
/* scroll-margin 으로 sticky bar 아래 헤더가 가려지지 않도록 */
[id^="sec-"] { scroll-margin-top: 80px; }
@media (max-width: 720px) {
  .lab-page-toc { gap: 4px; padding: 6px 8px; font-size: 12px; }
  .lab-page-toc-link { padding: 4px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .lab-page-toc-link { transition: none; }
}

/* D3 my-region collapsible KPI sections */
.myreg-collapsible {
  margin: 8px 0 12px 0;
  border: 1px solid var(--lab-border, #E5E7EB);
  border-radius: 8px;
  background: var(--lab-bg-surface, #fafbfc);
  overflow: hidden;
}
.myreg-collapsible[open] {
  background: #fff;
}
.myreg-collapsible-summary {
  cursor: pointer;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  color: var(--lab-text, #1F2937);
  background: var(--lab-bg-muted, #f4f6f8);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}
.myreg-collapsible-summary::-webkit-details-marker { display: none; }
.myreg-collapsible-summary::before {
  content: "▶";
  display: inline-block;
  font-size: 10px;
  color: var(--lab-text-secondary, #888);
  transition: transform 0.18s ease;
}
.myreg-collapsible[open] > .myreg-collapsible-summary::before {
  transform: rotate(90deg);
}
.myreg-collapsible-summary:hover {
  background: var(--lab-bg-hover, #eef1f4);
}
.myreg-collapsible > .lab-kpi-grid {
  padding: 12px;
  margin: 0;
}
@media (prefers-reduced-motion: reduce) {
  .myreg-collapsible-summary,
  .myreg-collapsible-summary::before { transition: none; }
}
