/* 추억 한 편 — 모든 화면이 같이 쓰는 모양.
   사진첩: 푸른 회색 바탕 종이, 흰 인화지, 짙은 남색 사진 모서리(포토 코너), 본명조 제목 + IBM 플렉스 산스 본문.
   손님 대부분이 휴대폰(카카오톡 링크)으로 들어오고 어르신도 있어 글씨를 크게(18px), 단추를 넉넉히 둔다. */
:root {
  color-scheme: light;
  --page: #edf1f3;      /* 사진첩 종이 */
  --paper: #ffffff;     /* 인화지 */
  --mount: #2b3a44;     /* 사진 모서리 */
  --ink: #1f2a30;
  --soft: #55646d;
  --line: #d3dbe0;
  --action: #1e5a78;
  --action-dark: #174962;
  --gold: #c08a2e;
  --alert: #a3362b;
  --ok: #2f6b48;
  --body: 1.125rem;
  --serif: "Noto Serif KR", "AppleMyungjo", "Batang", serif;
  --sans: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font-family: var(--sans); font-size: var(--body); line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
}
img, video { max-width: 100%; display: block; }
a { color: var(--action); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }

/* 머리 */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 0 8px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand .mark {
  width: 30px; height: 24px; background: var(--paper); position: relative; box-shadow: 0 1px 2px rgba(31, 42, 48, .25);
}
.brand .mark::before, .brand .mark::after {
  content: ""; position: absolute; width: 10px; height: 10px;
}
.brand .mark::before { left: 0; top: 0; background: linear-gradient(135deg, var(--mount) 50%, transparent 50%); }
.brand .mark::after { right: 0; bottom: 0; background: linear-gradient(315deg, var(--mount) 50%, transparent 50%); }
.brand b { font-family: var(--serif); font-weight: 700; font-size: 1.25rem; letter-spacing: -.01em; }
.top nav a { font-size: 1rem; text-decoration: none; font-weight: 600; }

h1, h2, h3 { font-family: var(--serif); line-height: 1.35; letter-spacing: -.01em; }
h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); margin: 20px 0 12px; font-weight: 700; }
h2 { font-size: clamp(1.4rem, 4.6vw, 1.75rem); margin: 0 0 12px; font-weight: 700; }
h3 { font-size: 1.2rem; margin: 0 0 6px; font-weight: 700; }
p { margin: 0 0 12px; }
.lead { font-size: 1.2rem; }
.note, .hint { color: var(--soft); font-size: 1rem; }
.hint { margin: 4px 0 0; }
.error { color: var(--alert); font-weight: 700; font-size: 1rem; margin: 6px 0 0; }
.good { color: var(--ok); font-weight: 700; }

/* 인화지(사진 모서리로 붙인 흰 종이) — 견본 영상·사진·안내 상자에 쓴다 */
.print {
  position: relative; background: var(--paper); padding: 12px;
  box-shadow: 0 1px 2px rgba(31, 42, 48, .18), 0 6px 18px rgba(31, 42, 48, .08);
}
.print.corners::after {
  content: ""; position: absolute; inset: 3px; pointer-events: none;
  background:
    linear-gradient(135deg, var(--mount) 0 15px, transparent 15px) top left / 34px 34px no-repeat,
    linear-gradient(225deg, var(--mount) 0 15px, transparent 15px) top right / 34px 34px no-repeat,
    linear-gradient(45deg, var(--mount) 0 15px, transparent 15px) bottom left / 34px 34px no-repeat,
    linear-gradient(315deg, var(--mount) 0 15px, transparent 15px) bottom right / 34px 34px no-repeat;
}
.print video, .print img.full { width: 100%; height: auto; background: #10171b; }
.print figcaption { font-family: var(--serif); font-size: 1rem; color: var(--soft); padding: 10px 2px 0; }

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin: 0 0 16px; }
.panel.alert { border-color: var(--alert); }
.panel.quiet { background: transparent; border-style: dashed; }

/* 단추 */
.cta {
  display: inline-block; background: var(--action); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1.15rem; padding: 14px 24px; border-radius: 8px; text-align: center;
  min-height: 54px;
}
.cta:hover { background: var(--action-dark); }
.cta:disabled { opacity: .6; cursor: wait; }
.cta.wide { display: block; width: 100%; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--paper); color: var(--action); border: 2px solid var(--action); cursor: pointer;
  font: inherit; font-weight: 700; font-size: 1rem; padding: 8px 14px; border-radius: 8px; text-decoration: none;
  min-height: 46px;
}
.btn:hover { background: #f3f7f9; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { min-height: 40px; padding: 4px 10px; font-size: .95rem; }
.btn.plain { border-color: var(--line); color: var(--ink); }
.btn.danger { border-color: #e2c2be; color: var(--alert); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* 입력 */
label { font-weight: 700; display: block; margin: 0 0 6px; }
input[type=text], input[type=email], textarea, select {
  width: 100%; font: inherit; font-size: 1.1rem; color: var(--ink); background: #fff;
  border: 2px solid var(--line); border-radius: 6px; padding: 10px 12px;
}
input:focus, textarea:focus, select:focus { border-color: var(--action); outline: none; }
textarea { min-height: 90px; resize: vertical; }
.field { margin: 0 0 18px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 24px; height: 24px; margin-top: 3px; flex: none; accent-color: var(--action); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label {
  margin: 0; font-weight: 600; border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 8px 16px; cursor: pointer; min-height: 46px; display: inline-flex; align-items: center;
}
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips input:checked + span { color: var(--action); }
.chips label:has(input:checked) { border-color: var(--action); background: #eef5f8; }
.chips label:has(input:focus-visible) { outline: 3px solid var(--gold); outline-offset: 2px; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 차례(실제로 순서가 있는 단계에만 번호를 쓴다) */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps > li { counter-increment: s; position: relative; padding: 0 0 18px 52px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 50%;
  background: var(--paper); border: 2px solid var(--gold); color: var(--ink);
  font-family: var(--serif); font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.steps h3 { margin-bottom: 2px; }
.steps p { margin: 0; color: var(--soft); font-size: 1.02rem; }

/* 꼬리 */
footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 22px 0 40px; color: var(--soft); font-size: .95rem; }
footer p { margin: 0 0 6px; }
footer .biz { font-size: .85rem; line-height: 1.6; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 8px; max-width: calc(100vw - 32px);
  font-size: 1rem; box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}

/* 만드는 화면 */
.status { display: inline-block; font-size: .95rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: #e3ebef; color: var(--ink); }
.status.wait { background: #f6ecd9; color: #7a5413; }
.status.done { background: #e1efe6; color: var(--ok); }
.status.bad { background: #f5e1de; color: var(--alert); }
.step { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 18px 16px; margin: 0 0 18px; }
.step > h2 { display: flex; gap: 10px; align-items: baseline; }
.step > h2 .n { font-size: 1rem; color: var(--gold); font-family: var(--serif); flex: none; }
.items { list-style: none; padding: 0; margin: 0 0 12px; }
.items li { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.items li.chapter { grid-template-columns: 1fr; background: #f5f8f9; padding: 10px; border-radius: 4px; border-bottom: 0; margin: 6px 0; }
.items .thumb { width: 84px; height: 84px; object-fit: cover; background: #dfe6ea; border: 4px solid #fff; box-shadow: 0 1px 3px rgba(31, 42, 48, .3); }
.items .tools { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.items .tools .btn { min-height: 38px; min-width: 42px; padding: 2px 8px; font-size: .95rem; }
.items .pos { font-size: .85rem; color: var(--soft); }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; }
.picker button { padding: 0; border: 3px solid transparent; background: none; cursor: pointer; }
.picker button[aria-pressed=true] { border-color: var(--action); }
.picker img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.pick { display: flex; gap: 12px; align-items: center; margin: 0 0 10px; }
.pick img { width: 64px; height: 64px; object-fit: cover; border: 3px solid #fff; box-shadow: 0 1px 3px rgba(31, 42, 48, .3); background: #dfe6ea; }
.lines input { margin-bottom: 8px; }
.scene { border-left: 3px solid var(--line); padding-left: 10px; margin: 0 0 10px; }
.music label { display: flex; align-items: center; gap: 10px; font-weight: 600; padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.music input { width: 22px; height: 22px; accent-color: var(--action); }
.music a { margin-left: auto; font-weight: 400; font-size: .95rem; white-space: nowrap; }
.bar { height: 10px; background: #e3ebef; border-radius: 999px; overflow: hidden; margin: 8px 0; }
.bar i { display: block; height: 100%; width: 0; background: var(--action); transition: width .2s; }
.letters { list-style: none; padding: 0; margin: 0 0 12px; }
.letters li { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 0; border-bottom: 1px solid var(--line); }
.letters li .who { font-weight: 700; flex: 1 1 140px; }
.price { font-family: var(--serif); font-size: 2rem; font-weight: 700; color: var(--ink); }
.price small { font-family: var(--sans); font-size: 1rem; color: var(--soft); font-weight: 400; }
.keep { background: #fbf6ec; border: 1px solid #ead9b8; border-radius: 6px; padding: 14px; margin: 0 0 16px; }
.keep code { display: block; font-size: .9rem; word-break: break-all; background: #fff; padding: 8px; border-radius: 4px; margin: 8px 0; }
.saved { font-size: .95rem; color: var(--soft); }
dialog { border: 0; border-radius: 8px; padding: 18px; max-width: min(560px, calc(100vw - 24px)); width: 100%; }
dialog::backdrop { background: rgba(31, 42, 48, .5); }

/* 영상편지 찍기 */
.cam { background: #10171b; border-radius: 6px; overflow: hidden; position: relative; aspect-ratio: 16 / 9; }
.cam video { width: 100%; height: 100%; object-fit: cover; }
.cam .rec { position: absolute; left: 12px; top: 10px; color: #fff; font-weight: 700; background: rgba(163, 54, 43, .9); padding: 2px 10px; border-radius: 999px; }

/* 약관·처리방침 */
.doc h2 { font-size: 1.3rem; margin: 26px 0 8px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 1rem; margin: 0 0 12px; background: #fff; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px; text-align: left; vertical-align: top; }
.doc ul, .doc ol { padding-left: 1.3em; }

@media (min-width: 640px) {
  .wrap { padding: 0 24px; }
  .step { padding: 22px 24px; }
  .items li { grid-template-columns: 96px 1fr; }
  .items .thumb { width: 96px; height: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
