/* 앱 구독 해지·환불 길잡이(#2353). 형제 페이지 /freelance-refund/ 와 같은 토큰·짜임(같은 사이트 일관성).
 * 색: 같은 참고 화면을 design-dna 로 잰 값(FORGE/2424/kit/design-dna.json, measure-colors.mjs 실행값)을 그대로 쓴다.
 * 측정 보라 #a168e9 는 흰 글자와 대비가 모자라 글자가 얹히는 보라 면만 같은 색상의 짙은 보라(--accent-strong, 파생)로 칠한다.
 * 짜임(참고 화면): 진보라 머리 띠 위로 흰 판이 겹쳐 올라옴 · 활동 고르기 목록(아이콘 + 이름 + 화살표) → 결제한 곳 ·
 * 날짜 칩 → 할 일 타일 · 달력 카드 → 다음 결제일 달력(그날만 진보라 칸) · 할 일 목록에서 지금 항목만 진보라 면 → 첫 단계.
 * 상태는 선·색·배경으로: 고름 = 진보라 면, 지금 할 단계 = 진보라 머리, 경고 = 장미색 면, 알림 = 남색 면.
 * 글꼴: 바깥 글꼴 없이 시스템 산세리프 + 한글 폴백. */
:root {
  --font: system-ui, -apple-system, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  /* 측정값 */
  --bg: #e7d9fd; --paper: #fefdfe; --ink: #333035; --accent: #a168e9; --line: #d4c9e3;
  /* WCAG AA 용 파생 */
  --surface: #efe6fd; --surface-2: #f6f1fe; --ink-2: #5f5768;
  --accent-strong: #6e3fc2; --accent-ink: #fefdfe; --on-strong-2: #e7d9fd; --accent-text: #6e3fc2;
  --warn: #8a5208; --warn-soft: #fbf0dc; --danger: #9b2147; --danger-soft: #fbe6ec; --info-soft: #eef0fb; --info: #3b4a8f;
  --shadow: 0 8px 24px rgba(80, 40, 140, .10);
  --radius: 20px; --radius-sm: 12px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15121c; --paper: #1e1a28; --ink: #f1ecf8; --line: #3a3348;
    --surface: #2a2338; --surface-2: #231d30; --ink-2: #bdb4cb;
    --accent-strong: #b58af0; --accent-ink: #1a1124; --on-strong-2: #3a2a55; --accent-text: #c9a8ff;
    --warn: #f0b552; --warn-soft: #3a2c12; --danger: #ff9bb6; --danger-soft: #3e1825; --info-soft: #20253d; --info: #aab8ff;
    --shadow: 0 8px 24px rgba(0, 0, 0, .35); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; scrollbar-color: var(--accent) var(--surface); }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; overflow-x: hidden; word-break: keep-all; overflow-wrap: break-word; }
::selection { background: var(--accent); color: #fefdfe; }
.skip { position: absolute; left: -999px; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; color: var(--accent-text); }
.skip:focus { left: 8px; top: 8px; background: var(--paper); z-index: 9; }
[hidden] { display: none !important; }
.wrap, .hero-in, .foot { max-width: 880px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent-text); text-underline-offset: 3px; }
button, textarea, input { font: inherit; font-size: 16px; color: inherit; }
button:focus-visible, summary:focus-visible, a:focus-visible, textarea:focus-visible, input[type="text"]:focus-visible, input[type="date"]:focus-visible,
.opt:focus-within, .chip:focus-within { outline: 3px solid var(--accent); outline-offset: 2px; }
.hero-nav a:focus-visible { outline-color: var(--accent-ink); }
/* 고르는 동그라미는 숨기되 화면 읽기·키보드에는 남긴다(고른 상태는 면 색 + ✓) */
.sr-only, .opt input, .chip input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* 머리 띠: 진보라 면, 아래 흰 판이 겹쳐 올라온다 */
.hero { background: var(--accent-strong); color: var(--accent-ink); padding: 32px 0 64px; }
h1 { font-size: clamp(28px, 7.6vw, 46px); line-height: 1.2; margin: 0 0 12px; letter-spacing: -0.02em; font-weight: 800; }
h1, h2, h3 { text-wrap: balance; }
.lede { margin: 0; max-width: 40em; font-size: 16px; }
.hero-nav { display: flex; gap: 8px; margin: 20px 0 0; }
.hero-nav a { flex: 1 1 0; min-width: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; border-radius: var(--radius-sm); background: rgba(254, 253, 254, .12); color: var(--accent-ink); text-decoration: none; text-align: center; }
.hero-nav b { font-size: 20px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.hero-nav span { font-size: 13px; font-weight: 600; line-height: 1.3; }
@media (prefers-color-scheme: dark) { .hero { background: #2b1f42; color: #f1ecf8; } .hero-nav a { color: #f1ecf8; } .hero-nav a:focus-visible { outline-color: #f1ecf8; } }

main.wrap { position: relative; margin-top: -40px; }
.panel { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 16px; margin: 16px 0; min-width: 0; }
.grid > .col:first-child > .panel:first-child { margin-top: 0; }
h2 { font-size: 20px; margin: 0 0 12px; line-height: 1.4; font-weight: 800; scroll-margin-top: 16px; }
h3 { font-size: 16px; margin: 0 0 4px; line-height: 1.45; }
.sub { margin: -4px 0 14px; color: var(--ink-2); font-size: 15px; }
.nojs { margin: 0 0 12px; padding: 10px 12px; background: var(--warn-soft); border-radius: var(--radius-sm); font-size: 14px; }
/* 문단·근거 줄 안 링크도 누르는 곳 44px. 위아래 패딩으로 늘리면 이웃 줄 링크와 누르는 곳이 겹친다(r1 지적 1, 360px 49조각 중 16).
 * 링크를 한 덩어리(inline-flex)로 세우면 그 줄 상자만 44px 로 커지고 줄끼리는 겹치지 않는다. 글자 기준선은 앞뒤 글과 같다. */
.disclaimer a, .help-body a, .step li a, .keep a, .advice a, .src a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }

/* 상황 고르기 */
.pick-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.count { margin: 0; font-size: 14px; font-weight: 700; color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.field { margin: 0 0 20px; padding: 0; border: 0; min-width: 0; }
.field legend { font-weight: 800; font-size: 16px; padding: 0; margin-bottom: 8px; }
.field.compact { margin-bottom: 14px; }
.field.compact legend { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.opt { position: relative; cursor: pointer; background: var(--surface); color: var(--ink); border-radius: var(--radius-sm); transition: background-color .18s var(--ease-out), color .18s var(--ease-out), transform .12s var(--ease-out); }
.opt:active, .chip:active { transform: scale(.98); }
.opts { display: grid; gap: 10px; }
/* 활동 목록 짜임: 아이콘 + 이름(작은 설명) + 화살표 */
.opt.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 14px; align-items: center; column-gap: 12px; min-height: 64px; padding: 10px 14px 10px 10px; font-weight: 700; line-height: 1.35; }
.opt.row small { display: block; margin-top: 2px; font-size: 13px; font-weight: 500; color: var(--ink-2); }
.ico { width: 44px; height: 44px; padding: 10px; border-radius: 10px; background: var(--paper); color: var(--accent-strong); fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.chev { width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); justify-self: center; opacity: .7; }
/* 날짜 칩 짜임: 굵은 한 단어 + 작은 설명 */
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.opt.tile { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 68px; padding: 8px 6px; font-size: 17px; font-weight: 800; line-height: 1.25; }
.opt.tile small { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.opt:has(input:checked) { background: var(--accent-strong); color: var(--accent-ink); }
.opt:has(input:checked) small { color: var(--on-strong-2); }
.opt.tile:has(input:checked) > span::before { content: "✓ "; }
.opt.row:has(input:checked) .ico { background: transparent; color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--on-strong-2); }
@media (prefers-color-scheme: dark) { .opt:has(input:checked) small { color: #3a2a55; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; background: var(--surface); font-weight: 600; line-height: 1.35; transition: background-color .18s var(--ease-out); }
.chip:has(input:checked) { background: var(--accent-strong); color: var(--accent-ink); font-weight: 700; }
.chip:has(input:checked) span::before { content: "✓ "; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 6.75em; padding: 8px 16px; white-space: nowrap; flex-shrink: 0; border-radius: var(--radius-sm); border: 0; cursor: pointer; font-weight: 700; background: var(--accent-strong); color: var(--accent-ink); }
.btn.go { width: 100%; margin: 0 0 10px; text-decoration: none; }
.btn.ghost { background: transparent; color: var(--accent-text); box-shadow: inset 0 0 0 1.5px var(--line); width: 100%; }
.btn:active { transform: translateY(1px); }

/* 할 일 순서: 진보라 머리 + 할 일 목록 */
.plan { padding: 0; overflow: hidden; }
.plan:focus { outline: none; }
.plan-head { background: var(--accent-strong); color: var(--accent-ink); padding: 18px 18px 16px; }
.plan-head h2 { margin: 0; font-size: 15px; font-weight: 700; color: var(--on-strong-2); }
@media (prefers-color-scheme: dark) { .plan-head h2 { color: #3a2a55; } }
.route { margin: 2px 0 12px; font-size: 21px; font-weight: 800; line-height: 1.35; }
.track { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.track li { flex: 1; height: 6px; border-radius: 3px; background: var(--accent-ink); opacity: .35; }
.track li.now { opacity: 1; height: 10px; margin-top: -2px; border-radius: 5px; }
.plan-body { padding: 16px 14px 18px; }
.empty { margin: 0; color: var(--ink-2); font-size: 15px; }
.block-h { margin: 0 0 8px; font-size: 15px; color: var(--accent-text); }
.identify { margin: 0 0 16px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface); }
.warnings { display: grid; gap: 10px; }
.warnings:not(:empty) { margin-bottom: 14px; }
.warn { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); font-size: 15px; }
.warn b { display: block; color: var(--warn); font-size: 14px; }
.warn.danger { background: var(--danger-soft); }
.warn.danger b { color: var(--danger); }
.warn.info { background: var(--info-soft); }
.warn.info b { color: var(--info); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: st; }
.step { counter-increment: st; background: var(--surface-2); border-radius: var(--radius-sm); padding: 0 14px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.step-head { display: grid; grid-template-columns: 36px minmax(0, 1fr); align-items: center; column-gap: 10px; min-height: 52px; margin: 0 -14px 6px; padding: 8px 14px; font-weight: 800; line-height: 1.4; }
.step-head::before { content: counter(st); width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: var(--paper); color: var(--accent-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.step-head h3 { margin: 0; font-size: 16px; }
.sub-steps .step { background: var(--paper); }
.sub-steps .step-head::before { background: var(--surface); }
/* 지금 할 일만 진보라 면(참고 화면 「지금 항목」) */
.step.now { box-shadow: none; background: var(--surface); }
.step.now .step-head { background: var(--accent-strong); color: var(--accent-ink); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.step.now .step-head h3::after { content: "지금 할 일"; display: inline-block; margin-left: 8px; padding: 0 8px; border-radius: 999px; background: var(--paper); color: var(--accent-text); font-size: 12px; font-weight: 700; line-height: 22px; vertical-align: 1px; }
.step ul { margin: 0; padding-left: 18px; font-size: 15px; }
.step li + li { margin-top: 4px; }
/* 근거 줄: 줄 바꿈 되는 flex 블록. 링크마다 한 덩어리(44px)로 서고, 쉼표(.sep)는 화면에서 빼고 간격으로 가른다(쉼표가 줄 맨 앞에 떨어지지 않게). CSS 없이 읽으면 쉼표가 남는다 */
.src { display: flex; flex-wrap: wrap; align-items: center; gap: 0 14px; margin: 8px 0 0; font-size: 13px; color: var(--ink-2); line-height: 1.55; }
.src .sep { display: none; }
.src .asof-in { display: block; flex-basis: 100%; }
.keep { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--info-soft); font-size: 15px; }
.keep b { display: block; color: var(--info); font-size: 14px; }

/* 다음 결제일: 달력 카드(참고 화면 셋째 판) */
.due-in { display: grid; gap: 4px; }
.in { display: grid; gap: 4px; font-size: 14px; font-weight: 700; min-width: 0; }
.in input, .in textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); font-weight: 400; }
.in input::placeholder { color: var(--ink-2); }
.due-in .in { margin-bottom: 14px; }
.due-out { min-height: 1px; }
.due-card { display: grid; gap: 14px; }
.due-main { margin: 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--accent-strong); color: var(--accent-ink); }
.due-main small { display: block; font-size: 13px; font-weight: 600; color: var(--on-strong-2); }
.due-main strong { display: block; font-size: 22px; line-height: 1.3; font-variant-numeric: tabular-nums; }
.due-main span { display: block; font-size: 15px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .due-main small { color: #3a2a55; } }
.due-error { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-weight: 600; font-size: 15px; }
.cal { padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.cal-cap { margin: 0 0 6px; text-align: center; font-weight: 800; font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; font-size: 13px; font-variant-numeric: tabular-nums; }
.cal-grid .wd { color: var(--ink-2); font-weight: 700; font-size: 12px; }
.cal-grid .wd:first-child { color: var(--danger); }
.cal-grid span { display: grid; place-items: center; height: 30px; border-radius: 8px; }
.cal-grid .today { box-shadow: inset 0 0 0 1.5px var(--accent); font-weight: 700; }
.cal-grid .mark { background: var(--accent-strong); color: var(--accent-ink); font-weight: 800; }
.cal-key { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 0; font-size: 12.5px; color: var(--ink-2); }
.cal-key i { display: inline-block; width: 12px; height: 12px; margin-right: 6px; border-radius: 4px; vertical-align: -1px; }
.cal-key .k-mark { background: var(--accent-strong); }
.cal-key .k-today { box-shadow: inset 0 0 0 1.5px var(--accent); }
.advice { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.advice li { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 15px; }

/* 환불 요청 문구 */
.inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 16px; }
.in.wide { grid-column: 1 / -1; }
.msgs { display: grid; gap: 12px; }
.msg { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.msg-head { margin: 0 0 8px; }
.msg-head h3 { margin: 0; font-size: 15px; }
.msg-head p { margin: 0; font-size: 13px; color: var(--ink-2); }
.msg textarea { field-sizing: content; max-height: 70vh; width: 100%; min-height: 200px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--paper); line-height: 1.6; resize: vertical; }
/* 복사 결과는 버튼 바로 옆 한 줄(360px 에서도) */
.copy-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; min-width: 0; }
.copy-note { white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--accent-text); min-width: 0; }
.copy-note[data-state="fail"] { color: var(--danger); }

/* 1372 */
.help { display: grid; gap: 4px; }
.help-body p { margin: 0 0 8px; font-size: 15px; }
.help-call { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface); }
.help-call b { font-size: 22px; font-weight: 800; color: var(--accent-text); font-variant-numeric: tabular-nums; }
.help-call span { font-size: 14px; color: var(--ink-2); font-weight: 600; }

/* 한눈에 보기·질문·근거 */
.routes { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.routes li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px; }
.routes p { margin: 0; font-size: 15px; }
.routes .src { margin-top: 8px; font-size: 13px; }
details { border-radius: var(--radius-sm); background: var(--surface-2); margin: 0 0 8px; }
summary { min-height: 48px; display: flex; align-items: center; padding: 10px 14px; cursor: pointer; font-weight: 700; list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; margin-left: auto; flex: 0 0 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); }
details[open] summary::after { transform: rotate(-135deg); }
details p { margin: 0; padding: 0 14px 14px; font-size: 15px; }
#sources h3 { margin: 14px 0 4px; font-size: 15px; }
#sources ul { margin: 0; padding-left: 18px; font-size: 14px; }
@media (min-width: 760px) { #sources ul { columns: 2; column-gap: 32px; } #sources li { break-inside: avoid; } }
#sources li a { display: inline-flex; align-items: center; min-height: 44px; }
.asof { margin: 0; font-size: 14px; color: var(--ink-2); }
.disclaimer { margin: 16px 4px; color: var(--ink-2); font-size: 14px; }
.foot { padding-bottom: 32px; font-size: 14px; color: var(--ink-2); }
.foot p { margin: 4px 0; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* 좁은 화면(갤럭시 폴드 펼침 포함): 한 칸 */
@media (max-width: 1279px) {
  .grid { display: block; }
}
@media (max-width: 1279px) and (min-width: 560px) {
  .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .due-in { grid-template-columns: minmax(0, 1fr) auto; column-gap: 16px; align-items: start; }
  .due-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .due-card .advice { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .inputs { grid-template-columns: minmax(0, 1fr); }
  .hero-nav span { font-size: 12px; }
  .opt.tile { font-size: 16px; }
}
/* 넓은 화면: 왼쪽 고르기·결제일, 오른쪽 할 일·문구 */
@media (min-width: 1280px) {
  .wrap, .hero-in, .foot { max-width: 1200px; }
  .grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 20px; align-items: start; }
  .grid > .col > .panel:first-child { margin-top: 0; }
  .routes { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .panel { padding: 24px 22px; }
  .plan { padding: 0; }
  .help { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 20px; align-items: center; }
  .help h2 { margin: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  .step, .warn, .msg, .due-card > * { animation: rise .42s var(--ease-out) both; animation-delay: calc(var(--i, 0) * 50ms); }
  .route { animation: rise .32s var(--ease-out) both; }
  .cal-grid .mark { animation: pop .5s var(--ease-out) both .15s; }
  @keyframes rise { from { transform: translateY(8px); filter: blur(2px); } to { transform: none; filter: none; } }
  @keyframes pop { from { transform: scale(.6); } to { transform: none; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
