/* ===== 거래소 비교(exchanges.html) — 접두사 xc- =====
   표 모양은 홈 비교표 부품(.xlist .xhead .xrow …, tk.css) 그대로. 여기엔 이 페이지에만 있는 것만:
   조건 카드(거래량·체결 비율) · 결과 줄(예시 안내·정렬·수수료율 보기) · 카드형 수수료 줄 · 계산 근거 펼침.
   페이지 머리는 공통 .page-top/.page-head(tk.css), 머리→조건 카드는 공통 .page-body(40/32/32).
   간격은 tk.css 단계(4·8·12·16·24·32·40·64)만 */


/* ── 조건 카드: 거래량 · 체결 비율(넓은 화면 5:4) ── */
.xc-ctrl {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); gap: 24px; align-items: start;
  margin-bottom: 24px; padding: calc(var(--pad) - 4px) var(--pad); /* 위 글줄(라벨)·아래 글줄(도움말) 여백 4씩 상쇄 → 잉크 위아래 같게 */
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
}
.xc-f .field-help { margin-bottom: 0; }
.xc-curvol { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); } /* 입력칸을 닫아도 프리셋이 아닌 거래량이 보이게 */

/* ── 결과 줄: 왼쪽 기준 안내(숫자보다 먼저), 오른쪽 정렬(·960 이하 수수료율 보기) ── */
.xc-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; margin-bottom: 12px; }
.xc-bar-note { font-size: 14px; line-height: 22px; color: var(--text-2); }
.xc-bar-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; }
.xc-sort { display: flex; align-items: center; gap: 12px; }
.xc-sort-l { font-size: 14px; line-height: 22px; color: var(--text-2); white-space: nowrap; }
.xc-sort .select { width: 268px; max-width: 100%; }
.xc-feechk { display: none; } /* 넓은 화면은 수수료 열이 늘 보임 */

/* ── 표: 낭독 구조는 HTML(ARIA 표 — 낭독용 머리글 줄·수수료 칸은 늘 있음), 화면 모양은 홈 부품.
   행 = 상세로 가는 보조 클릭, 진짜 링크는 거래소 이름 ── */
#xcList .xrow { cursor: pointer; }
.xc-name { color: inherit; }
.xc-sr, .xc-sr * { white-space: normal; } /* 낭독용(화면 밖 1px) 머리글·칸: 한 줄로 길게 늘어나 화면 폭 검사에 걸리지 않게 */
#xcList .xfee { font-variant-numeric: tabular-nums; }
.xrow:hover .xc-name { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); }
.xc-lbl, .xc-sep-m { display: none; } /* 카드형(폰·수수료 보기)에서만 보이는 항목 이름(aria-hidden — 낭독은 열 머리글) */
#xcList .xrow .xrate::before, #xcList .xrow .xnet::before { content: none; display: none; } /* 홈 부품의 가상 요소 이름표 대신 위 HTML 이름표 */
.xc-lbl { font-weight: 500; color: var(--text-2); }
/* 정렬 기준 강조: 머리글 본문색·700, 수수료 정렬이면 페이백 후 수수료 숫자를 주인공 크기로(초록은 안 씀) */
#xcList[data-sort="get"] .xh-get, #xcList[data-sort="net"] .xh-net, #xcList[data-sort="rate"] .xh-rate { color: var(--text); font-weight: 700; }
#xcList[data-sort="net"]:not(.is-large-amount) .xnet .js-net { font-size: 18px; line-height: 26px; font-weight: 700; }
.xc-soon { margin-top: 16px; font-size: 13px; line-height: 20px; color: var(--text-3); }

/* ── 계산 근거(펼침): 근거 줄 오른쪽 버튼 → 카드 ── */
.xc-how-btn { display: inline-flex; align-items: center; gap: 8px; }
.xc-how-ico { width: 12px; height: 12px; flex: none; transition: transform .15s var(--ease); }
.xc-how-btn[aria-expanded="true"] .xc-how-ico { transform: rotate(180deg); }
.xc-how { margin-top: 24px; }
.xc-how-t { font-size: 18px; line-height: 26px; font-weight: 700; letter-spacing: -0.015em; }
.xc-defs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin-top: 16px; }
.xc-def dt { font-size: 16px; line-height: 26px; font-weight: 600; }
.xc-def dd { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: pretty; }
.xc-eg { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line); }
.xc-eg-cond { margin-bottom: 12px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--text); }
.xc-eg-rows { display: grid; gap: 8px; font-size: 14px; line-height: 22px; }
.xc-eg-rows > div { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 16px; }
.xc-eg-rows dt { color: var(--text-2); }
.xc-eg-rows dd { color: var(--text); font-variant-numeric: tabular-nums; } /* 식은 연산 단위로 줄바꿈(숫자·단위 덩어리는 줄바꿈 없는 공백) */
.xc-eg-f { color: var(--text-2); }
.xc-eg-r { font-weight: 600; white-space: nowrap; }
.xc-how-note { margin-top: 16px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: pretty; }

@media (max-width: 960px) {
  .xc-feechk { display: flex; }
  /* 수수료율도 보기 켬 → 카드형: 이름·금액 첫 줄, 아래로 혜택·요율·페이백 후 수수료·거래 수수료(태블릿은 로고 36 + 간격 16 = 52 들여쓰기) */
  #xcList.xc-show-fees .xhead { display: none; }
  #xcList.xc-show-fees .xrow { grid-template-columns: minmax(0, 1fr) auto 16px; grid-template-areas: "name get go" "boost boost ." "rate rate ." "net net ." "fee fee ."; row-gap: 0; column-gap: 12px; padding: 16px 20px 11px; } /* 마지막 줄이 13/20(아래 글줄 여백이 작음)이라 홈 카드(9)보다 2 더 → 잉크 위아래 같게 */
  #xcList.xc-show-fees .xrow .xname { grid-area: name; }
  #xcList.xc-show-fees .xrow .xget { grid-area: get; justify-self: end; text-align: end; }
  #xcList.xc-show-fees .xrow .xgo { grid-area: go; }
  #xcList.xc-show-fees .xrow .xget-note, #xcList.xc-show-fees .xrow .js-boost { display: none; }
  #xcList.xc-show-fees .xrow .xboost-m { display: block; grid-area: boost; margin-top: 4px; padding-inline-start: 52px; font-size: 12px; line-height: 18px; font-weight: 500; color: var(--text-2); text-align: start; }
  #xcList.xc-show-fees .xrow .xboost-m[hidden] { display: none; }
  #xcList.xc-show-fees .xrow .xrate { grid-area: rate; margin-top: 4px; padding-inline-start: 52px; font-size: 14px; line-height: 22px; font-weight: 500; color: var(--text-2); text-align: start; }
  #xcList.xc-show-fees .xrow .xnet { display: block; grid-area: net; padding-inline-start: 52px; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--text); text-align: start; }
  #xcList.xc-show-fees .per-m { display: inline; }
  /* 거래 수수료 줄(큰 금액 상태에서도 — 공통 숨김 규칙을 이 페이지 안에서 덮어씀) */
  #xcList.xc-show-fees .xrow .xfee { display: block; grid-area: fee; margin-top: 4px; padding-inline-start: 52px; font-size: 13px; line-height: 20px; color: var(--text-2); text-align: start; white-space: normal; }
  #xcList.xc-show-fees .xrow .xrate .xc-lbl, #xcList.xc-show-fees .xrow .xnet .xc-lbl, #xcList.xc-show-fees .xc-lbl, #xcList.xc-show-fees .xc-sep-m { display: inline; }
  #xcList.xc-show-fees .xc-sep-d { display: none; }
  /* 큰 금액 상태(공통 규칙의 세로 카드)에서도 HTML 이름표 + 수수료 줄 */
  #xcList.is-large-amount .xrow .xrate .xc-lbl, #xcList.is-large-amount .xrow .xnet .xc-lbl { display: inline; }
  #xcList.is-large-amount.xc-show-fees .xrow { grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "name go" "get ." "boost ." "rate ." "net ." "fee ."; }
  #xcList.is-large-amount.xc-show-fees .xrow .xget { justify-self: start; text-align: start; padding-inline-start: 52px; margin-top: 4px; }
}
@media (max-width: 720px) {
  #xcList .xrow .xrate .xc-lbl, #xcList .xrow .xnet .xc-lbl { display: inline; }
  #xcList[data-sort="net"]:not(.is-large-amount) .xnet .js-net { font-size: 16px; line-height: 24px; }
  #xcList.xc-show-fees .xrow { grid-template-columns: minmax(0, 1fr) auto 20px; }
  #xcList.xc-show-fees .xrow .xboost-m, #xcList.xc-show-fees .xrow .xrate, #xcList.xc-show-fees .xrow .xnet, #xcList.xc-show-fees .xrow .xfee { padding-inline-start: 44px; } /* 폰은 로고 32 + 간격 12 */
  #xcList.is-large-amount.xc-show-fees .xrow { grid-template-columns: minmax(0, 1fr) 20px; }
  #xcList.is-large-amount.xc-show-fees .xrow .xget { padding-inline-start: 44px; }
}
@media (max-width: 640px) {
  .xc-name { padding: 9px 8px; margin: -9px -8px; } /* 거래소 이름 링크 누르는 칸 44(화면 간격은 그대로) */
  .xc-ctrl { grid-template-columns: minmax(0, 1fr); row-gap: 20px; padding: 16px 20px; margin-bottom: 16px; } /* 묶음 사이 = 공통 24에서 도움말 글줄 보정 4를 뺀 상자 간격(계산기 .field + .field와 같은 잉크 간격) */
  .xc-bar-tools { width: 100%; }
  .xc-sort { width: 100%; }
  .xc-sort .select { flex: 1; width: auto; min-width: 0; }
  .xc-defs { grid-template-columns: minmax(0, 1fr); }
  .xc-eg-rows > div { grid-template-columns: minmax(0, 1fr); gap: 0; } /* 폰: 이름표 위, 식 아래 */
}
@media (max-width: 389px) {
  #xcList.xc-show-fees .xrow { grid-template-columns: minmax(0, 1fr) 20px; grid-template-areas: "name go" "get ." "boost ." "rate ." "net ." "fee ."; }
  #xcList.xc-show-fees .xrow .xget { justify-self: start; text-align: start; padding-inline-start: 44px; margin-top: 4px; }
}
@media (max-width: 359px) {
  #xcList.is-large-amount .xrow .xnet .xc-lbl { display: block; } /* 320 폭 큰 금액: 이름표를 윗줄로(홈 부품과 같은 처리) */
}

/* 첫 그림 자리: 비교표 줄은 스크립트가 그림 — 그리기 전(첫 방문·느린 연결) 빈 표 아래의 근거 줄·맺음이 첫 화면에 보였다가 밀려나지 않게 화면 높이만큼(첫 방문 실측 CLS 0.11).
   자리는 명시한 로딩 상태(.is-loading, HTML에 처음부터)에만 — 스크립트가 줄·0곳 안내·실패 안내 중 하나를 넣고 상태를 풂(10곳 = 1440폭 720·390폭 1070, 맺음은 첫 화면 밖).
   스크립트 파일 자체가 실패하면 로딩 안내 줄이 남아 새로고침을 알림. 스크립트가 꺼진 경우·인쇄는 자리를 풂(noscript.css·아래 print) */
.xlist.is-loading #xrows { min-height: calc(100vh - 64px); }
@media print { .xlist.is-loading #xrows { min-height: 0; } }
/* 번역 언어: 정렬 상자 — 정렬 문구가 한국어('월 예상 페이백 높은 순')보다 길어 접힌 상자에서 잘렸음(15개 언어 실측: 320px에서 13개, 768px에서 10개).
   데스크톱은 고정 폭 268 대신 가장 긴 항목에 맞춤(화면 폭 안), 폰은 '정렬' 이름표를 위에 두고 상자가 한 줄을 다 씀 */
:root:not(:lang(ko)) .xc-sort .select { width: auto; }
@media (max-width: 640px) {
  :root:not(:lang(ko)) .xc-sort { flex-wrap: wrap; row-gap: 4px; }
  :root:not(:lang(ko)) .xc-sort .select { flex: 1 1 100%; }
}
