/* ==========================================================================
   위아스토리 WIA Story — 공용 스타일
   시니어 친화: 기본 18px+, 버튼 56px+, 고대비
   2026-07-26 리브랜딩: 크림/앰버(레트로) → WIA 모던 블루 그라데이션 (형 피드백).
   변수명은 관성상 유지(--amber = 주 포인트 컬러) — 규칙 전체를 안 건드리기 위함.
   ========================================================================== */

:root {
  --cream:        #F3F7FC;   /* 옅은 블루 화이트 */
  --cream-deep:   #E6EFF8;
  --card:         #FFFFFF;
  --amber:        #1D4ED8;   /* 주 버튼/포인트 (딥블루 — 흰 글자 대비 6:1+) */
  --amber-strong: #1E3A8A;
  --amber-soft:   #DBEAFE;
  --ink:          #17233A;   /* 본문 — 네이비 잉크, 대비 12:1 이상 */
  --ink-soft:     #4A5B78;
  --line:         #D6E1EE;
  --ok:           #1B6E3C;
  --err:          #B3261E;
  --focus:        #0284C7;
  --radius:       16px;   /* 카드 */
  --radius-sm:    12px;   /* 버튼·입력·칩 */
  --shadow:       0 4px 20px rgba(30, 64, 175, .08);
  --shadow-thumb: 0 4px 12px rgba(0, 0, 0, .08);

  /* 그레이 미세 스케일 (vstory 25단위 구조 이식) */
  --gray-25:  #fafafa;
  --gray-50:  #f4f5f5;
  --gray-100: #eaebec;
  --gray-150: #d7dadb;
  --gray-450: #879092;
  --gray-800: #303436;
  --gray-900: #181a1b;

  /* 시맨틱 5색 */
  --sem-red:       #f75031;
  --sem-red-bg:    #f9e8e8;
  --sem-green:     #22c55e;
  --sem-green-bg:  #f0fdf4;
  --sem-blue:      #3b82f6;
  --sem-blue-bg:   #eff6ff;
  --sem-orange:    #f97316;
  --sem-orange-bg: #fff7ed;
  --sem-violet:    #8b5cf6;
  --sem-violet-bg: #f5f3ff;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR",
               -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
               "Malgun Gothic", sans-serif;
  font-size: 19px;
  line-height: 1.65;
  word-break: keep-all;
}

img, video { max-width: 100%; }

a { color: var(--amber-strong); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ------------------------------------------------------------- 헤더 */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; min-height: 72px;
}
.brand {
  font-size: 24px; font-weight: 800; text-decoration: none;
  color: var(--ink); letter-spacing: -0.5px; white-space: nowrap;
}
.brand .brand-en { color: var(--amber); font-weight: 700; font-size: 18px; }
.header-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.header-nav > a {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 14px;
  font-size: 18px; font-weight: 700; text-decoration: none;
  color: var(--ink); border-radius: 10px;
}
.header-nav > a:hover { background: var(--amber-soft); }
.user-slot { display: inline-flex; align-items: center; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--amber-soft); color: var(--amber-strong);
  font-size: 17px; font-weight: 700;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.btn-login {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 18px;
  background: var(--amber); color: #fff !important;
  font-size: 18px; font-weight: 700; text-decoration: none;
  border-radius: 12px;
}
.btn-login:hover { background: var(--amber-strong); }

/* ------------------------------------------------------------- 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  min-height: 56px; padding: 0 28px;
  font-size: 20px; font-weight: 800;
  font-family: inherit;
  border-radius: 14px; border: 2px solid transparent;
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background .15s, transform .05s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }

/* 프레스 피드백 유틸 — 베이스 컬러와 무관하게 모든 버튼이 동일 비율로 어두워짐 */
.btn, .btn-login, .style-card .style-box, .radio-big .radio-box,
.photo-tools button, .voice-preview {
  position: relative;
}
.btn::after, .btn-login::after, .style-card .style-box::after,
.radio-big .radio-box::after, .photo-tools button::after,
.voice-preview::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--gray-900); opacity: 0; pointer-events: none;
  transition: opacity .15s cubic-bezier(.4, 0, .2, 1);
}
.btn:hover::after, .btn-login:hover::after,
.style-card .style-box:hover::after, .radio-big .radio-box:hover::after,
.photo-tools button:not([disabled]):hover::after, .voice-preview:hover::after { opacity: .06; }
.btn:active::after, .btn-login:active::after,
.style-card .style-box:active::after, .radio-big .radio-box:active::after,
.photo-tools button:not([disabled]):active::after, .voice-preview:active::after { opacity: .12; }
.btn[disabled]::after, .btn.is-disabled::after { display: none; }
.btn-primary { background: var(--amber); color: #fff; }
.btn-primary:hover { background: var(--amber-strong); }
.btn-secondary {
  background: var(--card); color: var(--amber-strong);
  border-color: var(--amber);
}
.btn-secondary:hover { background: var(--amber-soft); }
.btn-big { min-height: 64px; font-size: 22px; padding: 0 36px; }
.btn-block { width: 100%; }
.btn[disabled], .btn.is-disabled {
  background: #CBBBA4; color: #fff; border-color: transparent;
  cursor: not-allowed; transform: none;
}

/* ------------------------------------------------------------- 카드/섹션 */
.section { padding: 48px 0; }
.section-title {
  font-size: 30px; font-weight: 800; line-height: 1.35;
  margin: 0 0 10px; letter-spacing: -0.5px;
}
.section-sub { font-size: 20px; color: var(--ink-soft); margin: 0 0 28px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

/* ------------------------------------------------------------- 랜딩 히어로 */
.hero { padding: 56px 0 40px; }
.hero-grid {
  display: grid; grid-template-columns: 1.1fr .9fr;
  gap: 36px; align-items: center;
}
.hero h1 {
  font-size: 42px; line-height: 1.3; margin: 0 0 16px;
  font-weight: 900; letter-spacing: -1px;
}
.hero h1 .accent { color: var(--amber); }
.hero-lead { font-size: 22px; color: var(--ink-soft); margin: 0 0 30px; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-img-box {
  border-radius: 20px; overflow: hidden;
  background: linear-gradient(135deg, #DCE9F8, #B9D2F0);
  min-height: 280px; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
}
.hero-img-box img, .hero-img-box video { display: block; width: 100%; height: auto; }
.img-fallback-note { color: var(--amber-strong); font-size: 20px; font-weight: 700; padding: 20px; text-align: center; }

.trust-line { margin-top: 22px; font-size: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------- 기능 카드 */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.feature-thumb {
  aspect-ratio: 4 / 3; width: 100%;
  background: linear-gradient(135deg, #E3EEFA, #C6DAF3);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.feature-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feature-thumb .ph-emoji { font-size: 56px; }
.feature-body { padding: 20px 22px 26px; }
.feature-body h3 { font-size: 22px; margin: 0 0 8px; }
.feature-body p { margin: 0; font-size: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------- 이용 순서 */
.howto-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.howto-step { text-align: center; }
.howto-num {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 50%; background: var(--amber); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800;
}
.howto-step h3 { font-size: 21px; margin: 0 0 6px; }
.howto-step p { margin: 0; font-size: 18px; color: var(--ink-soft); }

/* ------------------------------------------------------------- 데모 영상 */
.demo-box {
  max-width: 420px; margin: 0 auto;
  border-radius: 20px; overflow: hidden; background: #000;
  box-shadow: var(--shadow);
}
.demo-box video { display: block; width: 100%; }
.demo-box img { display: block; width: 100%; }

/* ------------------------------------------------------------- 완성작 갤러리 */
.gallery-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  align-items: start;
}
.gallery-card { padding: 14px; text-align: center; }
.gallery-card video {
  display: block; width: 100%; border-radius: 12px; background: #000;
  max-height: 420px; object-fit: contain;
}
.gallery-caption { margin: 12px 0 0; font-size: 16px; font-weight: 700; color: var(--ink-soft); }
@media (max-width: 860px) {
  .gallery-grid { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; }
}

/* ------------------------------------------------------------- 푸터 */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 36px 0 0; margin-top: 40px;
  color: var(--ink-soft); font-size: 17px;
  background: var(--cream-deep);
}
.site-footer a { color: var(--ink-soft); }

.wia-footer-grid {
  display: flex; flex-wrap: wrap; gap: 32px;
  justify-content: space-between; padding-bottom: 32px;
}
.wia-footer-brand { flex: 1 1 260px; min-width: 240px; }
.wia-footer-note {
  margin-top: 10px; font-size: 15px; line-height: 1.5;
  color: var(--ink-soft);
}
.wia-footer-links { flex: 0 1 auto; display: flex; flex-direction: column; gap: 8px; }
.wia-footer-support { flex: 0 1 240px; min-width: 220px; }
.btn-donate {
  width: 100%; background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  color: #fff; font-size: 17px; min-height: 52px;
  box-shadow: 0 4px 15px rgba(238, 90, 36, .3);
}
.btn-donate:hover { background: linear-gradient(135deg, #ff8080, #f4702e); }
.wia-footer-social { display: flex; gap: 14px; margin-top: 14px; align-items: center; }
.wia-footer-social a { display: inline-flex; opacity: .85; }
.wia-footer-social a:hover { opacity: 1; }
.wia-footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px 0; font-size: 14px; text-align: center;
}
@media (max-width: 640px) {
  .wia-footer-grid { flex-direction: column; gap: 24px; }
}

/* ------------------------------------------------------------- 마법사 단계표시 */
.stepper {
  display: flex; align-items: center; justify-content: center;
  gap: 8px; margin: 34px 0 26px;
}
.stepper .dot {
  display: flex; align-items: center; gap: 8px;
  font-size: 18px; font-weight: 700; color: var(--ink-soft);
}
.stepper .dot .n {
  width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card); border: 2px solid var(--line);
  font-size: 20px; font-weight: 800;
}
.stepper .dot.active { color: var(--amber-strong); }
.stepper .dot.active .n { background: var(--amber); border-color: var(--amber); color: #fff; }
.stepper .dot.done .n { background: var(--ok); border-color: var(--ok); color: #fff; }
.stepper .bar { width: 36px; height: 3px; background: var(--line); border-radius: 2px; }
.stepper .label { display: inline; }

.wizard-panel { display: none; }
.wizard-panel.active { display: block; }

.panel-title { font-size: 27px; font-weight: 800; margin: 0 0 8px; }
.panel-sub { font-size: 19px; color: var(--ink-soft); margin: 0 0 22px; }

/* ------------------------------------------------------------- 사진 업로드 */
.drop-zone {
  border: 3px dashed var(--amber);
  border-radius: var(--radius);
  background: var(--amber-soft);
  padding: 36px 20px; text-align: center; cursor: pointer;
}
.drop-zone:hover { background: #FBDFB6; }
.drop-zone .dz-icon { font-size: 46px; line-height: 1; }
.drop-zone .dz-main { font-size: 21px; font-weight: 800; margin: 10px 0 4px; }
.drop-zone .dz-sub { font-size: 17px; color: var(--ink-soft); margin: 0; }

.photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px; margin-top: 20px;
}
.photo-item {
  border-radius: 12px; overflow: hidden;
  background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow-thumb);
  display: flex; flex-direction: column;
}
.photo-item .thumb {
  position: relative; aspect-ratio: 1 / 1;
  background: var(--cream-deep); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.photo-item .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-item .seq {
  position: absolute; top: 6px; left: 6px; z-index: 2;
  background: rgba(59, 42, 26, .78); color: #fff;
  font-size: 15px; font-weight: 700;
  padding: 2px 9px; border-radius: 999px;
}
.photo-item .ph-label { font-size: 16px; color: var(--ink-soft); font-weight: 700; padding: 8px; text-align: center; }
.photo-item .del {
  position: absolute; top: 4px; right: 4px; z-index: 2;
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
.photo-item.uploading .thumb::after {
  content: ""; position: absolute; inset: 0; background: rgba(0, 0, 0, .4);
}
/* 순서 이동 도구 (드래그 대신 큰 버튼) */
.photo-tools { display: flex; border-top: 1px solid var(--line); }
.photo-tools button {
  flex: 1; min-height: 48px; border: none; background: var(--card);
  font-size: 20px; font-weight: 800; color: var(--amber-strong);
  cursor: pointer; font-family: inherit;
}
.photo-tools button + button { border-left: 1px solid var(--line); }
.photo-tools button[disabled] { opacity: .3; cursor: default; }
.photo-order-hint { font-size: 17px; color: var(--ink-soft); margin: 16px 0 0; }

.photo-count { font-size: 19px; font-weight: 700; margin-top: 16px; }
.photo-count .ok-mark { color: var(--ok); }
.photo-count .warn-mark { color: var(--err); }

/* ------------------------------------------------------------- 스타일 카드 */
.style-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.style-card { position: relative; }
.style-card input { position: absolute; opacity: 0; pointer-events: none; }
.style-card .style-box {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--card); border: 3px solid var(--line);
  border-radius: var(--radius); padding: 22px 12px;
  cursor: pointer; text-align: center; min-height: 130px;
  justify-content: center;
}
.style-card .style-emoji { font-size: 40px; line-height: 1; }
.style-card .style-img {
  width: 100%; height: 92px; object-fit: cover;
  border-radius: 10px; display: block;
}
.style-card .style-box.has-img .style-emoji { display: none; }
.style-card .style-name { font-size: 20px; font-weight: 800; }
.style-card .style-desc { font-size: 16px; color: var(--ink-soft); }
.style-card input:checked + .style-box {
  border-color: var(--amber); background: var(--amber-soft);
}
.style-card input:focus-visible + .style-box {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* ------------------------------------------------------------- 폼 요소 */
.field { margin: 26px 0; }
.field > label, .field > .field-label {
  display: block; font-size: 20px; font-weight: 800; margin-bottom: 8px;
}
.field .hint { font-size: 17px; color: var(--ink-soft); margin: 4px 0 10px; }
input[type="text"], textarea {
  width: 100%; font-family: inherit; font-size: 20px; color: var(--ink);
  background: var(--card); border: 2px solid var(--line);
  border-radius: 12px; padding: 14px 16px;
}
input[type="text"]:focus, textarea:focus {
  border-color: var(--amber); outline: 3px solid var(--focus); outline-offset: 1px;
}
textarea { min-height: 140px; resize: vertical; line-height: 1.6; }

.radio-row { display: flex; gap: 14px; flex-wrap: wrap; }
.radio-big { position: relative; flex: 1 1 180px; }
.radio-big input { position: absolute; opacity: 0; pointer-events: none; }
.radio-big .radio-box {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 10px 16px;
  background: var(--card); border: 3px solid var(--line);
  border-radius: 14px; font-size: 20px; font-weight: 800; cursor: pointer;
}
.radio-big input:checked + .radio-box { border-color: var(--amber); background: var(--amber-soft); }
.radio-big input:focus-visible + .radio-box { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------- 마법사 하단 */
.wizard-nav { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.wizard-nav .btn { flex: 1 1 180px; }

/* ------------------------------------------------------------- 진행/결과 */
.progress-box { text-align: center; padding: 44px 20px; }
.spinner {
  width: 64px; height: 64px; margin: 0 auto 22px;
  border-radius: 50%;
  border: 7px solid var(--amber-soft); border-top-color: var(--amber);
  animation: ws-spin 1.1s linear infinite;
}
@keyframes ws-spin { to { transform: rotate(360deg); } }
.progress-main { font-size: 24px; font-weight: 800; margin: 0 0 8px; }
.progress-sub { font-size: 19px; color: var(--ink-soft); margin: 0; }
.queue-chip {
  display: inline-block; margin-top: 18px;
  background: var(--amber-soft); color: var(--amber-strong);
  font-size: 18px; font-weight: 800; padding: 10px 18px; border-radius: 999px;
}

.result-video-box {
  max-width: 380px; margin: 0 auto 26px;
  border-radius: 18px; overflow: hidden; background: #000;
  box-shadow: var(--shadow);
}
.result-video-box video { display: block; width: 100%; }

.error-box {
  background: #FDECEA; border: 2px solid #F2B8B5;
  color: var(--err); border-radius: var(--radius);
  padding: 20px 22px; font-size: 19px; font-weight: 700;
}
.error-box .error-detail { display: block; margin-top: 6px; font-size: 16px; font-weight: 400; color: #7A4540; }

/* ------------------------------------------------------------- 내 영상 목록 */
.project-list { display: flex; flex-direction: column; gap: 16px; }
.project-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.project-info { flex: 1 1 260px; min-width: 0; }
.project-title { font-size: 21px; font-weight: 800; margin: 0 0 4px; overflow-wrap: anywhere; }
.project-meta { font-size: 17px; color: var(--ink-soft); }
.status-badge {
  display: inline-block; font-size: 16px; font-weight: 800;
  padding: 5px 13px; border-radius: 999px; white-space: nowrap;
}
.status-COMPLETED { background: #DCEFE2; color: var(--ok); }
.status-QUEUED, .status-PROCESSING { background: var(--amber-soft); color: var(--amber-strong); }
.status-DRAFT { background: #EFEAE2; color: var(--ink-soft); }
.status-FAILED { background: #FDECEA; color: var(--err); }
.project-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.project-actions .btn { min-height: 52px; font-size: 18px; padding: 0 20px; }

.empty-box { text-align: center; padding: 54px 20px; }
.empty-box .empty-emoji { font-size: 52px; }
.empty-box p { font-size: 20px; color: var(--ink-soft); }

/* ------------------------------------------------------------- 토스트 */
.ws-toast {
  position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  font-size: 18px; font-weight: 700;
  padding: 14px 24px; border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0,0,0,.25);
  z-index: 200; max-width: calc(100vw - 40px); text-align: center;
  opacity: 0; transition: opacity .25s;
}
.ws-toast.show { opacity: 1; }
.ws-toast.err { background: var(--err); }

/* ------------------------------------------------------------- 반응형 */
@media (max-width: 860px) {
  .hero h1 { font-size: 33px; }
  .hero-grid { grid-template-columns: 1fr; }
  .feature-grid, .howto-grid { grid-template-columns: 1fr; }
  .section { padding: 36px 0; }
  .stepper .label { display: none; }
  .stepper .dot.active .label { display: inline; }
}

@media (max-width: 480px) {
  body { font-size: 18px; }
  .hero h1 { font-size: 29px; }
  .brand { font-size: 21px; }
  .brand .brand-en { font-size: 15px; }
  .card { padding: 20px; }
  /* 브랜드+내비를 합쳐도 좁은 화면엔 다 안 들어가서 "내 영상" 링크가 로그인 버튼 위에 어중간하게
     떠 보이던 버그(2026-08-04 발견) — 내비 전체를 브랜드 아래 완전한 둘째 줄로 내림 */
  .header-inner { flex-wrap: wrap; row-gap: 6px; }
  .header-nav { width: 100%; justify-content: flex-end; }
}

/* ==========================================================================
   vstory 흡수 고도화 (2026-07-18)
   ========================================================================== */

/* ------------------------------------------------------------- CTA 밑 안심 카피 */
.cta-note { margin-top: 12px; font-size: 17px; color: var(--ink-soft); font-weight: 700; }

/* ------------------------------------------------------------- 샘플 스타일 카드 */
.sample-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}
.sample-card {
  padding: 0; overflow: hidden; display: flex; flex-direction: column;
  text-align: center; border-radius: 20px;
}
.sample-card .sample-thumb {
  aspect-ratio: 3 / 4; width: 100%; overflow: hidden;
  background: linear-gradient(135deg, #E3EEFA, #C6DAF3);
  display: flex; align-items: center; justify-content: center;
}
.sample-card .sample-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sample-card .sample-thumb .ph-emoji { font-size: 48px; }
.sample-card .sample-body {
  padding: 14px 12px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1;
}
.sample-card h3 { margin: 0; font-size: 20px; }
.sample-card .sample-desc { margin: 0 0 4px; font-size: 16px; color: var(--ink-soft); flex: 1; }
.sample-card .btn { min-height: 48px; font-size: 16px; padding: 0 10px; border-radius: var(--radius-sm); }

/* ------------------------------------------------------------- FAQ 아코디언 */
.faq-list { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
details.faq {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 0 24px;
}
details.faq summary {
  cursor: pointer; font-size: 20px; font-weight: 800;
  padding: 20px 40px 20px 0; list-style: none;
  position: relative; min-height: 56px; display: flex; align-items: center;
  word-break: keep-all;
}
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::before {
  content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  font-size: 30px; font-weight: 700; color: var(--amber); line-height: 1;
}
details.faq[open] summary::before { content: "\2212"; }
details.faq .faq-body { padding: 0 0 22px; margin: 0; font-size: 19px; color: var(--ink-soft); }

/* ------------------------------------------------------------- 전면 드롭 오버레이 */
.dnd-overlay {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(29, 78, 216, .16);
  display: none; align-items: center; justify-content: center;
}
.dnd-overlay.show { display: flex; }
.dnd-overlay .dnd-box {
  background: var(--card); border: 3px dashed var(--amber);
  border-radius: 20px; padding: 40px 60px;
  font-size: 24px; font-weight: 800; color: var(--amber-strong);
}

/* ------------------------------------------------------------- 인라인 경고 */
.inline-warn {
  display: none; margin-top: 16px;
  background: var(--sem-red-bg); color: var(--err);
  border: 2px solid #F2B8B5; border-radius: var(--radius-sm);
  padding: 14px 18px; font-size: 19px; font-weight: 700;
}
.inline-warn.show { display: block; }
.field .hint.danger {
  color: var(--err); font-weight: 800;
  background: var(--sem-red-bg); border: 2px solid #F2B8B5;
  border-radius: var(--radius-sm); padding: 10px 14px;
}

/* ------------------------------------------------------------- shimmer 텍스트 */
@keyframes ws-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.shimmer-text {
  background: linear-gradient(90deg, var(--ink-soft) 40%, #7FA6E0 50%, var(--ink-soft) 60%);
  background-size: 200% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: ws-shimmer 3.2s linear infinite;
}

/* ------------------------------------------------------------- 생성 단계 타임라인 */
.stage-list {
  max-width: 430px; margin: 28px auto 0; text-align: left;
  display: flex; flex-direction: column; gap: 13px;
}
.stage-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 19px; font-weight: 700; color: var(--gray-450);
}
.stage-item .stage-ico {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100); font-size: 17px;
}
.stage-item.done { color: var(--ok); }
.stage-item.done .stage-ico { background: #DCEFE2; color: var(--ok); font-weight: 800; }
.stage-item.now { color: var(--ink); }
.stage-item.now .stage-ico { background: var(--amber-soft); }
.stage-spin {
  width: 18px; height: 18px; border-radius: 50%;
  border: 3px solid var(--amber-soft); border-top-color: var(--amber);
  animation: ws-spin 1.1s linear infinite;
}

/* ------------------------------------------------------------- 진행률 바 */
.progress-track {
  max-width: 430px; height: 10px; margin: 26px auto 8px;
  background: var(--gray-100); border-radius: 999px; overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--amber), #38BDF8);
  border-radius: 999px; transition: width .9s ease;
}
.progress-pct { font-size: 17px; color: var(--ink-soft); margin: 0; font-weight: 700; }

/* ------------------------------------------------------------- 축하 컨페티 */
.confetti-wrap { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti-piece {
  position: absolute; top: -24px; width: 12px; height: 18px;
  border-radius: 3px; opacity: .92;
  animation: ws-confetti-fall linear forwards;
}
@keyframes ws-confetti-fall {
  0%   { transform: translateY(-6vh) rotate(0deg); }
  100% { transform: translateY(112vh) rotate(720deg); }
}

/* ------------------------------------------------------------- 목소리 미리듣기 */
.voice-item { display: flex; gap: 8px; align-items: stretch; flex: 1 1 230px; }
.voice-item .radio-big { flex: 1; }
.voice-preview {
  width: 56px; flex: none; align-self: stretch;
  border-radius: 14px; border: 3px solid var(--line);
  background: var(--card); color: var(--amber-strong);
  font-size: 20px; cursor: pointer; font-family: inherit;
}
.voice-preview.playing { background: var(--amber); border-color: var(--amber); color: #fff; }
.voice-ab-tag {
  align-self: center; font-size: 12px; font-weight: 800; color: var(--ink-soft);
  min-width: 14px; text-align: center;
}
.voice-item { flex-wrap: wrap; }
.voice-item .voice-preview { width: 44px; }

/* ------------------------------------------------------------- 사연 도구 (예시/음성입력) */
.story-tools { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.story-tools .btn { min-height: 48px; font-size: 17px; padding: 0 16px; flex: none; }
.story-tools .btn.listening {
  background: var(--sem-red); border-color: var(--sem-red); color: #fff;
}

/* ------------------------------------------------------------- 지난번처럼 하기 */
.recall-box {
  margin: 0 0 22px; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--amber-soft); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 18px;
}
.recall-box p { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.recall-box .btn { min-height: 44px; padding: 0 18px; font-size: 15px; flex: none; }

/* ------------------------------------------------------------- 게스트 보관 훅 */
.guest-hook {
  margin: 24px auto 0; max-width: 480px;
  background: var(--amber-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px 22px;
  font-size: 18px; text-align: center;
}
.guest-hook p { margin: 0 0 14px; }
.guest-hook .btn { min-height: 52px; font-size: 18px; }

/* ------------------------------------------------------------- 만료 뱃지 */
.expire-badge {
  display: inline-block; font-size: 15px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; white-space: nowrap;
  background: var(--sem-blue-bg); color: var(--sem-blue);
}
.expire-badge.warn { background: var(--sem-orange-bg); color: var(--sem-orange); }
.expire-badge.dead { background: var(--gray-100); color: var(--gray-450); }

/* ------------------------------------------------------------- 세로 버튼 스택 */
.btn-stack {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 400px; margin: 0 auto 20px;
}
.btn-stack .btn { width: 100%; }

/* ------------------------------------------------------------- 접근성: 모션 최소화 */
@media (prefers-reduced-motion: reduce) {
  .shimmer-text { animation: none; color: var(--ink-soft); -webkit-text-fill-color: currentColor; }
  .confetti-piece { display: none; }
}

/* ------------------------------------------------------------- PWA 설치 배너 */
.install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 500;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 14px 16px;
  animation: ws-install-in .3s ease;
}
.install-banner-text { flex: 1 1 220px; font-size: 16px; font-weight: 700; color: var(--ink); }
.install-banner-btn { min-height: 44px; padding: 0 18px; font-size: 16px; flex: none; }
.install-banner-close {
  flex: none; width: 36px; height: 36px; border-radius: 999px; border: none;
  background: var(--cream-deep); color: var(--ink-soft); font-size: 16px; cursor: pointer;
}
.install-banner-close:hover { background: var(--amber-soft); }
@keyframes ws-install-in {
  0%   { transform: translateY(16px); opacity: 0; }
  100% { transform: translateY(0);    opacity: 1; }
}
@media (max-width: 480px) {
  .install-banner { left: 8px; right: 8px; bottom: 8px; padding: 12px; }
}

/* ------------------------------------------------------------- 광고 레일 (넓은 화면에서만) */
/* .wrap(1080px) 바깥 공간이 충분할 때만 좌/우에 뜬다 — 모바일/태블릿/좁은 노트북엔 안 보임(시니어 UX 방해 안 함) */
.ad-rail {
  display: none;
  position: fixed;
  top: 110px;
  width: 200px;
  z-index: 50;
}
.ad-rail-left  { left: 20px; }
.ad-rail-right { right: 20px; }
.ad-rail-slot {
  width: 200px; min-height: 700px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.ad-rail-slot img { display: block; width: 100%; height: auto; border-radius: 10px; }
@media (min-width: 1280px) {
  .ad-rail { display: block; }
}

/* 코리안투데이 배너 펄스 애니메이션 (wiabook.com 3D_book-detail-page-maker.html과 동일) */
@keyframes ws-ad-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(255, 0, 255, 0.5); }
  50%      { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 0, 255, 0.8); }
}
@keyframes ws-ad-pulse2 {
  0%, 100% { transform: scale(1); box-shadow: 0 0 20px rgba(0, 255, 255, 0.5); }
  50%      { transform: scale(1.05); box-shadow: 0 0 30px rgba(0, 255, 255, 0.8); }
}

/* ==========================================================================
   후원(커피 한 잔) 모달 — 2026-08-14. 클래스 전부 dn- 접두사로 기존 스타일과 분리.
   ========================================================================== */
:root{
  --dn-cream:#FBF6EF; --dn-card:#FFFFFF; --dn-ink:#2B1B0E; --dn-ink-soft:#7A5E42;
  --dn-line:#E8DAC7; --dn-accent:#C2660B; --dn-accent-strong:#9A4F07; --dn-accent-soft:#FBEBD9;
  --dn-shadow-lg:0 24px 64px rgba(43,27,14,.30);
}
@media (prefers-color-scheme: dark){
  :root{
    --dn-cream:#181210; --dn-card:#241A14; --dn-ink:#F3E7D8; --dn-ink-soft:#C2A583;
    --dn-line:#3D2C1E; --dn-accent:#E2A25C; --dn-accent-strong:#F0BE85; --dn-accent-soft:#3A2A18;
    --dn-shadow-lg:0 24px 64px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"]{
  --dn-cream:#181210; --dn-card:#241A14; --dn-ink:#F3E7D8; --dn-ink-soft:#C2A583;
  --dn-line:#3D2C1E; --dn-accent:#E2A25C; --dn-accent-strong:#F0BE85; --dn-accent-soft:#3A2A18;
  --dn-shadow-lg:0 24px 64px rgba(0,0,0,.6);
}
:root[data-theme="light"]{
  --dn-cream:#FBF6EF; --dn-card:#FFFFFF; --dn-ink:#2B1B0E; --dn-ink-soft:#7A5E42;
  --dn-line:#E8DAC7; --dn-accent:#C2660B; --dn-accent-strong:#9A4F07; --dn-accent-soft:#FBEBD9;
  --dn-shadow-lg:0 24px 64px rgba(43,27,14,.30);
}

.donate-btn{
  display:inline-flex; align-items:center; gap:9px;
  background:linear-gradient(135deg,#4A2E12,#2A1B0C); border:1px solid #6B4420;
  color:#F5D9AE; font-size:14px; font-weight:700; font-family:inherit;
  padding:10px 18px 10px 14px; border-radius:12px; cursor:pointer;
  box-shadow:0 4px 14px rgba(194,102,11,.25);
  transition:transform .1s, box-shadow .15s;
}
.donate-btn:hover{ transform:translateY(-1px); box-shadow:0 6px 18px rgba(194,102,11,.35); }
.donate-btn .dn-cup{ font-size:17px; }

.dn-modal-overlay{
  position:fixed; inset:0; background:rgba(24,15,8,.56); backdrop-filter:blur(2px);
  display:none; align-items:center; justify-content:center; padding:20px; z-index:400;
}
.dn-modal-overlay.open{ display:flex; }
.dn-modal-card{
  width:100%; max-width:400px; background:var(--dn-card); color:var(--dn-ink);
  border-radius:20px; box-shadow:var(--dn-shadow-lg); padding:28px 26px 24px; position:relative;
  animation:dn-modal-in .18s ease-out; font-family:inherit;
}
@keyframes dn-modal-in{ from{ opacity:0; transform:translateY(10px) scale(.98);} to{opacity:1; transform:none;} }
.dn-modal-close{
  position:absolute; top:14px; right:14px; width:32px; height:32px; border-radius:999px;
  border:none; background:var(--dn-accent-soft); color:var(--dn-ink-soft); font-size:16px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
}
.dn-modal-close:hover{ background:var(--dn-line); color:var(--dn-ink); }
.dn-modal-steps{ display:flex; gap:6px; margin-bottom:16px; }
.dn-modal-steps span{ height:4px; flex:1; border-radius:999px; background:var(--dn-line); }
.dn-modal-steps span.done, .dn-modal-steps span.active{ background:var(--dn-accent); }
.dn-modal-icon{ font-size:30px; margin-bottom:6px; line-height:1; }
.dn-modal-card h3{ font-size:19px; font-weight:800; margin:0 0 4px; letter-spacing:-.2px; }
.dn-modal-card .dn-sub{ font-size:14px; color:var(--dn-ink-soft); margin:0 0 20px; }

.dn-amount-grid{ display:grid; grid-template-columns:1fr 1fr; gap:10px; margin-bottom:10px; }
.dn-amount-chip{
  border:1.5px solid var(--dn-line); background:var(--dn-cream); color:var(--dn-ink);
  border-radius:12px; padding:16px 8px; font-size:16px; font-weight:700; cursor:pointer;
  font-family:inherit; font-variant-numeric:tabular-nums; transition:border-color .15s,background .15s;
}
.dn-amount-chip:hover{ border-color:var(--dn-accent); }
.dn-amount-chip.selected{ border-color:var(--dn-accent); background:var(--dn-accent-soft); color:var(--dn-accent-strong); }
.dn-amount-chip[disabled]{ opacity:.5; cursor:not-allowed; }
.dn-amount-custom{ position:relative; margin-bottom:14px; }
.dn-amount-custom input{
  width:100%; border:1.5px solid var(--dn-line); background:var(--dn-cream); color:var(--dn-ink);
  border-radius:12px; padding:13px 14px 13px 30px; font-size:15px; font-weight:700;
  font-family:inherit; font-variant-numeric:tabular-nums;
}
.dn-amount-custom input:focus{ border-color:var(--dn-accent); outline:none; }
.dn-amount-custom .dn-won{ position:absolute; left:14px; top:50%; transform:translateY(-50%); color:var(--dn-ink-soft); font-weight:700; font-size:15px; pointer-events:none; }
.dn-amount-custom input:placeholder-shown ~ .dn-won{ opacity:.5; }

.dn-primary{
  width:100%; min-height:50px; border:none; border-radius:12px; font-size:16px; font-weight:800;
  background:var(--dn-accent); color:#fff; cursor:pointer; font-family:inherit; margin-top:4px;
}
.dn-primary:hover{ background:var(--dn-accent-strong); }
.dn-primary[disabled]{ background:var(--dn-line); color:var(--dn-ink-soft); cursor:not-allowed; }
.dn-back{ background:none; border:none; color:var(--dn-ink-soft); font-size:13.5px; font-weight:700; cursor:pointer; padding:8px 0; font-family:inherit; }
.dn-back:hover{ color:var(--dn-ink); }

.dn-pay-visual{
  width:100%; aspect-ratio:1.586/1; max-width:220px; margin:0 auto 18px;
  border-radius:14px; padding:16px 18px;
  background:linear-gradient(135deg,#4A2E12 0%,#7A4A16 55%,#C2660B 130%);
  box-shadow:0 10px 24px rgba(154,79,7,.35), inset 0 1px 0 rgba(255,255,255,.08);
  display:flex; flex-direction:column; justify-content:space-between;
  position:relative; overflow:hidden;
}
.dn-pay-visual::after{
  content:""; position:absolute; inset:0;
  background:radial-gradient(circle at 85% 15%, rgba(255,255,255,.16), transparent 55%);
}
.dn-pay-visual .dn-chip{ width:30px; height:22px; border-radius:5px; background:linear-gradient(135deg,#F5DFA8,#D8B466); }
.dn-pay-visual .dn-num{ color:#FBEBD9; font-size:14px; font-weight:700; letter-spacing:2px; font-variant-numeric:tabular-nums; }

.dn-card-summary{
  display:flex; align-items:center; justify-content:space-between;
  background:var(--dn-accent-soft); border-radius:12px; padding:12px 14px; margin-bottom:14px;
  font-size:14.5px; color:var(--dn-accent-strong); font-weight:700;
}
.dn-card-summary b{ font-size:17px; font-variant-numeric:tabular-nums; }

#dn-payment-element{ margin-bottom:6px; }
.dn-trust-line{
  display:flex; align-items:center; gap:6px; justify-content:center;
  font-size:12.5px; color:var(--dn-ink-soft); margin:14px 0 4px;
}
.dn-error{ color:#B3261E; font-size:13.5px; margin:8px 0 0; min-height:1em; }

.dn-thanks{ text-align:center; padding:8px 0 4px; }
.dn-thanks .dn-emoji{ font-size:44px; margin-bottom:10px; }
.dn-thanks h3{ margin-bottom:6px; }
.dn-thanks p{ color:var(--dn-ink-soft); font-size:14.5px; margin:0 0 20px; }
