/* ============ Thiệp cưới — phần chung ============ */
:root {
  --c-primary: #9e1b1f; --c-accent: #d9aa52; --c-bg: #fff8ef; --c-text: #4a1d16;
  --c-primary-08: rgba(158,27,31,.08); --c-primary-15: rgba(158,27,31,.15);
  --c-accent-20: rgba(217,170,82,.2); --c-accent-50: rgba(217,170,82,.5);
  --c-text-60: rgba(74,29,22,.65); --c-bg-80: rgba(255,248,239,.85);
  --f-script: "Dancing Script", cursive; --f-serif: "Playfair Display", Georgia, serif; --f-sans: "Be Vietnam Pro", system-ui, sans-serif;
  --c-card: #fff;
  --w: 480px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
html.lock, html.lock body { overflow: hidden; height: 100%; }
body {
  margin: 0; font-family: var(--f-sans); color: var(--c-text); line-height: 1.6; font-size: 15px;
  background: var(--c-primary); background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.12), transparent 50%);
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: var(--c-primary); }
button { font: inherit; cursor: pointer; }
.card { max-width: var(--w); margin: 0 auto; background: var(--c-bg); min-height: 100vh; overflow: hidden; position: relative; box-shadow: 0 0 60px rgba(0,0,0,.25); }
.script { font-family: var(--f-script); font-weight: 400; }
.center { text-align: center; }
.sub { text-align: center; color: var(--c-text-60); font-size: 14px; margin: 0 0 18px; }

/* hiện dần khi cuộn */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s ease, transform .9s ease; }
.reveal.in { opacity: 1; transform: none; }
.is-preview .reveal { opacity: 1; transform: none; transition: none; }

/* ---------- phần chung các mục ---------- */
.sec { padding: 56px 24px; text-align: center; position: relative; }
.sec-title { font-family: var(--f-script); font-weight: 400; font-size: 38px; line-height: 1.2; color: var(--c-primary); margin: 0 0 22px; }
.kicker { font-family: var(--f-sans); text-transform: uppercase; letter-spacing: .32em; font-size: 11px; color: var(--c-text-60); margin: 0 0 14px; }
.divider { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px auto; color: var(--c-accent); }
.divider span { flex: 0 0 60px; height: 1px; background: var(--c-accent-50); }
.div-line i { width: 8px; height: 8px; transform: rotate(45deg); border: 1px solid var(--c-accent); }
.div-floral svg { width: 40px; height: 20px; }
.div-hy { width: 46px; height: 46px; color: var(--c-accent); }
.quote { font-family: var(--f-serif); font-style: italic; font-size: 19px; margin: 0 auto; max-width: 340px; color: var(--c-text); }
.intro, .announce { font-family: var(--f-serif); font-size: 16px; margin: 0; }
.btn { display: inline-block; border: 1px solid var(--c-primary); background: var(--c-primary); color: #fff; padding: 10px 20px; border-radius: 999px; text-decoration: none; font-size: 14px; letter-spacing: .03em; transition: transform .2s, opacity .2s; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--c-primary); }
.btn.wide { width: 100%; padding: 13px; font-size: 15px; }
.btn:disabled { opacity: .6; }
.mini { border: 1px solid var(--c-accent); background: transparent; color: var(--c-primary); border-radius: 999px; font-size: 12px; padding: 2px 10px; margin-left: 6px; }

/* ---------- màn mở thiệp ---------- */
.opening { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; transition: opacity .9s ease, visibility .9s; }
.opening.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.op-kicker { text-transform: uppercase; letter-spacing: .3em; font-size: 11px; margin: 0 0 8px; opacity: .85; }
.op-names { font-family: var(--f-script); font-weight: 400; font-size: 44px; line-height: 1.15; margin: 0; }
.op-names span { display: block; font-size: .55em; opacity: .8; }
.op-date { font-family: var(--f-serif); letter-spacing: .25em; margin: 10px 0 0; }
.op-guest { margin: 18px 0 0; font-size: 13px; letter-spacing: .05em; opacity: .9; }
.op-guest b { display: block; font-family: var(--f-serif); font-size: 22px; font-weight: 600; letter-spacing: 0; margin-top: 4px; }
.op-btn { margin-top: 18px; border: 1px solid currentColor; background: transparent; color: inherit; padding: 10px 30px; border-radius: 999px; letter-spacing: .2em; text-transform: uppercase; font-size: 12px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,255,255,.35); } 50% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } }

/* Phong bì */
.op-envelope { background: radial-gradient(circle at 50% 30%, var(--c-bg), #efe2cf); color: var(--c-primary); }
.op-envelope .op-top { margin-bottom: 26px; }
.env { position: relative; width: min(300px, 80vw); aspect-ratio: 3 / 2; perspective: 900px; }
.env-back, .env-front, .env-flap { position: absolute; inset: 0; }
.env-back { background: var(--c-primary); border-radius: 6px; box-shadow: 0 18px 40px rgba(0,0,0,.25); }
.env-front { background: linear-gradient(to top right, transparent 49.6%, rgba(0,0,0,.08) 50%) left/50% 100% no-repeat,
  linear-gradient(to top left, transparent 49.6%, rgba(0,0,0,.08) 50%) right/50% 100% no-repeat; z-index: 3;
  clip-path: polygon(0 0, 50% 55%, 100% 0, 100% 100%, 0 100%); background-color: var(--c-primary); border-radius: 6px; }
.env-flap { z-index: 4; clip-path: polygon(0 0, 100% 0, 50% 58%); background: var(--c-primary); filter: brightness(.88); transform-origin: top; transition: transform .7s ease, z-index 0s .35s; }
.env-letter { position: absolute; left: 6%; right: 6%; top: 8%; bottom: 6%; background: #fffaf1; border-radius: 4px; z-index: 2; transition: transform .8s ease .55s; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.env-letter-in { color: var(--c-primary); }
.env-letter .script { font-size: 20px; margin: 4px 0 0; }
.env-letter .small { font-size: 11px; letter-spacing: .2em; margin: 0; }
.env-hy { width: 36px; height: 36px; color: var(--c-accent); }
.env-seal { position: absolute; z-index: 5; left: 50%; top: 52%; transform: translate(-50%, -50%); width: 58px; height: 58px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #f3d48b, var(--c-accent) 60%, #a77a28); color: var(--c-primary); border: 0; font-size: 26px; font-family: var(--f-serif); font-weight: 700; box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: opacity .3s; }
.opening-go .env-flap { transform: rotateX(180deg); z-index: 1; }
.opening-go .env-seal { opacity: 0; }
.opening-go .env-letter { transform: translateY(-62%); }
.op-envelope .op-btn { color: var(--c-primary); }

/* Rèm */
.op-curtain { color: var(--c-text); overflow: hidden; }
.cur { position: absolute; top: 0; bottom: 0; width: 50.5%; background: var(--c-bg); transition: transform 1.2s cubic-bezier(.7,0,.3,1); overflow: hidden;
  background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.025) 0 18px, rgba(255,255,255,.4) 18px 36px); }
.cur-l { left: 0; box-shadow: inset -12px 0 24px rgba(0,0,0,.06); }
.cur-r { right: 0; box-shadow: inset 12px 0 24px rgba(0,0,0,.06); }
.cur-branch { position: absolute; width: 170px; height: 170px; bottom: -10px; left: -14px; }
.cur-r .cur-branch { left: auto; right: -14px; top: -10px; bottom: auto; transform: rotate(180deg); }
.cur-center { position: relative; z-index: 2; transition: opacity .5s; }
.mono { font-family: var(--f-script); font-size: 64px; color: var(--c-primary); line-height: 1; }
.mono span { font-size: .5em; margin: 0 6px; color: var(--c-accent); }
.op-curtain .op-btn { color: var(--c-primary); }
.opening-go .cur-l { transform: translateX(-101%); }
.opening-go .cur-r { transform: translateX(101%); }
.opening-go .cur-center { opacity: 0; }

/* Ảnh bìa */
.op-cover { color: #fff; padding: 0; background: #000; cursor: pointer; }
.op-cover .op-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s ease; }
.op-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.15), rgba(0,0,0,.55)); }
.op-in { position: relative; padding: 24px; }
.op-cover .op-names { font-size: 52px; text-shadow: 0 2px 20px rgba(0,0,0,.3); }
.opening-go.op-cover .op-bg { transform: scale(1.12); }

/* ---------- ảnh bìa trong thiệp ---------- */
.hero { position: relative; text-align: center; }
.hero-names { font-family: var(--f-script); font-weight: 400; color: var(--c-primary); font-size: 46px; line-height: 1.1; margin: 22px 0 8px; }
.hero-names .nm { display: block; }
.hero-names .amp { display: block; font-size: .55em; color: var(--c-accent); margin: 2px 0; }
.hero-date { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-serif); font-size: 20px; letter-spacing: .1em; color: var(--c-text); }
.hero-date i { width: 1px; height: 22px; background: var(--c-accent); }
.hero-frame { padding: 48px 28px 40px; }
.hero-hy { width: 70px; height: 70px; color: var(--c-accent); margin: 0 auto 14px; }
.frame { padding: 10px; border: 1px solid var(--c-accent); border-radius: 4px; position: relative; max-width: 330px; margin: 0 auto; }
.frame::before { content: ""; position: absolute; inset: -6px; border: 1px solid var(--c-accent-50); border-radius: 6px; pointer-events: none; }
.frame img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 2px; }
.hero-full { height: 100svh; min-height: 560px; color: #fff; display: flex; align-items: flex-end; justify-content: center; }
.hero-full .hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,0) 40%, rgba(0,0,0,.6)); }
.hero-in { position: relative; padding: 0 24px 80px; }
.hero-full .kicker, .hero-full .hero-date, .hero-full .hero-names { color: #fff; }
.hero-full .hero-names .amp { color: #fff; opacity: .8; }
.hero-full .hero-date i { background: rgba(255,255,255,.7); }
.scroll-hint { position: absolute; bottom: 22px; left: 50%; width: 22px; height: 34px; margin-left: -11px; border: 1.5px solid rgba(255,255,255,.8); border-radius: 12px; }
.scroll-hint span { position: absolute; left: 50%; top: 6px; width: 3px; height: 7px; margin-left: -1.5px; background: #fff; border-radius: 2px; animation: hint 1.6s infinite; }
@keyframes hint { 0% { opacity: 0; transform: translateY(0); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(12px); } }
.hero-arch { padding: 56px 28px 40px; overflow: hidden; }
.arch { max-width: 300px; margin: 0 auto; border-radius: 160px 160px 8px 8px; overflow: hidden; border: 6px solid #fff; box-shadow: 0 0 0 1px var(--c-accent-50), 0 18px 40px rgba(0,0,0,.12); }
.arch img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }
.corner { position: absolute; width: 150px; height: 150px; top: -14px; pointer-events: none; }
.corner.tl { left: -24px; transform: rotate(90deg); }
.corner.tr { right: -24px; transform: scaleX(-1) rotate(90deg); }

/* ---------- gia đình, cô dâu chú rể ---------- */
.fams { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 26px; }
.fam h3 { font-family: var(--f-serif); font-size: 15px; text-transform: uppercase; letter-spacing: .15em; color: var(--c-primary); margin: 0 0 8px; }
.fam p { margin: 0; font-size: 14px; }
.fam .addr { color: var(--c-text-60); font-size: 12.5px; margin-top: 6px; }
.cp-fulls { margin-top: 18px; }
.cp-full .role { display: block; font-size: 11px; letter-spacing: .25em; text-transform: uppercase; color: var(--c-text-60); }
.cp-full b { display: block; font-family: var(--f-serif); font-size: 24px; font-weight: 600; color: var(--c-primary); }
.cp-fulls .amp { display: block; font-family: var(--f-script); font-size: 30px; color: var(--c-accent); margin: 4px 0; }
.couple { display: grid; gap: 10px; }
.person .ph { width: 190px; height: 230px; margin: 0 auto 12px; border-radius: 999px; overflow: hidden; border: 4px solid #fff; box-shadow: 0 0 0 1px var(--c-accent), 0 12px 30px rgba(0,0,0,.12); }
.person .ph img { width: 100%; height: 100%; object-fit: cover; }
.person .role { margin: 0; font-size: 11px; letter-spacing: .3em; text-transform: uppercase; color: var(--c-text-60); }
.person h3 { font-size: 36px; color: var(--c-primary); margin: 0; line-height: 1.3; }
.person .bio { font-size: 14px; color: var(--c-text-60); max-width: 320px; margin: 6px auto 0; }
.couple .heart { color: var(--c-accent); font-size: 26px; animation: beat 1.4s infinite; }
@keyframes beat { 0%,100% { transform: scale(1); } 30% { transform: scale(1.25); } }

/* ---------- sự kiện ---------- */
.events { display: grid; gap: 18px; }
.event { background: var(--c-card); border: 1px solid var(--c-accent-50); border-radius: 14px; padding: 26px 18px; box-shadow: 0 10px 30px var(--c-primary-08); }
.event h3 { font-family: var(--f-serif); text-transform: uppercase; letter-spacing: .14em; font-size: 17px; margin: 0 0 6px; color: var(--c-primary); }
.ev-time { margin: 0 0 10px; font-size: 14px; }
.ev-date { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 6px 0; }
.ev-date .d { font-family: var(--f-serif); font-size: 54px; line-height: 1; color: var(--c-primary); padding: 0 16px; border-left: 1px solid var(--c-accent); border-right: 1px solid var(--c-accent); }
.ev-date .m, .ev-date .y { font-size: 13px; letter-spacing: .15em; text-transform: uppercase; width: 72px; }
.ev-date .m { text-align: right; } .ev-date .y { text-align: left; }
.ev-lunar { font-size: 13px; font-style: italic; color: var(--c-text-60); margin: 4px 0 12px; }
.ev-place { font-weight: 600; margin: 0; }
.ev-addr { margin: 2px 0 14px; font-size: 14px; color: var(--c-text-60); }
.ev-btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.invite { font-family: var(--f-serif); font-style: italic; margin: 26px auto 0; max-width: 340px; }

/* lịch tháng */
.cal { max-width: 320px; margin: 0 auto; background: var(--c-card); border-radius: 14px; padding: 16px; box-shadow: 0 10px 30px var(--c-primary-08); }
.cal-h, .cal-g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }
.cal-h span { font-size: 11px; font-weight: 600; color: var(--c-primary); padding-bottom: 8px; }
.cal-g span { padding: 7px 0; font-size: 14px; position: relative; }
.cal-g .on { color: #fff; font-weight: 700; z-index: 0; }
.cal-g .on::before { content: "♥"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 40px; line-height: 1; padding-bottom: 3px; color: var(--c-primary); z-index: -1; animation: beat 1.4s infinite; }

/* đếm ngược */
.cd { display: flex; justify-content: center; gap: 10px; }
.cd div { width: 70px; padding: 12px 0; background: var(--c-primary); color: #fff; border-radius: 12px; }
.cd b { display: block; font-family: var(--f-serif); font-size: 28px; line-height: 1.1; }
.cd span { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }

/* chuyện tình */
.story { text-align: left; border-left: 1px solid var(--c-accent); margin-left: 10px; padding-left: 22px; }
.st-item { position: relative; margin-bottom: 26px; }
.st-item::before { content: ""; position: absolute; left: -29px; top: 6px; width: 13px; height: 13px; border-radius: 50%; background: var(--c-bg); border: 2px solid var(--c-primary); }
.st-ph img { border-radius: 10px; margin-bottom: 8px; width: 100%; aspect-ratio: 3/2; object-fit: cover; }
.st-date { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--c-accent); margin: 0; font-weight: 600; }
.st-item h3 { font-family: var(--f-serif); margin: 2px 0 4px; color: var(--c-primary); font-size: 19px; }
.st-item p:last-child { margin: 0; font-size: 14px; }

/* album */
.album { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.al-it { display: block; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--c-primary-08); cursor: zoom-in; }
.al-it img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .5s; }
.al-it:nth-child(3n+1) { grid-column: span 2; }
.al-it:nth-child(3n+1) img { aspect-ratio: 3 / 2; }
.al-it:hover img { transform: scale(1.04); }
.lb { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.92); display: flex; align-items: center; justify-content: center; }
.lb img { max-width: 100%; max-height: 86vh; object-fit: contain; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 28px; line-height: 1; }
.lb-x { top: 14px; right: 14px; } .lb-p { left: 10px; top: 50%; } .lb-n { right: 10px; top: 50%; }
.lb-c { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; color: #fff; font-size: 13px; margin: 0; }

/* bản đồ */
.map { border-radius: 14px; overflow: hidden; border: 1px solid var(--c-accent-50); height: 260px; background: var(--c-primary-08); margin-bottom: 14px; }
.map iframe { width: 100%; height: 100%; border: 0; }
.map-addr { font-size: 14px; margin: -8px 0 14px; color: var(--c-text-60); }

/* biểu mẫu */
.form { display: grid; gap: 12px; text-align: left; max-width: 380px; margin: 0 auto; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--c-text-60); }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; color: var(--c-text); background: var(--c-card); border: 1px solid var(--c-accent-50); border-radius: 10px; padding: 10px 12px; width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--c-accent-50); border-color: var(--c-accent); }
.form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.choice { display: grid; gap: 6px; }
.choice label { display: flex; align-items: center; gap: 0; }
.choice input { position: absolute; opacity: 0; width: 1px; }
.choice span { flex: 1; border: 1px solid var(--c-accent-50); border-radius: 10px; padding: 9px 12px; color: var(--c-text); background: var(--c-card); font-size: 14px; }
.choice input:checked + span { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.choice input:focus-visible + span { outline: 2px solid var(--c-accent); }
.ok-msg { text-align: center; color: var(--c-primary); font-size: 14px; margin: 4px 0 0; }
.ok-msg.big { font-family: var(--f-serif); font-size: 18px; padding: 20px 0; }

/* mừng cưới */
.gifts { display: grid; gap: 16px; }
.gift-card { background: var(--c-card); border-radius: 14px; padding: 20px; border: 1px solid var(--c-accent-50); }
.gift-card .role { margin: 0 0 10px; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--c-primary); font-weight: 600; }
.qr { width: 190px; height: 190px; margin: 0 auto 10px; background: #fff; padding: 6px; border-radius: 10px; border: 1px solid #eee; }
.qr svg, .qr img { width: 100%; height: 100%; object-fit: contain; }
.gift-card p { margin: 2px 0; }
.gift-card .acc b { font-size: 18px; letter-spacing: .06em; }
.gift-card .holder { font-size: 13px; color: var(--c-text-60); }

/* lời chúc */
.wishes { margin-top: 22px; display: grid; gap: 10px; max-height: 420px; overflow: auto; text-align: left; padding: 2px; }
.wish { background: var(--c-card); border-radius: 12px; padding: 12px 14px; border-left: 3px solid var(--c-accent); }
.wish b { color: var(--c-primary); font-size: 14px; }
.wish p { margin: 2px 0 0; font-size: 14px; }

/* cảm ơn + chân trang */
.sec-thanks { padding: 0; color: #fff; }
.thanks-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.thanks-in { position: absolute; left: 0; right: 0; bottom: 0; padding: 60px 24px 34px; background: linear-gradient(to bottom, transparent, rgba(0,0,0,.65)); }
.thanks-in h2 { font-size: 54px; margin: 0; line-height: 1; }
.thanks-in p { margin: 8px auto 0; max-width: 340px; font-size: 14px; }
.thanks-in .sign { font-size: 26px; margin-top: 10px; }
.brand { text-align: center; font-size: 12px; padding: 18px 16px 90px; color: var(--c-text-60); display: grid; gap: 2px; }
.brand a { color: inherit; text-decoration: none; }
.brand b { color: var(--c-primary); letter-spacing: .08em; }

/* nút nổi */
.fab { position: fixed; z-index: 30; right: max(14px, calc(50vw - var(--w) / 2 + 14px)); bottom: 18px; display: grid; gap: 10px; }
.fab-b { width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--c-primary); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.fab-b svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; }
#btn-music svg { fill: none; }
#btn-music.on { animation: spin 4s linear infinite; }
#btn-music:not(.on)::after { content: ""; position: absolute; width: 26px; height: 2px; background: #fff; transform: rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 20; }
.is-closed #fx { z-index: 60; }

.sheet { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { background: #fff; width: 100%; max-width: var(--w); border-radius: 18px 18px 0 0; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; color: #333; }
.sheet-in h3 { margin: 0 0 4px; text-align: center; font-family: var(--f-serif); }
.sheet-in button, .sheet-in a { display: block; text-align: center; border: 1px solid #e5e5e5; background: #fafafa; color: #333; border-radius: 12px; padding: 12px; text-decoration: none; font-size: 15px; }
.sheet-in .close { background: transparent; border: 0; color: #888; }
.sheet-qr svg { width: 200px; height: 200px; display: block; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 14px; z-index: 100; opacity: 0; transition: .3s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.draft-badge { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 40; background: #222; color: #fff; font-size: 12px; padding: 6px 14px; border-radius: 999px; opacity: .85; }
.demo-bar { position: fixed; z-index: 45; left: 50%; transform: translateX(-50%); top: 12px; display: flex; gap: 6px; background: rgba(0,0,0,.75); padding: 6px; border-radius: 999px; }
.demo-bar a { white-space: nowrap; color: #fff; text-decoration: none; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.demo-bar a:last-child { background: var(--c-accent); color: #222; font-weight: 600; }
.is-closed .demo-bar { display: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .op-btn, .couple .heart, .cal-g .on::before, #btn-music.on { animation: none; }
}

/* ============ Mẫu 1: Hồng Hỷ Đỏ Son ============ */
.tpl-hong-hy .card { background-color: var(--c-bg);
  background-image: radial-gradient(var(--c-primary-08) 1px, transparent 1px); background-size: 18px 18px; }
.tpl-hong-hy .hero-frame { background: var(--c-primary); color: #fff; padding-bottom: 46px;
  background-image: radial-gradient(circle at 50% 0, rgba(255,255,255,.18), transparent 60%); }
.tpl-hong-hy .hero-frame .kicker { color: var(--c-accent); }
.tpl-hong-hy .hero-frame .hero-names { color: #fff; }
.tpl-hong-hy .hero-frame .hero-names .amp { color: var(--c-accent); }
.tpl-hong-hy .hero-frame .hero-date { color: #fff; }
.tpl-hong-hy .frame { border-color: var(--c-accent); background: rgba(255,255,255,.06); }
.tpl-hong-hy .sec-title { color: var(--c-primary); }
.tpl-hong-hy .sec-families { background: #fff; margin: 0 16px; border: 1px solid var(--c-accent-50); border-radius: 4px; outline: 1px solid var(--c-accent-50); outline-offset: 5px; margin-top: 36px; }
.tpl-hong-hy .sec-cd, .tpl-hong-hy .sec-gift { background: var(--c-primary); color: #fff; }
.tpl-hong-hy .sec-cd .sec-title, .tpl-hong-hy .sec-gift .sec-title { color: var(--c-accent); }
.tpl-hong-hy .sec-cd .cd div { background: rgba(255,255,255,.1); border: 1px solid var(--c-accent); }
.tpl-hong-hy .sec-cd .cd b { color: var(--c-accent); }
.tpl-hong-hy .sec-gift .sub { color: rgba(255,255,255,.8); }
.tpl-hong-hy .sec-gift .gift-card { color: var(--c-text); }
.tpl-hong-hy .event { border-top: 4px solid var(--c-primary); }
.tpl-hong-hy .btn { background: var(--c-primary); border-color: var(--c-primary); }
.tpl-hong-hy .btn.ghost { background: transparent; }

/* ============ Mẫu 2: Ngà Thanh Lịch ============ */
.tpl-nga-thanh-lich { background: #e9e2d8; }
.tpl-nga-thanh-lich .hero-names { font-size: 58px; }
.tpl-nga-thanh-lich .hero-full .hero-names .nm { font-family: var(--f-script); }
.tpl-nga-thanh-lich .hero-date { font-size: 16px; letter-spacing: .35em; }
.tpl-nga-thanh-lich .sec-title { font-family: var(--f-serif); font-weight: 400; font-size: 28px; letter-spacing: .12em; text-transform: uppercase; color: var(--c-text); }
.tpl-nga-thanh-lich .sec-title::after { content: ""; display: block; width: 40px; height: 1px; background: var(--c-accent); margin: 14px auto 0; }
.tpl-nga-thanh-lich .quote { font-size: 22px; }
.tpl-nga-thanh-lich .event { background: transparent; box-shadow: none; border: 0; border-top: 1px solid var(--c-accent-50); border-bottom: 1px solid var(--c-accent-50); border-radius: 0; }
.tpl-nga-thanh-lich .event h3 { font-weight: 400; letter-spacing: .25em; }
.tpl-nga-thanh-lich .ev-date .d { font-weight: 300; }
.tpl-nga-thanh-lich .btn { background: var(--c-text); border-color: var(--c-text); border-radius: 0; letter-spacing: .15em; text-transform: uppercase; font-size: 12px; }
.tpl-nga-thanh-lich .btn.ghost { background: transparent; color: var(--c-text); }
.tpl-nga-thanh-lich .person .ph { border-radius: 0; width: 100%; max-width: 300px; height: auto; aspect-ratio: 4/5; box-shadow: none; border: 0; }
.tpl-nga-thanh-lich .person h3 { font-size: 44px; }
.tpl-nga-thanh-lich .cd div { background: transparent; color: var(--c-text); border: 1px solid var(--c-accent-50); border-radius: 0; }
.tpl-nga-thanh-lich .cal, .tpl-nga-thanh-lich .gift-card, .tpl-nga-thanh-lich .wish { border-radius: 0; box-shadow: none; }
.tpl-nga-thanh-lich .cal-g .on::before { content: ""; inset: 50% auto auto 50%; width: 32px; height: 32px; margin: -16px 0 0 -16px; border-radius: 50%; background: var(--c-text); animation: none; padding: 0; }
.tpl-nga-thanh-lich .al-it { border-radius: 0; }
.tpl-nga-thanh-lich .form input, .tpl-nga-thanh-lich .form select, .tpl-nga-thanh-lich .form textarea, .tpl-nga-thanh-lich .choice span { border-radius: 0; }
.tpl-nga-thanh-lich .choice input:checked + span { background: var(--c-text); border-color: var(--c-text); }
.tpl-nga-thanh-lich .fab-b { background: var(--c-text); }

/* ============ Mẫu 3: Vườn Hoa Pastel ============ */
.tpl-vuon-hoa { background: #dfe7dc; }
.tpl-vuon-hoa .card { background: var(--c-bg); background-image: radial-gradient(circle at 0 0, var(--c-accent-20), transparent 35%), radial-gradient(circle at 100% 40%, var(--c-primary-08), transparent 35%); }
.tpl-vuon-hoa .hero-names { color: var(--c-primary); }
.tpl-vuon-hoa .sec-title { color: var(--c-primary); }
.tpl-vuon-hoa .event { border-radius: 120px 120px 16px 16px; padding-top: 44px; }
.tpl-vuon-hoa .btn { background: var(--c-primary); border-color: var(--c-primary); }
.tpl-vuon-hoa .btn.ghost { background: transparent; }
.tpl-vuon-hoa .cd div { background: var(--c-accent-20); color: var(--c-text); border-radius: 999px 999px 14px 14px; padding-top: 18px; }
.tpl-vuon-hoa .cd b { color: var(--c-primary); }
.tpl-vuon-hoa .person .ph { border-radius: 120px 120px 12px 12px; }
.tpl-vuon-hoa .sec-families { background: rgba(255,255,255,.6); margin: 24px 16px 0; border-radius: 24px; }
.tpl-vuon-hoa .cal-g .on::before { color: var(--c-accent); }
.tpl-vuon-hoa .choice input:checked + span { background: var(--c-primary); }
.tpl-vuon-hoa .op-curtain .cur { background-color: #f7efe9; }

.sec-intro { padding-bottom: 20px; }

/* ============ Kiểu ảnh bìa & hoạ tiết bổ sung (Giai đoạn 4) ============ */
.div-deco svg { width: 60px; height: 30px; }
.div-wave svg { width: 140px; height: 18px; }
.div-stamp svg { width: 34px; height: 34px; }
.hero-polaroid { padding: 52px 24px 40px; }
.polaroid { position: relative; width: 82%; max-width: 310px; margin: 6px auto 0; background: #fff; padding: 12px 12px 0; box-shadow: 0 16px 34px rgba(0,0,0,.18); transform: rotate(-2.5deg); }
.polaroid img { width: 100%; aspect-ratio: 6 / 7; object-fit: cover; }
.pol-cap { font-family: var(--f-script); font-size: 24px; color: #4a3a2e; margin: 0; padding: 10px 0 14px; }
.tape { position: absolute; width: 90px; height: 26px; background: rgba(255,255,255,.55); box-shadow: 0 1px 3px rgba(0,0,0,.08); z-index: 1; }
.tape.t1 { top: -12px; left: -18px; transform: rotate(-35deg); }
.tape.t2 { top: -12px; right: -18px; transform: rotate(35deg); }
.hero-split { padding: 28px 22px 34px; text-align: left; }
.split-k { font-family: var(--f-serif); text-transform: uppercase; font-size: 46px; line-height: .95; letter-spacing: .02em; margin: 0 0 18px; font-weight: 700; color: var(--c-text); }
.split-ph img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.split-names { font-family: var(--f-sans); font-weight: 700; text-transform: uppercase; font-size: 30px; line-height: 1.05; margin: 18px 0 8px; letter-spacing: .04em; color: var(--c-text); }
.split-names span { display: block; }
.split-names em { display: block; font-family: var(--f-script); font-style: normal; text-transform: none; font-weight: 400; font-size: 46px; line-height: .9; color: var(--c-accent); }
.split-date { display: flex; align-items: baseline; gap: 8px; font-family: var(--f-sans); }
.split-date b { font-size: 54px; font-weight: 300; line-height: 1; }
.split-date i { font-style: normal; font-size: 30px; color: var(--c-accent); }

/* thiệp nền tối */
.is-dark .card { box-shadow: 0 0 60px rgba(0,0,0,.5); }
.is-dark .event, .is-dark .cal, .is-dark .gift-card, .is-dark .wish { box-shadow: none; border-color: var(--c-accent-50); }
.is-dark .btn { color: var(--c-bg); }
.is-dark .btn.ghost { color: var(--c-primary); }
.is-dark .cd div, .is-dark .fab-b { color: var(--c-bg); }
.is-dark .choice input:checked + span { color: var(--c-bg); }
.is-dark .cal-g .on { color: var(--c-bg); }
.is-dark .form input::placeholder, .is-dark .form textarea::placeholder { color: rgba(255,255,255,.4); }
.is-dark .form select option { color: #222; }
.is-dark .person .ph, .is-dark .arch { border-color: var(--c-bg); }

/* ============ Mẫu 4: Hồng Phấn Ngọt Ngào ============ */
.tpl-hong-phan { background: #f6dde4; }
.tpl-hong-phan .card { background-image: radial-gradient(circle at 100% 0, var(--c-accent-50), transparent 30%), radial-gradient(circle at 0 55%, var(--c-accent-20), transparent 30%); }
.tpl-hong-phan .hero-names { font-size: 54px; }
.tpl-hong-phan .event { border-radius: 26px; border-style: dashed; }
.tpl-hong-phan .cd div { border-radius: 50%; width: 72px; height: 72px; padding: 14px 0 0; background: var(--c-accent-50); color: var(--c-primary); }
.tpl-hong-phan .cd span { color: var(--c-text); }
.tpl-hong-phan .op-envelope { background: radial-gradient(circle at 50% 30%, #fff, #f8d9e2); }
.tpl-hong-phan .env-back, .tpl-hong-phan .env-front { background-color: #e58fa8; }
.tpl-hong-phan .env-flap { background: #d97894; }
.tpl-hong-phan .env-seal { background: radial-gradient(circle at 35% 30%, #fff, #f7c6d3 60%, #e58fa8); color: var(--c-primary); }
.tpl-hong-phan .sec-wish { background: var(--c-accent-20); }

/* ============ Mẫu 5: Navy Hoàng Gia ============ */
.tpl-navy-gold { background: #070f1d; }
.tpl-navy-gold .card { background-color: var(--c-bg); background-image: linear-gradient(90deg, transparent 22px, var(--c-accent-20) 22px, var(--c-accent-20) 23px, transparent 23px, transparent calc(100% - 23px), var(--c-accent-20) calc(100% - 23px), var(--c-accent-20) calc(100% - 22px), transparent calc(100% - 22px)); }
.tpl-navy-gold .sec-title { font-family: var(--f-serif); font-size: 26px; text-transform: uppercase; letter-spacing: .14em; }
.tpl-navy-gold .kicker, .tpl-navy-gold .cp-full .role, .tpl-navy-gold .person .role { color: var(--c-accent); }
.tpl-navy-gold .frame { border-color: var(--c-primary); padding: 8px; clip-path: polygon(14px 0, calc(100% - 14px) 0, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) 100%, 14px 100%, 0 calc(100% - 14px), 0 14px); }
.tpl-navy-gold .frame::before { display: none; }
.tpl-navy-gold .hero-names { color: var(--c-primary); }
.tpl-navy-gold .event { border-radius: 0; clip-path: polygon(16px 0, calc(100% - 16px) 0, 100% 16px, 100% calc(100% - 16px), calc(100% - 16px) 100%, 16px 100%, 0 calc(100% - 16px), 0 16px); border-color: var(--c-primary); }
.tpl-navy-gold .cd div { border-radius: 0; }
.tpl-navy-gold .op-curtain .cur { background-color: #14284a; background-image: repeating-linear-gradient(90deg, rgba(0,0,0,.22) 0 16px, rgba(255,255,255,.04) 16px 34px); }
.tpl-navy-gold .op-curtain { color: var(--c-text); }
.tpl-navy-gold .mono { color: var(--c-primary); }
.tpl-navy-gold .cur-branch { opacity: .5; }
.tpl-navy-gold .btn { border-radius: 0; letter-spacing: .12em; text-transform: uppercase; font-size: 12px; }

/* ============ Mẫu 6: Vintage Giấy Kraft ============ */
.tpl-kraft { background: #d9c7a7; }
.tpl-kraft .card { background-color: var(--c-bg); background-image: radial-gradient(rgba(107,74,50,.07) 1px, transparent 1.2px), radial-gradient(rgba(255,255,255,.35) 1px, transparent 1.2px); background-size: 7px 7px, 11px 11px; background-position: 0 0, 3px 5px; }
.tpl-kraft .hero-names { color: var(--c-primary); }
.tpl-kraft .sec-title { color: var(--c-accent); }
.tpl-kraft .event { border-style: dashed; border-width: 2px; border-color: var(--c-accent-50); border-radius: 4px; box-shadow: 3px 3px 0 var(--c-primary-15); }
.tpl-kraft .person .ph { border-radius: 4px; border: 8px solid #fff; border-bottom-width: 26px; transform: rotate(-2deg); box-shadow: 0 8px 20px rgba(0,0,0,.15); }
.tpl-kraft .person:nth-child(3) .ph { transform: rotate(2deg); }
.tpl-kraft .op-envelope { background: radial-gradient(circle at 50% 30%, #f6ecda, #dcc6a2); }
.tpl-kraft .env-back, .tpl-kraft .env-front { background-color: #c9a77c; }
.tpl-kraft .env-flap { background: #b8936a; }
.tpl-kraft .env-seal { background: radial-gradient(circle at 35% 30%, #d77c62, var(--c-accent) 60%, #7e3b28); color: #fbe9dc; border-radius: 50% 46% 52% 48%; }
.tpl-kraft .btn { border-radius: 4px; }
.tpl-kraft .cd div { border-radius: 4px; background: var(--c-primary); }
.tpl-kraft .al-it { border: 6px solid #fff; border-radius: 2px; box-shadow: 0 4px 10px rgba(0,0,0,.12); }

/* ============ Mẫu 7: Đen Trắng Hiện Đại ============ */
.tpl-den-trang { background: #e9e9e9; }
.tpl-den-trang .sec { text-align: left; }
.tpl-den-trang .sec-title { font-family: var(--f-sans); font-weight: 700; text-transform: uppercase; font-size: 28px; letter-spacing: .04em; border-bottom: 3px solid var(--c-text); padding-bottom: 8px; }
.tpl-den-trang .sec-intro, .tpl-den-trang .sec-families, .tpl-den-trang .sec-cd, .tpl-den-trang .sec-thanks, .tpl-den-trang .sec-couple, .tpl-den-trang .sec-cal { text-align: center; }
.tpl-den-trang .sec-couple .sec-title { border: 0; }
.tpl-den-trang .quote { font-family: var(--f-sans); font-style: normal; font-weight: 300; font-size: 22px; text-transform: uppercase; letter-spacing: .04em; }
.tpl-den-trang .event { border-radius: 0; border: 0; border-left: 6px solid var(--c-text); box-shadow: none; text-align: left; }
.tpl-den-trang .ev-date { justify-content: flex-start; }
.tpl-den-trang .ev-date .m { text-align: left; width: auto; }
.tpl-den-trang .ev-date .d { border: 0; padding: 0 10px 0 0; font-family: var(--f-sans); font-weight: 700; order: -1; }
.tpl-den-trang .ev-btns { justify-content: flex-start; }
.tpl-den-trang .btn { border-radius: 0; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; font-weight: 700; }
.tpl-den-trang .person .ph { border-radius: 0; box-shadow: none; border: 0; width: 100%; max-width: 320px; height: auto; aspect-ratio: 4 / 5; }
.tpl-den-trang .person .ph img { filter: grayscale(1); }
.tpl-den-trang .person h3 { font-size: 46px; }
.tpl-den-trang .cd div { border-radius: 0; }
.tpl-den-trang .cal, .tpl-den-trang .gift-card, .tpl-den-trang .wish, .tpl-den-trang .form input, .tpl-den-trang .form select, .tpl-den-trang .form textarea, .tpl-den-trang .choice span { border-radius: 0; box-shadow: none; }
.tpl-den-trang .cal-g .on::before { content: ""; inset: 50% auto auto 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; background: var(--c-text); animation: none; padding: 0; }
.tpl-den-trang .al-it { border-radius: 0; }
.tpl-den-trang .fab-b { border-radius: 0; }

/* ============ Mẫu 8: Tím Lavender Mộng Mơ ============ */
.tpl-lavender { background: #e4dcf3; }
.tpl-lavender .card { background-image: radial-gradient(circle at 100% 10%, var(--c-accent-50), transparent 28%), radial-gradient(circle at 0 70%, var(--c-accent-20), transparent 35%); }
.tpl-lavender .hero-names { font-size: 56px; }
.tpl-lavender .op-curtain .cur { background-color: #efe8fb; }
.tpl-lavender .event { border-radius: 24px; }
.tpl-lavender .cd div { background: linear-gradient(160deg, var(--c-accent), var(--c-primary)); }
.tpl-lavender .person .ph { border-radius: 50%; width: 200px; height: 200px; }

/* ============ Mẫu 9: Biển Xanh Mùa Hè ============ */
.tpl-bien-xanh { background: #cfe6ea; }
.tpl-bien-xanh .hero-names { font-size: 44px; }
.tpl-bien-xanh .sec-title { color: var(--c-primary); }
.tpl-bien-xanh .sec-cd { background: var(--c-primary); color: #fff; margin: 30px 0; }
.tpl-bien-xanh .sec-cd .sec-title { color: #fff; }
.tpl-bien-xanh .sec-cd .cd div { background: rgba(255,255,255,.15); border: 1px solid rgba(255,255,255,.5); }
.tpl-bien-xanh .sec-cd::before, .tpl-bien-xanh .sec-cd::after { content: ""; position: absolute; left: 0; right: 0; height: 18px; background: radial-gradient(circle at 10px -4px, transparent 12px, var(--c-primary) 13px) repeat-x; background-size: 20px 18px; }
.tpl-bien-xanh .sec-cd::before { top: -17px; transform: rotate(180deg); }
.tpl-bien-xanh .sec-cd::after { bottom: -17px; }
.tpl-bien-xanh .event { border-radius: 18px; border: 0; border-bottom: 4px solid var(--c-accent); }
.tpl-bien-xanh .btn.ghost { border-color: var(--c-accent); color: var(--c-accent); }
.tpl-bien-xanh .person .ph { border-radius: 50%; width: 200px; height: 200px; }

/* ============ Mẫu 10: Lục Bảo Song Hỷ ============ */
.tpl-luc-bao { background: #0f3a2f; }
.tpl-luc-bao .hero-frame { background: var(--c-primary); color: #fff; background-image: radial-gradient(circle at 50% 0, rgba(255,255,255,.14), transparent 60%); }
.tpl-luc-bao .hero-frame .kicker, .tpl-luc-bao .hero-frame .hero-names .amp { color: var(--c-accent); }
.tpl-luc-bao .hero-frame .hero-names, .tpl-luc-bao .hero-frame .hero-date { color: #fff; }
.tpl-luc-bao .frame { border-color: var(--c-accent); }
.tpl-luc-bao .sec-cd, .tpl-luc-bao .sec-gift { background: var(--c-primary); color: #fff; }
.tpl-luc-bao .sec-cd .sec-title, .tpl-luc-bao .sec-gift .sec-title { color: var(--c-accent); }
.tpl-luc-bao .sec-cd .cd div { background: rgba(255,255,255,.08); border: 1px solid var(--c-accent); }
.tpl-luc-bao .sec-cd .cd b { color: var(--c-accent); }
.tpl-luc-bao .sec-gift .sub { color: rgba(255,255,255,.8); }
.tpl-luc-bao .sec-gift .gift-card { color: var(--c-text); }
.tpl-luc-bao .event { border-top: 4px solid var(--c-accent); }
.tpl-luc-bao .sec-families { background: #fff; margin: 36px 16px 0; border: 1px solid var(--c-accent-50); outline: 1px solid var(--c-accent-50); outline-offset: 5px; }
.tpl-luc-bao .op-envelope { background: radial-gradient(circle at 50% 30%, #fbf8ef, #e7dfc8); }
