/* css/npl.css — NPL 매수/매도 평가 UI
   .pd-* 토큰(css/pharmacy.css)을 재사용하고 NPL 고유 레이아웃만 정의.
   부모: GENERATE_CODE_NPL_BUY_UI-001 / GENERATE_CODE_NPL_SELL_UI-001 */

.npl-screen {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 24px 48px;
  color: #1a1a1a;
}

/* 색 의미 가드 라벨 — 항상 노출 */
.npl-color-guard {
  margin: 12px 0 16px;
  padding: 8px 14px;
  background: #f0f7ff;
  border-left: 3px solid #00529B;
  border-radius: 6px;
  font-size: 13px;
  color: #003e75;
}
.npl-sell .npl-color-guard {
  background: #fff7ed;
  border-left-color: #C9485B;
  color: #7a2b38;
}

/* 좌(폼) / 우(결과) 50:50 */
.npl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 1100px) { .npl-grid { grid-template-columns: 1fr; } }

.npl-form-panel, .npl-result-panel {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 18px;
}

.npl-field { display: block; margin-bottom: 12px; }
.npl-field-label { display: block; font-size: 12px; font-weight: 600; color: #374151; margin-bottom: 4px; }
.npl-input {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
}
.npl-input:focus { outline: none; border-color: #00529B; box-shadow: 0 0 0 2px rgba(0,82,155,0.15); }

.npl-fieldset { border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px; margin: 8px 0 12px; }
.npl-fieldset legend { font-size: 12px; font-weight: 600; color: #6b7280; padding: 0 6px; }

.npl-warn {
  margin: 8px 0;
  padding: 9px 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 7px;
  font-size: 13px;
  color: #92400e;
}

.npl-empty { color: #9ca3af; font-size: 14px; text-align: center; padding: 40px 12px; }

/* ── IRR 카드 (매수) ── */
.npl-irr-card { padding: 16px; border-radius: 8px; background: #fafbfc; }
.npl-irr-head { font-size: 13px; font-weight: 600; color: #6b7280; }
.npl-irr-value { font-size: 40px; font-weight: 800; line-height: 1.1; margin: 4px 0; }
.npl-irr-badge { display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.npl-irr-recovery { font-size: 13px; color: #4b5563; margin: 10px 0; }
.npl-risks-head { font-size: 12px; font-weight: 600; color: #6b7280; margin-top: 10px; }

/* ── 3시나리오 (매수) ── */
.npl-scenarios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 20px; }
@media (max-width: 760px) { .npl-scenarios { grid-template-columns: 1fr; } }
.npl-scenario-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; }
.npl-scenario-title { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 8px; }
.npl-scenario-row { font-size: 13px; color: #4b5563; margin: 3px 0; }
.npl-scenario-irr { font-size: 18px; font-weight: 800; }
.npl-scenario-cone { font-size: 11px; color: #9ca3af; margin: 6px 0; }
.npl-scenario-grade { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; margin-top: 4px; }

/* ── 추천 카드 (매도) ── */
.npl-rec-card { padding: 16px; border-radius: 8px; background: #fafbfc; }
.npl-rec-compare { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.npl-rec-now, .npl-rec-hold { display: flex; flex-direction: column; flex: 1; }
.npl-rec-label { font-size: 11px; color: #6b7280; }
.npl-rec-num { font-size: 24px; font-weight: 800; color: #1a1a1a; }
.npl-rec-vs { font-size: 13px; color: #9ca3af; font-weight: 600; }
.npl-rec-badge { display: inline-block; margin-top: 12px; padding: 5px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }

/* ── SHAP 막대 (매도) ── */
.npl-shap, .npl-cone { margin-top: 20px; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; }
.npl-section-head { font-size: 13px; font-weight: 700; color: #374151; margin-bottom: 12px; }
.npl-shap-row { display: flex; align-items: center; gap: 8px; margin: 7px 0; }
.npl-shap-sign { font-weight: 800; width: 14px; text-align: center; }
.npl-shap-text { font-size: 13px; color: #4b5563; flex: 0 0 280px; }
.npl-shap-bar { height: 12px; border-radius: 4px; min-width: 4px; transition: width 0.3s; }
@media (max-width: 760px) { .npl-shap-text { flex: 1; } }

/* ── 보유 cone (매도) ── */
.npl-cone-now { font-size: 12px; color: #00529B; font-weight: 600; margin-bottom: 10px; }
.npl-cone-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; border-bottom: 1px solid #f3f4f6; }
.npl-cone-horizon { font-weight: 700; color: #374151; width: 40px; }
.npl-cone-band { font-size: 13px; color: #4b5563; flex: 1; }
.npl-cone-flag { font-size: 11px; font-weight: 700; color: #6b7280; }

/* ── 포트폴리오 (P2) ── */
.npl-pf-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 4px 0 16px; }
@media (max-width: 1000px) { .npl-pf-kpi-grid { grid-template-columns: repeat(2, 1fr); } }
.npl-kpi-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; }
.npl-kpi-label { font-size: 11px; color: #6b7280; font-weight: 600; }
.npl-kpi-value { font-size: 28px; font-weight: 800; color: #1a1a1a; line-height: 1.2; }
.npl-kpi-sub { font-size: 11px; color: #9ca3af; }
.npl-kpi-grades { grid-row: span 1; }
.npl-gradebar-row { display: flex; align-items: center; gap: 6px; margin: 4px 0; }
.npl-gradebar-label { font-size: 11px; font-weight: 700; flex: 0 0 64px; }
.npl-gradebar-track { flex: 1; height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.npl-gradebar-fill { display: block; height: 100%; border-radius: 4px; }
.npl-gradebar-num { font-size: 10px; color: #6b7280; flex: 0 0 64px; text-align: right; }

/* IRR 분포 히스토그램 */
.npl-hist-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.npl-hist { display: flex; align-items: flex-end; gap: 3px; height: 90px; }
.npl-hist-bar { flex: 1; border-radius: 3px 3px 0 0; min-height: 3px; transition: height 0.3s; }
.npl-hist-axis { display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; margin-top: 6px; }

/* 필터 */
.npl-pf-filters { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.npl-pf-filter { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 13px; background: #fff; color: #374151; }
.npl-pf-count { font-size: 12px; color: #6b7280; margin-left: auto; }

/* 테이블 */
.npl-pf-table-wrap { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.npl-pf-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.npl-pf-table th { background: #f9fafb; color: #6b7280; font-size: 11px; font-weight: 600; text-align: left; padding: 9px 12px; border-bottom: 1px solid #e5e7eb; }
.npl-pf-table td { padding: 9px 12px; border-bottom: 1px solid #f3f4f6; color: #374151; }
.npl-pf-table tbody tr:hover { background: #f9fafb; }
.npl-td-id { font-family: monospace; font-size: 11px; color: #6b7280; }
.npl-td-metric { font-weight: 700; }
.npl-td-grade { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.npl-td-conf { color: #6b7280; }
.npl-td-cone { font-size: 11px; color: #9ca3af; }
.npl-td-empty { text-align: center; color: #9ca3af; padding: 30px; }
.npl-pager { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px; }
.npl-pager-btn { padding: 6px 14px; border: 1px solid #d1d5db; border-radius: 7px; background: #fff; color: #374151; font-size: 13px; cursor: pointer; }
.npl-pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.npl-pager-info { font-size: 13px; color: #6b7280; }

/* ── 단건 객관성 상세 패널 (P3) ── */
.npl-pf-table tbody tr[data-asset-id] { cursor: pointer; }
.npl-detail-overlay { position: fixed; inset: 0; background: rgba(7,16,31,0.55); z-index: 90; }
.npl-detail-panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
  background: #fff; z-index: 91; box-shadow: -8px 0 32px rgba(0,0,0,0.3);
  padding: 22px; overflow-y: auto; color: #1a1a1a;
  animation: nplSlideIn 0.22s ease;
}
@keyframes nplSlideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.npl-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.npl-detail-id { font-family: monospace; font-size: 12px; color: #6b7280; }
.npl-detail-addr { font-size: 16px; font-weight: 700; margin-top: 2px; }
.npl-detail-close { background: none; border: none; font-size: 20px; color: #9ca3af; cursor: pointer; line-height: 1; }
.npl-detail-close:hover { color: #374151; }
.npl-detail-grade { display: inline-block; margin: 12px 0 8px; padding: 5px 14px; border-radius: 999px; font-size: 14px; font-weight: 700; }
.npl-detail-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.npl-detail-meta span { font-size: 12px; color: #6b7280; background: #f3f4f6; padding: 3px 10px; border-radius: 999px; }
.npl-detail-section { margin: 18px 0; padding-top: 14px; border-top: 1px solid #f0f0f0; }
.npl-detail-objnote { font-size: 11px; color: #9ca3af; margin: 4px 0 10px; }

/* 백분위 바 */
.npl-pct-block { margin: 12px 0; }
.npl-pct-head { font-size: 13px; color: #374151; margin-bottom: 6px; }
.npl-pct-sub { font-size: 11px; color: #9ca3af; }
.npl-pct-track { position: relative; height: 10px; background: linear-gradient(90deg,#fde2e4,#fff3cd,#cfe8ff); border-radius: 5px; }
.npl-pct-fill { position: absolute; left: 0; top: 0; height: 100%; background: rgba(0,82,155,0.12); border-radius: 5px; }
.npl-pct-marker { position: absolute; top: -3px; width: 4px; height: 16px; background: #00529B; border-radius: 2px; transform: translateX(-50%); }
.npl-pct-axis { display: flex; justify-content: space-between; font-size: 10px; color: #9ca3af; margin-top: 3px; }
.npl-pct-nopeer { font-size: 12px; color: #9ca3af; padding: 8px 0; }

/* cone viz */
.npl-cone-viz { margin: 8px 0; }
.npl-cone-bar { position: relative; height: 12px; background: linear-gradient(90deg,#C9485B,#FED766,#00529B); border-radius: 6px; opacity: 0.85; }
.npl-cone-p50 { position: absolute; top: -3px; width: 3px; height: 18px; background: #1a1a1a; border-radius: 2px; transform: translateX(-50%); }
.npl-cone-vals { display: flex; justify-content: space-between; font-size: 12px; color: #4b5563; margin-top: 6px; }

/* 신뢰도 바 */
.npl-conf-bar { height: 10px; background: #f3f4f6; border-radius: 5px; overflow: hidden; }
.npl-conf-fill { display: block; height: 100%; background: linear-gradient(90deg,#5BC0EB,#00529B); }

/* ── 분석 대시보드 (P4) ── */
.npl-dashboard { max-width: 1100px; }
.npl-dash-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px; margin-bottom: 16px; }

/* 위험 히트맵 */
.npl-heatmap { width: 100%; border-collapse: separate; border-spacing: 4px; }
.npl-heatmap th { font-size: 11px; color: #6b7280; font-weight: 600; padding: 4px; text-align: center; }
.npl-hm-region { font-size: 12px; color: #374151; font-weight: 600; text-align: left; white-space: nowrap; padding-right: 8px; }
.npl-hm-cell { text-align: center; font-weight: 700; font-size: 14px; color: #fff; border-radius: 6px; padding: 8px 4px; min-width: 56px; position: relative; }
.npl-hm-risk { display: block; font-size: 9px; font-weight: 600; opacity: 0.85; }
.npl-hm-empty { background: #f3f4f6 !important; color: #d1d5db; font-weight: 400; }
.npl-hm-legend { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #6b7280; margin-top: 10px; }
.npl-hm-legend span { width: 16px; height: 12px; border-radius: 3px; display: inline-block; margin-left: 8px; }

/* 회수 cone 누적 */
.npl-rcone-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.npl-rcone-label { font-size: 12px; font-weight: 700; flex: 0 0 110px; }
.npl-rcone-track { position: relative; flex: 1; height: 18px; background: #f9fafb; border-radius: 4px; }
.npl-rcone-band { position: absolute; left: 0; top: 0; height: 100%; border-radius: 4px; }
.npl-rcone-p50mark { position: absolute; top: -2px; width: 2px; height: 22px; background: #1a1a1a; transform: translateX(-50%); }
.npl-rcone-val { font-size: 12px; font-weight: 700; color: #374151; flex: 0 0 60px; text-align: right; }

/* 신뢰도 분포 */
.npl-conf-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.npl-conf-label { font-size: 12px; font-weight: 700; flex: 0 0 160px; }
.npl-conf-track { flex: 1; height: 12px; background: #f3f4f6; border-radius: 6px; overflow: hidden; }
.npl-conf-fill2 { display: block; height: 100%; border-radius: 6px; }
.npl-conf-num { font-size: 12px; color: #6b7280; flex: 0 0 48px; text-align: right; }

/* ── 리포트 버튼 (P5) ── */
.npl-detail-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.npl-detail-report { padding: 9px 16px; background: #00529B; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; }
.npl-detail-report:hover { background: #003e75; }
.npl-dash-toolbar { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* ── V4 권리관계 (체크박스 + 배당순위) ── */
.npl-chk { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 12px; color: #4b5563; cursor: pointer; }
.npl-chk input { width: 15px; height: 15px; cursor: pointer; }
.npl-rights-head { font-size: 12px; font-weight: 700; color: #6b7280; margin: 12px 0 6px; }
.npl-rights-list { list-style: none; padding: 0; margin: 0; }
.npl-rights-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #f3f4f6; font-size: 12px; }
.npl-rights-rank { flex: 0 0 44px; font-weight: 700; color: #00529B; font-size: 11px; }
.npl-rights-name { flex: 1; color: #374151; }
.npl-rights-amt { font-weight: 700; color: #1a1a1a; }
.npl-rights-flag { font-size: 11px; color: #92400e; background: #fffbeb; border-radius: 5px; padding: 4px 8px; margin: 4px 0; }

/* ══════════════════════════════════════════════════════════════════════════════
   NPL → RWA 조각투자 마켓플레이스 (NPL_RWA_FRACTIONAL_UI-001)
   prefix: .rwa-  (기존 .npl-* 셀렉터와 충돌 없음)
   ══════════════════════════════════════════════════════════════════════════════ */

/* 위험 고지 컬러가드 오버라이드 */
.rwa-guard {
  background: #fff7ed;
  border-left-color: #C9485B;
  color: #7a2b38;
}

/* ── 탭 ── */
.rwa-tabs {
  display: flex;
  gap: 4px;
  margin: 16px 0 20px;
  border-bottom: 2px solid #e5e7eb;
}
.rwa-tab {
  padding: 10px 20px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  font-weight: 600;
  color: #6b7280;
  cursor: pointer;
}
.rwa-tab--active {
  color: #00529B;
  border-bottom-color: #00529B;
}
.rwa-tab:hover:not(.rwa-tab--active) { color: #374151; }

/* ── 마켓플레이스 ── */
.rwa-market-wrap { padding-bottom: 32px; }
.rwa-filters { flex-wrap: wrap; }
.rwa-market-count { font-size: 12px; color: #6b7280; margin-bottom: 12px; }

.rwa-token-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 900px) { .rwa-token-grid { grid-template-columns: 1fr; } }

/* 토큰 카드 */
.rwa-token-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s;
}
.rwa-token-card:hover { box-shadow: 0 4px 16px rgba(0,82,155,0.1); }

.rwa-token-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.rwa-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.rwa-grade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.rwa-token-name {
  font-size: 15px;
  font-weight: 700;
  color: #16325C;
  line-height: 1.3;
}
.rwa-token-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rwa-token-meta span {
  font-size: 11px;
  color: #6b7280;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 999px;
}

/* KPI 행 */
.rwa-token-kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 600px) { .rwa-token-kpi-row { grid-template-columns: repeat(2, 1fr); } }
.rwa-kpi-item { display: flex; flex-direction: column; }
.rwa-kpi-label { font-size: 10px; color: #9ca3af; font-weight: 600; }
.rwa-kpi-val { font-size: 14px; font-weight: 800; color: #1a1a1a; }
.rwa-irr-val { color: #00529B; }
.rwa-kpi-sub2 { font-size: 9px; color: #9ca3af; font-weight: 500; margin-top: 1px; }
.rwa-maturity { font-size: 12px; font-weight: 600; color: #374151; }

/* cone 미니 */
.rwa-cone-wrap { margin: 4px 0; }
.rwa-cone-label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 600;
  margin-bottom: 4px;
}
.rwa-cone-bar { margin: 2px 0; }
.rwa-cone-vals { font-size: 11px; }
.rwa-conf-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  margin-left: 6px;
}

/* 청약 진행 바 */
.rwa-sub-bar-wrap { margin: 4px 0 8px; }
.rwa-sub-bar-track {
  height: 6px;
  background: #f3f4f6;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}
.rwa-sub-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #5BC0EB, #00529B);
  border-radius: 3px;
  transition: width 0.4s;
}
.rwa-sub-bar-label { font-size: 10px; color: #9ca3af; }

/* 청약 버튼 */
.rwa-subscribe-btn {
  width: 100%;
  padding: 11px;
  background: #00529B;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  margin-top: auto;
  transition: background 0.15s;
}
.rwa-subscribe-btn:hover:not(:disabled) { background: #003e75; }
.rwa-subscribe-btn--disabled,
.rwa-subscribe-btn:disabled {
  background: #e5e7eb;
  color: #9ca3af;
  cursor: not-allowed;
}

/* ── 보유 포트폴리오 ── */
.rwa-portfolio-wrap { padding-bottom: 32px; }
.rwa-pf-kpi { margin-bottom: 16px; }
.rwa-obj-note {
  font-size: 12px;
  color: #003e75;
  background: #f0f7ff;
  border-left: 3px solid #5BC0EB;
  border-radius: 5px;
  padding: 8px 12px;
  margin-bottom: 16px;
}

/* 보유 카드 */
.rwa-holding-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rwa-holding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.rwa-holding-kpi {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
@media (max-width: 700px) { .rwa-holding-kpi { grid-template-columns: repeat(2, 1fr); } }

/* 신뢰구간 cone 섹션 */
.rwa-cone-section {
  background: #fafbfc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px;
}
.rwa-cone-title {
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 8px;
}
.rwa-cone-disclaimer {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 6px;
}

/* 회수 진행률 */
.rwa-recovery-prog { }
.rwa-recovery-label {
  font-size: 12px;
  color: #374151;
  margin-bottom: 4px;
}
.rwa-recovery-pct { font-weight: 800; color: #00529B; margin: 0 4px; }
.rwa-recovery-sub { font-size: 10px; color: #9ca3af; }
.rwa-recovery-fill { background: linear-gradient(90deg, #00A1E0, #00529B); }

/* 보유 카드 footer */
.rwa-holding-foot {
  font-size: 11px;
  color: #9ca3af;
  border-top: 1px solid #f3f4f6;
  padding-top: 8px;
}
.rwa-mono { font-family: monospace; font-size: 11px; }

/* ── 모달 공통 ── */
.rwa-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7,16,31,0.6);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.rwa-modal-box {
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.3);
  max-height: 90vh;
  overflow-y: auto;
  width: 100%;
  animation: rwaModalIn 0.2s ease;
}
@keyframes rwaModalIn { from { transform: scale(0.95) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.rwa-risk-box { max-width: 560px; }
.rwa-subscribe-box { max-width: 480px; }

.rwa-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.rwa-modal-title { font-size: 16px; font-weight: 700; color: #16325C; }
.rwa-modal-close { flex-shrink: 0; }

/* 위험고지 본문 */
.rwa-risk-body { padding: 16px 20px; }
.rwa-risk-callout {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #7c2d12;
  line-height: 1.6;
}
.rwa-risk-callout p { margin: 4px 0; }
.rwa-risk-list {
  padding-left: 18px;
  margin: 0 0 16px;
}
.rwa-risk-list li {
  font-size: 13px;
  color: #374151;
  margin: 8px 0;
  line-height: 1.6;
}
.rwa-risk-list li strong { color: #1a1a1a; }
.rwa-risk-agree {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13px;
  color: #1a1a1a;
  font-weight: 600;
  cursor: pointer;
}
.rwa-risk-agree input { flex-shrink: 0; width: 16px; height: 16px; margin-top: 1px; cursor: pointer; }

/* 청약 폼 본문 */
.rwa-sub-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.rwa-sub-token-info { }
.rwa-sub-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}
.rwa-calc-box {
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}
.rwa-calc-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  border-bottom: 1px solid #f3f4f6;
}
.rwa-calc-row:last-of-type { border-bottom: none; }
.rwa-calc-row span { color: #6b7280; }
.rwa-calc-row strong { font-weight: 800; color: #1a1a1a; }
.rwa-calc-muted span { color: #9ca3af; font-size: 11px; }
.rwa-calc-disclaimer { font-size: 10px; color: #9ca3af; margin-top: 8px; }
.rwa-sub-validation { }

/* 모달 footer */
.rwa-modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px 18px;
  border-top: 1px solid #e5e7eb;
  position: sticky;
  bottom: 0;
  background: #fff;
}
.rwa-btn-cancel {
  padding: 10px 20px;
  background: #f3f4f6;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
}
.rwa-btn-cancel:hover { background: #e5e7eb; }
.rwa-btn-confirm {
  padding: 10px 24px;
  background: #00529B;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}
.rwa-btn-confirm:hover:not(:disabled) { background: #003e75; }
.rwa-btn-confirm:disabled { background: #e5e7eb; color: #9ca3af; cursor: not-allowed; }

/* ── 청약 완료 토스트 ── */
.rwa-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #16325C;
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 300;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
}
.rwa-toast--show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.rwa-toast--error { background: #C9485B; }

/* ── 분배 내역 드릴다운 (UPGRADE-003) ── */
.rwa-dist-drill { margin-top: 10px; border-top: 1px solid #e5e7eb; padding-top: 8px; }
.rwa-dist-toggle-btn {
  background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 6px;
  padding: 5px 12px; font-size: 12px; color: #16325C; cursor: pointer; font-weight: 600;
}
.rwa-dist-toggle-btn:hover { background: #e8f0fe; border-color: #00A1E0; }
.rwa-dist-panel { margin-top: 8px; }
.rwa-dist-table-wrap { overflow-x: auto; }
.rwa-dist-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rwa-dist-table th {
  background: #16325C; color: #fff; padding: 6px 8px; text-align: right; font-weight: 600;
}
.rwa-dist-table th:first-child, .rwa-dist-table td:first-child { text-align: left; }
.rwa-dist-table td { padding: 6px 8px; border-bottom: 1px solid #eef0f2; text-align: right; color: #374151; }
.rwa-dist-table tr:nth-child(even) td { background: #F8FAFC; }
.rwa-dist-myshare { color: #00529B; font-weight: 700; }
.rwa-dist-total {
  margin-top: 6px; text-align: right; font-size: 12px; color: #16325C; font-weight: 700;
}
.rwa-dist-empty { font-size: 11.5px; color: #9ca3af; padding: 10px 0; text-align: center; }

/* ─── NPL 외부 리포트 라이브러리 (npl-reports.js) ─────────────────── */
/* 리포트는 뷰어 가독성이 핵심 — 공통 1100px 상한을 풀어 큰 화면(PT)에서 폭을 채운다 */
.npl-screen.npl-reports { max-width: 1760px; padding: 4px 2px 24px; }
.rl-header { margin: 8px 0 14px; }
.rl-h2 { font-size: 18px; font-weight: 700; color: #16325C; margin: 0 0 4px; }
.rl-sub { font-size: 12px; color: #6b7280; margin: 0; line-height: 1.5; }
.rl-loading, .rl-empty { font-size: 13px; color: #9ca3af; padding: 24px; text-align: center; }

.rl-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .rl-layout { grid-template-columns: 1fr; } }
/* 큰 화면(PT): 카드 리스트를 좁혀 뷰어를 최대한 크게 */
@media (min-width: 1400px) { .rl-layout { grid-template-columns: 300px 1fr; } }

/* ── 리스트 (카드) ── */
.rl-list { display: flex; flex-direction: column; gap: 8px; max-height: calc(100vh - 180px); overflow-y: auto; padding-right: 4px; }
.rl-card {
  display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 12px;
  cursor: pointer; transition: border-color .15s, box-shadow .15s, transform .1s;
}
.rl-card:hover { border-color: #5BC0EB; box-shadow: 0 2px 10px rgba(0,82,155,0.08); }
.rl-card.is-active { border-color: #00529B; box-shadow: 0 0 0 1px #00529B inset, 0 2px 12px rgba(0,82,155,0.12); }
.rl-card-icon { flex: 0 0 auto; color: #00529B; margin-top: 2px; }
.rl-card-body { flex: 1 1 auto; min-width: 0; }
.rl-card-title-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rl-card-title { font-size: 13.5px; font-weight: 700; color: #1a1a1a; }
.rl-tag {
  font-size: 10px; font-weight: 700; color: #00529B; background: #cfe8ff;
  padding: 1px 6px; border-radius: 999px; line-height: 1.6;
}
.rl-card-sub { font-size: 11.5px; color: #4b5563; margin-top: 3px; line-height: 1.4; }
.rl-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; font-size: 11px; color: #6b7280; }
.rl-meta-bank { color: #7c2d12; background: #fff7ed; padding: 0 5px; border-radius: 4px; font-weight: 600; }
.rl-card-fmt { flex: 0 0 auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.rl-fmt { font-size: 9.5px; font-weight: 700; padding: 1px 5px; border-radius: 4px; }
.rl-fmt-html { color: #065f46; background: #bbf7d0; }
.rl-fmt-pdf { color: #7a2b38; background: #fde2e6; }

/* ── 뷰어 (iframe) ── */
.rl-viewer {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column; min-height: 640px; height: calc(100vh - 180px);
}
.rl-viewer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 12px; background: #16325C; color: #fff; flex: 0 0 auto;
}
.rl-viewer-name { font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rl-viewer-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.rl-viewer-btn {
  font-size: 11px; font-weight: 600; color: #16325C; background: #fff;
  padding: 3px 9px; border-radius: 6px; text-decoration: none; white-space: nowrap;
  transition: background .15s;
}
.rl-viewer-btn:hover { background: #cfe8ff; }
.rl-viewer-frame { flex: 1 1 auto; width: 100%; border: 0; background: #f3f4f6; }
.rl-viewer-empty {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: #9ca3af; font-size: 13px; padding: 40px;
}
