/* ===== 페이백 계산기(calculator.html) — 접두사 ck- =====
   공통 부품(tk.css: .page-top·.page-head·.page-body · .calc·.calc-big·.calc-rows · .field·.field-keep·.seg·.select·.vol-input · .link-btn · .xlist·.xrow · .faq · .closing)을
   그대로 쓰고, 여기엔 이 페이지에만 있는 것만 둔다(머리·머리→본문 간격·비교표 구조는 사이트 공통 — 사이트 일관성 2단계).
   ▣ 도구 카드 하나 = 입력(왼쪽, 12열 격자 1~5열) → 결과(6~12열) → 시작 버튼. 폰·태블릿은 같은 순서로 쌓음(DOM 순서 = 화면 순서).
   ▣ 비교표는 홈·거래소 비교와 같은 열·같은 폰 카드. 이 페이지만 순서가 페이백 후 수수료 낮은 순(표 위에 명시). */

/* ── 도구 카드 ── */
.ck-tool {
  display: grid; padding: 0;
  grid-template-columns: calc((100% + 2px + var(--col-gap)) * 5 / 12 - var(--col-gap) - 1px) minmax(0, 1fr); /* 입력 칸 = 페이지 격자 1~5열, 결과 글은 6열 시작선 */
  grid-template-areas: "in out" "in cta";
  grid-template-rows: auto 1fr;
}
.ck-in { grid-area: in; padding: var(--pad); border-inline-end: 1px solid var(--line); min-width: 0; }
.ck-out { grid-area: out; padding: var(--pad); min-width: 0; }
.ck-cta { grid-area: cta; align-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 0 var(--pad) var(--pad); }
.ck-cta .link { font-size: 14px; line-height: 22px; }
.ck-in > .field + .field { margin-top: 24px; } /* 입력 묶음 사이 24(사이트 공통) */
.ck-in > .field:last-of-type .field-help { margin-bottom: 0; } /* 데스크톱은 입력 칸의 끝(결과 보기 링크는 폰만) → 묶음 사이 보정(-4) 없이 위아래 안쪽 여백 같게 */
.ck-jump { display: none; font-size: 14px; line-height: 22px; }
[tabindex="-1"]:focus { outline: none; } /* 이동 대상 제목(초점만 받음)은 테두리 없이 */

/* 입력 */
.ck-presets { margin-top: 8px; }
.ck-more-row { margin-top: 12px; } /* 예시 펼침 버튼 줄·예시 글은 공통 도움말 줄(.field-help) — 묶음 끝 보정도 공통 것만 씀 */
.ck-more { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: pretty; }
/* 펼침 버튼 방향 표시: 접힘 아래 / 펼침 위(장식 — 상태는 aria-expanded와 보기·접기 문구) */
.ck-chev { display: inline-block; width: 12px; height: 12px; margin-inline-start: 6px; vertical-align: -1px; transition: transform .15s var(--ease); }
[aria-expanded="true"] > .ck-chev { transform: rotate(180deg); }
.ck-custom { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.ck-fine { margin-top: 4px; }
/* 체결 비율 막대: 값 = 메이커 비율(왼쪽 = 테이커 위주, 위 프리셋과 같은 방향). 선택 위치는 손잡이(본문색, 대비 3:1 이상)가 알려 줌 */
.ck-range { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0; background: transparent; cursor: pointer; }
.ck-range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.ck-range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--line-2); }
.ck-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -10px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px var(--surface); }
.ck-range::-moz-range-thumb { width: 24px; height: 24px; border: 0; border-radius: 50%; background: var(--text); box-shadow: 0 0 0 4px var(--surface); }
.ck-range:focus-visible { outline: none; }
.ck-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--focus); }
.ck-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--focus); }
.ck-ratio { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.ck-ratio b { font-weight: 600; color: var(--text); }

/* 결과 */
.ck-out-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.ck-cond, .ck-copy-msg { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: balance; }
.ck-cond:empty { min-height: 22px; } @media print { .ck-cond:empty { min-height: 0; } } /* 조건 줄은 스크립트가 채움 — 첫 그림부터 한 줄 자리(첫 방문 실측: 아래 결과가 26px 밀림) */
.ck-cond.is-error, .ck-copy-msg.is-fail, .ck-xwarn.is-error { color: var(--danger); } /* 입력 중 안내·성공 안내는 보통 글자색, 오류만 빨강 */
.ck-out .calc-big { margin-top: 12px; }
.ck-boost { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.ck-rows { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.ck-why-btn { margin-top: 16px; }
.ck-why { margin-top: 12px; padding: 16px; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--line); }
.ck-why-rows { display: grid; gap: 12px; font-size: 14px; line-height: 22px; }
/* 이름·금액은 한 줄(안 들어가면 금액이 다음 줄 오른쪽으로), 식은 그 아래 전체 폭 */
.ck-why-rows > div, .ck-rows > div { flex-wrap: wrap; column-gap: 16px; row-gap: 4px; }
.ck-why-rows > div { display: flex; justify-content: space-between; }
.ck-why-rows dt { color: var(--text-2); }
.ck-why-rows dd, .ck-rows dd { margin-inline-start: auto; white-space: nowrap; text-align: end; }
.ck-why-rows dd { color: var(--text); font-weight: 600; }
.ck-why-rows dd.money { color: var(--money); }
.ck-why-rows .ck-expr { flex-basis: 100%; margin-inline-start: 0; white-space: normal; text-align: start; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--text-3); }
.ck-why-note { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; line-height: 20px; color: var(--text-3); text-wrap: pretty; }
.ck-why-note > span { display: block; text-wrap: balance; } /* 근거 문장 / 반올림 설명 — 줄마다 균형(긴 설명 끝 낱말만 남지 않게) */
.ck-why-note > span + span { margin-top: 4px; }

/* 밑줄 버튼(공통 .link-btn)의 이 페이지 보완 — 공통 반영은 노트 '공통 변경 요청' */
.vol-head .link-btn::after { inset: -12px -8px -10px; } /* 홈 '직접 입력'과 같음: 아래 세그먼트의 누르는 칸과 겹치지 않게 */
.link-btn[aria-expanded="true"] { text-decoration-color: currentColor; }
.link-btn:disabled { color: var(--text-3); cursor: not-allowed; text-decoration-color: var(--line); }

/* ── 비교표: 조건 줄 → 경고 줄(입력 중·오류일 때) → 정렬·근거 줄 → 표(구조는 tk.css .xrow 그대로) ── */
#ckCompare .xcond { margin-bottom: 8px; }
.ck-xwarn { margin: 0 0 8px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: balance; }
.ck-compare-note { margin: 0 0 16px; font-size: 13px; line-height: 20px; color: var(--text-3); }
@media (max-width: 640px) { .ck-compare-note .js-basis { display: block; } .ck-sep { display: none; } } /* 폰: 정렬 / 근거를 줄로 나눔('요율 기준'만 꼬리 줄로 남지 않게) */
.ck-xh-net small { display: block; font-size: 12px; line-height: 16px; } /* 두 줄 머리글: 열 이름 + 정렬 */
#xrows .xboost-m { text-wrap: balance; } /* 폰 혜택 줄 '선택한 거래소 · 첫 달 85% · 예상액은 기본 70% 기준'이 '기준'만 꼬리 줄로 남지 않게 */
#xrows > li:last-child .xrow { border-bottom: 0; } /* 펼치기 버튼이 없는 표 — 마지막 줄 선이 표 상자 테두리와 겹쳐 2px로 보이지 않게 */
#xrows > li:last-child .xrow:focus-visible { border-radius: 0 0 15px 15px; } /* 아래 둥근 모서리에 닿는 마지막 줄 */
@media (max-width: 720px) { #xrows > li:first-child .xrow:focus-visible { border-radius: 15px 15px 0 0; } } /* 폰은 머리줄이 없어 첫 줄이 위 모서리에 닿음(목록이 ol>li라 tk.css 규칙이 안 닿음) */
@media (max-width: 960px) { .xlist.is-large-amount #xrows > li:first-child .xrow:focus-visible { border-radius: 15px 15px 0 0; } }

/* ── 반응형 ── */
@media (min-width: 961px) {
  /* 넓은 결과 칸은 큰 금액(상한 1조 거래량)도 한 줄에 들어감 → 글자를 줄이지 않음(폰·태블릿만 한 단계 작게) */
  .ck-tool.is-large-amount .calc-big .v { font-size: 48px; line-height: 60px; }
  .ck-tool.is-large-amount .calc-big .v small { font-size: 28px; }
  .ck-tool.is-large-amount .calc-big .u { font-size: 18px; line-height: 26px; }
}
@media (min-width: 641px) {
  .ck-cta { padding-bottom: calc(var(--pad) + 5px); } /* 카드 맨 아래가 버튼 면일 때(태블릿, 데스크톱에서 근거를 펼쳐 결과 쪽이 길 때) → 맨 위 제목 글줄 잉크(위 29)와 같게 */
}
@media (max-width: 960px) {
  .ck-tool { grid-template-columns: minmax(0, 1fr); grid-template-areas: "in" "out" "cta"; grid-template-rows: auto; }
  .ck-in { border-inline-end: 0; padding-bottom: 16px; }
  .ck-out { border-top: 1px solid var(--line); padding-top: 16px; padding-bottom: 0; }
  .ck-cta { padding-top: 24px; }
  .ck-jump { display: inline-block; margin-top: 20px; } /* 도움말 글줄 아래 여백(4)만큼 −4 → 입력 묶음 사이와 같은 잉크 간격 */
}
@media (max-width: 640px) {
  .ck-cta .btn { width: 100%; }
  .ck-cta .link { padding-block: 11px; margin-block: -11px; } /* 누르는 칸 44, 화면 간격은 그대로 */
  .ck-jump { padding-block: 11px; margin-block: 9px -11px; } /* 위 20 − 11, 누르는 칸 44 */
  .ck-cta { justify-content: center; }
}
