/* public/css/pages-fin.css — 금융기관 화면 배치: Main(히어로 | 카테고리 목록 → 연결 방식 띠), 카테고리 템플릿(기관 타일 격자),
   연결금융기관(요약 띠 → 표 카드). 부품 모양(막대 목록·칩·표·쪽 넘김·KPI 띠·방식 칩)은 components.css. */

/* ── 금융기관 Main: 페이지 스크롤 없이 남은 높이를 본문(2열)과 방식 띠가 나눈다 ───────────────────── */

.fin-main-body {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

@media (min-aspect-ratio: 19/10) {
  .fin-main-body {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }
}

/* 왼쪽: 남색 히어로 — 위에 눈썹글과 큰 수, 가운데 국내·글로벌·국가 수와 비율 막대, 아래 버튼 */
.fin-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.4rem;
  min-width: 0;
  min-height: 0;
  margin: -1px 0 -1px -1px; /* 바깥 1px 테두리 위까지 남색으로 채운다 */
  padding: 4rem 4.4rem 4.4rem;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  background: var(--navy);
  color: var(--on-fill);
}

.fin-hero-eyebrow {
  font-size: var(--fs-eyebrow);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sky);
}

.fin-hero-total {
  font-size: var(--fs-hero);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  color: var(--on-fill);
}

.fin-hero-label {
  margin-top: 1.6rem;
  font-size: var(--fs-section);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--navy-text);
}

/* 큰 수 아래의 내역: 1px 선으로 나눈 뒤 국내·글로벌·국가 수와 비율 막대 */
.fin-hero-split {
  padding-top: 2.8rem;
  border-top: 1px solid var(--navy-line);
}

.fin-split-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1.2rem 3.2rem;
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy-text);
}

.fin-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 1rem;
  white-space: nowrap;
}

.fin-stat.is-phrase {
  display: block;
}

.fin-stat .num {
  font-size: var(--fs-section);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  color: var(--on-fill);
}

/* 모르는 값(세계 데이터를 한 번도 받지 못함): 흐린 대시 */
.fin-stat .num.is-none {
  font-weight: 700;
  color: var(--navy-text);
}

/* 국내(파랑)·글로벌(하늘) 색 견본 — 아래 비율 막대의 범례 */
.fin-swatch {
  align-self: center;
  width: 1.2rem;
  height: 1.2rem;
  border-radius: 0.3rem;
}

.fin-swatch.is-domestic,
.fin-ratio-part.is-domestic {
  background: var(--blue);
}

.fin-swatch.is-global,
.fin-ratio-part.is-global {
  background: var(--sky);
}

.fin-ratio {
  margin-top: 2.4rem;
}

.fin-ratio-bar {
  display: flex;
  gap: 0.3rem;
  height: 1.6rem;
  overflow: hidden;
  border-radius: 0.8rem;
}

.fin-ratio-part {
  flex: 1 1 0;
  min-width: 0.6rem;
}

.page-enter .fin-ratio-bar {
  transform-origin: left center;
  animation: bar-grow 620ms ease-out both;
}

.fin-ratio-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
  font-size: var(--fs-small);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--navy-text);
}

.fin-hero-pending {
  margin-top: 2.4rem;
  font-size: var(--fs-body);
  font-weight: 700;
  color: var(--navy-text);
}

.fin-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
}

/* 오른쪽: 카테고리 목록 — 국내 5행이 높이를 똑같이 나누고, 1px 남색 구분선 아래 세계금융기관 1행(한 행 높이).
   행은 모두 모서리 없는 띠다: 구분선(행 아래 1px)이 양 끝까지 곧고, 누름·초점 모양도 국내·세계 행이 같다(R24) */
.fin-cats {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 2.4rem 3.6rem 2rem;
}

.fin-cats-title {
  flex: 0 0 auto;
  padding: 0 0.8rem 1.2rem;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-body);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-2);
}

.fin-cats .bar-list {
  flex: 5 1 0;
  min-height: 0;
  grid-auto-rows: minmax(0, 1fr);
}

.fin-cats .bar-row {
  padding: 0 0.8rem;
  border-radius: 0;
}

.fin-cats .bar-label {
  font-size: var(--fs-section);
  letter-spacing: -0.02em;
}

.fin-cats .bar-icon {
  width: 3rem;
  height: 3rem;
}

.fin-cats .bar-track {
  height: 1.4rem;
  border-radius: 0.7rem;
}

.fin-cats .bar-value {
  min-width: 7rem;
  text-align: right;
  font-size: var(--fs-title);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--blue);
}

.fin-cats .bar-value .is-none {
  font-size: var(--fs-section);
  font-weight: 700;
  color: var(--muted);
}

.fin-cats .bar-go {
  width: 2.8rem;
  height: 2.8rem;
}

/* 세계금융기관 행: 국내와 따로 비교 — 위 1px 남색 구분선(R24: 구분선은 모두 1px), 막대 자리에 연결 국가 수.
   .fin-cats .bar-row와 같은 구체성 + 뒤에 있어 여기 값이 이긴다(모서리 없음은 위 규칙 그대로, 누르는 높이 최소값은 그대로) */
.fin-cats .fin-world-row {
  flex: 1 1 0;
  min-height: var(--tap);
  grid-template-columns: max-content minmax(0, 1fr) max-content max-content;
  column-gap: 2.4rem;
  margin-top: 1.2rem;
  border-top: 1px solid var(--ink);
  border-bottom: 0;
}

.bar-note {
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-body);
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--text-2);
}

/* 아래 띠: 제목 칸 + 연결 방식 4칸(위 줄 칩 · 이름, 아래 칸 폭 전체에 설명 — 한두 줄) */
.fin-methods {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: max-content repeat(4, minmax(0, 1fr));
  margin-top: 2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
}

.fin-methods-title {
  display: flex;
  align-items: center;
  padding: 0 3.2rem;
  border-right: 1px solid var(--line);
  font-size: var(--fs-menu);
  font-weight: 800;
  line-height: 1.2;
  color: var(--ink);
}

.fin-method {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  padding: 1.8rem 2.4rem;
}

.fin-method + .fin-method {
  border-left: 1px solid var(--line);
}

.fin-method-head {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-width: 0;
}

.fin-method .method-chip {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: var(--radius-sm);
  font-size: var(--fs-menu);
}

.fin-method-name {
  min-width: 0;
  font-size: var(--fs-menu);
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink);
}

.fin-method-desc {
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.45;
  word-break: keep-all; /* 한국어는 띄어쓰기에서만 줄을 바꾼다("수집합/니다"처럼 낱말을 자르지 않게) */
  overflow-wrap: anywhere;
  color: var(--text-2);
}

/* ── 카테고리 템플릿: 제목 아래 한 줄(수 · 구분선 · 범례), 기관 타일 격자(넘치면 격자만 스크롤) ─────────── */

.meta-count {
  flex: 0 0 auto;
  font-weight: 800;
  color: var(--ink);
}

.meta-sep {
  flex: 0 0 auto;
  width: 1px;
  height: 2.4rem;
  background: var(--line-strong);
}

.inst-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.inst-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr));
  gap: 1.6rem;
}

.inst-tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 11rem;
  overflow: hidden;
  padding: 2.4rem 2rem 4.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

/* 위쪽 0.4rem 파란 선(모서리는 타일이 자른다) */
.inst-tile::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 0.4rem;
  background: var(--blue);
}

.inst-name {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: var(--fs-menu);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  color: var(--ink);
}

/* 로고는 비율 그대로, 원본보다 키우지 않는다(width/height auto + 최대 크기만) */
.inst-logo {
  width: auto;
  height: auto;
  max-width: 80%;
  max-height: 5.6rem;
  object-fit: contain;
}

.inst-tile .method-chips {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
}

/* ── 연결금융기관: 요약 띠 → 표 카드(남은 높이) ─────────────────────────────────────── */

.fin-linked .kpi-band {
  flex: 0 0 auto;
  margin-bottom: 1.6rem;
}
