:root {
  --paper: #F6F5F1;
  --card: #FFFFFF;
  --ink: #15181D;
  --muted: #5B6270;
  --line: #DCDDD8;
  --navy: #1E3A5F;
  --navy-press: #152B47;
  --pen: #C8202F;
  --ok: #17663A;
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--font); word-break: keep-all; overflow-wrap: anywhere; }
a { color: inherit; }
h1, h2 { line-height: 1.25; letter-spacing: -0.025em; margin: 0 0 .4em; }
h1 { font-size: clamp(27px, 6.6vw, 44px); font-weight: 800; }
h2 { font-size: clamp(20px, 4.6vw, 24px); font-weight: 750; }
p { margin: 0 0 .8em; }

.top { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; padding: 16px max(16px, env(safe-area-inset-left)); max-width: 1040px; margin: 0 auto; }
.brand { font-weight: 800; font-size: 19px; text-decoration: none; letter-spacing: -0.03em; }
.tag { color: var(--muted); font-size: 13px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; }
.wrap.narrow { max-width: 640px; }
.hero { margin: 4px 0 16px; }
.lead { font-size: 15px; color: var(--muted); margin: 0; }
.quick { list-style: none; padding: 0; margin: 4px 0 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-width: 560px; }
.quick a { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; min-height: 44px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-size: 14px; }
.quick b { font-size: 20px; }
.fine { font-size: 13px; color: var(--muted); }

/* 두 상품: 폰에선 위아래, PC에선 나란히 */
.products { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .products { grid-template-columns: 1fr 1fr; gap: 20px; } }
.product { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; }
.product h2 { margin-top: 12px; }
.ba { position: relative; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ba div { position: relative; }
.ba img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #e9e8e3; }
.ba figcaption { position: absolute; left: 8px; bottom: 8px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(0,0,0,.55); padding: 1px 8px; border-radius: 99px; }
.ai-badge { position: absolute; right: 8px; top: 8px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(21,24,29,.78); padding: 2px 8px; border-radius: 6px; }
.pen-demo { position: relative; background: #FFFEF8; border: 1px solid var(--line); border-radius: 10px; padding: 48px 16px 14px; min-height: 140px;
  }
.pen-demo p { margin: 0 0 8px; font-size: 16px; line-height: 1.6; }
.pen-demo del { text-decoration-color: var(--pen); text-decoration-thickness: 2px; color: #6b6f78; }
.pen-demo .ins, .paper .rewrite { color: var(--pen); font-weight: 650; }
.pen-demo .ai-badge { left: 8px; right: auto; background: var(--pen); }

.prices { list-style: none; padding: 0; margin: 4px 0 10px; border-top: 1px solid var(--line); }
.prices li { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.prices strong { font-size: 18px; white-space: nowrap; }
.prices .free strong { color: var(--ok); }
.product .btn { margin-top: auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 10px 18px; border: 0; border-radius: 12px; background: var(--navy); color: #fff;
  font: 700 16px var(--font); text-decoration: none; cursor: pointer; transition: background-color .15s ease, transform .1s ease; }
.btn:hover { background: var(--navy-press); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn.ghost { background: transparent; color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.btn:focus-visible, input:focus-visible, textarea:focus-visible, .chips input:focus-visible + span { outline: 3px solid #F2B705; outline-offset: 2px; }

.tool { margin: 28px 0 0; padding: 18px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 12px; }
@media (min-width: 760px) { .tool { padding: 24px; } }
form { display: grid; gap: 14px; }
.drop { position: relative; display: grid; place-items: center; min-height: 140px; border: 2px dashed #B8BBC3; border-radius: 12px; cursor: pointer; overflow: hidden; background: #FAFAF8; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop span { font-weight: 700; color: var(--navy); padding: 10px; background: rgba(255,255,255,.85); border-radius: 8px; z-index: 1; }
.drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.chips { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 6px; width: 100%; }
.chips label { position: relative; }
.chips input { position: absolute; opacity: 0; }
.chips span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; }
.chips input:checked + span { background: var(--navy); color: #fff; border-color: var(--navy); }
.field { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.field input, .field textarea { font: 16px/1.6 var(--font); padding: 10px 12px; border: 1px solid #B8BBC3; border-radius: 10px; background: #fff; color: var(--ink); width: 100%; resize: vertical; }
.err { color: var(--pen); font-weight: 600; margin: 0; min-height: 0; }
.err:empty { display: none; }

.result { margin-top: 18px; }
#photoCanvas { display: block; width: min(100%, 360px); height: auto; border-radius: 12px; }
.pay { display: flex; flex-wrap: wrap; gap: 8px; }
.paper { background: #FFFEF8; border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.paper .orig { text-decoration: line-through; text-decoration-color: var(--pen); text-decoration-thickness: 2px; color: #6b6f78; }
.paper .note { font-size: 15px; }
.paper .note b { color: var(--pen); margin-right: 6px; }
.paper .rewrite { border-left: 3px solid var(--pen); padding-left: 12px; font-size: 16px; }
.paper .why { font-size: 14px; color: var(--muted); margin: 0; }

.notice { position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto; background: var(--ink); color: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 10; }
.notice .btn.ghost { color: #fff; box-shadow: inset 0 0 0 2px #fff; min-height: 44px; }
.foot { max-width: 1040px; margin: 0 auto; padding: 8px 16px 40px; font-size: 13px; color: var(--muted); }
.foot p { margin: 0 0 4px; }
