/* assets/analysis_29cm.css */
/* ============================================================
   29CM "느낌"의 미니멀 커머스 UI 테마
   - white / black / soft gray
   - 여백 넉넉 + 라운드 + 은은한 그림자
   ============================================================ */

/* ------------------------------------------------------------
   1) CSS 변수(테마 토큰)
   - 색/그림자/라운드/패딩/최대폭을 한 곳에서 관리
   ------------------------------------------------------------ */
/* ------------------------------------------------------------
   2) Base(분석 페이지 스코프)
   ------------------------------------------------------------ */
.analysis29{
  background: var(--bg) !important;
  color: var(--text);
  letter-spacing: -0.2px;
}

.analysis29 a{ color: var(--text); text-decoration: none; }
.analysis29 a:hover{ text-decoration: underline; }

.analysis29 h2,
.analysis29 h3,
.analysis29 h4{
  letter-spacing: -0.4px;
  margin: 0 0 10px 0;
}

.analysis29 h2{ font-size: 24px; font-weight: 800; }
.analysis29 h4{ font-size: 16px; font-weight: 800; }

.analysis29 .help-text{
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* ------------------------------------------------------------
   3) Page container
   - 분석 페이지 최상위 wrapper에 className="analysis29" 부여하면
     전체 패딩/최대폭이 적용됨
   ------------------------------------------------------------ */
.analysis29{
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 22px 18px 40px 18px;
}

/* ------------------------------------------------------------
   Analysis shell (sidebar + main)
   - Desktop: 2-col layout
   - Mobile: sidebar hidden, use sticky subnav
   ------------------------------------------------------------ */
.analysis-shell{
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.analysis-shell-main{
  flex: 1;
  min-width: 0;
}

.analysis-mobile-guard{
  display: none;
  margin: 24px auto 0;
  max-width: 560px;
  padding: 28px 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: center;
}

.analysis-mobile-guard-title{
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.4px;
}

.analysis-mobile-guard-text{
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

@media (max-width: 992px){
  .analysis-shell{
    display: block;
  }
  .analysis-sidebar{
    display: none !important;
  }
}

@media (max-width: 768px){
  .analysis-desktop-shell{
    display: none;
  }
  .analysis-mobile-guard{
    display: block;
  }
}

/* ------------------------------------------------------------
   4) 상단 필터/컨트롤 라벨
   ------------------------------------------------------------ */
.filter-label{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}

/* ------------------------------------------------------------
   5) Dropdown(react-select 기반: dcc.Dropdown)
   - Select-control / menu 스타일 통일
   ------------------------------------------------------------ */
.analysis29 .Select-control, .analysis29 .Select-menu-outer, .analysis29 .Select{
  font-size: 13px !important;
}
.analysis29 .Select-control{
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  min-height: 40px !important;
}
.analysis29 .Select-control:hover{
  border-color: var(--border-strong) !important;
}
.analysis29 .is-open > .Select-control{
  border-color: var(--text) !important;
}
.analysis29 .Select-placeholder, .analysis29 .Select--single > .Select-control .Select-value{
  padding-left: 12px !important;
}
.analysis29 .Select-menu-outer{
  border: 1px solid var(--border) !important;
  border-radius: 12px !important;
  box-shadow: var(--shadow-hover) !important;
  overflow: hidden;
}


/* ------------------------------------------------------------
   6) RadioItems(시간 모드 등)
   - 특정 ID(#analysis-time-mode)에만 적용
   ------------------------------------------------------------ */
#analysis-time-mode label{
  font-size: 13px;
  color: var(--text);
  margin-right: 12px;
}
#analysis-time-mode input{
  transform: translateY(1px);
}

/* ------------------------------------------------------------
   7) RangeSlider
   - rc-slider 기본 테마 변경
   ------------------------------------------------------------ */
.rc-slider-rail{ background-color: #eaeaea; }
.rc-slider-track{ background-color: #111; }
.rc-slider-handle{ border: 2px solid #111; box-shadow: none; }

/* ------------------------------------------------------------
   8) 패널(카드) 공통 컴포넌트
   - .panel: 카드 컨테이너
   - .panel-title: 상단 헤더(제목 영역)
   - .panel-body: 내용 영역(그래프/표/내용)
   - flex + min-height:0 은 "그래프 100% 채우기"에서 핵심
   ------------------------------------------------------------ */
.panel{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* 특정 카드에서 드롭다운이 바깥으로 열리도록 예외 처리 */
.panel.panel-allow-overflow{
  overflow: visible !important;
  position: relative;
  z-index: 2;
}
.panel.panel-allow-overflow .panel-body{
  overflow: visible !important;
}
.panel.panel-allow-overflow .Select-menu-outer{
  z-index: 1000;
  overflow: visible;
}

.panel-title{
  padding: 14px 16px 10px 16px;
  font-size: 14px;
  font-weight: 800;
  border-bottom: 1px solid var(--border);
}

.panel-body{
  padding: 14px 16px 16px 16px;
  flex: 1;                /* 카드 내부에서 콘텐츠가 남은 높이를 사용하도록 */
  min-height: 0;          /* flex 자식 overflow/height 계산 안정화 */
  display: flex;
  flex-direction: column;
}

/* ------------------------------------------------------------
   9) 지도 패널
   - 지도는 보통 제목이 불필요하므로 panel-title 제거
   - padding을 최소화해 지도 시각 영역을 최대화
   ------------------------------------------------------------ */
.panel-map .panel-title{
  display: none;
}

.panel-body-map{
  padding: 4px;
}

/* ------------------------------------------------------------
   10) 제목 없는 패널
   - panel-title 자체를 숨김
   ------------------------------------------------------------ */
.panel-no-title .panel-title{
  display: none;
}

.group-title{
  font-size: 13px;
  font-weight: 800;
  margin: 4px 0 10px 0;
}

/* ------------------------------------------------------------
   11) 분석 리포트(주소 검색)
   ------------------------------------------------------------ */
.report-search-row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

.report-input{
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  background: #fff;
}
.report-input:focus{
  border-color: var(--border-strong);
  box-shadow: 0 0 0 2px rgba(17,17,17,.06);
}

.report-search-btn{
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: -0.2px;
  cursor: pointer;
}
.report-search-btn:hover{
  opacity: 0.9;
}

.report-summary-card{
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.report-kv-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.report-kv-row{
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.report-kv-label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.report-kv-value{
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  word-break: break-word;
}

.report-json-wrap{
  margin-top: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
}

.report-json-wrap summary{
  cursor: pointer;
  font-weight: 800;
  font-size: 12px;
  list-style: none;
}
.report-json-wrap summary::-webkit-details-marker{ display: none; }

.report-json{
  margin: 10px 0 0;
  font-size: 12px;
  color: #1f2937;
  background: #f7f7f7;
  border-radius: 10px;
  padding: 10px;
  max-height: 280px;
  overflow: auto;
}

.report-report-shell{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-loading-wrap{
  min-height: 320px;
}

.report-loading-wrap > div{
  min-height: 320px;
}

.report-loading-wrap .dash-spinner{
  margin: 80px auto !important;
}

.report-placeholder{
  padding: 28px 20px;
  border: 1px dashed var(--border-strong);
  border-radius: 16px;
  background: linear-gradient(180deg, #fbfbfb, #f5f5f5);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.report-overview-card{
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(246,246,246,.96));
}

.report-overview-head{
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.report-overview-address{
  font-size: clamp(20px, 2vw, 28px);
  font-weight: 900;
  letter-spacing: -0.4px;
}

.report-overview-grid{
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
}

.report-meta-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-meta-card{
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
}

.report-meta-title{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  margin-bottom: 8px;
}

.report-meta-value{
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.5;
}

.report-risk-chip-row{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.report-risk-chip{
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #111111;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.report-prototype-note{
  font-size: 12px;
  line-height: 1.6;
  color: #6b6b6b;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff8ef;
  border: 1px solid #f0e2c6;
}

.report-report-summary{
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-text-stack{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-body-text{
  margin: 0;
  color: #333333;
  font-size: 13px;
  line-height: 1.7;
}

.report-tabs{
  width: 100%;
}

.report-tabs .tab{
  border: 0 !important;
  background: transparent !important;
}

.report-tab{
  padding: 0 !important;
}

.report-tabs .tab--selected,
.report-tab--selected{
  border: 0 !important;
  background: transparent !important;
}

.report-tabs .tab > span,
.report-tabs .tab--selected > span{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}

.report-tabs .tab--selected > span{
  background: #111111;
  border-color: #111111;
  color: #ffffff;
}

.report-tab-pane{
  padding-top: 18px;
}

.report-llm-status-wrap{
  margin-top: 18px;
}

.report-llm-status-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.report-llm-status-head{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.report-llm-status-title{
  font-size: 14px;
  font-weight: 900;
}

.report-llm-status-grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.report-llm-status-item{
  padding: 14px;
  border-radius: 14px;
  background: #f8f8f8;
  border: 1px solid #efefef;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.report-llm-status-label{
  font-size: 13px;
  font-weight: 800;
  color: #333333;
}

.report-llm-status-count{
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.4px;
}

.report-llm-status-chip{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.report-llm-status-chip.success{
  background: #e8f7ee;
  color: #1f7a43;
}

.report-llm-status-chip.fail{
  background: #fff1f0;
  color: #bb3d32;
}

.report-llm-status-note,
.report-llm-status-empty{
  font-size: 12px;
  line-height: 1.6;
  color: #6b6b6b;
}

.report-llm-runtime-box{
  padding: 12px 14px;
  border-radius: 14px;
  background: #fff8ef;
  border: 1px solid #f0e2c6;
  font-size: 12px;
  line-height: 1.65;
  color: #5b5145;
}

.report-llm-payload-stack{
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-tab-body{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-kpi-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.report-story-stack{
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.report-story-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.report-kpi-card{
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.report-kpi-label{
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.report-kpi-value{
  margin-top: 8px;
  font-size: clamp(22px, 2.2vw, 32px);
  font-weight: 900;
  letter-spacing: -0.6px;
}

.report-kpi-help{
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #7a7a7a;
}

.report-chart-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-chart-card{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  overflow: hidden;
  padding: 8px 8px 2px;
}

.report-block{
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #ffffff;
  padding: 18px;
}

.report-block-title{
  font-size: 14px;
  font-weight: 900;
  margin-bottom: 12px;
}

.report-ai-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-ai-section{
  padding: 14px;
  border-radius: 14px;
  background: #f8f8f8;
  border: 1px solid #efefef;
}

.report-section-title{
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 8px;
}

.report-bullet-list{
  margin: 0;
  padding-left: 18px;
  color: #333333;
  font-size: 13px;
  line-height: 1.6;
}

.report-data-note{
  font-size: 13px;
  line-height: 1.7;
  color: #444444;
}

@media (max-width: 900px){
  .report-kv-grid{
    grid-template-columns: 1fr;
  }
  .report-kv-row{
    grid-template-columns: 120px 1fr;
  }
  .report-meta-grid,
  .report-chart-grid,
  .report-ai-grid,
  .report-kpi-grid,
  .report-llm-status-grid{
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------
   11) metric 카드 그리드(상품 카드 느낌)
   - 2열 그리드로 버튼 카드 배치
   ------------------------------------------------------------ */
.metric-grid{
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
}

.metric-card-btn{
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 12px;
  text-align: left;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.metric-card-btn:hover{
  border-color: var(--text);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.metric-card-btn:focus{
  outline: none;
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(17,17,17,.12);
}

.metric-title{
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}
.metric-subtitle{
  font-size: 12px;
  color: var(--muted);
}

/* ------------------------------------------------------------
   12) 알람/지표 카드(3열)
   ------------------------------------------------------------ */
.alarm-row{
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 10px;
}
.alarm-card{
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  background: #fff;
}
.alarm-title{
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.alarm-value{
  font-size: 18px;
  font-weight: 900;
}

/* ------------------------------------------------------------
   13) Dash DataTable 스타일(리스트 뷰)
   ------------------------------------------------------------ */
.dash-table-container .dash-spreadsheet-container{
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.dash-table-container .dash-header{
  background: #fafafa !important;
  font-weight: 800 !important;
  border-bottom: 1px solid var(--border) !important;
}
.dash-table-container .dash-cell{
  border-color: var(--border) !important;
  font-size: 12px !important;
}
.dash-table-container .dash-row:hover .dash-cell{
  background: #f7f7f7 !important;
}

/* ------------------------------------------------------------
   14) Plotly 그래프 라운드(내부 SVG)
   - plotly svg에 라운드 감성 추가
   ------------------------------------------------------------ */
.js-plotly-plot .plotly .main-svg{
  border-radius: 12px;
}

/* ------------------------------------------------------------
   15) Blur paywall(블러 처리 + 안내 오버레이)
   - 유료/미완성 구간을 블러 처리하고 overlay로 안내
   ------------------------------------------------------------ */
.blur-wrap{
  position: relative;
  border-radius: var(--radius);
}
.blurred{
  filter: blur(8px);
  opacity: .75;
  pointer-events: none;
  user-select: none;
}
.blur-overlay{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 18px;
  background: rgba(255,255,255,.65);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.cta{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #111;
  color: #fff !important;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none !important;
}
.cta:hover{
  background: #000;
}

/* ------------------------------------------------------------
   16) Spacing helpers
   - 섹션 안의 작은 제목용
   ------------------------------------------------------------ */
.section-mini-title{
  font-size: 12px;
  font-weight: 800;
  margin: 10px 0 8px 0;
}

/* ============================================================
   18) 자연재난 대시보드: 3열 레이아웃 + "무스크롤" 높이 설계
   ============================================================ */

/* ------------------------------------------------------------
   18-1) 3컬럼 그리드 기본(좌/중/우)
   - 좌/우는 clamp로 화면에 따라 폭이 변화
   ------------------------------------------------------------ */
.disaster-page .dash3{
  display: grid;
  grid-template-columns: clamp(260px, 22vw, 320px) 1fr clamp(340px, 30vw, 440px);
  gap: 14px;
  align-items: stretch;
}

/* ------------------------------------------------------------
   18-2) 무스크롤 모드
   - 화면 높이(100vh)에서 헤더 높이를 뺀 만큼만 차지
   - overflow hidden으로 내부에서 스크롤이 생기지 않게 함
   ------------------------------------------------------------ */
.disaster-page .dash3--no-scroll{
  height: calc(100vh - 190px);
  overflow: hidden;
}

/* ------------------------------------------------------------
   18-3) 각 컬럼을 flex stack으로
   - 카드들이 남은 높이를 나눠 쓰도록
   ------------------------------------------------------------ */
.disaster-page .col-left,
.disaster-page .col-center,
.disaster-page .col-right{
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Left: 추세 카드가 컬럼을 꽉 채움 */
.disaster-page .panel-trend{
  flex: 1 1 auto;
  min-height: 0;
}

/* Center: 도넛은 일정 비율, 막대는 나머지 공간 */
.disaster-page .panel-donut{ flex: 0 0 34%; min-height: 0; }
.disaster-page .kpi-row{ flex: 0 0 auto; }
.disaster-page .panel-bars{ flex: 1 1 auto; min-height: 0; }

/* Right: 지도는 컬럼 꽉 채움 */
.disaster-page .panel-map{ flex: 1 1 auto; min-height: 0; }

/* ------------------------------------------------------------
   18-4) body 여백 줄이기(더 많이 담기 위해)
   ------------------------------------------------------------ */
.panel-body--tight{
  padding: 12px !important;
}

/* ------------------------------------------------------------
   18-5) 그래프를 패널 내부 높이에 맞춰 꽉 채우는 유틸
   ------------------------------------------------------------ */
.g-fill{
  width: 100%;
  height: 100% !important;
  min-height: 0 !important;
}

/* 패널은 flex 컨테이너여야 Graph(height:100%)가 동작 */
.disaster-page .panel{
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.disaster-page .panel-body{
  flex: 1 1 auto;
  min-height: 0;
}

/* ------------------------------------------------------------
   18-6) Trend 카드(왼쪽) 내부 스택 구조
   ------------------------------------------------------------ */
.trend-card-body{
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 0;
}

.trend-stack{
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  min-height: 0;
}

/* trend-stack의 그래프들이 균등하게 공간 분배 */
.trend-stack > .g-fill{
  flex: 1 1 0;
}

/* ------------------------------------------------------------
   18-7) 도넛 행: 도넛(좌) + hazard pills(우)
   ------------------------------------------------------------ */
.donut-row{
  display: flex;
  gap: 12px;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

.donut-wrap{
  flex: 0 0 46%;
  min-width: 180px;
  min-height: 0;
}

.hazard-row{
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

/* ------------------------------------------------------------
   18-8) KPI 카드(자동 줄바꿈 가능한 grid)
   ------------------------------------------------------------ */
.kpi-row{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: 10px;
}

.kpi-card{
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
}

.kpi-label{
  color: var(--muted);
  font-size: clamp(10px, 0.9vw, 12px);
  font-weight: 800;
  margin-bottom: 4px;
}

.kpi-value{
  font-size: clamp(16px, 1.6vw, 22px);
  font-weight: 900;
  letter-spacing: -0.6px;
}

/* ------------------------------------------------------------
   18-9) Bars: 2개 그래프를 나란히 배치하고 남은 높이를 공유
   ------------------------------------------------------------ */
.bars-2col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  height: 100%;
  min-height: 0;
}

.bar-cell{
  min-height: 0;
}

/* ------------------------------------------------------------
   18-10) pill 라디오를 compact하게(한 화면에 더 많이)
   ------------------------------------------------------------ */
.pill-radio--compact label{
  padding: 6px 10px !important;
  font-size: clamp(11px, 1.0vw, 13px) !important;
}

/* ------------------------------------------------------------
   18-12) Panel title info icon (ⓘ)
   - 제목 옆에 설명 툴팁 아이콘
   ------------------------------------------------------------ */
.panel-title--with-info{
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.info-wrap{
  position: relative;
  display: inline-flex;
  align-items: center;
}

.info-icon{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid rgba(31,35,41,.14);
  color: rgba(31,35,41,.65);
  background: rgba(255,255,255,.85);
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  padding: 0;
  outline: none;
}

.info-icon:hover{
  border-color: rgba(31,35,41,.22);
  color: rgba(31,35,41,.9);
}

.info-popover{
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 240px;
  max-width: min(420px, 86vw);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(31,35,41,.16);
  background: rgba(255,255,255,.98);
  color: rgba(31,35,41,.92);
  box-shadow: 0 14px 36px rgba(17,17,17,.12);
  font-size: 12px;
  line-height: 1.45;
  display: none;
  z-index: 9999;
  white-space: normal;
}

.info-wrap.is-open .info-popover{
  display: block;
}

.info-popover::before{
  content: "";
  position: absolute;
  top: -6px;
  left: 8px;
  width: 10px;
  height: 10px;
  background: rgba(255,255,255,.98);
  border-left: 1px solid rgba(31,35,41,.16);
  border-top: 1px solid rgba(31,35,41,.16);
  transform: rotate(45deg);
}

/* ------------------------------------------------------------
   18-11) 좁은 화면(태블릿/모바일)에서는 1열 스택
   - 모바일은 1-screen 보장이 어려워 height:auto로 전환
   ------------------------------------------------------------ */
@media (max-width: 1100px){
  .disaster-page .dash3{
    grid-template-columns: 1fr;
  }
  .disaster-page .dash3--no-scroll{
    height: auto;
    overflow: visible;
  }
}

/* ============================================================
   19) One-screen layout helpers (무스크롤 보조 세트)
   - 다양한 화면비에서 스크롤 없이 들어오게 하기 위한 변수/레이아웃
   ============================================================ */

/* ------------------------------------------------------------
   19-1) one-screen용 변수
   - graph-inset: 그래프를 컨테이너보다 "조금 작게" 그리게 하는 안쪽 패딩
   - ts-row-h: 왼쪽 mini 차트의 한 줄 높이(반응형 clamp)
   - donut-h: 도넛 영역 높이
   - map-min-h: 지도 최소 높이
   ------------------------------------------------------------ */
.analysis29{
  --graph-inset: 8px;                 /* 그래프 잘림 방지용 인셋 */
  --ts-row-h: clamp(110px, 14vh, 170px);
  --donut-h: clamp(150px, 20vh, 210px);
  --map-min-h: clamp(420px, 55vh, 720px);
}

/* ------------------------------------------------------------
   19-2) one-screen-grid: 화면 높이를 고정해서 내부 스크롤 제거
   ------------------------------------------------------------ */
.one-screen-grid{
  height: calc(100vh - 190px); /* 글로벌 헤더/페이지 헤더/패딩을 뺀 값 */
  min-height: 560px;
  align-items: stretch !important;
}

/* 컬럼 기본 */
.col-left, .col-center{
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ------------------------------------------------------------
   19-3) 왼쪽 추세 그래프 스택
   - ts-item이 한 줄 단위(제목 + 그래프)
   - height: var(--ts-row-h)로 행 높이를 통제
   ------------------------------------------------------------ */
.ts-stack{
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.ts-item{
  min-height: 0;
  height: var(--ts-row-h);     /* ★ 왼쪽 mini 그래프 높이 조절 핵심 레버 */
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ts-item .help-text{
  margin: 0;
  line-height: 1.15;
}

/* 제목을 제외한 그래프 영역이 차지할 비율(값을 올리면 그래프가 더 커짐) */
.ts-item .graph-inset{
  flex: 1;
  min-height: 0;
}

/* ------------------------------------------------------------
   19-4) graph-inset
   - Plotly를 컨테이너보다 조금 작게 그려서
     축/라벨이 잘리는 현상을 완화
   ------------------------------------------------------------ */
.graph-inset{
  height: 100%;
  width: 100%;
  padding: var(--graph-inset);     /* ★ "몇% 더 작게" 효과 */
  box-sizing: border-box;
}

/* plotly 컨테이너들을 부모 높이에 꽉 맞추도록 강제 */
.graph-inset .js-plotly-plot,
.graph-inset .plot-container,
.graph-inset .svg-container{
  height: 100% !important;
  width: 100% !important;
}

/* ------------------------------------------------------------
   19-5) 도넛 행(one-screen 버전)
   - grid로 도넛/버튼 비율 안정화
   ------------------------------------------------------------ */
.donut-row{
  display: grid;
  grid-template-columns: minmax(200px, 320px) 1fr;
  gap: 12px;
  align-items: center;
}

.donut-wrap{
  height: var(--donut-h);      /* ★ 도넛 세로 높이 통제 */
}

.hazard-pills{
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

/* ------------------------------------------------------------
   19-6) KPI 2개짜리 행
   - 중앙 KPI를 2열로
   ------------------------------------------------------------ */
.kpi-2col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* KPI 숫자(요청에 따라 줄여서 막대 영역을 확보하기 쉬움) */
.kpi-big{
  font-size: clamp(20px, 1.9vw, 30px);
  font-weight: 900;
  letter-spacing: -0.6px;
  padding: 2px 0;
}

/* KPI 카드: 패딩을 줄여 높이 절약 */
.kpi-2col .panel-title{
  padding: 12px 16px 6px 16px;
}
.kpi-2col .panel-body{
  padding: 10px 16px 12px 16px;
}

/* ------------------------------------------------------------
   19-7) Bars 2-col
   - TOP10 막대그래프를 2열로 배치
   - flex:1로 남은 공간을 적극적으로 사용
   ------------------------------------------------------------ */
.bar-2col{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  min-height: 0;
  flex: 1;                     /* ★ 중앙에서 막대 영역이 남은 높이 차지 */
}

/* 막대그래프 카드: 제목-그래프 사이 여백 축소 */
.bar-2col .panel-title{
  padding: 12px 16px 6px 16px;
}
.bar-2col .panel-body{
  padding: 8px 12px 10px 12px; /* ★ 제목 아래 여백 줄이기 핵심 */
}

.bar-card-body{
  height: 100%;
  min-height: 0;
  flex: 1;
}

/* ------------------------------------------------------------
   19-8) 지도 최소 높이(너무 작아지지 않게)
   ------------------------------------------------------------ */
.panel-map{
  height: 100%;
  min-height: var(--map-min-h);
}

/* ------------------------------------------------------------
   19-9) 페이지 헤더(제목 + 설명을 한 줄처럼)
   - 설명이 길면 말줄임(...)
   ------------------------------------------------------------ */
.page-header{
  margin-bottom: 14px;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.page-header-left{
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
  min-width: 0;
}

.page-desc-inline{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 68ch;
}

/* ------------------------------------------------------------
   19-10) 헤더 우측 시나리오(라벨 + pills)
   ------------------------------------------------------------ */
.header-scenario{
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-scenario-label{
  margin: 0 !important;
  font-weight: 900;
  white-space: nowrap;
}

/* ------------------------------------------------------------
   19-11) 사이드바/네비 반응형
   - clamp로 폭/패딩/폰트가 화면에 따라 줄어듦
   ------------------------------------------------------------ */
.analysis-sidebar{
  width: clamp(150px, 15vw, 200px) !important;
  min-width: clamp(150px, 15vw, 200px) !important;
  align-self: flex-start !important;
  margin-top: 0 !important;
  top: 78px !important;
  padding: clamp(10px, 1.0vw, 16px) clamp(8px, 0.9vw, 12px) !important;
}

.analysis-nav-item{
  display: block;
  font-weight: 800;
  font-size: clamp(11px, 0.95vw, 14px);
  line-height: 1.2;
  padding: clamp(7px, 0.8vw, 10px) clamp(9px, 0.9vw, 12px);
  border-radius: clamp(10px, 1.0vw, 12px);
  margin-bottom: 6px;
  color: var(--text);
  border: 1px solid transparent;
}

.analysis-nav-item.is-active{
  background: #1F1F1F;
  color: #fff;
  border-color: #111;
}

.analysis29 .analysis-nav-item.is-active,
.analysis29 .report-search-btn,
.analysis29 .map-yearpill-play,
.analysis29 .analysis-home-primary-link,
.analysis29 .analysis-report-primary-link,
.analysis29 .analysis-report-chapter-link{
  color: #ffffff !important;
}

/* ------------------------------------------------------------
   19-12) 중간 화면(<=1200px)에서 인셋/헤더높이 미세조정
   ------------------------------------------------------------ */
@media (max-width: 1200px){
  .analysis29{ --graph-inset: 6px; }         /* 작은 화면에서는 인셋 감소 */
  .one-screen-grid{ height: calc(100vh - 175px); }
  .donut-row{ grid-template-columns: 220px 1fr; }
}

/* ------------------------------------------------------------
   19-13) 더 작은 화면(<=1024px)에서 최소 높이/그리드 비율 조정
   - mini 차트 겹침 방지: ts-row-h를 약간 줄이되 최소 확보
   ------------------------------------------------------------ */
@media (max-width: 1024px){
  .analysis29{ --graph-inset: 5px; --ts-row-h: clamp(100px, 13vh, 140px); }
  .one-screen-grid{
    height: calc(100vh - 165px);
    grid-template-columns: minmax(300px, 1fr) minmax(460px, 1.2fr) minmax(360px, 1.2fr) !important;
  }
  .page-desc-inline{ max-width: 44ch; }
}

/* ------------------------------------------------------------
   19-14) 매우 작은 화면(<=860px)
   - 이 구간부터는 1-screen 보장을 포기하고 자연스럽게 세로 스택
   ------------------------------------------------------------ */
@media (max-width: 860px){
  .one-screen-grid{
    height: auto;
    display: flex !important;
    flex-direction: column !important;
  }
}
