/* ═══════════════════════════════════════════════════════
   ChartFlow — mypage.html 전용 (내 페이지)
   [2026-10-18 개편] 예전 <style> 덩어리(어두운 테마)와 common.css 의 내 페이지 규칙을 옮겨 밝은 테마로 다시 그림.
   js/mypage.js 가 만들어 넣는 이름(.mp-proof-item · .mp-lb · .mp-stale-banner · .mp-rg-* · .mp-prog-step.done/.current
   · .positive/.negative · .tc-modal 안 .mp-proof-file-row 등)은 그대로 두고 모양만 바꿉니다.
   공용 부품: .ui-card · .ui-stats · .ui-stepper · .ui-progress · .ui-table · .ui-state · .ui-empty · .chip--link
   ═══════════════════════════════════════════════════════ */

.mp-main { min-height: 50vh; }
/* 묶음 제목 크기(1.375rem)는 site.css .mp-group-title */

/* ─── 인사 줄 ─── */
.mp-hello { display: flex; align-items: center; gap: 14px; padding-bottom: 24px; border-bottom: 1px solid var(--c-line); }
.mp-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 1px solid var(--c-line); background: var(--c-band); }
.mp-hello-body { flex: 1; min-width: 0; }
.mp-hello-label { font-size: var(--fs-xs); color: var(--c-ink-3); line-height: 1.5; }
.mp-hello-name { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-ink); line-height: 1.4; overflow-wrap: anywhere; }
.mp-hello .btn-sm { flex-shrink: 0; }

/* ─── 디스코드 멤버십 안내 (미보유자만) ─── */
.mp-membership-banner { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 20px 24px; border: 1px solid var(--c-line); border-radius: var(--radius-lg); background: var(--c-band); }
.mp-mem-body { flex: 1; min-width: 0; }
.mp-mem-title { font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-ink); margin-bottom: 4px; }
.mp-mem-desc { font-size: var(--fs-small); color: var(--c-ink-2); line-height: 1.7; }
.mp-mem-desc p + p { margin-top: 4px; color: var(--c-ink-3); }
.mp-membership-banner .btn-primary { flex-shrink: 0; }

/* ─── 빠른 이동 (display 는 스크립트가 flex/none 으로) ─── */
.mp-jump { flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 24px; }
.mp-jump .chip--link.mp-jump-acct { color: var(--c-accent-ink); border-color: var(--c-accent-line); }
.mp-jump-cta { margin-left: auto; }

/* ─── 누적 수익률 그래프 ─── */
.mp-eq { margin-bottom: 16px; padding: 20px 24px; }
.mp-eq-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.mp-eq-range { width: auto; min-height: 40px; padding: 6px 36px 6px 12px; background-position: right 12px center; }
.mp-eq-canvas { display: block; width: 100%; height: 190px; }
.mp-eq-empty { padding: 32px 12px; text-align: center; color: var(--c-ink-3); font-size: var(--fs-small); line-height: 1.7; }

/* ─── 손실 게이지 (막대 + 한도 눈금, 숫자 없음) ─── */
.mp-risk-gauges { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.mp-risk-gauge { padding: 18px 20px 12px; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); min-width: 0; }
.mp-rg-header { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.mp-rg-label { font-size: var(--fs-small); font-weight: 650; color: var(--c-ink); }
.mp-rg-limit { font-size: 0.875rem; font-weight: 600; color: var(--c-down); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-rg-bar { position: relative; height: 10px; border-radius: 999px; background: var(--c-neutral-tint); box-shadow: inset 0 0 0 1px var(--c-line); overflow: hidden; }
.mp-rg-fill { height: 100%; width: 0; border-radius: inherit; background: var(--c-up); transition: width 0.4s ease; }
.mp-rg-fill.mp-rg-safe { background: var(--c-up); }
.mp-rg-fill.mp-rg-warn { background: var(--c-warn); }
.mp-rg-fill.mp-rg-danger { background: var(--c-down); }
.mp-rg-threshold { display: none; }
.mp-rg-scale { position: relative; height: 22px; margin-top: 4px; }
.mp-rg-tick { position: absolute; top: 8px; font-size: 0.75rem; color: var(--c-ink-3); white-space: nowrap; line-height: 1; font-variant-numeric: tabular-nums; }
.mp-rg-tick::before { content: ''; position: absolute; top: -8px; left: 50%; width: 1px; height: 5px; background: var(--c-line-2); }
.mp-rg-tick.edge-l::before { left: 0; }
.mp-rg-tick.edge-r::before { left: auto; right: 0; }

/* ─── 수치 (mypage.js 가 .positive / .negative 를 붙임) ─── */
.mp-stats .ui-stat__value.positive { color: var(--c-up); }
.mp-stats .ui-stat__value.negative { color: var(--c-down); }
.mp-updated { margin-top: 10px; text-align: right; }
.mp-stale-banner { margin-bottom: 12px; padding: 12px 16px; border: 1px solid var(--c-warn-line); border-left: 3px solid var(--c-warn); border-radius: var(--radius-sm); background: var(--c-warn-tint); color: var(--c-ink-2); font-size: var(--fs-small); line-height: 1.7; }
.mp-stale-banner strong { color: var(--c-ink); }

/* ─── 상태 카드 (계정 없음 · 검토 중 · 탈락 · 보류 · 포기 · 회수 · 오류) ─── */
.mypage-state-card { margin-top: 32px; }
.mypage-state-title { font-size: 1.1875rem; font-weight: 700; letter-spacing: -0.01em; color: var(--c-ink); line-height: 1.4; margin-bottom: 6px; }
.mypage-state-text { font-size: 1rem; color: var(--c-ink-2); line-height: 1.75; max-width: 46em; }
.mypage-state-text em { font-style: normal; font-weight: 700; color: var(--c-ink); }
.mypage-cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.mypage-cta-row:empty { display: none; }
.mp-state-note { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--c-line); border-left: 3px solid var(--c-accent); border-radius: var(--radius-sm); background: var(--c-band); font-size: var(--fs-small); line-height: 1.7; }
.mp-state-note strong { color: var(--c-ink); }
.mp-state-meta { margin-top: 10px; font-size: var(--fs-small); color: var(--c-ink-3); line-height: 1.6; }

/* ─── PRO 승격 진행 (단계 상태는 스크립트가 .done / .current 로) ─── */
.mp-prog-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.mp-prog-steps { margin-top: 8px; }
.mp-prog-step.done:not(:last-child)::after { background: var(--c-up); }
.mp-prog-step.done .ui-step__dot { background: var(--c-up); border-color: var(--c-up); color: #fff; }
.mp-prog-step.current .ui-step__dot { background: var(--c-accent-tint); border-color: var(--c-accent); color: var(--c-accent-ink); }
.mp-prog-step.current .ui-step__label { color: var(--c-accent-ink); font-weight: 700; }
.mp-prog-step:not(.done):not(.current) .ui-step__label { color: var(--c-ink-2); }
.mp-prog-sub { font-variant-numeric: tabular-nums; }
.mp-prog-bar { width: 120px; max-width: 100%; margin: 6px auto 4px; }
.mp-prog-conds { align-self: center; text-align: left; }
.mp-cond { display: flex; align-items: center; gap: 6px; white-space: nowrap; line-height: 1.75; }
.mp-cond-mark { flex-shrink: 0; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--c-line-2); background: var(--c-surface); }
.mp-cond.is-ok { color: var(--c-ink-2); }
.mp-cond.is-ok .mp-cond-mark { border-color: var(--c-up); background: var(--c-up) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.8 7.2l2.1 2 4.3-4.4' fill='none' stroke='%23fff' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
.mp-prog-next { margin-top: 20px; padding: 12px 16px; border-radius: var(--radius-sm); background: var(--c-accent-tint); color: var(--c-accent-ink); font-size: var(--fs-small); line-height: 1.7; }
.mp-prog-next:empty { display: none; }

/* ─── 내 수익인증 목록 (mypage.js 가 .mp-proof-item 을 만듦) ─── */
.mp-proofs { margin-top: 28px; }
.mp-progression-card[style*="none"] + .mp-proofs { margin-top: 0; }
.mp-count { margin-left: 4px; color: var(--c-accent-ink); font-variant-numeric: tabular-nums; }
.mp-proof-item { display: flex; gap: 14px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); }
.mp-proof-item + .mp-proof-item { margin-top: 10px; }
.mp-proof-thumb-btn { position: relative; flex-shrink: 0; padding: 0; border: 0; border-radius: var(--radius-sm); background: none; cursor: zoom-in; }
.mp-proof-thumb { display: block; width: 64px; height: 64px; object-fit: cover; border: 1px solid var(--c-line); border-radius: var(--radius-sm); background: var(--c-band); }
.mp-proof-thumb-btn:hover .mp-proof-thumb { border-color: var(--c-accent); }
.mp-proof-thumb-cnt { position: absolute; right: 3px; bottom: 3px; padding: 0 6px; border-radius: 999px; background: var(--c-ink); color: #fff; font-size: 0.6875rem; line-height: 1.6; pointer-events: none; }
.mp-proof-body { flex: 1; min-width: 0; }
.mp-proof-title-row { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.mp-proof-title { font-size: var(--fs-small); font-weight: 650; color: var(--c-ink); line-height: 1.5; overflow-wrap: anywhere; }
.mp-proof-meta { margin-top: 4px; font-size: var(--fs-xs); color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
.mp-proof-reject { margin-top: 8px; padding: 8px 12px; border-left: 3px solid var(--c-down); border-radius: var(--radius-sm); background: var(--c-down-tint); color: var(--c-down); font-size: 0.875rem; line-height: 1.6; }

/* 인증 이미지 크게 보기 (mypage.js 가 .mp-lb 를 만들고 닫으면 지움) — 모양은 site.css .ui-lightbox 와 같게 */
.mp-lb { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; padding: 20px; background: var(--c-scrim-strong); }
.mp-lb-box { width: min(880px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain; background: var(--c-surface); border-radius: var(--radius-lg); }
.mp-lb-imgwrap { position: relative; background: var(--c-ink); }
.mp-lb-img { display: block; width: 100%; max-height: 70vh; object-fit: contain; }
.mp-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 44px; height: 56px; border: 0; background: var(--c-media-btn); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.mp-lb-nav:hover { background: var(--c-media-btn-hover); }
.mp-lb-prev { left: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.mp-lb-next { right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.mp-lb-counter { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); padding: 2px 12px; border-radius: 999px; background: var(--c-media-btn); color: #fff; font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.mp-lb-close { position: absolute; top: 8px; right: 8px; z-index: 2; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--c-media-btn); color: #fff; font-size: 1.0625rem; cursor: pointer; }
.mp-lb-close:hover { background: var(--c-media-btn-hover); }
.mp-lb-nav:focus-visible, .mp-lb-close:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.mp-lb-title { padding: 14px 20px 18px; font-size: 1.0625rem; font-weight: 700; line-height: 1.5; color: var(--c-ink); overflow-wrap: anywhere; }

/* ─── 정산 · 신청 이력 ─── */
.mp-history + .mp-history { margin-top: 36px; }
.mp-sub-title { margin-bottom: 14px; }
.mp-wd-summary { margin-bottom: 12px; }
.mp-table td.settlement-amount { text-align: right; }
.mp-table th:last-child, .mp-table td:last-child { white-space: normal; min-width: 12em; }
.mp-tx { margin-left: 6px; font-family: var(--font-code); font-size: 0.8125rem; white-space: nowrap; }
/* 내용이 없으면 표 머리줄만 남지 않게 숨김 (빈 안내 상자가 대신 보임). :has 를 모르는 브라우저는 예전처럼 머리줄만 보임 */
.mp-table-wrap:has(tbody:empty) { display: none; }
.mp-table-wrap + .ui-empty { margin-top: 12px; }
.mp-table-wrap:has(tbody:empty) + .ui-empty { margin-top: 0; }

/* ─── 창 안 (정산 · 재도전 · 수익인증 제출 · 첫 안내) ─── */
.tc-modal-hint ul { margin: 6px 0 0; padding-left: 1.2em; }
.tc-modal-hint li + li { margin-top: 2px; }
.tc-modal-hint .mp-hint-title { display: block; margin-top: 8px; font-weight: 650; color: var(--c-ink); }
.tc-modal-hint.mp-hint-warn { border-color: var(--c-down-line); border-left-color: var(--c-down); background: var(--c-down-tint); color: var(--c-down); }
.tc-modal-hint + .form-row { margin-top: 20px; }
.mp-proof-file-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.mp-file-label { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--c-line-2); border-radius: var(--radius-sm); background: var(--c-surface); color: var(--c-ink); font-size: var(--fs-small); font-weight: 600; cursor: pointer; }
.mp-file-label:hover { border-color: var(--c-accent); color: var(--c-accent-ink); }
/* 파일 칸은 화면에서만 숨김(.sr-only) — 키보드로 닿으면 고르기 단추에 테두리 */
.form-row:has(#proofImage:focus-visible) .mp-file-label { outline: 2px solid var(--c-accent); outline-offset: 2px; }
.mp-file-name { font-size: 0.875rem; color: var(--c-ink-3); word-break: break-all; }
.mp-file-note { margin-top: 6px; font-size: 0.875rem; color: var(--c-ink-3); }
.mp-preview-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* ─── 반응형 ─── */
@media (max-width: 640px) {
  .mp-hello { flex-wrap: wrap; gap: 12px; padding-bottom: 20px; }
  .mp-hello-name { font-size: 1.125rem; }
  .mp-membership-banner { flex-wrap: wrap; align-items: flex-start; padding: 18px; }
  .mp-membership-banner .btn-primary { flex: 1 1 100%; }
  .mp-jump-cta { flex: 1 1 100%; margin: 4px 0 0; }
  .mp-eq { padding: 16px; }
  .mp-risk-gauges { grid-template-columns: 1fr; }
  .mp-stats, .mp-wd-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .mp-stats .ui-stat, .mp-wd-summary .ui-stat { padding: 14px; }
  .mp-stats .ui-stat__value, .mp-wd-summary .ui-stat__value { font-size: 1.25rem; }
  .mp-stats .ui-stat:first-child, .mp-wd-summary .ui-stat:first-child { grid-column: 1 / -1; }
  .mp-updated { text-align: left; }
  .mp-prog-header { flex-direction: column; align-items: stretch; }
  .mp-proof-cta { width: 100%; }
  .mp-prog-bar { margin: 6px 0 4px; width: 200px; }
  .mp-prog-conds { align-self: auto; }
  .mp-proof-item { padding: 12px; gap: 12px; }
  /* 표: 좁은 화면에서는 한 건을 두 줄로 (신청일 · 금액/경로 · 상태 / 처리 결과). 공통 틀은 site.css 의 .ui-table--stack */
  .mp-table tr { grid-template-columns: minmax(0, 1fr) auto minmax(4.75em, auto); gap: 6px 14px; padding: 12px 14px; }
  .mp-table td:nth-child(3) { justify-self: end; }
  .mp-table td:last-child { grid-column: 1 / -1; min-width: 0; white-space: normal; font-size: 0.875rem; color: var(--c-ink-2); }
  .mp-table td:last-child::before { content: '처리 결과 · '; color: var(--c-ink-3); }
  .mp-lb { padding: 8px; }
  .mp-lb-nav { width: 38px; height: 48px; }
}
