/* =========================================================
   디자인 토큰 — 색은 여기서만 바꾼다.
   --brand : 캐스타와 맞춘 흑/백 메인 색 (라이트=검정, 다크=흰색)
   ========================================================= */
:root {
  --bg: #ffffff;
  --surface: #f2f4f6;
  --surface-2: #f9fafb;
  --line: #e5e8eb;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;
  --brand: #000000;
  --on-brand: #ffffff;
  --brand-press: #2b2b2b;
  --danger: #f04452;
  /* 캐스타 노랑 — 로딩·진행·드래그 등 '움직이는 효과'에만 사용 (버튼은 흑/백 유지) */
  --accent: #ffc21f;
  --accent-grad: linear-gradient(90deg, #ffd72a 0%, #ffb517 100%);
  --accent-soft: rgba(255, 194, 31, .16);
  --on-accent: #111111;
  --ok: #191f28;
  --overlay: rgba(0, 0, 0, .5);
  --shadow: 0 8px 28px rgba(0, 0, 0, .08);

  --r-s: 10px;
  --r-m: 16px;
  --r-l: 24px;

  /* 폰트 크기: 모바일 기준 → 데스크톱으로 커짐 (clamp) */
  --fs-h1: clamp(30px, 7.2vw, 52px);
  --fs-h2: clamp(24px, 5.6vw, 32px);
  --fs-lead: clamp(16px, 4.2vw, 19px);
  --fs-body: 16px;
  --fs-small: 14px;
  --fs-cap: 13px;

  --gutter: 20px;
  --max: 1080px;
  --max-narrow: 560px;
  --header-h: 60px;

  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #000000;
  --surface: #17171a;
  --surface-2: #0e0e10;
  --line: #2a2a2e;
  --text: #f2f4f6;
  --text-2: #b0b8c1;
  --text-3: #7e8690;
  --brand: #ffffff;
  --on-brand: #000000;
  --brand-press: #d9d9d9;
  --ok: #f2f4f6;
  --shadow: 0 8px 28px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

/* ========================= 기본 ========================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  text-wrap: pretty;          /* 마지막 줄에 한 단어만 남는 줄바꿈 방지 */
  line-break: strict;
  min-height: 100dvh;
  display: flex; flex-direction: column;
  transition: background .2s, color .2s;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }
/* 번역 문구는 문장 단위 줄바꿈(\n)을 그대로 보여줌 */
[data-i18n] { white-space: pre-line; }
.h1, .h2, .ws-title, .drag-card b { text-wrap: balance; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--on-brand); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.wrap-narrow { max-width: var(--max-narrow); }
.center { text-align: center; }
.mt0 { margin-top: 0; }
.mt8 { margin-top: 8px; }

/* ========================= 타이포 ========================= */
.h1 { font-size: var(--fs-h1); line-height: 1.25; font-weight: 800; letter-spacing: -0.03em; margin: 0 0 16px; white-space: pre-line; }
.h2 { font-size: var(--fs-h2); line-height: 1.35; font-weight: 750; letter-spacing: -0.025em; margin: 48px 0 12px; }
.lead { font-size: var(--fs-lead); color: var(--text-2); margin: 0; max-width: 36em; }
.sub { font-size: var(--fs-body); color: var(--text-2); margin: 0 0 28px; }
.eyebrow { display: inline-block; font-size: var(--fs-small); font-weight: 650; color: var(--text-2); background: var(--surface); padding: 6px 12px; border-radius: 999px; margin: 0 0 18px; }
.caption { font-size: var(--fs-cap); color: var(--text-3); }
small { display: block; font-size: var(--fs-cap); color: var(--text-3); font-weight: 400; margin-top: 2px; }

/* ========================= 헤더 ========================= */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px); border-bottom: 1px solid var(--line); }
.top-in { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); height: var(--header-h); display: flex; align-items: center; gap: 24px; }
.logo { display: flex; align-items: flex-end; gap: 9px; text-decoration: none; color: var(--text); }
.logo svg { height: 22px; width: auto; display: block; transition: transform .25s cubic-bezier(.2,1.6,.4,1); }
.logo-en { color: var(--text); font-size: 20px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; margin-bottom: -2px; }
.logo:hover svg { transform: translateY(-2px); }
.nav { display: flex; gap: 4px; }
.nav a, .nav-m a { text-decoration: none; color: var(--text-2); font-weight: 600; font-size: 15px; padding: 8px 12px; border-radius: var(--r-s); transition: background .15s, color .15s; }
.nav a:hover { background: var(--surface); }
.nav a.on, .nav-m a.on { color: var(--text); }
.nav a.on { background: var(--surface); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 40px; height: 40px; border: 0; background: transparent; border-radius: var(--r-s); display: grid; place-items: center; color: var(--text-2); }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.i-moon { display: none; }
[data-theme="dark"] .i-sun { display: none; }
[data-theme="dark"] .i-moon { display: block; }
.nav-m { display: none; }

/* ========================= 버튼 ========================= */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--r-m); font-weight: 650; text-decoration: none; height: 48px; padding: 0 20px; font-size: 16px; transition: background .15s, transform .08s, opacity .15s; -webkit-tap-highlight-color: transparent; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-lg { height: 56px; font-size: 17px; }
.btn-sm { height: 38px; font-size: 14px; padding: 0 14px; border-radius: var(--r-s); }
.btn-block { width: 100%; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover:not(:disabled) { background: var(--brand-press); }
.btn-secondary { background: var(--surface); color: var(--text); }
.btn-secondary:hover:not(:disabled) { background: var(--line); }
.btn-text { background: transparent; color: var(--text-2); }
.btn-text:hover { color: var(--text); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; font-size: var(--fs-cap); }

.seg { display: inline-flex; background: var(--surface); border-radius: var(--r-s); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; border-radius: 8px; padding: 0 14px; height: 40px; font-weight: 650; color: var(--text-3); font-size: 15px; }
.seg button.on { background: var(--bg); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
[data-theme="dark"] .seg button.on { background: #2c2c30; }
.seg-sm button { height: 32px; padding: 0 10px; font-size: 13px; }
.seg-full { display: flex; width: 100%; }
.seg-full button { flex: 1; }

/* ========================= 홈 ========================= */
.view { display: none; padding: 40px 0 72px; animation: in .25s ease; }
.view.active { display: block; }
@keyframes in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero { padding: 24px 0 32px; }
.drop { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 40px 20px; background: var(--surface-2); border: 2px dashed var(--line); border-radius: var(--r-l); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; }
.drop-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.drop-btn { min-width: 220px; pointer-events: none; }
.drop-hint { color: var(--text-2); font-size: var(--fs-small); }
.drop-sm { padding: 28px 20px; margin-bottom: 8px; }

.quota { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 16px 20px; background: var(--surface); border-radius: var(--r-m); font-size: 15px; color: var(--text-2); }
.quota strong { color: var(--text); font-size: 17px; }

.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0 32px; }
.card-s { background: var(--surface); border-radius: var(--r-m); padding: 20px; }
.card-s b { display: block; font-size: 17px; margin-bottom: 4px; }
.card-s p { margin: 0; color: var(--text-2); font-size: var(--fs-small); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps li { display: flex; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r-m); }
.steps b { display: block; font-size: 17px; }
.steps p { margin: 4px 0 0; color: var(--text-2); font-size: var(--fs-small); }
.num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; }

.note { margin: 32px 0 0; padding: 18px 20px; background: var(--surface); border-radius: var(--r-m); color: var(--text-2); font-size: var(--fs-small); }
.note b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }
.note p { margin: 0; }

/* ========================= 확인 ========================= */
.preview { position: relative; background: var(--surface); border-radius: var(--r-l); overflow: hidden; aspect-ratio: 4 / 5; max-height: 52vh; margin: 0 auto 28px; display: grid; place-items: center; }
.preview img { width: 100%; height: 100%; object-fit: contain; }
.preview-tag { position: absolute; left: 12px; top: 12px; right: 12px; display: inline-flex; width: fit-content; max-width: calc(100% - 24px); align-items: center; gap: 6px; background: rgba(0,0,0,.72); color: #fff; padding: 8px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; backdrop-filter: blur(8px); }
.preview-tag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; flex: none; }
.preview-tag.warn::before { background: #ffb020; }
.preview-tag.loading::before { background: var(--accent); animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .2; } }

.field { margin-bottom: 24px; }
.label { display: block; font-size: 15px; font-weight: 650; color: var(--text-2); margin-bottom: 10px; }
.label.req::after { content: " *"; color: var(--danger); }
.row-between { display: flex; justify-content: space-between; align-items: center; }
.row-between b { color: var(--text); }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice-item { position: relative; cursor: pointer; }
.choice-item input { position: absolute; opacity: 0; }
.choice-item > span { display: block; padding: 16px; border: 1.5px solid var(--line); border-radius: var(--r-m); height: 100%; transition: border-color .15s, background .15s; }
.choice-item b { font-size: 16px; }
.choice-item input:checked + span { border-color: var(--brand); background: var(--surface-2); }
.choice-item input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.row-toggle { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 20px; cursor: pointer; }
.row-toggle b { font-size: 16px; }
.switch { appearance: none; -webkit-appearance: none; flex: none; width: 52px; height: 32px; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; transition: background .2s; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); background: var(--on-brand); }

.check { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; font-size: 15px; color: var(--text-2); margin-bottom: 24px; }
.check input { appearance: none; -webkit-appearance: none; flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--text-3); margin: 0; display: grid; place-items: center; cursor: pointer; transition: background .15s, border-color .15s; }
.check input:checked { background: var(--brand); border-color: var(--brand); }
.check input:checked::after { content: ""; width: 6px; height: 11px; border: solid var(--on-brand); border-width: 0 2.5px 2.5px 0; transform: translateY(-1px) rotate(45deg); }
.check a { color: var(--text); font-weight: 600; }

.cta-bar { display: grid; gap: 6px; margin-top: 8px; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* ========================= 대기 ========================= */
.progress { text-align: left; background: var(--surface); border-radius: var(--r-l); padding: 22px; margin-bottom: 20px; }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.progress-pct { font-size: 34px; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
/* 진행 막대 = 벽돌을 한 장씩 쌓는 모양 (담장 컨셉) */
.bar { height: 12px; background: var(--line); border-radius: 4px; overflow: hidden;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 26px, transparent 26px 29px);
          mask: repeating-linear-gradient(90deg, #000 0 26px, transparent 26px 29px); }
.bar i { display: block; height: 100%; width: 0; background: var(--accent-grad); border-radius: 999px; transition: width .4s ease; position: relative; overflow: hidden; }
.bar i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); transform: translateX(-100%); animation: shine 1.4s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(100%); } }
.mini-steps { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; font-size: var(--fs-small); color: var(--text-3); }
.mini-steps li { display: flex; align-items: center; gap: 10px; }
.mini-steps li::before { content: ""; width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--line); flex: none; box-sizing: border-box; }
.mini-steps li.now { color: var(--text); font-weight: 600; }
.mini-steps li.now::before { border: 2px solid var(--accent); border-right-color: transparent; animation: spin .8s linear infinite; }
.mini-steps li.done { color: var(--text-2); }
.mini-steps li.done::before { background: var(--accent); border-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.wait-cta { margin-top: 32px; }
.wait-ad { margin: 8px 0 20px; display: grid; justify-items: center; gap: 8px; }

/* ========================= 결과 ========================= */
.done-mark { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-grad); display: grid; place-items: center; margin: 0 0 20px; animation: pop .5s cubic-bezier(.2,1.6,.4,1) both; box-shadow: 0 0 0 0 var(--accent-soft); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.done-mark.sm { width: 40px; height: 40px; margin: 2px 0 0; flex: none; }
.done-mark.sm svg { width: 22px; height: 22px; }
.center .done-mark { margin: 0 auto 20px; }
.done-mark svg { width: 28px; height: 28px; fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.compare { position: relative; border-radius: var(--r-l); overflow: hidden; background: var(--surface); margin-bottom: 28px; user-select: none; touch-action: pan-y; }
.compare > img { width: 100%; max-height: 60vh; object-fit: contain; }
.compare-before { position: absolute; inset: 0; clip-path: inset(0 50% 0 0); }
.compare-before img { width: 100%; height: 100%; object-fit: contain; }
.compare-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; transform: translateX(-1px); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.compare-handle span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; border-radius: 50%; background: #fff; transform: translate(-50%, -50%); box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.compare-handle span::before, .compare-handle span::after { content: ""; position: absolute; top: 50%; width: 0; height: 0; border: 6px solid transparent; transform: translateY(-50%); }
.compare-handle span::before { left: 6px; border-right-color: #191f28; }
.compare-handle span::after { right: 6px; border-left-color: #191f28; }
.compare-tag { position: absolute; top: 12px; background: rgba(0,0,0,.65); color: #fff; font-size: 12px; font-weight: 650; padding: 5px 10px; border-radius: 999px; pointer-events: none; }
.compare-tag.l { left: 12px; } .compare-tag.r { right: 12px; }
.compare input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }

.name-input { display: flex; align-items: center; background: var(--surface); border-radius: var(--r-m); padding-right: 16px; border: 1.5px solid transparent; transition: border-color .15s; }
.name-input:focus-within { border-color: var(--brand); }
.name-input input { flex: 1; min-width: 0; border: 0; background: transparent; height: 56px; padding: 0 16px; font-size: 17px; outline: none; }
.name-input span { color: var(--text-3); font-weight: 600; }
.field-err { color: var(--danger); font-size: var(--fs-cap); margin: 8px 0 0; }

.meta-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin: 16px 0 0; flex-wrap: wrap; }
.fb { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 18px 0; margin: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-weight: 600; }
.fb-btns { display: flex; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; }
.chip:hover { background: var(--surface); }

.big-emoji { width: 72px; height: 72px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; margin: 24px auto 20px; }
.big-emoji svg { width: 34px; height: 34px; fill: none; stroke: var(--text); stroke-width: 1.8; stroke-linecap: round; }
.big-emoji.err svg { stroke: var(--danger); }

/* ========================= 변환 ========================= */
.range { width: 100%; accent-color: var(--accent); height: 28px; }
.files { list-style: none; padding: 0; margin: 8px 0 20px; border-top: 1px solid var(--line); }
.files li { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.files-empty { justify-content: center; color: var(--text-3); font-size: var(--fs-small); padding: 28px 0 !important; }
.files .thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface); flex: none; }
.files .fi { flex: 1; min-width: 0; }
.files .fn { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.files .fs { font-size: var(--fs-cap); color: var(--text-3); }
.files .fs b { color: var(--text); font-weight: 650; }
.cross { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: var(--surface); border-radius: var(--r-m); margin-top: 28px; }
.cross b { font-size: 16px; } .cross p { margin: 2px 0 0; color: var(--text-2); font-size: var(--fs-small); }
.cross .btn { flex: none; background: var(--bg); }

/* ========================= 폼 ========================= */
.input { width: 100%; border: 1.5px solid transparent; background: var(--surface); border-radius: var(--r-m); padding: 0 16px; height: 56px; font-size: 17px; outline: none; transition: border-color .15s; }
textarea.input { height: auto; padding: 14px 16px; resize: vertical; line-height: 1.5; }
select.input { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px; padding-right: 44px; }
.input:focus { border-color: var(--brand); }
.input.bad { border-color: var(--danger); }
.input::placeholder { color: var(--text-3); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-block; padding: 10px 16px; border-radius: 999px; background: var(--surface); font-size: 15px; font-weight: 600; color: var(--text-2); cursor: pointer; border: 1.5px solid transparent; }
.chip-check input:checked + span { background: var(--brand); color: var(--on-brand); }
.chip-check input:focus-visible + span { border-color: var(--text); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.doc .note { margin: 0 0 24px; }
.doc-h { font-size: 19px; font-weight: 750; margin: 8px 0 12px; }
.doc-list { margin: 0 0 32px; padding-left: 22px; color: var(--text-2); display: grid; gap: 10px; font-size: 15px; }
.foot-disclaim { flex-basis: 100%; order: 3; margin: 4px 0 0; font-size: 12px; line-height: 1.6; color: var(--text-3); }

/* ========================= 광고 ========================= */
.ad { display: grid; justify-items: center; gap: 6px; margin: 32px auto; width: 100%; overflow: hidden; }
.ad-label { font-size: 11px; color: var(--text-3); letter-spacing: .04em; }
.ad-ph { display: grid; place-items: center; background: repeating-linear-gradient(45deg, var(--surface), var(--surface) 10px, var(--surface-2) 10px, var(--surface-2) 20px); border: 1px dashed var(--line); border-radius: var(--r-s); color: var(--text-3); font-size: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ad-banner .ad-ph { width: 100%; max-width: 728px; height: 90px; }
.ad-rect .ad-ph { width: 300px; height: 250px; }
.wait-ad .ad { margin: 0; }
.ad ins { width: 100%; }

/* ========================= 푸터 / 쿠키 / 토스트 ========================= */
.foot { border-top: 1px solid var(--line); padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: var(--fs-small); }
.foot-links a { color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot .caption { margin: 0; }

.cookie { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: 560px; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); box-shadow: var(--shadow); border-radius: var(--r-m); padding: 16px 18px; z-index: 40; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: var(--fs-small); }
.cookie p { margin: 0; color: var(--text-2); flex: 1 1 220px; }
.cookie-btns { display: flex; gap: 8px; align-items: center; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-size: 15px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 공통 하단 배너 + 모바일 하단 고정 광고 */
.foot-ad { width: 100%; }
.foot-ad .ad { margin: 8px auto 32px; }
.anchor-ad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 0 calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: center; }
.anchor-ad .ad { margin: 0; gap: 0; }
.anchor-ad .ad-label { display: none; }
.ad-anchor .ad-ph { width: 320px; height: 50px; }
.anchor-close { position: absolute; top: -28px; right: 8px; width: 28px; height: 28px; border: 1px solid var(--line); border-bottom: 0; border-radius: 8px 8px 0 0; background: var(--bg); display: grid; place-items: center; color: var(--text-2); padding: 0; }
.anchor-close svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
body.has-anchor { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
body.has-anchor .cookie { bottom: calc(78px + env(safe-area-inset-bottom)); }
body.has-anchor .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* ========================= 워터마크 설정 ========================= */
.wm-panel { margin: -8px 0 24px; padding: 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-m); display: grid; gap: 18px; }
.wm-sec { display: grid; gap: 10px; }
.wm-k { font-size: 14px; font-weight: 650; color: var(--text-2); }
.wm-row { display: flex; align-items: center; justify-content: space-between; }
.wm-panel .input { background: var(--bg); border-color: var(--line); }
.wm-panel .input:focus { border-color: var(--brand); }
.swatches { display: flex; gap: 10px; }
.sw { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); padding: 0; position: relative; }
.sw-w { background: #fff; } .sw-b { background: #000; }
.sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--brand); }
.wm-logo { display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--bg); border: 1.5px dashed var(--line); border-radius: var(--r-m); cursor: pointer; }
.wm-logo:hover { border-color: var(--text-3); }
.wm-logo-thumb { flex: none; width: 56px; height: 56px; border-radius: 12px; background: repeating-conic-gradient(var(--surface) 0 25%, var(--bg) 0 50%) 0 0 / 12px 12px; background-size: 12px 12px; display: grid; place-items: center; overflow: hidden; }
.wm-logo-thumb img { width: 100%; height: 100%; object-fit: contain; }
.wm-logo-thumb:empty::before { content: "+"; font-size: 26px; color: var(--text-3); font-weight: 300; }
.wm-logo-txt b { font-size: 15px; display: block; }
/* 위치: 사진 모양 미니 보드에서 고르기 */
.pos-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 34px) 44px; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-m); padding: 8px; max-width: 260px; }
.pos-grid button { border: 0; border-radius: 8px; background: var(--surface); position: relative; padding: 0; }
.pos-grid button::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 10px; border-radius: 3px; background: var(--text-3); transform: translate(-50%, -50%); }
.pos-grid button.on { background: var(--brand); }
.pos-grid button.on::after { background: var(--on-brand); }
[data-wmpos="tl"] { grid-area: 1 / 1; } [data-wmpos="tr"] { grid-area: 1 / 3; }
[data-wmpos="c"] { grid-area: 2 / 2; }
[data-wmpos="bl"] { grid-area: 3 / 1; } [data-wmpos="br"] { grid-area: 3 / 3; }
.pos-grid .pos-tile { grid-area: 4 / 1 / 5 / 4; font-size: 14px; font-weight: 650; color: var(--text-2); }
.pos-grid .pos-tile::after { display: none; }
.pos-grid .pos-tile.on { color: var(--on-brand); }
.wm-panel .range { height: 24px; }

/* ========================= 작업 화면 (보호·결과·변환 공통) =========================
   데스크톱: 왼쪽 사진(고정) / 오른쪽 설정
   모바일: 사진이 헤더 아래에 붙어 있고, 설정은 그 아래에서 스크롤 → 설정 바꾸면서 사진을 계속 볼 수 있음 */
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 40px; align-items: start; }
.ws-media { position: sticky; top: calc(var(--hdr, 61px) + 20px); }
.ws-stage { position: relative; height: min(calc(100vh - var(--hdr, 61px) - 110px), 720px); min-height: 320px; background: var(--surface); border-radius: var(--r-l); overflow: hidden; display: grid; place-items: center; }
.ws-stage > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.ws-stage.checker { background: repeating-conic-gradient(var(--surface) 0 25%, var(--surface-2) 0 50%) 0 0 / 22px 22px; }
.ws-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 10px; font-size: var(--fs-cap); color: var(--text-3); }
.ws-file { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-meta .link-btn { flex: none; }
.ws-panel { min-width: 0; }
.ws-title { font-size: 24px; font-weight: 750; letter-spacing: -0.025em; margin: 0 0 20px; line-height: 1.35; }
.ws-title-row { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; }
.ws-title-row .ws-title { margin: 0; }
.ws-sub { margin: 2px 0 0; color: var(--text-2); font-size: 15px; }
.ws-actions { margin: 8px 0 20px; }
.ws .compare { position: absolute; inset: 0; margin: 0; border-radius: 0; background: transparent; }
.ws .compare > img, .ws .compare-before img { width: 100%; height: 100%; max-height: none; object-fit: contain; }
.ws .wm-panel { margin-top: -8px; }

/* 작업 화면 들어올 때: 사진은 살짝 커지며, 설정은 아래에서 순서대로 */
.ws.enter .ws-stage { animation: stageIn .5s cubic-bezier(.2,.9,.3,1) both; }
.ws.enter .ws-panel > * { animation: rise .45s ease both; }
.ws.enter .ws-panel > *:nth-child(2) { animation-delay: .05s; }
.ws.enter .ws-panel > *:nth-child(3) { animation-delay: .1s; }
.ws.enter .ws-panel > *:nth-child(4) { animation-delay: .15s; }
.ws.enter .ws-panel > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes stageIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ========================= 화면 전체 드래그 앤 드롭 ========================= */
.drag-ov { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; pointer-events: none; opacity: 0; visibility: hidden; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(10px) saturate(140%); -webkit-backdrop-filter: blur(10px) saturate(140%); transition: opacity .2s, visibility .2s; }
.drag-ov.show { opacity: 1; visibility: visible; pointer-events: auto; }
/* 테두리를 따라 노란 빛이 도는 링 */
.drag-ring { position: absolute; inset: 16px; border-radius: 28px; padding: 3px; background: conic-gradient(from var(--ang, 0deg), #ffd72a, #ffb517, transparent 30%, transparent 55%, #ffd72a 75%, #ffb517); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ring 2.4s linear infinite; }
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@keyframes ring { to { --ang: 360deg; } }
/* 가운데서 퍼지는 물결 */
.drag-ripples { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.drag-ripples i { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%; border: 2px solid var(--accent); opacity: 0; animation: ripple 2.1s ease-out infinite; }
.drag-ripples i:nth-child(2) { animation-delay: .7s; }
.drag-ripples i:nth-child(3) { animation-delay: 1.4s; }
@keyframes ripple { 0% { transform: scale(.6); opacity: .9; } 100% { transform: scale(3.2); opacity: 0; } }
.drag-card { position: relative; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 0 24px; transform: scale(.9); transition: transform .35s cubic-bezier(.2,1.5,.4,1); }
.drag-ov.show .drag-card { transform: none; }
.drag-icon { width: 96px; height: 96px; border-radius: 30px; background: var(--accent-grad); display: grid; place-items: center; box-shadow: 0 18px 50px rgba(255, 181, 23, .45); animation: bob 1.1s ease-in-out infinite; margin-bottom: 10px; }
.drag-icon svg { width: 44px; height: 44px; fill: none; stroke: var(--on-accent); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(-3deg); } }
.drag-card b { font-size: clamp(26px, 5vw, 40px); font-weight: 800; letter-spacing: -0.03em; }
.drag-card span { color: var(--text-2); font-size: 16px; }
/* 놓는 순간: 아이콘이 쏙 들어가며 노란 빛이 번쩍 */
.drag-ov.drop { animation: flash .42s ease forwards; }
.drag-ov.drop .drag-icon { animation: gulp .42s cubic-bezier(.5,-0.6,.6,1) forwards; }
@keyframes gulp { 40% { transform: scale(1.25); } 100% { transform: scale(0); opacity: 0; } }
@keyframes flash { 0% { background: var(--accent-soft); } 100% { opacity: 0; background: color-mix(in srgb, var(--bg) 70%, transparent); } }
::selection { background: var(--accent); color: var(--on-accent); }

/* ========================= 담장 컨셉 (은은하게) =========================
   벽돌 줄눈 무늬. 색은 --line 을 따라가서 라이트/다크 모두 자연스럽게. */
:root { --brick: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cpath d='M0 .75H64M0 16.75H64M.75 0V16M32.75 16V32' stroke='%23000' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); }
.hero { position: relative; isolation: isolate; }
.hero::after { content: ""; position: absolute; z-index: -1; right: min(calc(50% - 50vw), calc(-1 * var(--gutter))); top: -40px; width: 60%; height: calc(100% + 40px); background: var(--line);
  -webkit-mask: var(--brick), linear-gradient(to left, #000 10%, transparent 90%); -webkit-mask-composite: source-in;
          mask: var(--brick), linear-gradient(to left, #000 10%, transparent 90%); mask-composite: intersect; opacity: .9; pointer-events: none; }
.foot { position: relative; border-top: 0; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 32px; background: var(--line);
  -webkit-mask: var(--brick), linear-gradient(to bottom, #000, transparent); -webkit-mask-composite: source-in;
          mask: var(--brick), linear-gradient(to bottom, #000, transparent); mask-composite: intersect; pointer-events: none; }
.foot { padding-top: 44px; }

/* ========================= 테마 전환: 벽돌 쌓기 ========================= */
html.no-anim *:not(.brick-ov):not(.brick-ov *), html.no-anim *::before, html.no-anim *::after { transition: none !important; }
/* 다 쌓은 담: 줄눈을 담 색으로 메우고(뒤가 안 비침) 벽돌 윤곽만 남김 */
.brick-ov.sealed { background-color: var(--brick-bg); transition: background-color .16s ease; }
.brick-ov.sealed .brick-row i { opacity: 1; animation: none; }
.brick-ov.sealed .brick-row i::before { box-shadow: inset 0 0 0 1.5px rgba(127,127,127,.28); }
/* 담 들어 올리기: 통째로 위로 올라가며 아래쪽부터 새 화면이 드러남 */
.brick-ov.lift { transform: translateY(-104%); transition: transform .6s cubic-bezier(.7, 0, .25, 1); box-shadow: 0 18px 40px rgba(0,0,0,.28); }
.brick-ov { position: fixed; inset: 0; z-index: 300; pointer-events: none; overflow: hidden; }
.brick-row { position: absolute; display: flex; gap: 0; white-space: nowrap; }
.brick-row i { flex: none; width: var(--bw); height: var(--bh); padding: 1.5px; box-sizing: border-box; opacity: 0; animation: brickIn .2s cubic-bezier(.2,.9,.3,1.15) forwards; }
.brick-row i::before { content: ""; display: block; width: 100%; height: 100%; border-radius: 3px; background: var(--brick-bg); box-shadow: inset 0 0 0 1px rgba(127,127,127,.18); }
.brick-row i.gold::before { background: linear-gradient(90deg, #ffd72a, #ffb517); }
@keyframes brickIn { from { opacity: 0; transform: translateY(-60%); } to { opacity: 1; transform: none; } }
/* 다 쌓이면 줄눈이 은은하게 메워지며 한 면으로 채워짐 */
.brick-ov { background-color: var(--from-bg); transition: background-color .26s ease, opacity .36s ease; animation: ovBlank .08s ease-out; }
@keyframes ovBlank { from { opacity: 0; } }
.brick-row i::before { transition: border-radius .26s ease, box-shadow .26s ease; }
.brick-ov.fill { background-color: var(--brick-bg); }
/* 벽돌이 같은 색 면 속으로 녹아들며 사라짐 → 완전히 한 가지 색만 남음 */
.brick-ov.fill .brick-row i { opacity: 1; animation: brickMelt .26s ease forwards; }
.brick-ov.fill .brick-row i::before { box-shadow: inset 0 0 0 1px transparent; border-radius: 0; }
@keyframes brickMelt { to { opacity: 0; } }

/* ========================= 작업 화면 광고 =========================
   데스크톱: 보호=왼쪽 미리보기 아래, 변환=오른쪽 설정 아래
   모바일(720px 이하): 둘 다 미리보기 사진 위 */
.ad-mob-only { display: none; }
.ws-ad.ad, .ws-ad-top.ad { margin: 0; }
.ws-media .ws-ad.ad { margin-top: 14px; }
.ws-panel .ws-ad.ad { margin-top: 4px; }
.ad-fluid .ad-ph { width: 100%; height: 90px; }
/* 미리보기 아래에 광고가 있으면 사진 영역을 그만큼 줄여 한 화면에 다 보이게 */
.ws-media.has-ad .ws-stage { height: min(calc(100vh - var(--hdr, 61px) - 230px), 620px); }

/* ========================= 반응형 ========================= */
@media (max-width: 960px) and (min-width: 721px) {
  .ws { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; }
}
@media (max-width: 860px) {
  .trust, .steps { grid-template-columns: 1fr; }
  .trust { gap: 8px; }
}
@media (max-width: 720px) {
  :root { --gutter: 20px; --header-h: 56px; }
  .nav { display: none; }
  .nav-m { display: flex; padding: 0 12px 6px; gap: 2px; }
  .nav-m a { flex: 1; text-align: center; padding: 8px 4px; font-size: 15px; border-bottom: 2px solid transparent; border-radius: 0; }
  .nav-m a.on { border-bottom-color: var(--text); }
  .logo svg { height: 20px; }
  .logo-en { font-size: 18px; }
  .hero::after { width: 70%; top: -28px; opacity: .7; }
  .view { padding: 28px 0 56px; }
  .hero { padding: 12px 0 24px; }
  .drop { padding: 32px 16px; }
  .drop-btn { width: 100%; }
  .pc-only { display: none; }
  .h2 { margin-top: 40px; }
  /* 확인/결과 화면의 주 버튼을 화면 하단에 고정 → 엄지로 누르기 쉽게 */
  .cta-sticky {
    position: sticky; bottom: 0; z-index: 5;
    margin: 0 calc(-1 * var(--gutter));
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 75%, transparent);
  }
  .cross { flex-direction: column; align-items: stretch; }
  /* 작업 화면: 사진을 헤더 아래 고정, 설정은 아래에서 스크롤 */
  .ws { grid-template-columns: 1fr; gap: 16px; }
  .ad-desk-only { display: none !important; }
  .ad-mob-only { display: grid; }
  .ws-ad-top.ad { margin: 12px 0 -6px; }
  .ws-media.has-ad .ws-stage { height: 34vh; }
  .ws-media { top: var(--hdr, 105px); z-index: 6; background: var(--bg); margin: 0 calc(-1 * var(--gutter)); padding: 10px var(--gutter) 8px; box-shadow: 0 10px 14px -12px rgba(0,0,0,.25); }
  .ws-stage { height: 34vh; min-height: 220px; border-radius: var(--r-m); }
  .ws-meta { margin-top: 8px; }
  .ws-title { font-size: 21px; margin-bottom: 16px; }
  [data-view="confirm"], [data-view="result"], [data-view="convert"] { padding-top: 0; }
  #convLanding { padding-top: 28px; }
  .preview { max-height: 46vh; }
  .ad-rect .ad-ph { width: 300px; height: 250px; }
  .ad-banner .ad-ph { max-width: 320px; height: 100px; }
}
@media (max-width: 360px) {
  :root { --gutter: 16px; }
  .choice { grid-template-columns: 1fr; }
  .seg-sm button { padding: 0 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.doc-p { margin: 0 0 24px; color: var(--text-2); font-size: 15px; line-height: 1.7; white-space: pre-line; }
.foot .caption#copy { white-space: pre-line; line-height: 1.6; }

.name-note { margin: 14px 0 0; font-size: 13.5px; color: var(--text-3); }
.name-note:empty, .foot-about:empty { display: none; }
.foot-about { flex-basis: 100%; order: 2; margin: 4px 0 0; font-size: 13px; color: var(--text-2); }
