/* ===== 친구 초대 페이지(invite.html) — 접두사 iv-. 첫 화면은 공통 서브페이지 머리 + 오른쪽 내 초대 링크 카드(12열 7:5, .card), 3단계 .steps, 질문 .faq-* 그대로 ===== */

/* 첫 화면: 공통 서브페이지 머리(.page-top·.page-head) + 오른쪽 내 초대 링크 카드 — 12열 7:5(홈 첫 화면과 같은 비율), 카드는 그림자 없는 .card */
.iv-top { align-items: start; }
.iv-top .page-head { grid-column: 1 / span 7; }
.iv-panel { grid-column: 8 / span 5; }
.iv-top .page-head__note { text-wrap: balance; }
.iv-top .page-head__title { text-wrap: balance; } /* 태블릿 이상은 '친구에게도' 뒤에서 줄바꿈(br-t), 폰은 균형 줄바꿈('알려 / 주세요'로 갈라지지 않게) */
#ivReward.is-set { text-wrap: pretty; } /* 확정된 보상도 공통 안내 줄 규격(14/22·--text-2) 그대로 — 사이트 결정표. 초록은 안 씀(문장이라서) */

/* 내 초대 링크 카드 */
.iv-text { margin-top: 12px; color: var(--text-2); text-wrap: balance; }
.iv-panel.is-out { padding-bottom: calc(var(--pad) + 5px); } /* 비로그인 카드는 버튼 면으로 끝나 위(제목 글줄 잉크)보다 아래가 5 좁음 → 위아래 같게 */
.iv-cta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.iv-cta .btn { padding-inline: 12px; }

/* 코드·링크 칸: 입력칸과 같은 상자(48·surface-2·r-sm·위 1px 잉크 보정), 오른쪽에 밑줄 글자 버튼(홈 '직접 입력'과 같은 모양) */
.iv-box { display: flex; align-items: center; gap: 12px; height: 48px; padding: 1px 16px 0; border-radius: var(--r-sm); background: var(--surface-2); border: 1px solid var(--control-line); font-weight: 500; } /* 입력칸 테두리 = 공통 --control-line(바탕 대비 3:1) */
.iv-box:has(.iv-val:focus) { outline: 2px solid var(--focus); outline-offset: 3px; }
.iv-val { flex: 1; min-width: 0; height: 100%; background: transparent; border: 0; padding: 0; font-size: 16px; line-height: 26px; font-weight: 500; color: var(--text); text-overflow: ellipsis; } /* 긴 링크는 끝을 …로(복사는 전체 값), 칸에 들어가면 잘림 없이 */
.iv-val:focus { outline: none; text-overflow: clip; }
.iv-code { font-weight: 600; letter-spacing: 0.04em; }
.iv-copy { position: relative; flex: none; min-width: 42px; text-align: end; font-size: 14px; line-height: 22px; font-weight: 600; color: var(--text); text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--line-2); white-space: nowrap; }
.iv-copy::after { content: ""; position: absolute; inset: -11px -8px; } /* 누르는 칸 44(상자 48 안) */
.iv-copy:hover { text-decoration-color: currentColor; }
.iv-in .field + .field { margin-top: 20px; } /* 칸(면)으로 끝나는 묶음 → 다음 라벨 글줄 위 여백 4를 빼 입력 묶음 사이 잉크 24(홈 계산기와 같게) */
.iv-share { width: 100%; margin-top: 24px; }
.iv-stats { padding-top: 16px; border-top: 1px solid var(--line); }
/* 예시 계정 안내: 제목 바로 아래(복사·공유보다 먼저 읽히게) */
.iv-sample { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: balance; }
/* 복사·공유 결과: 누른 곳 옆에 보이는 한 줄(비어 있으면 자리도 없음) */
.iv-status { font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: balance; }
.iv-status:not(:empty) { margin-top: 8px; } /* 칸 아래 도움말·오류 줄(.field-help·.field-err)과 같은 자리·간격 */
.iv-in .field:has(.iv-status:not(:empty)) + .field { margin-top: 16px; }
.iv-in .field:has(.iv-status:not(:empty)) + .iv-share { margin-top: 20px; } /* 공유 버튼 앞도 같은 보정(24 → 20) */ /* 위 묶음이 작은 글줄로 끝나면 글줄 아래 여백(4)만큼 → 입력 묶음 사이 잉크 24 유지 */
.iv-end-status:not(:empty) { margin-top: 12px; }
.step p.iv-step-reward { color: var(--text); text-wrap: balance; } /* 단계 설명 아래 따로 한 문단(보상이 확정됐을 때만) */
.iv-dyn { text-wrap: balance; } /* 보상 확정 여부로 길이가 바뀌는 답 — 마지막 줄에 몇 글자만 남지 않게 */

/* 질문 섹션: 앞 섹션이 본문 글줄(16/26)로 끝나 아래 여백 4만큼 당김 → 섹션 사이를 홈(102~106)과 같게 */
.iv-faq { padding-top: calc(var(--section) - 4px); }


@media (max-width: 960px) {
  /* 단이 쌓이면 머리 → 카드 = 공통 '머리 → 첫 본문'(태블릿·폰 32) */
  .iv-top { row-gap: 32px; }
  .iv-top .page-head, .iv-panel { grid-column: 1 / -1; }
}
