/* 랜딩 · 에디터 공통 스타일 */
:root {
  --bg: #faf7f3; --bg2: #f2ece5; --ink: #1f1b18; --ink2: #5f5751; --muted: #968c84; --line: #e6ddd3; --card: #fff;
  --accent: #b4574b; --accent-2: #f3e1dc; --radius: 16px;
  font-family: 'Pretendard', 'Apple SD Gothic Neo', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); line-height: 1.6; word-break: keep-all; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
.wrap { width: min(1160px, 100% - 32px); margin: 0 auto; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; font-size: 15px; transition: transform .15s, background .2s, box-shadow .2s; white-space: nowrap; }
.btn:hover { box-shadow: 0 4px 14px rgba(0, 0, 0, .06); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-accent { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-sm { min-height: 36px; padding: 6px 14px; font-size: 13px; }
.btn-ghost { background: transparent; border-color: transparent; }

/* 헤더 */
.site-head { position: sticky; top: 0; z-index: 50; background: rgba(250, 247, 243, .88); backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-head.scrolled { border-color: var(--line); }
.site-head .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.logo { font-family: 'Gowun Batang', serif; font-weight: 700; font-size: 19px; display: flex; align-items: center; gap: 8px; }
.logo i { font-style: normal; color: var(--accent); }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: var(--ink2); }
.nav a:hover { color: var(--ink); }
@media (max-width: 720px) { .nav { display: none; } .site-head .btn { margin-left: auto; } }

/* 히어로 */
.hero { padding: 70px 0 40px; overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center; }
.hero-kicker { display: inline-block; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-2); padding: 5px 12px; border-radius: 999px; margin-bottom: 20px; }
.hero h1 { font-family: 'Gowun Batang', serif; font-size: clamp(32px, 4.6vw, 54px); line-height: 1.28; letter-spacing: -.02em; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { margin-top: 18px; color: var(--ink2); font-size: 17px; max-width: 30em; }
.hero-cta { display: flex; gap: 10px; margin-top: 30px; flex-wrap: wrap; }
.hero-phones { position: relative; height: 560px; }
.hero-phones .phone { position: absolute; top: 0; }
.hero-phones .phone:nth-child(1) { left: 0; transform: rotate(-7deg) translateY(50px); }
.hero-phones .phone:nth-child(2) { left: 50%; transform: translateX(-50%); z-index: 2; }
.hero-phones .phone:nth-child(3) { right: 0; transform: rotate(7deg) translateY(50px); }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-phones { height: 480px; max-width: 460px; width: 100%; margin: 0 auto; }
  .hero-phones .phone { --s: .52; }
}

/* 폰 목업 (iframe 축소) */
.phone { --s: .6; --w: 390px; --h: 780px; width: calc(var(--w) * var(--s) + 16px); height: calc(var(--h) * var(--s) + 16px); padding: 8px; border-radius: calc(46px * var(--s) + 8px); background: #1b1917; box-shadow: 0 24px 50px rgba(40, 25, 15, .18); flex: none; }
.phone-screen { width: calc(var(--w) * var(--s)); height: calc(var(--h) * var(--s)); border-radius: calc(40px * var(--s)); overflow: hidden; position: relative; background: #eee; }
.phone iframe { width: var(--w); height: var(--h); border: 0; transform: scale(var(--s)); transform-origin: 0 0; pointer-events: none; }

/* 섹션 */
.section { padding: 90px 0; }
.section-alt { background: var(--bg2); }
.sec-label { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .1em; }
.section h2 { font-family: 'Gowun Batang', serif; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.35; margin-top: 8px; letter-spacing: -.02em; }
.section .lead { color: var(--ink2); margin-top: 12px; max-width: 40em; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; counter-reset: s; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.step::before { counter-increment: s; content: '0' counter(s); font-family: 'Space Mono', monospace; font-size: 13px; color: var(--accent); font-weight: 700; }
.step h3 { font-size: 18px; margin: 8px 0 6px; }
.step p { color: var(--ink2); font-size: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* 템플릿 갤러리 */
.tabs { display: flex; gap: 8px; margin-top: 30px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 8px 16px; font-size: 14px; font-weight: 600; color: var(--ink2); }
.tab[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 22px; margin-top: 26px; }
.tpl-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 20px 20px 22px; display: flex; flex-direction: column; transition: transform .25s, box-shadow .25s; }
.tpl-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(60, 40, 25, .1); }
.tpl-card .phone { --s: .56; margin: 0 auto 18px; box-shadow: 0 12px 26px rgba(40, 25, 15, .16); }
.tpl-card .badge { align-self: flex-start; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--bg2); color: var(--ink2); }
.tpl-card .badge.unique { background: var(--accent-2); color: var(--accent); }
.tpl-card h3 { font-size: 19px; margin: 10px 0 4px; }
.tpl-card p { font-size: 14px; color: var(--ink2); flex: 1; }
.tpl-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 12px 0 16px; }
.tpl-tags span { font-size: 12px; color: var(--muted); }
.tpl-actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; }
.tpl-actions .btn { font-size: 14px; }

/* 트렌드 */
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin-top: 36px; }
.trend { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.trend b { display: block; font-size: 16px; margin-bottom: 6px; }
.trend p { font-size: 14px; color: var(--ink2); }
.trend .src { font-size: 12px; color: var(--muted); margin-top: 10px; }
.trend .src a { text-decoration: underline; }
.feature-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 30px; list-style: none; }
.feature-list li { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 14px; font-weight: 600; }
.feature-list li span { display: block; font-weight: 400; color: var(--muted); font-size: 13px; }

.cta-band { text-align: center; padding: 90px 0; }
.cta-band h2 { font-family: 'Gowun Batang', serif; font-size: clamp(26px, 3.6vw, 38px); }
.cta-band .btn { margin-top: 24px; }
.site-foot { border-top: 1px solid var(--line); padding: 30px 0 40px; font-size: 13px; color: var(--muted); }

/* ═════════ 에디터 ═════════ */
.ed-body { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.ed-top { display: flex; align-items: center; gap: 10px; height: 60px; padding: 0 16px; border-bottom: 1px solid var(--line); background: var(--card); flex: none; }
.ed-top .logo { font-size: 17px; margin-right: 4px; }
.ed-status { font-size: 12px; color: var(--muted); margin-right: auto; }
.ed-main { flex: 1; display: grid; grid-template-columns: minmax(380px, 520px) 1fr; min-height: 0; }
.ed-form { overflow-y: auto; border-right: 1px solid var(--line); background: var(--bg); padding: 18px 18px 120px; }
.ed-preview { display: grid; place-items: center; background: radial-gradient(circle at 50% 30%, #f4ede6, #e4dad0); overflow: auto; padding: 24px; }
.ed-preview .phone { --s: 1; --h: 800px; border-radius: 52px; padding: 10px; }
.ed-preview .phone-screen { border-radius: 42px; }
.ed-preview .phone iframe { pointer-events: auto; }
.ed-preview-bar { display: flex; gap: 8px; justify-content: center; margin-bottom: 14px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.panel > summary { list-style: none; cursor: pointer; padding: 16px 18px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary small { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: auto; }
.panel > summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); margin-left: 6px; transition: transform .2s; }
.panel > summary:not(:has(small))::after { margin-left: auto; }
.panel[open] > summary::after { transform: rotate(-135deg); }
.panel-body { padding: 0 18px 20px; display: grid; gap: 14px; }
.sub-title { font-size: 13px; font-weight: 700; color: var(--accent); margin-top: 6px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-3 { grid-template-columns: 1fr 1.4fr 1fr; }
.f { display: grid; gap: 5px; font-size: 13px; color: var(--ink2); font-weight: 500; min-width: 0; }
.f input:not([type=checkbox]):not([type=radio]), .f select, .f textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: 14px; color: var(--ink); outline: none; transition: border-color .15s; }
.f input:focus, .f select:focus, .f textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-2); }
.f textarea { resize: vertical; min-height: 120px; line-height: 1.7; }
.hint { font-size: 12px; color: var(--muted); font-weight: 400; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); cursor: pointer; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.chk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.person-parent { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: end; }
.person-parent .chk { padding-bottom: 11px; }

.tpl-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tpl-opt { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 8px; text-align: left; transition: border-color .15s; }
.tpl-opt[aria-pressed='true'] { border-color: var(--accent); }
.tpl-opt .sw { height: 46px; border-radius: 8px; display: flex; align-items: flex-end; padding: 6px; margin-bottom: 6px; }
.tpl-opt .sw i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .7); }
.tpl-opt b { font-size: 12.5px; display: block; line-height: 1.3; }
.tpl-opt small { font-size: 10.5px; color: var(--muted); }

.photo-main { display: grid; grid-template-columns: 96px 1fr; gap: 12px; align-items: center; }
.photo-thumb { width: 96px; aspect-ratio: 4/5; border-radius: 10px; object-fit: cover; background: var(--bg2); border: 1px solid var(--line); }
.photo-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.gal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gal-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--bg2); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; }
.gal-item .ga { position: absolute; inset: auto 0 0 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); padding: 10px 3px 3px; opacity: 0; transition: opacity .15s; }
.gal-item:hover .ga, .gal-item:focus-within .ga { opacity: 1; }
@media (hover: none) { .gal-item .ga { opacity: 1; } }
.gal-item .ga button { width: 24px; height: 24px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, .9); font-size: 12px; line-height: 1; }
.gal-item .ga .del { background: #fff; color: #c0392b; font-weight: 700; }
.gal-no { position: absolute; top: 4px; left: 4px; font-size: 10px; background: rgba(0, 0, 0, .5); color: #fff; border-radius: 4px; padding: 0 5px; }
.acc-edit { display: grid; grid-template-columns: 72px 1fr 1.5fr 1fr; gap: 6px; align-items: center; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.acc-edit span { font-size: 13px; font-weight: 600; color: var(--ink2); }
.acc-edit input { padding: 9px 10px !important; font-size: 13px !important; }
.acc-edit .acc-pay { grid-column: 1 / -1; }
.nt-edit { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 8px; }
.nt-edit input, .nt-edit textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; background: #fff; min-width: 0; }
.nt-edit textarea { grid-column: 1; min-height: 60px; resize: vertical; line-height: 1.6; }
.nt-edit-btns { grid-row: 1 / 3; grid-column: 2; display: grid; gap: 4px; align-content: start; }
.nt-edit-btns .btn { min-height: 30px; padding: 2px 8px; }
.nt-presets { display: flex; flex-wrap: wrap; gap: 6px; }

.ed-fab { display: none; }
.mobile-close { display: none; }
@media (max-width: 960px) {
  .ed-main { grid-template-columns: 1fr; }
  .ed-form { border-right: 0; }
  .ed-preview { position: fixed; inset: 0; z-index: 90; display: none; padding: 10px; }
  .ed-preview.open { display: grid; }
  .ed-fab { display: inline-flex; position: fixed; right: 16px; bottom: 18px; z-index: 80; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
  .mobile-close { display: inline-flex; }
  .ed-top .hide-m { display: none; }
}

/* 모달 (발행 · 응답 관리) */
.dlg { border: 0; border-radius: 20px; padding: 0; width: min(520px, calc(100vw - 24px)); max-height: 90vh; background: var(--card); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .3); margin: auto; }
.dlg::backdrop { background: rgba(20, 15, 10, .45); }
.dlg-in { padding: 28px 26px 24px; display: grid; gap: 14px; }
.dlg h3 { font-family: 'Gowun Batang', serif; font-size: 22px; }
.dlg p { color: var(--ink2); font-size: 14px; }
.dlg-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; color: var(--muted); width: 40px; height: 40px; }
.url-box { display: flex; gap: 6px; }
.url-box input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; }
.qr { display: grid; place-items: center; padding: 10px; }
.qr img, .qr canvas { width: 160px; height: 160px; }
.dlg-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.rsvp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rsvp-table th, .rsvp-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.rsvp-table th { color: var(--muted); font-weight: 600; }
.table-wrap { max-height: 300px; overflow: auto; }
.ph-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; max-height: 260px; overflow: auto; }
.ph-grid:empty { display: none; }
.ph-item { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg2); }
.ph-item img { width: 100%; height: 100%; object-fit: cover; }
.ph-item button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; line-height: 1; }
.ph-item span { position: absolute; left: 0; right: 0; bottom: 0; font-size: 10px; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, .6)); padding: 8px 4px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast-site { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px; font-size: 14px; opacity: 0; pointer-events: none; transition: .3s; z-index: 300; }
.toast-site.on { opacity: 1; transform: translate(-50%, 0); }
