/* Trình soạn thiệp và 20 mẫu thiệp. Cỡ chữ trong thiệp theo cqi để co giãn theo bề rộng thiệp. */
.card-editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 24px; align-items: start; }
.preview-sticky { position: sticky; top: 84px; }
.preview-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.card-preview { container-type: inline-size; width: 100%; max-width: 440px; margin: 0 auto; }

@media (max-width: 900px) {
  .card-editor { grid-template-columns: 1fr; }
  .preview-side { order: -1; }
  .preview-sticky { position: static; }
  .card-preview { max-width: 380px; }
}

/* Chọn mẫu */
.template-picker { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.template-option {
  display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 10px; border-radius: 12px; cursor: pointer;
  background: #fff; border: 2px solid var(--line); font: inherit; color: var(--text);
}
.template-option > small { color: var(--muted); font-size: 0.78rem; line-height: 1.35; }
.template-option[aria-checked='true'] { border-color: var(--green); background: var(--green-soft); }

@media (max-width: 520px) {
  .template-picker { grid-template-columns: 1fr; }
  .template-option { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .template-option > small { flex-basis: 100%; }
}

/* Bản nháp */
.draft-save { display: flex; flex-wrap: wrap; gap: 0 12px; align-items: flex-end; }
.draft-save label { flex: 1 1 220px; }
.draft-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.draft-status { min-height: 1.4em; font-size: 0.92rem; color: var(--ok-text); margin: 0 0 8px; }
.draft-status.is-error { color: var(--danger); }
.draft-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.draft-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.draft-item.is-current { border-color: var(--green); }
.draft-item strong, .draft-item small { display: block; }
.draft-item small { color: var(--muted); }
.draft-actions { display: flex; gap: 6px; }

/* ===== Thiệp chung ===== */
/* Giữ tỉ lệ 5:7 khi nội dung ngắn; nội dung dài thì thiệp tự cao thêm (không cắt chữ). */
.wedding-card {
  aspect-ratio: 5 / 7; width: 100%; border-radius: 6px; display: flex; flex-direction: column;
  box-shadow: 0 18px 40px rgba(31, 51, 43, 0.18); text-align: center; overflow-wrap: anywhere;
}
.wedding-card p { margin: 0; }

/* ===== Mẫu 1: Cổ điển ===== */
.card-classic { background: #fbf6ea; color: #3d3528; padding: 4.5cqi; font-family: var(--font-serif); }
.card-classic__frame {
  flex: 1; border: 1.2cqi double #b38e55; padding: 7cqi 7cqi;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3.2cqi;
  background: radial-gradient(circle at 50% 0%, rgba(179, 142, 85, 0.12), transparent 60%);
}
.card-classic__eyebrow { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.3em; font-size: 2.6cqi; color: #765a2e; }
.card-classic__names { display: flex; flex-direction: column; font-size: 8.4cqi; line-height: 1.15; color: #2f4a3f; font-weight: 500; }
.card-classic__amp { font-family: var(--font-script); color: #b38e55; font-size: 9cqi; line-height: 1; }
.card-classic__divider { display: flex; align-items: center; gap: 3cqi; width: 60%; color: #b38e55; font-size: 4cqi; }
.card-classic__divider::before, .card-classic__divider::after { content: ''; flex: 1; height: 1px; background: #b38e55; }
.card-classic__photo { width: 36cqi; height: 36cqi; border-radius: 50%; object-fit: cover; border: 0.7cqi solid #fff; box-shadow: 0 0 0 0.45cqi #b38e55, 0 1.5cqi 4cqi rgba(47, 74, 63, 0.18); margin: 1cqi 0 2cqi; }
.card-classic__invitation { font-style: italic; font-size: 3.5cqi; line-height: 1.5; max-width: 90%; }
.card-classic__when { display: flex; flex-direction: column; gap: 0.6cqi; font-size: 3.5cqi; font-family: var(--font-sans); }
.card-classic__time { font-weight: 600; color: #2f4a3f; }
.card-classic__venue { font-family: var(--font-sans); font-size: 3.2cqi; line-height: 1.45; }
.card-classic__venue-name { font-weight: 600; color: #2f4a3f; font-size: 3.6cqi; }
.card-classic__map { display: inline-block; margin-top: 1.5cqi; color: #8c6d3e; font-size: 3cqi; }

/* ===== Mẫu 2: Hiện đại ===== */
.card-modern {
  background: linear-gradient(160deg, #24382f 0%, #2f4a3f 60%, #3c5c4e 100%); color: #f3ecdc;
  padding: 10cqi 8cqi; font-family: var(--font-sans);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4cqi;
}
.card-modern__eyebrow { font-size: 2.8cqi; letter-spacing: 0.22em; text-transform: uppercase; color: #cdb88f; }
.card-modern__names { display: flex; flex-direction: column; font-size: 9cqi; font-weight: 600; line-height: 1.1; letter-spacing: -0.01em; }
.card-modern__plus { font-weight: 400; color: #cdb88f; font-size: 6cqi; margin: 1cqi 0; }
.card-modern__invitation { font-size: 3.4cqi; line-height: 1.55; color: #dcd4c2; max-width: 92%; }
.card-modern__date { display: grid; grid-template-columns: 1fr 1fr 1.4fr; width: 78%; border-top: 1px solid rgba(243, 236, 220, 0.35); border-bottom: 1px solid rgba(243, 236, 220, 0.35); }
.card-modern__date div { padding: 2.5cqi 0; display: flex; flex-direction: column; }
.card-modern__date div + div { border-left: 1px solid rgba(243, 236, 220, 0.35); }
.card-modern__date small { font-size: 2.4cqi; text-transform: uppercase; letter-spacing: 0.15em; color: #cdb88f; }
.card-modern__date strong { font-size: 7cqi; font-weight: 500; font-family: var(--font-serif); }
.card-modern__when { font-size: 3.4cqi; }
.card-modern__venue { font-size: 3.2cqi; line-height: 1.45; color: #dcd4c2; }
.card-modern__venue-name { font-weight: 600; color: #f3ecdc; font-size: 3.7cqi; }
.card-modern__map { display: inline-block; margin-top: 2cqi; padding: 1.4cqi 4cqi; border-radius: 999px; border: 1px solid #cdb88f; color: #f3ecdc; text-decoration: none; font-size: 3cqi; }

/* ===== Mẫu 3: Truyền thống ===== */
.card-traditional {
  background: #f5ead4; color: #5b1712; padding: 4cqi; font-family: var(--font-serif);
  background-image: radial-gradient(rgba(163, 36, 28, 0.06) 1px, transparent 1px); background-size: 3cqi 3cqi;
}
.card-traditional__border {
  flex: 1; border: 0.9cqi solid #a3241c; outline: 0.4cqi solid #c9a45c; outline-offset: -2.4cqi;
  padding: 6cqi 7cqi; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.2cqi;
}
.card-traditional__symbol { font-size: 15cqi; line-height: 1; color: #a3241c; font-family: 'Noto Serif SC', 'SimSun', 'Songti SC', serif; }
.card-traditional__eyebrow { font-size: 4.2cqi; letter-spacing: 0.25em; text-transform: uppercase; color: #a3241c; font-weight: 600; }
.card-traditional__names { font-size: 7.6cqi; font-family: var(--font-script); color: #5b1712; line-height: 1.15; font-weight: 600; }
.card-traditional__amp { font-size: 3.2cqi; font-style: italic; color: #8a5a2b; }
.card-traditional__photo { width: 34cqi; height: 34cqi; border-radius: 50%; object-fit: cover; border: 0.7cqi solid #fffaf0; box-shadow: 0 0 0 0.5cqi #a3241c, 0 1.5cqi 4cqi rgba(110, 30, 25, 0.2); margin: 1.5cqi 0 2.5cqi; }
.card-traditional__invitation { font-size: 3.3cqi; line-height: 1.5; max-width: 92%; color: #4a2a1f; }
.card-traditional__when { font-size: 3.4cqi; font-family: var(--font-sans); color: #5b1712; font-weight: 500; }
.card-traditional__venue { font-size: 3.1cqi; font-family: var(--font-sans); line-height: 1.45; color: #4a2a1f; }
.card-traditional__venue-name { font-weight: 600; color: #a3241c; font-size: 3.5cqi; }
.card-traditional__map { display: inline-block; margin-top: 1.5cqi; color: #a3241c; font-size: 3cqi; }

/* ===== Lưu & chia sẻ ===== */
.save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 8px; }
.publish-box { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.status-line { margin-bottom: 12px; }
.share-box { background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin-bottom: 14px; }
.share-box > label { margin-bottom: 6px; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { margin-top: 0; flex: 1; min-width: 0; font-size: 0.9rem; }
.qr-row { display: flex; gap: 14px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.qr-row img { width: 148px; height: 148px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.qr-row div { flex: 1 1 180px; }
.publish-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }

/* ===== Thiệp của tôi ===== */
.my-cards-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.my-cards-header h1 { margin-bottom: 0.2rem; }
.card-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 16px; }
.card-list > .state-box { grid-column: 1 / -1; }
.card-item { display: flex; gap: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card-item__thumb { flex: 0 0 120px; max-width: 120px; margin: 0; }
.card-item__thumb .wedding-card { box-shadow: 0 4px 12px rgba(31, 51, 43, 0.15); pointer-events: none; }
.card-item__body { flex: 1; min-width: 0; }
.card-item__title { font-size: 1.15rem; margin-bottom: 6px; overflow-wrap: anywhere; }
.card-item__body p { margin-bottom: 6px; }
.card-item__link { overflow-wrap: anywhere; }
.card-item__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 420px) {
  .card-item__thumb { flex-basis: 88px; max-width: 88px; }
}
.dialog-preview { width: min(600px, calc(100vw - 24px)); }
.preview-modes { display: flex; gap: 6px; margin-bottom: 12px; }
.preview-modes [aria-pressed='true'] { background: var(--green); color: var(--cream); border-color: var(--green); }
.preview-frame { margin: 0 auto; transition: max-width 0.2s ease; }

/* ===== Trang khách xem thiệp ===== */
.public-card-page { background: radial-gradient(circle at 50% 0%, #fbf6ea, var(--cream-2)); }
.public-card-main { display: flex; justify-content: center; align-items: flex-start; padding: clamp(16px, 5vw, 48px) 16px; }
.public-card { max-width: 520px; }
.public-card-footer { text-align: center; padding: 8px 16px 24px; font-size: 0.85rem; color: var(--muted); }
.public-card-footer p { margin: 0; }

/* ===== Màu nhấn & kiểu chữ trong phạm vi mẫu ===== */
.card-theme { --tpl-accent: #2f4a3f; }
.tpl-co-dien, .card-theme:has(.card-classic) { --tpl-accent: #8c6d3e; }
.tpl-truyen-thong, .card-theme:has(.card-traditional) { --tpl-accent: #a3241c; }
.tpl-hong-dat, .card-theme:has(.card-rose) { --tpl-accent: #a8604f; }
.tpl-vang-nhat, .card-theme:has(.card-gold) { --tpl-accent: #96773a; }
.tpl-tap-chi, .card-theme:has(.card-mag) { --tpl-accent: #1f332b; }
.theme-accent-xanh-tram { --accent: #2f4a3f; }
.theme-accent-hong-dat { --accent: #a8604f; }
.theme-accent-vang-nhat { --accent: #96773a; }
.theme-accent-do-son { --accent: #a3241c; }
.theme-accent-xanh-khoi { --accent: #476472; }
.card-theme { --a: var(--accent, var(--tpl-accent)); }
.card-theme:not(.theme-accent-mac-dinh) .wedding-card:not(.card-modern):not(.premium) .card-names { color: var(--a); }
.card-theme:not(.theme-accent-mac-dinh) .card-modern { background: linear-gradient(160deg, var(--a), #1f2a26); }
.theme-font-co-chan .card-names { font-family: var(--font-serif); font-style: normal; }
.theme-font-khong-chan .card-names { font-family: var(--font-sans); font-style: normal; letter-spacing: -0.01em; }
.theme-font-viet-tay .card-names { font-family: var(--font-script); font-style: normal; }

/* ảnh trong bìa */
.wedding-card .photo { object-fit: cover; display: block; }
.monogram {
  display: grid; place-items: center; font-family: var(--font-script); color: #fff;
  background: linear-gradient(135deg, var(--a, #a8604f), #d9b8a8);
}
.card-classic__avatars { display: flex; gap: 3cqi; justify-content: center; }
.card-classic__avatars .avatar { width: 16cqi; height: 16cqi; border-radius: 50%; object-fit: cover; border: 0.8cqi solid #e8d9b8; }
.card-modern__photo { width: 60%; aspect-ratio: 4 / 3; border-radius: 3cqi; border: 0.6cqi solid rgba(243, 236, 220, 0.5); }

/* ===== Mẫu 4: Hồng đất ===== */
.card-rose {
  position: relative; overflow: hidden; background: #f8ece6; color: #5a3a31; padding: 10cqi 8cqi;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3cqi; font-family: var(--font-sans);
}
.card-rose__petal { position: absolute; width: 60cqi; height: 60cqi; border-radius: 50%; background: rgba(168, 96, 79, 0.12); }
.card-rose__petal--a { top: -22cqi; left: -20cqi; }
.card-rose__petal--b { bottom: -26cqi; right: -22cqi; background: rgba(214, 180, 120, 0.18); }
.card-rose > :not(.card-rose__petal) { position: relative; }
.card-rose__photo { width: 42cqi; height: 42cqi; border-radius: 50%; border: 1.2cqi solid #fff; box-shadow: 0 2cqi 6cqi rgba(90, 58, 49, 0.18); font-size: 10cqi; }
.card-rose__eyebrow { font-size: 2.8cqi; letter-spacing: 0.22em; text-transform: uppercase; color: #8f4c3d; }
.card-rose__names { font-family: var(--font-script); font-size: 9.5cqi; line-height: 1.15; color: #a8604f; font-weight: 600; }
.card-rose__invitation { font-size: 3.3cqi; line-height: 1.55; max-width: 90%; }
.card-rose__when { font-size: 3.4cqi; }
.card-rose__venue { font-size: 3.1cqi; line-height: 1.45; }
.card-rose__venue-name { font-weight: 600; font-size: 3.5cqi; }
.card-rose__map { color: #a8604f; font-size: 3cqi; }

/* ===== Mẫu 5: Tạp chí ===== */
.card-mag { background: #fbfaf6; color: #1f2420; padding: 7cqi; text-align: left; font-family: var(--font-sans); display: flex; flex-direction: column; gap: 3cqi; }
.card-mag__top { display: flex; justify-content: space-between; border-bottom: 0.4cqi solid #1f2420; padding-bottom: 2cqi; font-size: 2.6cqi; letter-spacing: 0.2em; text-transform: uppercase; }
.card-mag__photo { width: 100%; aspect-ratio: 16 / 10; font-size: 12cqi; }
.card-mag__kicker { font-size: 3cqi; text-transform: uppercase; letter-spacing: 0.25em; color: #6b6a60; }
.card-mag__names { font-family: var(--font-serif); font-size: 10cqi; line-height: 1.02; margin: 0; color: #1f2420; font-weight: 600; }
.card-mag__names em { font-style: italic; font-weight: 500; font-size: 0.6em; color: #8c6d3e; }
.card-mag__invitation { font-size: 3.3cqi; line-height: 1.5; border-left: 0.8cqi solid #8c6d3e; padding-left: 3cqi; }
.card-mag__facts { display: grid; grid-template-columns: auto 1fr; gap: 1cqi 3cqi; font-size: 3.1cqi; margin: 0; }
.card-mag__facts dt { text-transform: uppercase; letter-spacing: 0.12em; font-size: 2.5cqi; color: #6b6a60; padding-top: 0.5cqi; }
.card-mag__facts dd { margin: 0; }
.card-mag__map { font-size: 3cqi; color: #1f2420; }

/* ===== Mẫu 6: Vàng nhạt ===== */
.card-gold { background: #fdf8ea; color: #3e3626; display: flex; flex-direction: column; font-family: var(--font-sans); }
.card-gold__hero { height: 48cqi; border-bottom: 0.6cqi solid #e2cf96; }
.card-gold__photo { width: 100%; height: 100%; font-size: 14cqi; }
.card-gold__body { flex: 1; margin: 4cqi; border: 0.3cqi solid #d9c386; padding: 6cqi 6cqi; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqi; }
.card-gold__eyebrow { font-size: 2.6cqi; letter-spacing: 0.24em; text-transform: uppercase; color: #765c26; }
.card-gold__names { font-family: var(--font-serif); font-size: 8cqi; line-height: 1.15; color: #3e3626; }
.card-gold__amp { font-family: var(--font-script); color: #96773a; }
.card-gold__when { font-size: 3.4cqi; font-weight: 600; color: #765c26; }
.card-gold__invitation { font-size: 3.2cqi; line-height: 1.5; }
.card-gold__venue { font-size: 3.1cqi; line-height: 1.45; }
.card-gold__venue-name { font-weight: 600; font-size: 3.5cqi; }
.card-gold__map { color: #96773a; font-size: 3cqi; }

/* ===== Các mục bên dưới bìa ===== */
.card-page { display: flex; flex-direction: column; gap: 14px; }
.card-section {
  background: #fffdf8; border: 1px solid #eadfca; border-top: 3px solid var(--a); border-radius: 10px;
  padding: 18px 18px 14px; text-align: center; font-size: 0.95rem; line-height: 1.6; color: #3a362e;
}
.card-section__title { font-family: var(--font-serif); font-size: 1.2rem; color: var(--a); margin: 0 0 10px; }
.card-section p { margin: 0 0 6px; }
.event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.event-item { padding-bottom: 10px; border-bottom: 1px dashed #eadfca; }
.event-item:last-child { border-bottom: 0; padding-bottom: 0; }
.event-item__name { font-weight: 600; color: var(--a); }
.event-item__address { color: #6b6a60; font-size: 0.9rem; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 140px), 1fr)); gap: 6px; }
.album-photo { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; }
.contact-list { list-style: none; padding: 0; margin: 0 0 6px; }
.contact-note { color: #6b6a60; font-size: 0.9rem; }
.card-section form { text-align: left; }
.card-section .btn { margin-top: 4px; }
.wish-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; text-align: left; }
.wish-list li { background: #fbf6ea; border-radius: 8px; padding: 10px 12px; }
.wish-list strong { display: block; color: var(--a); }
.wish-list p { margin: 0; overflow-wrap: anywhere; }
.slot-preview { color: #6b6a60; font-size: 0.9rem; }
.slot-preview .btn { pointer-events: none; }

/* ===== Trình chỉnh sửa: ảnh, sự kiện, xem trước ===== */
.events-box { display: grid; gap: 12px; margin-bottom: 10px; }
.event-row .btn { margin-bottom: 8px; }
.photo-slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 12px; }
.photo-slot { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photo-slot__label { font-weight: 600; margin: 0; font-size: 0.92rem; }
.photo-slot__img, .photo-slot__empty { width: 100%; aspect-ratio: 1; border-radius: 10px; object-fit: cover; border: 1px solid var(--line); }
.photo-slot__empty { display: grid; place-items: center; background: var(--cream); color: var(--muted); font-size: 1.6rem; }
.file-btn { position: relative; cursor: pointer; }
.album-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 10px; }
.album-item { position: relative; }
.album-item img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.album-remove { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, 0.9); width: 30px; height: 30px; }
.preview-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.preview-scroll { max-height: calc(100vh - 140px); overflow-y: auto; padding: 4px 4px 16px; border-radius: 10px; }
.card-preview { transition: max-width 0.2s ease; }
@media (max-width: 900px) { .preview-scroll { max-height: 70vh; } }

/* ===== Bộ sưu tập ===== */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 22px; }
.gallery-item { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.gallery-item h2 { font-size: 1.2rem; margin: 6px 0 0; }
.gallery-item > p { margin: 0; flex: 1; }
.gallery-thumb { max-width: 100%; }
.gallery-item .btn { align-self: flex-start; }

/* ===== Bộ Di Sản Việt (mẫu cao cấp) ===== */
.card-theme { --font-display: 'Cormorant Garamond', 'Playfair Display', 'Noto Serif', 'Times New Roman', serif; --font-vibes: 'Great Vibes', 'Dancing Script', 'Playfair Display', 'Times New Roman', serif; }
.tpl-ngoc-luc-bao, .card-theme:has(.card-emerald) { --tpl-accent: #1f5a45; }
.tpl-nhung-do, .card-theme:has(.card-velvet) { --tpl-accent: #7a1a24; }
.tpl-sen-hong, .card-theme:has(.card-lotus) { --tpl-accent: #b4607c; }
.tpl-o-thuoc, .card-theme:has(.card-starry) { --tpl-accent: #1d2f63; }
.tpl-dong-duong, .card-theme:has(.card-indo) { --tpl-accent: #2f6f6b; }
.tpl-trau-cau, .card-theme:has(.card-betel) { --tpl-accent: #3f6b45; }

.wedding-card--tall { aspect-ratio: 9 / 16; }
/* overflow: clip (không phải hidden): vẫn cắt họa tiết tràn mép nhưng không thành vùng cuộn,
   nên aspect-ratio cho phép bìa tự cao thêm khi nội dung dài (tên dài, có ảnh) thay vì cắt chữ. */
.premium { position: relative; overflow: clip; text-align: center; align-items: center; }
.premium > * { position: relative; }
.premium p { margin: 0; }

/* Chữ ánh kim: dải màu vàng chuyển động chậm; tắt khi khách bật giảm chuyển động */
.foil {
  background: linear-gradient(105deg, #a07c36 0%, #f6e7b4 18%, #c19a48 34%, #fff3cf 50%, #b48c3e 66%, #f0dca0 82%, #9c7833 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text;
  color: transparent; -webkit-text-fill-color: transparent;
  animation: tc-foil 7s ease-in-out infinite alternate;
}
@keyframes tc-foil { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@media (prefers-reduced-motion: reduce) { .foil { animation: none; } }
.premium .card-names { line-height: 1.05; }

/* Góc trang trí: một hình, lật cho bốn góc */
.card-emerald__corner, .card-velvet__corner { position: absolute !important; width: 26cqi; height: 26cqi; pointer-events: none; }
.card-emerald__corner { width: 17cqi; height: 17cqi; opacity: .85; }
.card-emerald__corner--tl, .card-velvet__corner--tl { top: 3cqi; left: 3cqi; }
.card-emerald__corner--tr, .card-velvet__corner--tr { top: 3cqi; right: 3cqi; transform: scaleX(-1); }
.card-emerald__corner--bl, .card-velvet__corner--bl { bottom: 3cqi; left: 3cqi; transform: scaleY(-1); }
.card-emerald__corner--br, .card-velvet__corner--br { bottom: 3cqi; right: 3cqi; transform: scale(-1, -1); }

/* --- 1. Ngọc Lục Bảo --- */
.card-emerald {
  background: radial-gradient(120% 80% at 50% 0%, #1d4a3b 0%, #0f2a22 55%, #0a1d17 100%);
  color: #e9dcb5; padding: 11cqi 9cqi 18cqi; gap: 2.6cqi; font-family: var(--font-display);
}
.card-emerald__eyebrow { font-size: 2.8cqi; letter-spacing: 0.26em; margin-top: 4cqi !important; text-transform: uppercase; font-weight: 600; }
.card-emerald__arch { position: relative; width: 66cqi; aspect-ratio: 300 / 470; margin: 1cqi 0; }
.card-emerald__window { position: absolute; left: 13.33%; width: 73.34%; top: 12.77%; height: 72.34%; border-radius: 9999px 9999px 0 0; overflow: hidden; }
.card-emerald__frame { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-emerald__photo { width: 100%; height: 100%; font-size: 13cqi; }
.card-emerald .monogram { background: linear-gradient(160deg, #24584a, #12342b); color: #e9d9a6; font-family: var(--font-vibes); }
.card-emerald__names { font-family: var(--font-vibes); font-size: 11cqi; display: flex; flex-direction: column; margin-top: -2cqi; }
.card-emerald__amp { font-size: 0.6em; }
.card-emerald__date { display: flex; align-items: center; gap: 3cqi; width: 78%; font-size: 5cqi; letter-spacing: 0.12em; }
.card-emerald__rule { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, #c9a95a, transparent); }
.card-emerald__when { font-size: 3.6cqi; font-style: italic; }
.card-emerald__venue { font-size: 3.3cqi; line-height: 1.45; font-family: var(--font-sans); color: #d9cba2; }
.card-emerald__venue-name { font-weight: 600; font-size: 3.6cqi; color: #f1e3b8; }
.card-emerald__map { color: #e9d9a6; font-size: 3cqi; }

/* --- 2. Nhung Đỏ Hồi Văn --- */
.card-velvet {
  background:
    url('/assets/orn/van-sen.svg') 0 0 / 16cqi 16cqi,
    radial-gradient(110% 70% at 50% 35%, #6e1520 0%, #4a0c14 55%, #2c060b 100%);
  color: #f1dfb6; padding: 13cqi 10cqi 22cqi; gap: 2.2cqi; font-family: var(--font-display);
}
.card-velvet__seal { position: relative; width: 26cqi; height: 26cqi; display: grid; place-items: center; }
.card-velvet__ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.card-velvet__hy { font-size: 12cqi; line-height: 1; font-family: 'Noto Serif SC', 'SimSun', 'Songti SC', serif; }
.card-velvet__eyebrow { font-size: 4cqi; letter-spacing: 0.32em; text-transform: uppercase; font-weight: 600; }
.card-velvet__photo { width: 34cqi; height: 42cqi; border-radius: 50%; border: 0.8cqi solid #c9a95a; box-shadow: 0 0 0 1.6cqi rgba(201, 169, 90, 0.18); }
.card-velvet__name { font-family: var(--font-vibes); font-size: 11.5cqi; }
.card-velvet__cung { font-size: 3.4cqi; font-style: italic; color: #d8c08a; letter-spacing: 0.2em; }
.card-velvet__invitation { font-size: 3.4cqi; line-height: 1.5; max-width: 88%; color: #ead6ad; font-style: italic; }
.card-velvet__info { width: 86%; border: 0.4cqi solid rgba(201, 169, 90, 0.6); border-radius: 2cqi; padding: 3.4cqi 4cqi; margin-top: 1cqi; display: flex; flex-direction: column; gap: 1.4cqi; }
.card-velvet__info-title { font-size: 3.4cqi; letter-spacing: 0.24em; text-transform: uppercase; font-weight: 600; }
.card-velvet__when { font-size: 3.4cqi; font-family: var(--font-sans); color: #f1dfb6; }
.card-velvet__venue { font-size: 3.1cqi; line-height: 1.45; font-family: var(--font-sans); color: #e2cda0; }
.card-velvet__venue-name { font-weight: 600; font-size: 3.4cqi; color: #f6e7c2; }
.card-velvet__map { color: #f1dfb6; font-size: 3cqi; }

/* --- 3. Sen Hồng --- */
.card-lotus { background: radial-gradient(120% 90% at 30% 10%, #fff8f6 0%, #fbf3ec 50%, #f6ebe0 100%); color: #6b4552; padding: 9cqi 8cqi; font-family: var(--font-display); justify-content: center; }
.card-lotus__bouquet { position: absolute !important; top: -4cqi; left: -6cqi; width: 44cqi; pointer-events: none; }
.card-lotus__bud { position: absolute !important; bottom: -3cqi; right: -2cqi; width: 26cqi; pointer-events: none; }
.card-lotus__frame { flex: 1; width: 100%; border: 0.35cqi solid #d4b67a; outline: 0.2cqi solid #d4b67a; outline-offset: -2.2cqi; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqi; padding: 34cqi 7cqi 14cqi; }
.card-lotus__eyebrow { font-size: 3cqi; letter-spacing: 0.32em; text-transform: uppercase; color: #8f6438; font-weight: 600; }
.card-lotus__photo { width: 36cqi; height: 46cqi; border-radius: 50%; border: 0.6cqi solid #e2c79a; }
.card-lotus__names { font-family: var(--font-vibes); font-size: 12cqi; display: flex; flex-direction: column; }
.card-lotus .foil { background-image: linear-gradient(105deg, #a8546e 0%, #f3c4cf 20%, #c9708a 38%, #fbe3e8 52%, #b85d79 68%, #e9a9b9 84%, #9c4762 100%); }
.card-lotus__amp { font-size: 0.6em; }
.card-lotus__divider { width: 30%; height: 1px; background: linear-gradient(90deg, transparent, #d4b67a, transparent); }
.card-lotus__invitation { font-size: 3.5cqi; line-height: 1.5; font-style: italic; max-width: 92%; }
.card-lotus__date { font-size: 5cqi; letter-spacing: 0.12em; color: #a35872; font-weight: 600; }
.card-lotus__when { font-size: 3.4cqi; font-style: italic; }
.card-lotus__venue { font-size: 3.1cqi; line-height: 1.45; font-family: var(--font-sans); }
.card-lotus__venue-name { font-weight: 600; font-size: 3.4cqi; color: #8c4560; }
.card-lotus__map { color: #a35872; font-size: 3cqi; }

/* --- 4. Cầu Ô Thước --- */
.card-starry {
  background:
    radial-gradient(1px 1px at 12% 30%, #fff8 50%, transparent 51%),
    radial-gradient(1px 1px at 78% 62%, #fff8 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 30% 78%, #fffa 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 88%, #fff7 50%, transparent 51%),
    radial-gradient(120% 70% at 50% 0%, #1d2f63 0%, #0d1838 55%, #070e24 100%);
  color: #e6dcc0; padding: 6cqi 8cqi 9cqi; gap: 2.4cqi; font-family: var(--font-display);
}
.card-starry__bridge { width: 104%; margin: 0 -2%; }
.card-starry__tag { font-size: 3.6cqi; font-style: italic; color: #d9c79a; margin-top: -4cqi !important; }
.card-starry__orbit { width: 40cqi; height: 40cqi; border-radius: 50%; padding: 1.2cqi; background: conic-gradient(from 210deg, #a07c36, #f6e7b4, #c19a48, #fff3cf, #a07c36); box-shadow: 0 0 6cqi rgba(246, 231, 180, 0.28); }
.card-starry__photo { width: 100%; height: 100%; border-radius: 50%; font-size: 11cqi; }
.card-starry .monogram { background: radial-gradient(circle at 40% 35%, #2a3f7a, #101b40); color: #f3e2a9; font-family: var(--font-vibes); }
.card-starry__names { font-family: var(--font-vibes); font-size: 11.5cqi; display: flex; flex-direction: column; }
.card-starry__amp { font-size: 0.55em; }
.card-starry__invitation { font-size: 3.4cqi; line-height: 1.5; font-style: italic; max-width: 92%; color: #cfc4a6; }
.card-starry__date { font-size: 6cqi; letter-spacing: 0.14em; font-weight: 600; }
.card-starry__when { font-size: 3.4cqi; font-style: italic; }
.card-starry__venue { font-size: 3.1cqi; line-height: 1.45; font-family: var(--font-sans); color: #cfc4a6; }
.card-starry__venue-name { font-weight: 600; font-size: 3.4cqi; color: #f3e6c0; }
.card-starry__map { color: #f3e2a9; font-size: 3cqi; }

/* --- 5. Gạch Bông Đông Dương --- */
.card-indo { background: #f4ecd9; color: #23443f; font-family: var(--font-display); padding: 0; }
.card-indo__band { flex: none; width: 100%; height: 11cqi; background: url('/assets/orn/gach-bong.svg') 0 0 / 11cqi 11cqi; border-block: 0.8cqi solid #2f6f6b; }
.card-indo__body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqi; padding: 6cqi 9cqi; }
.card-indo__eyebrow { font-size: 3cqi; letter-spacing: 0.3em; text-transform: uppercase; color: #855c1c; font-weight: 600; }
.card-indo__window { width: 54cqi; height: 64cqi; border-radius: 9999px 9999px 1cqi 1cqi; border: 1.2cqi solid #2f6f6b; outline: 0.4cqi solid #c99a2e; outline-offset: -2.6cqi; overflow: hidden; background: #e8dcc0; }
.card-indo__photo { width: 100%; height: 100%; font-size: 13cqi; }
.card-indo .monogram { background: linear-gradient(170deg, #2f6f6b, #1d4a47); color: #f1d58a; font-family: var(--font-vibes); }
.card-indo__names { font-size: 8.6cqi; font-style: italic; font-weight: 600; color: #1f5c5a; display: flex; flex-direction: column; line-height: 1.1; }
.card-indo__amp { font-size: 0.5em; font-style: normal; letter-spacing: 0.3em; color: #855c1c; margin: 0.6cqi 0; }
.card-indo__ornament { font-size: 2.6cqi; color: #c99a2e; letter-spacing: 0.6em; }
.card-indo__invitation { font-size: 3.4cqi; line-height: 1.5; max-width: 92%; font-style: italic; }
.card-indo__date { font-size: 5.4cqi; letter-spacing: 0.12em; font-weight: 600; color: #9a4231; }
.card-indo__when { font-size: 3.4cqi; }
.card-indo__venue { font-size: 3.1cqi; line-height: 1.45; font-family: var(--font-sans); }
.card-indo__venue-name { font-weight: 600; font-size: 3.4cqi; color: #1f5c5a; }
.card-indo__map { color: #b0503c; font-size: 3cqi; }

/* --- 6. Trầu Cau --- */
.card-betel { background: radial-gradient(120% 80% at 50% 0%, #fbf9f0 0%, #f2efdf 60%, #e8e4cd 100%); color: #33493a; padding: 10cqi 8cqi 0; gap: 2.4cqi; font-family: var(--font-display); }
.card-betel__proverb { font-size: 4.2cqi; font-style: italic; color: #8a6a2c; }
.card-betel__thread { width: 22cqi; height: 0.6cqi; border-radius: 1cqi; background: #b3262e; }
.card-betel__photo { width: 40cqi; height: 40cqi; border-radius: 50%; border: 0.8cqi solid #fff; box-shadow: 0 0 0 0.5cqi #b3262e33, 0 2cqi 5cqi rgba(51, 73, 58, 0.2); }
.card-betel__eyebrow { font-size: 3cqi; letter-spacing: 0.32em; text-transform: uppercase; color: #3f6b45; font-weight: 600; }
.card-betel__names { font-family: var(--font-vibes); font-size: 12cqi; display: flex; flex-direction: column; }
.card-betel .foil { background-image: linear-gradient(105deg, #2f5a37 0%, #6f9a5e 22%, #3f6b45 40%, #a5862f 55%, #3f6b45 72%, #7da56a 86%, #2f5a37 100%); }
.card-betel__amp { font-size: 0.55em; }
.card-betel__invitation { font-size: 3.4cqi; line-height: 1.5; font-style: italic; max-width: 92%; }
.card-betel__date { font-size: 5.4cqi; letter-spacing: 0.12em; font-weight: 600; color: #b3262e; }
.card-betel__when { font-size: 3.4cqi; font-style: italic; }
.card-betel__venue { font-size: 3.1cqi; line-height: 1.45; font-family: var(--font-sans); }
.card-betel__venue-name { font-weight: 600; font-size: 3.4cqi; color: #2f5a37; }
.card-betel__map { color: #b3262e; font-size: 3cqi; }
.card-betel__art { width: 92%; margin-top: auto !important; }

/* Ảnh thu nhỏ trong bộ chọn mẫu của trình soạn */
.template-thumb { display: block; width: 100%; margin-bottom: 6px; border-radius: 6px; overflow: hidden; pointer-events: none; }
.template-thumb .wedding-card { box-shadow: none; border-radius: 4px; }

/* Bộ chọn mẫu: lưới ảnh thu nhỏ thật (thay ô màu) */
.template-picker { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); max-height: 560px; overflow-y: auto; padding: 2px; }
.template-option { cursor: pointer; padding: 6px; gap: 2px; align-items: stretch; text-align: center; }
.template-option > strong { font-size: 0.82rem; line-height: 1.25; }
.template-option > small { display: none; }
.template-option:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.template-option:hover { border-color: var(--gold); }
@media (max-width: 520px) {
  .template-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: 440px; }
  .template-option { flex-direction: column; align-items: stretch; }
}

/* Bộ sưu tập chia nhóm, thẻ cao */
.gallery-group { margin-bottom: 40px; }
.gallery-group__head { margin-bottom: 16px; }
.gallery-group__head h2 { margin-bottom: 4px; }
.gallery-group .gallery { grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.gallery-item h3 { font-size: 1.15rem; margin: 6px 0 0; }

/* Ảnh mẫu trong bộ chọn: cùng một khung tỉ lệ để các ô thẳng hàng */
.template-thumb { aspect-ratio: 5 / 8; background: var(--cream-2); }
.template-thumb > .card-theme { height: 100%; }
.my-cards-header.page-header--wedding::after { order: 9; flex-basis: 100%; max-width: 96px; margin-top: 2px; }

/* ===== Hành trình tình yêu (dòng thời gian) ===== */
.journey-intro { margin-bottom: 14px; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 22px; position: relative; text-align: left; }
.timeline::before { content: ''; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--a), color-mix(in srgb, var(--a) 25%, transparent)); border-radius: 2px; }
.timeline__item { position: relative; padding: 0 0 18px 10px; }
.timeline__item:last-child { padding-bottom: 0; }
.timeline__dot { position: absolute; left: -21px; top: 4px; width: 14px; height: 14px; border-radius: 50%; background: #fffdf8; border: 3px solid var(--a); }
.timeline__item--cuoi .timeline__dot { background: var(--a); }
.timeline__date { font-size: 0.82rem; letter-spacing: 0.06em; color: #8a7a5a; margin: 0 0 2px !important; }
.timeline__title { font-family: var(--font-serif); font-size: 1.08rem; color: var(--a); margin: 0 0 4px; }
.timeline__text { margin: 0 0 8px !important; white-space: pre-line; }
.timeline__photo { margin: 6px 0 0; }

/* Ảnh giữ đúng tỉ lệ gốc: chỉ co theo chiều ngang, không cắt, không kéo méo */
.natural-photo { display: block; width: 100%; height: auto; border-radius: 8px; background: #f1ebdd; }

/* ===== Album xếp cột ===== */
.album-masonry { columns: 2 140px; column-gap: 8px; text-align: left; }
.album-figure { break-inside: avoid; margin: 0 0 8px; }
.album-figure figcaption { font-size: 0.82rem; color: #6b6a60; padding: 4px 2px 0; line-height: 1.4; }

/* ===== Lịch trình ===== */
.event-item { text-align: left; }
.event-item__time { color: #4a4436; }
.event-item__place { display: flex; gap: 10px; align-items: flex-start; margin-top: 4px; }
.venue-tag { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--a); color: #fff; font-size: 0.78rem; font-weight: 700; margin-top: 2px; }
.event-item__venue { font-weight: 600; }
.event-item__links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px !important; }
.event-item__links .btn { margin-top: 0; }
.guide-list { margin: 14px 0 0; padding-top: 12px; border-top: 1px dashed #eadfca; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; text-align: left; font-size: 0.92rem; }
.guide-list dt { font-weight: 600; color: var(--a); }
.guide-list dd { margin: 0; white-space: pre-line; }

/* ===== Trình soạn: cột mốc, album, sự kiện ===== */
.milestone-row .row-tools, .album-item .row-tools { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 4px; }
.milestone-row.is-hidden { opacity: 0.65; }
.milestone-row__photo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 4px 0 10px; }
.milestone-row__photo img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.quick-add { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 12px; }
.album-editor { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important; gap: 12px !important; }
.album-item { display: flex; flex-direction: column; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 6px; }
.album-item.is-cover { border-color: var(--green); box-shadow: 0 0 0 2px var(--green-soft); }
.album-item img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #f4efe4; border-radius: 6px; }
.album-item input { margin-top: 0; min-height: 36px; padding: 6px 8px; font-size: 0.85rem; }
.album-item .badge { align-self: flex-start; }
.map-check { font-size: 0.85rem; }
@media (max-width: 480px) { .album-masonry { columns: 2; } .guide-list { grid-template-columns: 1fr; } }

/* Hộp xác nhận xuất bản: ảnh thu nhỏ của mọi ảnh sẽ công khai (giữ tỉ lệ) */
.public-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 12px; max-height: 260px; overflow-y: auto; }
.public-thumbs figure { margin: 0; }
.public-thumbs img { width: 100%; aspect-ratio: 1; object-fit: contain; background: #f4efe4; border-radius: 6px; border: 1px solid var(--line); }
.public-thumbs figcaption { font-size: 0.75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== Trang soạn thiệp: bố cục nhóm mở/đóng ===== */
.editor-header h1 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.editor-header .lead { margin-bottom: 0; }
.card-editor { grid-template-columns: minmax(0, 1fr) minmax(0, 460px); }
.editor-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-bottom: 12px; }
.editor-group { padding: 0; margin: 0; overflow: clip; }
.editor-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 14px 18px; font-weight: 600; color: var(--green-dark); min-height: 52px;
}
.editor-group > summary::-webkit-details-marker { display: none; }
.editor-group > summary::after { content: '▾'; margin-left: auto; color: var(--muted); transition: transform 0.2s ease; }
.editor-group:not([open]) > summary::after { transform: rotate(-90deg); }
.editor-group > summary:hover { background: var(--cream); }
.editor-group > summary:focus-visible { outline: 3px solid var(--gold); outline-offset: -3px; }
.editor-group[open] > summary { border-bottom: 1px solid var(--line); }
.grp-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: var(--cream); font-size: 0.85rem; flex: none; }
.grp-title { font-family: var(--font-serif); font-size: 1.08rem; }
.grp-sum { font-weight: 400; font-size: 0.85rem; color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 120px; }
.grp-body { padding: 16px 18px 18px; }

/* Mẫu đang chọn */
.current-template { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 14px; align-items: start; margin-bottom: 14px; }
.current-template__thumb { width: 116px; max-width: 116px; margin: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 4px 14px rgba(31, 51, 43, 0.18); }
.current-template__thumb .wedding-card { box-shadow: none; }
.current-template__info p { margin: 0 0 4px; }
.current-template__name { font-family: var(--font-serif); font-size: 1.2rem; color: var(--green-dark); }
.current-template__info .btn { margin-top: 6px; }

/* Thư viện mẫu */
.dialog-library { width: min(1120px, 96vw); max-height: 92vh; padding: 0; overflow: auto; }
.dialog-library > * { margin-left: 20px; margin-right: 20px; }
.library-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--paper); margin: 0; padding: 16px 20px 10px; border-bottom: 1px solid var(--line); }
.library-head h2 { margin: 0; }
.dialog-library > p { margin-top: 10px; }
.library-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.chip { font: inherit; font-size: 0.88rem; font-weight: 600; border: 1px solid var(--line); background: #fff; color: var(--green-dark); border-radius: 999px; padding: 6px 14px; min-height: 36px; cursor: pointer; }
.chip[aria-pressed='true'] { background: var(--green); color: var(--cream); border-color: var(--green); }
.chip:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.library-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 16px; padding-bottom: 20px; }
.library-item { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px; cursor: pointer; }
.library-item:hover { border-color: var(--gold); }
.library-item.is-current { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.library-item__thumb { width: 100%; max-width: none; margin: 0; border-radius: 6px; overflow: hidden; }
.library-item__thumb .wedding-card { box-shadow: none; }
.library-item__info h3 { font-size: 1.02rem; margin: 0 0 4px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.library-item__info p { margin: 0 0 8px; }

/* Khung xem trước bên phải: một vùng cuộn duy nhất, dính dưới header */
.preview-sticky { top: calc(var(--header-h, 64px) + 12px); display: flex; flex-direction: column; max-height: calc(100vh - var(--header-h, 64px) - 24px); }
.preview-head { flex: none; margin-bottom: 8px; }
.preview-modes { flex-wrap: wrap; margin-bottom: 0; }
.preview-note { flex: none; margin: 0 0 6px; }
.preview-note:empty { display: none; }
.preview-scroll { flex: 1; min-height: 0; max-height: none; overflow-y: auto; background: var(--cream-2); border-radius: 12px; padding: 12px; }
.preview-host { width: 100%; }
.stage-viewport { margin: 0 auto; overflow: hidden; border-radius: 10px; }
.stage-canvas { transform-origin: 0 0; min-height: 200px; }
.preview-host[data-device='phone'] .stage-viewport { border-radius: 22px; box-shadow: 0 0 0 7px #1f2a26, 0 10px 30px rgba(0, 0, 0, 0.25); margin: 8px auto; }

/* Xem trước toàn màn hình */
.preview-full { width: 100vw; height: 100vh; max-width: 100vw; max-height: 100vh; margin: 0; padding: 0; border: 0; background: #2a332f; display: none; }
.preview-full[open] { display: flex; flex-direction: column; }
.preview-full::backdrop { background: rgba(0, 0, 0, 0.6); }
.preview-full__bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: var(--paper); border-bottom: 1px solid var(--line); }
.preview-full__body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px; }
.preview-full[data-device='phone'] .preview-full__body { padding-top: 24px; }
.preview-full__body[data-device='phone'] .stage-viewport { border-radius: 22px; box-shadow: 0 0 0 7px #11161a, 0 14px 40px rgba(0, 0, 0, 0.4); }

/* Điện thoại: không chia cột; xem trước mở toàn màn hình bằng nút nổi */
.preview-fab { display: none; }
@media (max-width: 900px) {
  .card-editor { grid-template-columns: minmax(0, 1fr); }
  .preview-side { display: none; }
  .preview-fab { display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 30; box-shadow: 0 8px 24px rgba(31, 51, 43, 0.35); }
  .editor-page .site-footer { padding-bottom: 80px; }
  .current-template { grid-template-columns: 92px minmax(0, 1fr); }
  .current-template__thumb { width: 92px; }
}

/* Sân khấu xem trước: đệm theo thiết bị mô phỏng (trang khách thật dùng 5vw theo màn hình) */
.stage-canvas--phone .public-card-main { padding: 20px 16px; }
.stage-canvas--desktop .public-card-main { padding: 48px 16px; }
.library-head { display: block; }
.library-head__row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.library-head .library-filters { margin-bottom: 0; }

/* ===== Bố cục thiệp: bìa 520px, các mục rộng tới 760px trên màn hình lớn ===== */
.public-card { max-width: 760px; }
.card-page .card-cover { max-width: 520px; width: 100%; margin: 0 auto; }
.card-interact { display: grid; gap: 14px; }

/* ===== Mục bên dưới bìa: lấy màu, font, viền theo từng mẫu ===== */
.card-page {
  --sec-bg: #fffdf8; --sec-text: #3a362e; --sec-muted: #6b6a60; --sec-border: #eadfca;
  --sec-accent: var(--a); --sec-title-font: var(--font-serif); --sec-radius: 10px; --sec-btn-text: #fff;
}
.card-page .card-section {
  background: var(--sec-bg); color: var(--sec-text); border: 1px solid var(--sec-border);
  border-top: 3px solid var(--sec-accent); border-radius: var(--sec-radius);
}
.card-page .card-section__title { font-family: var(--sec-title-font); color: var(--sec-accent); }
.card-page .card-section__title::after { content: ''; display: block; width: 44px; height: 1px; margin: 8px auto 0; background: var(--sec-accent); opacity: 0.6; }
.card-page .event-item, .card-page .guide-list { border-color: var(--sec-border); }
.card-page .event-item__name, .card-page .timeline__title, .card-page .guide-list dt, .card-page .wish-list strong { color: var(--sec-accent); }
.card-page .event-item__address, .card-page .album-figure figcaption, .card-page .timeline__date, .card-page .contact-note, .card-page .slot-preview { color: var(--sec-muted); }
.card-page .event-item__time { color: var(--sec-text); }
.card-page .venue-tag, .card-page .timeline__item--cuoi .timeline__dot { background: var(--sec-accent); color: var(--sec-btn-text); }
.card-page .timeline::before { background: var(--sec-accent); opacity: 0.45; }
.card-page .timeline__dot { background: var(--sec-bg); border-color: var(--sec-accent); }
.card-page .card-section .btn-primary { background: var(--sec-accent); border-color: var(--sec-accent); color: var(--sec-btn-text); }
.card-page .card-section .btn-small { background: transparent; color: var(--sec-accent); border-color: var(--sec-border); }
.card-page .wish-list li { background: color-mix(in srgb, var(--sec-accent) 8%, var(--sec-bg)); }
.card-page .card-section a:not(.btn) { color: var(--sec-accent); }

/* Mẫu nền tối: mục nền tối, chữ và điểm nhấn ánh vàng (màu nhấn tối của khách sẽ chìm nên dùng vàng) */
.tpl-ngoc-luc-bao { --sec-bg: #12322a; --sec-text: #ece0bd; --sec-muted: #c4b78f; --sec-border: rgba(201, 169, 90, 0.4); --sec-accent: #d9b96a; --sec-title-font: var(--font-display); --sec-btn-text: #12322a; }
.tpl-nhung-do { --sec-bg: #4a0c14; --sec-text: #f1dfb6; --sec-muted: #d6bd8e; --sec-border: rgba(201, 169, 90, 0.42); --sec-accent: #e0c27a; --sec-title-font: var(--font-display); --sec-btn-text: #4a0c14; }
.tpl-nhung-do .card-section { background-image: url('/assets/orn/van-sen.svg'); background-size: 64px; }
.tpl-o-thuoc { --sec-bg: #101d44; --sec-text: #e6dcc0; --sec-muted: #b9b096; --sec-border: rgba(233, 207, 138, 0.35); --sec-accent: #e9cf8a; --sec-title-font: var(--font-display); --sec-btn-text: #101d44; }
.tpl-hien-dai { --sec-bg: #2c463b; --sec-text: #f3ecdc; --sec-muted: #cfc6b2; --sec-border: rgba(205, 184, 143, 0.4); --sec-accent: #d7c194; --sec-title-font: var(--font-sans); --sec-btn-text: #22382f; --sec-radius: 4px; }
.tpl-hien-dai .card-section__title { text-transform: uppercase; letter-spacing: 0.14em; font-size: 1rem; }
.card-page:is(.tpl-ngoc-luc-bao, .tpl-nhung-do, .tpl-o-thuoc, .tpl-hien-dai) .card-section input,
.card-page:is(.tpl-ngoc-luc-bao, .tpl-nhung-do, .tpl-o-thuoc, .tpl-hien-dai) .card-section textarea { background: rgba(255, 255, 255, 0.95); color: #2a2a26; }
.card-page:is(.tpl-ngoc-luc-bao, .tpl-nhung-do, .tpl-o-thuoc, .tpl-hien-dai) .card-section label { color: var(--sec-text); }

/* Mẫu nền sáng: giữ nét riêng của từng mẫu */
.tpl-co-dien { --sec-bg: #fbf6ea; --sec-accent: var(--accent, #765a2e); --sec-border: #e3d3ad; }
.tpl-co-dien .card-section { border: 3px double #c7a96b; }
.tpl-truyen-thong { --sec-bg: #f7eedb; --sec-accent: var(--accent, #a3241c); --sec-border: #d8b97a; --sec-text: #4a2a1f; }
.tpl-truyen-thong .card-section { border: 2px solid #a3241c; outline: 1px solid #c9a45c; outline-offset: -6px; }
.tpl-hong-dat { --sec-bg: #fbf1ec; --sec-accent: var(--accent, #96503f); --sec-border: #ecd2c7; --sec-text: #5a3a31; --sec-radius: 18px; }
.tpl-hong-dat .card-section__title { font-style: italic; }
.tpl-tap-chi { --sec-bg: #fbfaf6; --sec-accent: var(--accent, #1f2420); --sec-border: #d8d2c4; --sec-title-font: var(--font-sans); --sec-radius: 0; }
.tpl-tap-chi .card-section { text-align: left; border-top-width: 4px; }
.tpl-tap-chi .card-section__title { text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.95rem; }
.tpl-tap-chi .card-section__title::after { margin-left: 0; width: 100%; }
.tpl-vang-nhat { --sec-bg: #fdf8ea; --sec-accent: var(--accent, #7d6230); --sec-border: #e2cf96; --sec-text: #3e3626; }
.tpl-sen-hong { --sec-bg: #fff8f6; --sec-accent: var(--accent, #974763); --sec-border: #efd6dc; --sec-text: #6b4552; --sec-title-font: var(--font-display); --sec-radius: 16px; }
.tpl-sen-hong .card-section__title { font-style: italic; font-size: 1.4rem; }
.tpl-dong-duong { --sec-bg: #f4ecd9; --sec-accent: var(--accent, #2f6f6b); --sec-border: #d9caa4; --sec-text: #23443f; --sec-title-font: var(--font-display); --sec-radius: 4px; }
.tpl-dong-duong .card-section { border-top: 0; padding-top: 26px; }
.tpl-dong-duong .card-section { background: linear-gradient(#f4ecd9, #f4ecd9) 0 10px / 100% calc(100% - 10px) no-repeat, url('/assets/orn/gach-bong.svg') 0 0 / 10px 10px repeat-x; }
.tpl-trau-cau { --sec-bg: #f6f3e6; --sec-accent: var(--accent, #3f6b45); --sec-border: #ddd8bd; --sec-text: #33493a; --sec-title-font: var(--font-display); }
.tpl-trau-cau .card-section__title::after { background: #b3262e; opacity: 1; height: 2px; }

/* Trầu Cau: khối chữ căn giữa phần trống, trầu cau sát đáy, không còn khoảng trống lớn */
.card-betel { justify-content: flex-start; padding: 0; }
.card-betel__body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqi; padding: 9cqi 8cqi 2cqi; }
.card-betel__art { width: 100% !important; margin-top: 0 !important; display: block; }

/* ===== Màn hình rộng: tận dụng bề ngang cho lịch trình, album, mục tương tác ===== */
@container (min-width: 640px) {
  .card-page { gap: 18px; }
  .card-page .card-section { padding: 26px 30px 22px; }
  .card-page .event-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .card-page .event-item { border: 1px solid var(--sec-border); border-radius: 8px; padding: 14px; }
  .card-page .event-item:last-child { padding-bottom: 14px; border-bottom: 1px solid var(--sec-border); }
  .card-page .album-masonry { columns: 3; }
  .card-page .card-interact--2 { grid-template-columns: 1fr 1fr; align-items: start; }
  .card-page .timeline { max-width: 600px; margin: 0 auto; }
  .card-page .journey-intro { max-width: 600px; margin-left: auto; margin-right: auto; }
}

/* Trầu Cau: thiệp ít chữ không để trống quá nửa thân — tỉ lệ thấp hơn, nội dung dài vẫn tự cao thêm */
.wedding-card--tall.card-betel { aspect-ratio: 2 / 3; }
.card-betel__body { padding-bottom: 0; }
/* Sen Hồng: dải ánh kim hồng đậm hơn để tên dài vẫn đọc rõ trên nền sáng */
.card-lotus .foil { background-image: linear-gradient(105deg, #8f3f59 0%, #c96f8a 20%, #a24d68 38%, #d98aa0 52%, #9a4762 68%, #c7718b 84%, #84374f 100%); }

/* Thư viện mẫu trên điện thoại: bộ lọc một hàng vuốt ngang, mẫu xếp 2 cột để so sánh nhanh */
@media (max-width: 600px) {
  .library-head { padding: 12px 14px 8px; }
  .library-head .library-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -14px; padding: 0 14px 2px; }
  .library-head .library-filters .chip { flex: none; }
  .library-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .library-item { padding: 6px; gap: 6px; }
  .library-item__info h3 { font-size: 0.92rem; }
  .library-item__info p { display: none; }
  .library-item__info .btn { width: 100%; padding-left: 6px; padding-right: 6px; font-size: 0.85rem; }
}

/* ===== Bộ Hỷ Sự Đỏ (8 mẫu sắc đỏ truyền thống) =====
   Chữ thân thiệp ≥ 3.6cqi (≈ 12–13px khi bìa rộng 340px trên điện thoại). Chữ trên nền đỏ dùng kem/vàng sáng (≥ 7:1),
   chữ đỏ trên nền kem ≥ 6:1. Chữ ánh kim chỉ dùng cho chữ lớn. */
.tpl-song-hy-son, .card-theme:has(.card-hyson) { --tpl-accent: #a51c1c; }
.tpl-sen-vang, .card-theme:has(.card-senvang) { --tpl-accent: #7d1a26; }
.tpl-trau-cau-do, .card-theme:has(.card-traudo) { --tpl-accent: #6e1426; }
.tpl-thu-phap, .card-theme:has(.card-thuphap) { --tpl-accent: #8f1a24; }
.tpl-den-long, .card-theme:has(.card-denlong) { --tpl-accent: #5a1428; }
.tpl-may-vang, .card-theme:has(.card-mayvang) { --tpl-accent: #a51c1c; }
.tpl-hoa-dao, .card-theme:has(.card-hoadao) { --tpl-accent: #a51c1c; }
.tpl-cua-nguyet, .card-theme:has(.card-nguyet) { --tpl-accent: #7a1622; }
.card-theme { --font-han: 'Noto Serif SC', 'Noto Serif CJK SC', 'Noto Sans CJK SC', 'SimSun', 'Songti SC', 'Microsoft YaHei', serif; }

/* --- 1. Song Hỷ Đỏ Son --- */
.card-hyson {
  background: radial-gradient(120% 90% at 50% 30%, #b3241f 0%, #94181a 55%, #6f1013 100%);
  color: #fbeccc; padding: 13cqi 9cqi 12cqi; gap: 2.6cqi; font-family: var(--font-serif); justify-content: center;
}
.card-hyson__corner { position: absolute !important; width: 22cqi; height: 22cqi; pointer-events: none; }
.card-hyson__corner--tl { top: 2.5cqi; left: 2.5cqi; }
.card-hyson__corner--tr { top: 2.5cqi; right: 2.5cqi; transform: scaleX(-1); }
.card-hyson__corner--bl { bottom: 2.5cqi; left: 2.5cqi; transform: scaleY(-1); }
.card-hyson__corner--br { bottom: 2.5cqi; right: 2.5cqi; transform: scale(-1, -1); }
.card-hyson__hy { font-size: 19cqi; line-height: 1; font-family: var(--font-han); }
.card-hyson__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; letter-spacing: 0.3em; text-transform: uppercase; color: #f3d98f; font-weight: 600; }
.card-hyson__photo { width: 44cqi; aspect-ratio: 3 / 4; border-radius: 2cqi; border: 0.8cqi solid #e6c674; }
.card-hyson__pair { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 3.5cqi; width: 100%; font-size: 7.6cqi; line-height: 1.25; font-weight: 600; color: #fff4dc; }
.card-hyson__name:first-child { text-align: right; }
.card-hyson__name:last-child { text-align: left; }
.card-hyson__axis { width: 0.5cqi; align-self: stretch; min-height: 15cqi; background: linear-gradient(transparent, #e6c674 20%, #e6c674 80%, transparent); }
.card-hyson__invitation { font-size: 3.8cqi; line-height: 1.5; font-style: italic; color: #f6e2b8; max-width: 92%; }
.card-hyson__band { width: calc(100% + 18cqi); margin: 1cqi -9cqi 0; background: #fbf1dc; color: #7e1414; border-block: 0.7cqi solid #d8b45e; padding: 2.8cqi 4cqi; display: flex; flex-direction: column; gap: 0.6cqi; }
.card-hyson__date { font-size: 6.2cqi; font-weight: 700; letter-spacing: 0.08em; }
.card-hyson__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #5a1a14; font-weight: 500; }
.card-hyson__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #f6e2b8; }
.card-hyson__venue-name { font-weight: 600; font-size: 4.1cqi; color: #fff4dc; }
.card-hyson__map { color: #f3d98f; font-size: 3.6cqi; }

/* --- 2. Sen Vàng Đỏ Đô --- */
.card-senvang {
  background: radial-gradient(100% 60% at 50% 30%, #7d1a26 0%, #5e1019 55%, #3f0910 100%);
  color: #f6e4bd; padding: 12cqi 9cqi 12cqi; gap: 2.8cqi; font-family: var(--font-display); justify-content: center;
}
.card-senvang__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; letter-spacing: 0.28em; text-transform: uppercase; color: #ecc979; font-weight: 600; }
.card-senvang__pedestal { width: 88cqi; display: flex; flex-direction: column; align-items: center; margin-top: 2cqi; }
.card-senvang__halo {
  width: 48cqi; aspect-ratio: 1; border-radius: 50%; padding: 1.2cqi; z-index: 1;
  background: conic-gradient(from 30deg, #9b7733, #f4e4ad, #b98f3c, #f8ecc4, #9b7733, #e9d08f, #9b7733);
  box-shadow: 0 0 0 2.2cqi rgba(236, 201, 121, 0.12);
}
.card-senvang__photo { width: 100%; height: 100%; border-radius: 50%; font-size: 14cqi; }
.card-senvang .monogram { background: linear-gradient(160deg, #8a2230, #4f0d16); color: #f3dc9b; font-family: var(--font-vibes); }
.card-senvang__lotus { width: 100%; margin-top: -15cqi; display: block; }
.card-senvang__names { font-family: var(--font-vibes); font-size: 12cqi; display: flex; flex-direction: column; margin-top: -1cqi; line-height: 1.2; }
.card-senvang__amp { font-size: 0.55em; }
.card-senvang__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #f0dcb2; max-width: 90%; }
.card-senvang__date { font-size: 5.6cqi; letter-spacing: 0.14em; color: #f3dc9b; font-weight: 600; }
.card-senvang__when { font-size: 4cqi; font-style: italic; }
.card-senvang__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #ead2a4; }
.card-senvang__venue-name { font-weight: 600; font-size: 4.1cqi; color: #fff1d2; }
.card-senvang__map { color: #f3dc9b; font-size: 3.6cqi; }

/* --- 3. Trầu Cau Lạt Đỏ: hai cột, dải đỏ bên trái --- */
.card-traudo {
  flex-direction: row; align-items: stretch; text-align: left; padding: 0; color: #4a1c16; font-family: var(--font-display);
  background: radial-gradient(rgba(140, 30, 40, 0.05) 1px, transparent 1px) 0 0 / 3cqi 3cqi, #fbf3e2;
}
.card-traudo__ribbon {
  flex: 0 0 23cqi; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqi;
  padding: 8cqi 2cqi; text-align: center; color: #f8e6bf;
  background: linear-gradient(180deg, #6e1426, #561020); box-shadow: inset -1cqi 0 0 #c9a24f;
}
.card-traudo__hy { font-size: 10cqi; line-height: 1; color: #f0d48a; font-family: var(--font-han); margin-bottom: 2cqi; }
.card-traudo__day { font-size: 13cqi; font-weight: 700; line-height: 1; font-family: var(--font-serif); }
.card-traudo__month { font-size: 3.9cqi; font-family: var(--font-sans); letter-spacing: 0.06em; font-weight: 600; }
.card-traudo__year { font-size: 4.6cqi; letter-spacing: 0.12em; font-weight: 600; }
.card-traudo__body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2.6cqi; padding: 9cqi 6cqi 0 7cqi; }
.card-traudo__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; letter-spacing: 0.26em; text-transform: uppercase; color: #8c1d2c; font-weight: 600; }
.card-traudo__photo { width: 100%; aspect-ratio: 4 / 3; border-radius: 1.5cqi; border-left: 1.4cqi solid #8c1d2c; }
.card-traudo__names { display: flex; flex-direction: column; font-size: 7.4cqi; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; color: #6e1426; line-height: 1.32; }
.card-traudo__amp { text-transform: none; font-style: italic; font-size: 4.4cqi; color: #7a5a24; letter-spacing: 0; font-weight: 500; margin: 0.6cqi 0; }
.card-traudo__invitation { font-size: 3.9cqi; line-height: 1.5; color: #4a2a20; }
.card-traudo__when { font-family: var(--font-sans); font-size: 3.8cqi; font-weight: 600; color: #6e1426; }
.card-traudo__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #4a2a20; }
.card-traudo__venue-name { font-weight: 600; font-size: 4.1cqi; color: #6e1426; }
.card-traudo__map { color: #8c1d2c; font-size: 3.6cqi; }
.card-traudo__art { width: 108% !important; max-width: none; margin: auto -6cqi 0 0 !important; align-self: flex-end; display: block; }

/* --- 4. Thư Pháp Ấn Son: canh trái, ấn đỏ góc phải --- */
.card-thuphap {
  background: linear-gradient(180deg, #fdfaf2, #f6efdf); color: #2e1f1a; padding: 11cqi 10cqi 12cqi; gap: 2.2cqi;
  align-items: flex-start; text-align: left; font-family: var(--font-sans); justify-content: center;
  box-shadow: inset 0 0 0 2.6cqi #fdfaf2, inset 0 0 0 3cqi #b3262e, 0 18px 40px rgba(31, 51, 43, 0.18);
}
.card-thuphap__head { width: 100%; display: flex; justify-content: space-between; align-items: flex-start; gap: 4cqi; }
.card-thuphap__eyebrow { font-family: var(--font-display); font-size: 5.4cqi; color: #9e1f27; letter-spacing: 0.4em; font-weight: 700; text-transform: uppercase; padding-top: 2cqi; }
.card-thuphap__seal {
  flex: none; width: 17cqi; height: 17cqi; display: grid; place-content: center; justify-items: center; gap: 0.4cqi;
  background: #a8202a; color: #fbefd8; border-radius: 1.4cqi; transform: rotate(-5deg);
  font-family: var(--font-serif); font-size: 5.6cqi; font-weight: 700; line-height: 1;
  box-shadow: inset 0 0 0 0.8cqi #a8202a, inset 0 0 0 1.2cqi #fbefd8;
}
.card-thuphap__brush { width: 50cqi; height: 2.2cqi; margin: 1cqi 0 2cqi; background: linear-gradient(90deg, #2e1f1a 0%, #2e1f1a 65%, rgba(46, 31, 26, 0)); border-radius: 50% 10% 40% 20%; opacity: 0.85; }
.card-thuphap__name { font-family: var(--font-script); font-size: 12.5cqi; line-height: 1.22; color: #8f1a24; font-weight: 600; }
.card-thuphap__and { font-family: var(--font-display); font-style: italic; font-size: 4.6cqi; color: #6e5226; padding-left: 10cqi; }
.card-thuphap__photo { width: 100%; aspect-ratio: 16 / 10; border-radius: 1cqi; margin: 1.5cqi 0; }
.card-thuphap__invitation { font-size: 3.9cqi; line-height: 1.55; color: #3d2a22; margin-top: 1cqi !important; }
.card-thuphap__date { font-family: var(--font-display); font-size: 5.4cqi; font-weight: 700; color: #8f1a24; border-top: 0.3cqi solid #d9c39a; padding-top: 2.4cqi; width: 100%; }
.card-thuphap__when { font-size: 3.8cqi; color: #4a3a30; }
.card-thuphap__venue { font-size: 3.7cqi; line-height: 1.45; color: #3d2a22; }
.card-thuphap__venue-name { font-weight: 600; font-size: 4.1cqi; color: #2e1f1a; }
.card-thuphap__map { color: #9e1f27; font-size: 3.6cqi; }

/* --- 5. Đèn Lồng Hội Hỷ --- */
.card-denlong {
  background: radial-gradient(90% 60% at 50% 42%, #6c1a2e 0%, #4f1022 60%, #350a17 100%);
  color: #f6e3bf; padding: 34cqi 8cqi 12cqi; gap: 3cqi; font-family: var(--font-sans); justify-content: center;
}
.card-denlong__lantern { position: absolute !important; top: 0; width: 17cqi; transform-origin: 50% 0; animation: tc-sway 6s ease-in-out infinite alternate; }
.card-denlong__lantern--l { left: 8cqi; }
.card-denlong__lantern--r { right: 8cqi; animation-delay: -3s; }
@keyframes tc-sway { from { transform: rotate(-2.5deg); } to { transform: rotate(2.5deg); } }
@media (prefers-reduced-motion: reduce) { .card-denlong__lantern { animation: none; } }
.card-denlong__eyebrow { font-family: var(--font-display); font-style: italic; font-size: 5.6cqi; color: #f0d48a; font-weight: 600; }
.card-denlong__photo { width: 62cqi; aspect-ratio: 4 / 3; border-radius: 2cqi; border: 0.7cqi solid #d9b35d; }
.card-denlong__plaque { width: 100%; margin: 2cqi 0; padding: 5cqi 4cqi; border: 0.7cqi solid #d9b35d; outline: 0.3cqi solid #d9b35d; outline-offset: 1.2cqi; background: linear-gradient(#5a1426, #481020); }
.card-denlong__names { display: flex; flex-direction: column; gap: 1.6cqi; font-size: 6.6cqi; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.38; color: #fff2d6; }
.card-denlong__amp { font-family: var(--font-han); font-size: 6cqi; color: #f0d48a; letter-spacing: 0; font-weight: 400; }
.card-denlong__invitation { font-size: 3.8cqi; line-height: 1.55; color: #edd6ad; max-width: 94%; }
.card-denlong__date { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 2.4cqi; width: 86%; }
.card-denlong__date div { display: flex; flex-direction: column; gap: 0.6cqi; padding: 2.2cqi 0; border: 0.4cqi solid rgba(217, 179, 93, 0.75); border-radius: 1.6cqi; }
.card-denlong__date small { font-size: 3.9cqi; text-transform: uppercase; letter-spacing: 0.12em; color: #f0d48a; font-weight: 600; }
.card-denlong__date strong { font-family: var(--font-display); font-size: 8cqi; line-height: 1; color: #fff2d6; font-weight: 600; }
.card-denlong__when { font-size: 3.9cqi; color: #f6e3bf; }
.card-denlong__venue { font-size: 3.7cqi; line-height: 1.45; color: #edd6ad; }
.card-denlong__venue-name { font-weight: 600; font-size: 4.1cqi; color: #fff2d6; }
.card-denlong__map { color: #f0d48a; font-size: 3.6cqi; }

/* --- 6. Mây Cuộn Hoàng Kim: dải đỏ trên, dưới; thân kem --- */
.card-mayvang { background: #fbf3e3; color: #4d1a14; padding: 0; gap: 0; align-items: stretch; justify-content: space-between; font-family: var(--font-serif); }
.card-mayvang__band {
  display: flex; justify-content: center; align-items: center; padding: 5cqi 4cqi; color: #fbe7b5;
  background: url('/assets/orn/cuon-van.svg') 0 50% / 20cqi auto repeat-x, linear-gradient(#a51c1c, #8a1515);
}
.card-mayvang__band--top { border-bottom: 0.8cqi solid #d6b25e; }
.card-mayvang__band--bottom { border-top: 0.8cqi solid #d6b25e; }
.card-mayvang__band > * { background: #8a1515; border: 0.3cqi solid #e2c070; border-radius: 999px; padding: 1cqi 5cqi; }
.card-mayvang__band span { font-family: var(--font-sans); font-size: 3.8cqi; text-transform: uppercase; letter-spacing: 0.3em; font-weight: 600; }
.card-mayvang__band strong { font-family: var(--font-display); font-size: 6cqi; letter-spacing: 0.14em; font-weight: 700; }
.card-mayvang__body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.8cqi; padding: 7cqi 8cqi; }
.card-mayvang__photo { width: 100%; aspect-ratio: 3 / 2; border: 1cqi solid #a51c1c; outline: 0.3cqi solid #d6b25e; outline-offset: -2.4cqi; }
.card-mayvang__hy { font-size: 17cqi; color: #a51c1c; font-family: var(--font-han); line-height: 1; }
.card-mayvang__names { display: flex; flex-direction: column; font-style: italic; font-size: 8.8cqi; color: #9a1b1b; line-height: 1.24; font-weight: 500; }
.card-mayvang__amp { font-style: normal; font-family: var(--font-display); color: #7a5a24; font-size: 0.6em; }
.card-mayvang__invitation { font-size: 3.9cqi; line-height: 1.5; color: #4d2a20; max-width: 94%; }
.card-mayvang__when { font-family: var(--font-sans); font-size: 3.9cqi; font-weight: 600; color: #7e1414; }
.card-mayvang__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #4d2a20; }
.card-mayvang__venue-name { font-weight: 600; font-size: 4.1cqi; color: #7e1414; }
.card-mayvang__map { color: #9a1b1b; font-size: 3.6cqi; }

/* --- 7. Hoa Đào Xuân Hỷ: cành đào đầu thiệp, canh trái --- */
.card-hoadao { background: linear-gradient(180deg, #fffaf3, #fbf0e6); color: #3b1f1a; padding: 0; gap: 0; align-items: stretch; text-align: left; font-family: var(--font-sans); }
.card-hoadao__branch { width: 100% !important; display: block; margin-bottom: -4cqi; }
.card-hoadao__body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 2.6cqi; padding: 2cqi 9cqi 10cqi; }
.card-hoadao__eyebrow { font-size: 3.8cqi; text-transform: uppercase; letter-spacing: 0.24em; color: #a51c1c; font-weight: 600; }
.card-hoadao__photo { width: 100%; aspect-ratio: 5 / 4; border-radius: 40cqi 40cqi 2cqi 2cqi; }
.card-hoadao__names { display: flex; flex-direction: column; font-family: var(--font-display); font-style: italic; font-size: 10.5cqi; line-height: 1.18; color: #a51c1c; font-weight: 600; }
.card-hoadao__amp { color: #7a5a24; font-size: 0.6em; padding-left: 6cqi; }
.card-hoadao__invitation { font-size: 3.9cqi; line-height: 1.55; color: #4a2c25; }
.card-hoadao__date { display: flex; align-items: center; gap: 3.5cqi; border-top: 0.3cqi solid #e8c9b8; padding-top: 3cqi; }
.card-hoadao__date strong { font-family: var(--font-display); font-size: 17cqi; line-height: 0.9; color: #a51c1c; font-weight: 600; }
.card-hoadao__date div { display: flex; flex-direction: column; gap: 0.6cqi; }
.card-hoadao__date span:first-child { font-size: 4.2cqi; font-weight: 600; color: #3b1f1a; }
.card-hoadao__date span:last-child { font-size: 3.8cqi; color: #5e3f36; }
.card-hoadao__venue { font-size: 3.7cqi; line-height: 1.45; color: #4a2c25; }
.card-hoadao__venue-name { font-weight: 600; font-size: 4.1cqi; color: #3b1f1a; }
.card-hoadao__map { color: #a51c1c; font-size: 3.6cqi; }

/* --- 8. Cửa Nguyệt Đỏ Đô: nửa trên đỏ, nửa dưới kem --- */
.card-nguyet { background: #fbf3e2; color: #4a1418; padding: 0; gap: 0; align-items: stretch; font-family: var(--font-serif); }
.card-nguyet__top {
  display: flex; flex-direction: column; align-items: center; gap: 4cqi; padding: 10cqi 8cqi 9cqi;
  background: radial-gradient(90% 80% at 50% 45%, #7a1622 0%, #5a0f19 60%, #400a12 100%); border-bottom: 1cqi solid #c9a24f;
}
.card-nguyet__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; text-transform: uppercase; letter-spacing: 0.32em; font-weight: 600; color: #f0d48a; }
.card-nguyet__gate { position: relative; width: 70cqi; aspect-ratio: 1; }
.card-nguyet__window { position: absolute; inset: 12.5%; border-radius: 50%; overflow: hidden; }
.card-nguyet__frame { position: absolute !important; inset: 0; width: 100%; height: 100%; }
.card-nguyet__photo { width: 100%; height: 100%; font-size: 14cqi; }
.card-nguyet .monogram { background: radial-gradient(circle, #8a2230, #4f0d16); color: #f3dc9b; font-family: var(--font-vibes); }
.card-nguyet__panel { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqi; padding: 7cqi 8cqi 9cqi; }
.card-nguyet__names { display: flex; flex-direction: column; font-size: 8.4cqi; line-height: 1.24; color: #7a1622; font-weight: 500; }
.card-nguyet__amp { font-family: var(--font-vibes); color: #7a5a24; font-size: 0.9em; line-height: 1; }
.card-nguyet__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #4a2a24; max-width: 94%; }
.card-nguyet__date { font-family: var(--font-display); font-size: 5.8cqi; font-weight: 700; letter-spacing: 0.12em; color: #7a1622; }
.card-nguyet__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #4a2a24; }
.card-nguyet__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #4a2a24; }
.card-nguyet__venue-name { font-weight: 600; font-size: 4.1cqi; color: #7a1622; }
.card-nguyet__map { color: #7a1622; font-size: 3.6cqi; }

/* Mục bên dưới bìa của Bộ Hỷ Sự Đỏ: nền kem, đỏ chỉ làm điểm nhấn để trang không bị đỏ dày đặc */
.card-page:is(.tpl-song-hy-son, .tpl-sen-vang, .tpl-trau-cau-do, .tpl-thu-phap, .tpl-den-long, .tpl-may-vang, .tpl-hoa-dao, .tpl-cua-nguyet) {
  --sec-bg: #fdf7ea; --sec-text: #3f1f1a; --sec-muted: #6a4a3c; --sec-border: #e6cfa4; --sec-title-font: var(--font-display);
}
.tpl-song-hy-son { --sec-accent: var(--accent, #a51c1c); }
.tpl-song-hy-son .card-section { border: 2px solid #a51c1c; border-top-width: 6px; }
.tpl-song-hy-son .card-section__title::before { content: '囍'; display: block; font-family: var(--font-han); font-size: 1.1rem; margin-bottom: 2px; }
.tpl-sen-vang { --sec-accent: var(--accent, #7d1a26); }
.tpl-sen-vang .card-section { border-top: 3px solid #c9a24f; box-shadow: inset 0 3px 0 #7d1a26; border-radius: 16px; }
.tpl-trau-cau-do { --sec-accent: var(--accent, #6e1426); --sec-bg: #fbf3e2; }
.tpl-trau-cau-do .card-section { border-top: 1px solid var(--sec-border); border-left: 6px solid #6e1426; text-align: left; border-radius: 4px; }
.tpl-trau-cau-do .card-section__title::after { margin-left: 0; }
.tpl-thu-phap { --sec-accent: var(--accent, #8f1a24); --sec-bg: #fdfaf2; }
.tpl-thu-phap .card-section { border-top: 1px solid #e9dcc0; border-radius: 2px; text-align: left; }
.tpl-thu-phap .card-section__title { font-family: var(--font-script); font-size: 1.6rem; }
.tpl-thu-phap .card-section__title::after { margin-left: 0; width: 64px; height: 3px; border-radius: 2px; }
.tpl-den-long { --sec-accent: var(--accent, #5a1428); }
.tpl-den-long .card-section { border: 1px solid #d9b35d; border-top: 4px double #5a1428; }
.tpl-den-long .card-section__title { text-transform: uppercase; letter-spacing: 0.12em; font-size: 1.05rem; font-family: var(--font-sans); }
.tpl-may-vang { --sec-accent: var(--accent, #a51c1c); }
.tpl-may-vang .card-section { border-top: 0; padding-top: 26px; background: linear-gradient(#a51c1c, #a51c1c) 0 0 / 100% 8px no-repeat, linear-gradient(#d6b25e, #d6b25e) 0 8px / 100% 2px no-repeat, var(--sec-bg); }
.tpl-may-vang .card-section__title { font-style: italic; }
.tpl-hoa-dao { --sec-accent: var(--accent, #a51c1c); --sec-bg: #fffaf3; --sec-border: #f0d7cd; --sec-radius: 18px; }
.tpl-hoa-dao .card-section { text-align: left; }
.tpl-hoa-dao .card-section__title { font-style: italic; font-size: 1.35rem; }
.tpl-hoa-dao .card-section__title::after { margin-left: 0; background: #e48b95; opacity: 1; }
.tpl-cua-nguyet { --sec-accent: var(--accent, #7a1622); --sec-radius: 4px; }
.tpl-cua-nguyet .card-section { border-top: 6px solid #7a1622; box-shadow: inset 0 2px 0 #c9a24f; }

/* 12 mẫu cũ: chữ trên bìa thiệp đầy đủ (trang khách, xem trước trong trình soạn) không nhỏ hơn mức đọc được trên điện thoại.
   Ảnh thu nhỏ trong bộ sưu tập không có .card-cover nên giữ nguyên tỉ lệ. Bộ Hỷ Sự Đỏ đã đặt cỡ đủ lớn trong từng mẫu. */
.card-cover :is(.card-classic, .card-modern, .card-traditional, .card-rose, .card-mag, .card-gold, .card-emerald, .card-velvet, .card-lotus, .card-starry, .card-indo, .card-betel)
  :is([class*='__invitation'], [class*='__when'], [class*='__time'], [class*='__venue-address'], [class*='__map'], [class*='__cung'], .card-mag__facts dd, .card-traditional__when p, .card-classic__when span) { font-size: max(12.5px, 3.6cqi); }
.card-cover :is(.card-classic, .card-modern, .card-traditional, .card-rose, .card-mag, .card-gold, .card-emerald, .card-velvet, .card-lotus, .card-starry, .card-indo, .card-betel)
  [class*='__venue-name'] { font-size: max(13px, 3.9cqi); }
.card-cover :is(.card-classic, .card-modern, .card-traditional, .card-rose, .card-mag, .card-gold, .card-emerald, .card-velvet, .card-lotus, .card-starry, .card-indo, .card-betel)
  :is([class*='__eyebrow'], [class*='__kicker'], [class*='__tag'], [class*='__info-title'], .card-mag__top, .card-mag__facts dt, .card-modern__date small) { font-size: max(11.5px, 3.2cqi); }
.card-cover .card-traditional__amp { font-size: max(12.5px, 3.2cqi); }
/* Bộ Hỷ Sự Đỏ: tên dài xuống dòng không để dấu tiếng Việt chạm dòng trên/dưới (thắng .premium .card-names) */
.premium .card-hyson__pair { line-height: 1.25; }
.premium .card-senvang__names { line-height: 1.2; }
.premium .card-traudo__names { line-height: 1.32; }
.premium .card-thuphap__name { line-height: 1.22; }
.premium .card-denlong__names { line-height: 1.38; }
.premium .card-mayvang__names { line-height: 1.24; }
.premium .card-hoadao__names { line-height: 1.18; }
.premium .card-nguyet__names { line-height: 1.24; }
/* Trầu Cau Lạt Đỏ xếp hai cột (flex hàng ngang) nên aspect-ratio không tự nới: dùng chiều cao tối thiểu 5:7 theo bề rộng bìa */
.card-traudo { aspect-ratio: auto; min-height: 140cqi; }

/* ===== 16 mẫu bổ sung (mỗi bộ 12 mẫu) =====
   Quy ước như Bộ Hỷ Sự Đỏ: chữ thân thiệp ≥ 3.6cqi, nhãn nhỏ ≥ 3.6cqi, tên 7–10cqi; chữ ánh kim chỉ cho chữ lớn. */
.tpl-cau-doi, .card-theme:has(.card-caudoi) { --tpl-accent: #9a1d1d; }
.tpl-phong-bi, .card-theme:has(.card-phongbi) { --tpl-accent: #7a1622; }
.tpl-dong-ho, .card-theme:has(.card-dongho) { --tpl-accent: #8c2f1c; }
.tpl-gom-lam, .card-theme:has(.card-gomlam) { --tpl-accent: #1f4e8c; }
.tpl-son-mai, .card-theme:has(.card-sonmai) { --tpl-accent: #8a1f17; }
.tpl-trong-dong, .card-theme:has(.card-trongdong) { --tpl-accent: #7a5326; }
.tpl-tim-hue, .card-theme:has(.card-timhue) { --tpl-accent: #5b3b78; }
.tpl-lua-ha-dong, .card-theme:has(.card-luahd) { --tpl-accent: #263f73; }
.tpl-dong-lua, .card-theme:has(.card-donglua) { --tpl-accent: #3f5d24; }
.tpl-toi-gian, .card-theme:has(.card-toigian) { --tpl-accent: #222222; }
.tpl-mau-nuoc, .card-theme:has(.card-maunuoc) { --tpl-accent: #3f6b55; }
.tpl-polaroid, .card-theme:has(.card-polaroid) { --tpl-accent: #8a4b3b; }
.tpl-ve-moi, .card-theme:has(.card-vemoi) { --tpl-accent: #1f4f5c; }
.tpl-lich-thang, .card-theme:has(.card-lich) { --tpl-accent: #b0413e; }
.tpl-hoa-dai, .card-theme:has(.card-hoadai) { --tpl-accent: #56704f; }
.tpl-vom-dat, .card-theme:has(.card-vomdat) { --tpl-accent: #9c4f30; }

/* --- Câu Đối Đỏ: ba cột (câu đối – khung kem – câu đối) --- */
.card-caudoi { flex-direction: row; align-items: stretch; gap: 0; padding: 5cqi 3.5cqi; background: #f6e8cc; font-family: var(--font-serif); color: #4a1e16; aspect-ratio: auto; min-height: 140cqi; }
.card-caudoi__scroll {
  flex: 0 0 13cqw; width: 13cqw; max-width: 13cqw; overflow: hidden; writing-mode: vertical-rl; text-orientation: upright; letter-spacing: 0.06em;
  display: grid; place-items: center; font-family: var(--font-display); font-size: 5.6cqw; font-weight: 700; color: #f6dc8f;
  background: linear-gradient(#a51c1c, #85151a); border: 0.6cqw solid #d6b25e; border-radius: 1cqw; box-shadow: inset 0 0 0 1cqw #a51c1c, inset 0 0 0 1.3cqw #e6c674;
  padding: 4cqw 0;
}
.card-caudoi__center { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.6cqi; padding: 4cqi 4cqi; margin: 0 3cqi; border-block: 0.5cqi solid #c9a24f; }
.card-caudoi__lintel { display: flex; flex-direction: column; align-items: center; gap: 0.5cqi; font-family: var(--font-sans); font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; color: #9a1d1d; }
.card-caudoi__lintel span { font-family: var(--font-han); font-size: 13cqi; letter-spacing: 0; line-height: 1; color: #a51c1c; }
.card-caudoi__photo { width: 40cqi; aspect-ratio: 1; border-radius: 50%; border: 0.8cqi solid #c9a24f; }
.card-caudoi__names { display: flex; flex-direction: column; font-size: 7.2cqi; font-weight: 600; color: #8a1a1a; }
.card-caudoi__amp { font-family: var(--font-script); font-size: 0.62em; color: #7a5a24; font-weight: 500; }
.card-caudoi__invitation { font-size: 3.7cqi; line-height: 1.5; font-style: italic; color: #4a2a20; }
.card-caudoi__date { font-size: 5.4cqi; font-weight: 700; letter-spacing: 0.08em; color: #8a1a1a; }
.card-caudoi__when { font-family: var(--font-sans); font-size: 3.7cqi; color: #4a2a20; }
.card-caudoi__venue { font-family: var(--font-sans); font-size: 3.6cqi; line-height: 1.45; color: #4a2a20; }
.card-caudoi__venue-name { font-weight: 600; font-size: 4cqi; color: #8a1a1a; }
.card-caudoi__map { color: #8a1a1a; font-size: 3.6cqi; }

/* --- Phong Bì Hỷ Tín: nắp tam giác đỏ đô, dấu sáp, lá thư kem --- */
.card-phongbi { background: #7a1622; padding: 0; justify-content: flex-start; font-family: var(--font-display); }
.card-phongbi__flap { position: absolute !important; inset: 0 0 auto 0; height: 46cqi; background: linear-gradient(160deg, #96202c, #5e0f19); clip-path: polygon(0 0, 100% 0, 50% 100%); z-index: 2; filter: drop-shadow(0 1cqi 1cqi rgba(0, 0, 0, 0.3)); }
.card-phongbi__seal {
  position: absolute !important; top: 34cqi; left: 50%; transform: translateX(-50%); z-index: 3; width: 20cqi; height: 20cqi; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--font-han); font-size: 10cqi; color: #6b3d0b;
  background: radial-gradient(circle at 35% 30%, #fbe3a0, #d9a940 55%, #a77a23); box-shadow: 0 0.6cqi 1.4cqi rgba(0, 0, 0, 0.35), inset 0 0 0 1cqi rgba(255, 255, 255, 0.18);
}
.card-phongbi__letter { flex: 1; width: calc(100% - 10cqi); margin: 8cqi 5cqi 5cqi; padding: 50cqi 6cqi 8cqi; background: #fdf6e6; border-radius: 1.5cqi; display: flex; flex-direction: column; align-items: center; gap: 2.4cqi; color: #4a2420; }
.card-phongbi__eyebrow { font-family: var(--font-sans); font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #7a1622; }
.card-phongbi__photo { width: 54cqi; aspect-ratio: 4 / 3; border-radius: 1.5cqi; }
.card-phongbi__names { display: flex; flex-direction: column; font-size: 8.6cqi; font-weight: 600; color: #7a1622; }
.card-phongbi__amp { font-family: var(--font-vibes); font-size: 0.8em; color: #7d5f2a; font-weight: 400; }
.card-phongbi__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; }
.card-phongbi__date { font-size: 4.6cqi; font-weight: 700; color: #7a1622; border-top: 0.4cqi solid #d9b35d; border-bottom: 0.4cqi solid #d9b35d; padding: 1.2cqi 2cqi; }
.card-phongbi__when { font-family: var(--font-sans); font-size: 3.7cqi; }
.card-phongbi__venue { font-family: var(--font-sans); font-size: 3.6cqi; line-height: 1.45; }
.card-phongbi__venue-name { font-weight: 600; font-size: 4cqi; color: #7a1622; }
.card-phongbi__map { color: #7a1622; font-size: 3.6cqi; }

/* --- Tranh Đông Hồ: giấy điệp, khung mộc bản, màu son – lá – chàm --- */
.card-dongho {
  padding: 4cqi; color: #2a1f16; font-family: var(--font-serif);
  background: radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.7), transparent 40%), repeating-linear-gradient(115deg, rgba(220, 205, 170, 0.25) 0 2px, transparent 2px 6px), #efe2c4;
}
.card-dongho__frame { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqi; padding: 5cqi; border: 1.4cqi solid #241a12; outline: 0.5cqi solid #241a12; outline-offset: -3.2cqi; }
.card-dongho__title { font-family: var(--font-display); font-size: 5cqi; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #fff4dc; background: #8c2f1c; padding: 1cqi 5cqi; border: 0.5cqi solid #241a12; }
.card-dongho__panel { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2.4cqi; padding: 4cqi; background: #e9c46a; border: 0.6cqi solid #241a12; }
.card-dongho__photo { width: 44cqi; aspect-ratio: 1; border-radius: 50%; border: 0.8cqi solid #241a12; font-size: 11cqi; }
.card-dongho .monogram { background: #2f5d4a; color: #fff4dc; }
.card-dongho__names { display: flex; flex-direction: column; font-size: 7.8cqi; font-weight: 700; color: #241a12; }
.card-dongho__amp { font-family: var(--font-script); font-size: 0.6em; color: #8c2f1c; font-weight: 600; }
.card-dongho__invitation { font-size: 3.8cqi; line-height: 1.5; font-style: italic; }
.card-dongho__dots { display: flex; gap: 2cqi; }
.card-dongho__dots span { width: 3cqi; height: 3cqi; border-radius: 50%; background: #8c2f1c; }
.card-dongho__dots span:nth-child(2) { background: #2f5d4a; }
.card-dongho__dots span:nth-child(3) { background: #2b3f6b; }
.card-dongho__date { font-size: 4.8cqi; font-weight: 700; color: #8c2f1c; }
.card-dongho__when { font-family: var(--font-sans); font-size: 3.7cqi; }
.card-dongho__venue { font-family: var(--font-sans); font-size: 3.6cqi; line-height: 1.45; }
.card-dongho__venue-name { font-weight: 700; font-size: 4cqi; color: #2f5d4a; }
.card-dongho__map { color: #8c2f1c; font-size: 3.6cqi; }

/* --- Gốm Lam: đĩa men trắng vành lam --- */
.card-gomlam { background: linear-gradient(#f7f6f1, #eef0ef); color: #1d3557; padding: 10cqi 8cqi 0; gap: 2.6cqi; font-family: var(--font-display); justify-content: flex-start; }
.card-gomlam__eyebrow { font-family: var(--font-sans); font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: #1f4e8c; }
.card-gomlam__plate {
  width: 82cqi; height: 82cqi; flex: none; border-radius: 50%; padding: 6cqi; margin: 1cqi 0;
  background: repeating-conic-gradient(from 0deg, #1f4e8c 0 4deg, #f7f6f1 4deg 11.25deg), #f7f6f1;
  box-shadow: 0 1.4cqi 3cqi rgba(31, 78, 140, 0.2), inset 0 0 0 1cqi #1f4e8c;
}
.card-gomlam__well { width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle, #ffffff 60%, #eaf0f7); box-shadow: 0 0 0 0.8cqi #1f4e8c, 0 0 0 2cqi #f7f6f1, 0 0 0 2.4cqi #1f4e8c; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.4cqi; padding: 6cqi; overflow: hidden; }
.card-gomlam__photo { width: 62cqi; aspect-ratio: 4 / 3; border-radius: 3cqi; border: 0.6cqi solid #1f4e8c; box-shadow: 0 0 0 1.2cqi #fff, 0 0 0 1.5cqi #9fb6d6; }
.card-gomlam__names { display: flex; flex-direction: column; font-size: 6.6cqi; font-weight: 700; color: #1a3f73; }
.card-gomlam__amp { font-family: var(--font-vibes); font-size: 0.8em; font-weight: 400; color: #4a74ad; }
.card-gomlam__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #2b3f5e; max-width: 94%; }
.card-gomlam__date { font-size: 5.8cqi; font-weight: 700; letter-spacing: 0.1em; color: #1a3f73; }
.card-gomlam__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #2b3f5e; }
.card-gomlam__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #2b3f5e; }
.card-gomlam__venue-name { font-weight: 600; font-size: 4.1cqi; color: #1a3f73; }
.card-gomlam__map { color: #1f4e8c; font-size: 3.6cqi; }
.card-gomlam__wave { margin-top: auto; width: calc(100% + 16cqi); height: 12cqi; flex: none; background: radial-gradient(circle at 50% 100%, transparent 3.2cqi, #1f4e8c 3.3cqi, #1f4e8c 3.9cqi, transparent 4cqi) 0 0 / 8cqi 6cqi repeat-x, radial-gradient(circle at 50% 100%, transparent 3.2cqi, #4a74ad 3.3cqi, #4a74ad 3.9cqi, transparent 4cqi) 4cqi 6cqi / 8cqi 6cqi repeat-x; }

/* --- Sơn Mài: đen son, vệt vàng lá --- */
.card-sonmai { background: radial-gradient(120% 80% at 70% 20%, #2a1512, #120a09 60%, #080505); color: #f0dfb8; padding: 12cqi 8cqi; gap: 2.8cqi; justify-content: center; font-family: var(--font-display); }
.card-sonmai__shell { position: absolute !important; inset: 0; pointer-events: none; opacity: 0.55;
  background: radial-gradient(circle at 5% 95%, #f3ead2 0 0.8cqi, transparent 0.9cqi), radial-gradient(circle at 9% 97%, #e9dcb8 0 0.6cqi, transparent 0.7cqi), radial-gradient(circle at 3% 91%, #f3ead2 0 0.5cqi, transparent 0.6cqi), radial-gradient(circle at 92% 4%, #f3ead2 0 0.7cqi, transparent 0.8cqi), radial-gradient(circle at 96% 7%, #e9dcb8 0 0.5cqi, transparent 0.6cqi), radial-gradient(circle at 89% 8%, #f3ead2 0 0.6cqi, transparent 0.7cqi); } }
.card-sonmai__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; font-weight: 600; letter-spacing: 0.3em; text-transform: uppercase; color: #d9b35d; }
.card-sonmai__photo { width: 50cqi; aspect-ratio: 4 / 5; border-radius: 1cqi; border: 0.5cqi solid #b8913e; box-shadow: 0 0 0 1.6cqi rgba(184, 145, 62, 0.25); }
.card-sonmai__leaf { width: calc(100% + 16cqi); padding: 4cqi 8cqi; background: linear-gradient(100deg, transparent 0%, rgba(184, 140, 50, 0.22) 12%, rgba(218, 176, 84, 0.32) 50%, rgba(184, 140, 50, 0.22) 88%, transparent 100%); border-block: 0.3cqi solid rgba(217, 179, 93, 0.6); }
.card-sonmai__names { display: flex; flex-direction: column; font-size: 9.4cqi; font-weight: 700; }
.card-sonmai__amp { font-family: var(--font-vibes); font-size: 0.7em; font-weight: 400; }
.card-sonmai__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #e6d3a6; max-width: 92%; }
.card-sonmai__date { font-size: 5.8cqi; font-weight: 700; letter-spacing: 0.14em; color: #e9c977; }
.card-sonmai__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #eadbb5; }
.card-sonmai__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #eadbb5; }
.card-sonmai__venue-name { font-weight: 600; font-size: 4.1cqi; color: #f6e7bf; }
.card-sonmai__map { color: #e9c977; font-size: 3.6cqi; }

/* --- Trống Đồng: mặt trống tỏa tia, vành hoa văn --- */
.card-trongdong { background: radial-gradient(130% 80% at 50% 30%, #4b3220, #2c1d13 70%); color: #f2dfb5; padding: 10cqi 7cqi; gap: 2.6cqi; justify-content: center; font-family: var(--font-display); }
.card-trongdong__eyebrow { font-family: var(--font-sans); font-size: 3.8cqi; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: #e0b866; }
.card-trongdong__drum {
  width: 86cqi; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center;
  background:
    radial-gradient(circle, transparent 33%, #b98a3e 33.4% 34.4%, transparent 34.8% 40%, #b98a3e 40.4% 41%, transparent 41.4%),
    repeating-radial-gradient(circle, transparent 0 4.2%, rgba(224, 184, 102, 0.55) 4.4% 4.8%, transparent 5%),
    repeating-conic-gradient(from 0deg, rgba(224, 184, 102, 0.85) 0 2deg, transparent 2deg 15deg),
    radial-gradient(circle, #6b4a2c, #3a2717);
  box-shadow: 0 0 0 1cqi #b98a3e, 0 0 0 2.4cqi #3a2717, 0 0 0 3cqi #b98a3e;
}
.card-trongdong__core { width: 62%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #3a2717 60%, #2c1d13); display: grid; place-items: center; padding: 4cqi; box-shadow: 0 0 0 0.6cqi #e0b866; }
.card-trongdong__names { display: flex; flex-direction: column; font-size: 6.6cqi; font-weight: 700; color: #f6e2b0; }
.card-trongdong__amp { color: #e0b866; font-size: 0.6em; }
.card-trongdong__photo { width: 54cqi; aspect-ratio: 4 / 3; border-radius: 1cqi; border: 0.5cqi solid #b98a3e; margin-top: 2cqi; }
.card-trongdong__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #ead6a8; max-width: 92%; }
.card-trongdong__date { font-size: 5.8cqi; font-weight: 700; letter-spacing: 0.12em; color: #e9c977; }
.card-trongdong__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #ecdcb4; }
.card-trongdong__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #ecdcb4; }
.card-trongdong__venue-name { font-weight: 600; font-size: 4.1cqi; color: #f6e2b0; }
.card-trongdong__map { color: #e9c977; font-size: 3.6cqi; }

/* --- Tím Huế: cổng bậc mái, tím mộng mơ --- */
.card-timhue { background: linear-gradient(180deg, #efe6f3 0%, #f8f3ea 60%); color: #3d2a52; padding: 8cqi 8cqi 10cqi; gap: 2.6cqi; justify-content: flex-start; font-family: var(--font-display); }
.card-timhue__gate { width: 74cqi; display: flex; flex-direction: column; align-items: center; }
.card-timhue__roof { width: 100%; height: 14cqi; background: #5b3b78; clip-path: polygon(0 100%, 8% 55%, 22% 55%, 28% 18%, 72% 18%, 78% 55%, 92% 55%, 100% 100%); box-shadow: none; position: relative; }
.card-timhue__roof::after { content: ''; position: absolute; left: 30%; right: 30%; top: 26%; height: 1cqi; background: #e2c477; }
.card-timhue__door { width: 64cqi; aspect-ratio: 4 / 5; padding: 2cqi; background: #5b3b78; border-radius: 32cqi 32cqi 0 0; box-shadow: inset 0 0 0 0.6cqi #e2c477; }
.card-timhue__photo { width: 100%; height: 100%; border-radius: 30cqi 30cqi 0 0; font-size: 13cqi; }
.card-timhue .monogram { background: linear-gradient(180deg, #7b5a99, #4a2f63); color: #f3e3b3; font-family: var(--font-vibes); }
.card-timhue__eyebrow { font-family: var(--font-sans); font-size: 3.7cqi; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #6d4a8c; margin-top: 2cqi; }
.card-timhue__names { display: flex; flex-direction: column; font-size: 9cqi; font-weight: 600; color: #4a2f63; }
.card-timhue__amp { font-family: var(--font-vibes); font-size: 0.75em; color: #7d6424; font-weight: 400; }
.card-timhue__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #4b3a5a; max-width: 92%; }
.card-timhue__date { font-size: 5.8cqi; font-weight: 700; letter-spacing: 0.1em; color: #5b3b78; }
.card-timhue__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #4b3a5a; }
.card-timhue__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #4b3a5a; }
.card-timhue__venue-name { font-weight: 600; font-size: 4.1cqi; color: #5b3b78; }
.card-timhue__map { color: #5b3b78; font-size: 3.6cqi; }

/* --- Lụa Hà Đông: dải lụa chàm chéo, viền chỉ vàng --- */
.card-luahd { background: #fbf7ee; padding: 4cqi; color: #22325a; font-family: var(--font-display); }
.card-luahd__silk { position: absolute !important; top: 2cqi; left: -20%; right: -20%; height: 30cqi; transform: rotate(-9deg); transform-origin: center;
  background: linear-gradient(180deg, transparent 0, #263f73 8%, #3b5a99 30%, #8fa6d6 46%, #3b5a99 62%, #263f73 92%, transparent 100%); opacity: 0.92; }
.card-luahd__body { flex: 1; width: 100%; margin-top: 26cqi; border: 0.4cqi solid #c9a24f; outline: 0.3cqi dashed #c9a24f; outline-offset: -2cqi; background: rgba(251, 247, 238, 0.96); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqi; padding: 7cqi 6cqi; }
.card-luahd__eyebrow { font-family: var(--font-sans); font-size: 3.7cqi; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: #8c6a24; }
.card-luahd__photo { width: 46cqi; aspect-ratio: 1; border-radius: 50%; border: 0.6cqi solid #263f73; }
.card-luahd__names { display: flex; flex-direction: column; font-family: var(--font-vibes); font-size: 11.5cqi; color: #263f73; }
.card-luahd__amp { font-size: 0.6em; color: #7d5f2a; }
.card-luahd__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #3a4466; }
.card-luahd__date { font-size: 5.6cqi; font-weight: 700; letter-spacing: 0.12em; color: #263f73; }
.card-luahd__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #3a4466; }
.card-luahd__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #3a4466; }
.card-luahd__venue-name { font-weight: 600; font-size: 4.1cqi; color: #263f73; }
.card-luahd__map { color: #263f73; font-size: 3.6cqi; }

/* --- Đồng Lúa Chín: trời sáng, chân thiệp lúa vàng --- */
.card-donglua { background: linear-gradient(180deg, #eaf2ee 0%, #fbf6e4 55%, #f6ead0 100%); padding: 0; justify-content: flex-start; color: #2e4420; font-family: var(--font-serif); }
.card-donglua__body { flex: 1; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4cqi; padding: 10cqi 8cqi 3cqi; }
.card-donglua__eyebrow { font-family: var(--font-sans); font-size: 3.7cqi; font-weight: 600; color: #6b5414; letter-spacing: 0.06em; }
.card-donglua__photo { width: 60cqi; aspect-ratio: 4 / 3; border-radius: 3cqi; border: 0.8cqi solid #fff; box-shadow: 0 1cqi 3cqi rgba(46, 68, 32, 0.25); }
.card-donglua__names { display: flex; flex-direction: column; font-family: var(--font-script); font-size: 10cqi; font-weight: 600; color: #3f5d24; }
.card-donglua__amp { font-family: var(--font-serif); font-size: 0.42em; font-style: italic; color: #6b5414; }
.card-donglua__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #3d4a2e; }
.card-donglua__date { font-size: 5.6cqi; font-weight: 700; letter-spacing: 0.1em; color: #6b5414; }
.card-donglua__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #3d4a2e; }
.card-donglua__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #3d4a2e; }
.card-donglua__venue-name { font-weight: 600; font-size: 4.1cqi; color: #3f5d24; }
.card-donglua__map { color: #3f5d24; font-size: 3.6cqi; }
.card-donglua__field { width: 100% !important; height: 26cqi; object-fit: cover; object-position: bottom; display: block; flex: none; }

/* --- Tối Giản: trắng, canh trái, số lớn nét mảnh --- */
.card-toigian { background: #ffffff; color: #1f1f1f; padding: 12cqi 10cqi; gap: 3.2cqi; align-items: flex-start !important; text-align: left !important; justify-content: center; font-family: var(--font-sans); }
.card-toigian__eyebrow { font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.24em; text-transform: uppercase; color: #6a6a6a; }
.card-toigian__big { font-family: var(--font-display); font-size: 25cqi; font-weight: 500; line-height: 0.95; letter-spacing: -0.02em; color: #1f1f1f; }
.card-toigian__names { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 9cqi; font-weight: 600; color: #1f1f1f; border-left: 0.6cqi solid #1f1f1f; padding-left: 4cqi; }
.card-toigian__photo { width: 100%; aspect-ratio: 16 / 10; border-radius: 0; filter: grayscale(0.15); }
.card-toigian__invitation { font-size: 3.8cqi; line-height: 1.55; color: #444; max-width: 92%; }
.card-toigian__meta { width: 100%; border-top: 0.3cqi solid #1f1f1f; padding-top: 3cqi; display: grid; gap: 1.6cqi; }
.card-toigian__when { font-size: 3.9cqi; font-weight: 600; color: #1f1f1f; }
.card-toigian__venue { font-size: 3.7cqi; line-height: 1.45; color: #444; }
.card-toigian__venue-name { font-weight: 600; font-size: 4cqi; color: #1f1f1f; }
.card-toigian__map { color: #1f1f1f; font-size: 3.6cqi; }

/* --- Màu Nước Xanh --- */
.card-maunuoc { background: #fbfaf5; color: #2f4a3e; padding: 12cqi 8cqi; gap: 2.6cqi; justify-content: center; font-family: var(--font-display); }
.card-maunuoc__wash { position: absolute !important; border-radius: 50%; filter: blur(2cqi); pointer-events: none; }
.card-maunuoc__wash--a { width: 80cqi; height: 56cqi; top: -16cqi; left: -24cqi; background: radial-gradient(circle at 40% 40%, rgba(122, 168, 140, 0.55), rgba(122, 168, 140, 0.15) 60%, transparent 70%); }
.card-maunuoc__wash--b { width: 70cqi; height: 60cqi; bottom: -20cqi; right: -22cqi; background: radial-gradient(circle at 60% 50%, rgba(158, 192, 170, 0.6), rgba(211, 194, 150, 0.25) 55%, transparent 70%); }
.card-maunuoc__eyebrow { font-family: var(--font-sans); font-size: 3.7cqi; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; color: #4f7a63; }
.card-maunuoc__photo { width: 46cqi; aspect-ratio: 3 / 4; border-radius: 50%; border: 0.8cqi solid #fff; box-shadow: 0 0 0 0.4cqi #9cbca8; }
.card-maunuoc__names { display: flex; flex-direction: column; font-family: var(--font-vibes); font-size: 12cqi; color: #2f5a46; }
.card-maunuoc__amp { font-size: 0.6em; color: #6f5d2c; }
.card-maunuoc__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #3d5248; max-width: 92%; }
.card-maunuoc__date { font-size: 5.6cqi; font-weight: 700; letter-spacing: 0.12em; color: #2f5a46; }
.card-maunuoc__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #3d5248; }
.card-maunuoc__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #3d5248; }
.card-maunuoc__venue-name { font-weight: 600; font-size: 4.1cqi; color: #2f5a46; }
.card-maunuoc__map { color: #2f5a46; font-size: 3.6cqi; }

/* --- Polaroid: giấy kẻ, khung ảnh nghiêng --- */
.card-polaroid { background: linear-gradient(transparent 95%, rgba(150, 170, 200, 0.25) 95%) 0 0 / 100% 6cqi, #fbf8f1; color: #3d2f2a; padding: 10cqi 8cqi; gap: 3cqi; justify-content: center; font-family: var(--font-sans); }
.card-polaroid__print { margin: 0 0 2cqi; width: 66cqi; padding: 3.5cqi 3.5cqi 0; background: #fff; box-shadow: 0 1.2cqi 3.5cqi rgba(61, 47, 42, 0.25); transform: rotate(-3deg); display: flex; flex-direction: column; }
.card-polaroid__tape { position: absolute !important; top: -3cqi; left: 50%; width: 24cqi; height: 6cqi; transform: translateX(-50%) rotate(4deg); background: rgba(231, 206, 150, 0.75); }
.card-polaroid__photo { width: 100%; aspect-ratio: 1; font-size: 14cqi; }
.card-polaroid .monogram { background: linear-gradient(135deg, #f1e2d8, #e2c7b7); color: #7a3f31; }
.card-polaroid__caption { font-family: var(--font-script); font-size: 6cqi; color: #8a4b3b; padding: 3cqi 0 4cqi; }
.card-polaroid__names { font-family: var(--font-script); font-size: 9.6cqi; font-weight: 600; color: #8a4b3b; line-height: 1.2; }
.card-polaroid__invitation { font-size: 3.8cqi; line-height: 1.55; color: #4d3d36; max-width: 92%; }
.card-polaroid__when { font-size: 3.9cqi; font-weight: 600; color: #3d2f2a; }
.card-polaroid__venue { font-size: 3.7cqi; line-height: 1.45; color: #4d3d36; }
.card-polaroid__venue-name { font-weight: 600; font-size: 4cqi; color: #8a4b3b; }
.card-polaroid__map { color: #8a4b3b; font-size: 3.6cqi; }

/* --- Vé Mời: thân vé + cuống, răng cưa --- */
.card-vemoi { background: #e8efee; padding: 6cqi; justify-content: center; font-family: var(--font-sans); color: #17353d; }
.card-vemoi__main { width: 100%; background: #fffdf7; border-radius: 3cqi 3cqi 0 0; padding: 7cqi 6cqi 6cqi; display: flex; flex-direction: column; align-items: center; gap: 2.4cqi; }
.card-vemoi__eyebrow { font-size: 3.7cqi; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: #fff; background: #1f4f5c; padding: 1.2cqi 4cqi; border-radius: 99px; }
.card-vemoi__photo { width: 100%; aspect-ratio: 16 / 9; border-radius: 2cqi; }
.card-vemoi__names { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 0 2.4cqi; font-family: var(--font-display); font-size: 9cqi; font-weight: 700; color: #17353d; }
.card-vemoi__amp { color: #c27a3a; }
.card-vemoi__invitation { font-size: 3.8cqi; line-height: 1.5; color: #35525a; }
.card-vemoi__grid { width: 100%; margin: 1cqi 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 2cqi; text-align: left; }
.card-vemoi__grid div { border: 0.3cqi solid #c9d6d4; border-radius: 1.6cqi; padding: 2cqi 3cqi; }
.card-vemoi__wide { grid-column: span 2; }
.card-vemoi__grid dt { font-size: 3.6cqi; text-transform: uppercase; letter-spacing: 0.12em; color: #5a7178; }
.card-vemoi__grid dd { margin: 0.5cqi 0 0; font-size: 4.4cqi; font-weight: 700; color: #17353d; }
.card-vemoi__address { font-size: 3.7cqi; line-height: 1.45; color: #35525a; }
.card-vemoi__map { color: #1f4f5c; font-size: 3.6cqi; }
.card-vemoi__stub {
  width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2cqi; padding: 5cqi 6cqi; color: #fff;
  background: radial-gradient(circle at 0 0, transparent 2.6cqi, #1f4f5c 2.7cqi) 0 0 / 51% 100% no-repeat, radial-gradient(circle at 100% 0, transparent 2.6cqi, #1f4f5c 2.7cqi) 100% 0 / 51% 100% no-repeat;
  border-top: 0.5cqi dashed #e8efee; border-radius: 0 0 3cqi 3cqi; font-size: 3.6cqi;
}
.card-vemoi__stub span:last-child { text-align: right; }
.card-vemoi__stub span:first-child { text-align: left; }
.card-vemoi__stub strong { font-family: var(--font-display); font-size: 8cqi; letter-spacing: 0.1em; color: #f5d7a1; }

/* --- Lịch Tháng Cưới --- */
.card-lich { background: #fdf9f3; color: #3a2b28; padding: 10cqi 8cqi; gap: 2.6cqi; justify-content: center; font-family: var(--font-sans); }
.card-lich__eyebrow { font-size: 3.7cqi; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: #b0413e; }
.card-lich__names { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 9cqi; font-weight: 600; color: #3a2b28; }
.card-lich__amp { font-family: var(--font-vibes); font-size: 0.75em; color: #b0413e; font-weight: 400; }
.card-lich__photo { width: 56cqi; aspect-ratio: 4 / 3; border-radius: 2cqi; }
.card-lich__sheet { width: 100%; background: #fff; border: 0.3cqi solid #ead9cf; border-radius: 2.4cqi; padding: 4cqi; box-shadow: 0 1cqi 2.5cqi rgba(58, 43, 40, 0.08); }
.card-lich__month { font-family: var(--font-display); font-size: 5.4cqi; font-weight: 700; color: #b0413e; margin-bottom: 2cqi !important; }
.card-lich__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1cqi; }
.card-lich__wd { font-size: 3.6cqi; font-weight: 600; color: #6b5852; }
.card-lich__cell { display: grid; place-items: center; aspect-ratio: 1; font-size: 3.8cqi; color: #3a2b28; }
.card-lich__cell.is-day { position: relative; color: #fff; font-weight: 700; }
.card-lich__cell.is-day::before { content: ''; position: absolute; inset: 6%; z-index: -1; border-radius: 50%; background: #b0413e; box-shadow: 0 0 0 0.6cqi #fdf9f3, 0 0 0 1cqi #b0413e; }
.card-lich__cell.is-day { isolation: isolate; }
.card-lich__cell.is-day::after { content: '♥'; position: absolute; top: -18%; right: -14%; font-size: 3.6cqi; line-height: 1; color: #b0413e; }
.card-lich__invitation { font-size: 3.8cqi; line-height: 1.5; color: #5a4842; max-width: 92%; }
.card-lich__when { font-size: 3.9cqi; font-weight: 600; color: #3a2b28; }
.card-lich__venue { font-size: 3.7cqi; line-height: 1.45; color: #5a4842; }
.card-lich__venue-name { font-weight: 600; font-size: 4cqi; color: #b0413e; }
.card-lich__map { color: #b0413e; font-size: 3.6cqi; }

/* --- Hoa Cỏ Đồng Nội --- */
.card-hoadai { background: #fbf9f2; color: #3c4a37; padding: 16cqi 10cqi; gap: 2.6cqi; justify-content: center; font-family: var(--font-display); }
.card-hoadai__sprig { position: absolute !important; width: 40cqi; height: 40cqi; pointer-events: none; }
.card-hoadai__sprig--tl { top: 1cqi; left: 1cqi; }
.card-hoadai__sprig--br { bottom: 1cqi; right: 1cqi; transform: rotate(180deg); }
.card-hoadai__eyebrow { font-family: var(--font-sans); font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: #4f6648; }
.card-hoadai__photo { width: 50cqi; aspect-ratio: 1; border-radius: 50%; border: 0.5cqi solid #c9b9b0; padding: 1cqi; background: #fff; }
.card-hoadai__names { display: flex; flex-direction: column; font-size: 9.4cqi; font-weight: 500; font-style: italic; color: #3c4a37; }
.card-hoadai__amp { font-family: var(--font-vibes); font-style: normal; font-size: 0.7em; color: #9a5856; }
.card-hoadai__invitation { font-size: 3.9cqi; line-height: 1.5; font-style: italic; color: #4a5544; max-width: 92%; }
.card-hoadai__date { font-size: 5.6cqi; font-weight: 700; letter-spacing: 0.12em; color: #56704f; }
.card-hoadai__when { font-family: var(--font-sans); font-size: 3.8cqi; color: #4a5544; }
.card-hoadai__venue { font-family: var(--font-sans); font-size: 3.7cqi; line-height: 1.45; color: #4a5544; }
.card-hoadai__venue-name { font-weight: 600; font-size: 4.1cqi; color: #56704f; }
.card-hoadai__map { color: #56704f; font-size: 3.6cqi; }

/* --- Vòm Đất Nung --- */
.card-vomdat { background: #f3e7d7; color: #4a2c1f; padding: 10cqi 8cqi; gap: 2.6cqi; justify-content: flex-start; font-family: var(--font-sans); }
.card-vomdat__sun { position: absolute !important; width: 90cqi; height: 90cqi; top: -30cqi; right: -40cqi; border-radius: 50%; background: radial-gradient(circle, rgba(214, 138, 96, 0.35), rgba(214, 138, 96, 0) 70%); pointer-events: none; }
.card-vomdat__arch { width: 64cqi; aspect-ratio: 3 / 4; border-radius: 32cqi 32cqi 2cqi 2cqi; padding: 1.6cqi; background: #c46a43; }
.card-vomdat__photo { width: 100%; height: 100%; border-radius: 30cqi 30cqi 1cqi 1cqi; font-size: 13cqi; }
.card-vomdat .monogram { background: linear-gradient(180deg, #a85a35, #74361f); color: #fbeee0; font-family: var(--font-display); }
.card-vomdat__eyebrow { font-size: 3.6cqi; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: #9c4f30; margin-top: 2cqi; }
.card-vomdat__names { display: flex; flex-direction: column; font-family: var(--font-display); font-size: 8.4cqi; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: #4a2c1f; }
.card-vomdat__amp { font-family: var(--font-vibes); text-transform: none; letter-spacing: 0; font-size: 0.85em; color: #9c4f30; font-weight: 400; }
.card-vomdat__invitation { font-size: 3.8cqi; line-height: 1.5; color: #5d4033; max-width: 92%; }
.card-vomdat__date { font-family: var(--font-display); font-size: 5.6cqi; font-weight: 700; letter-spacing: 0.14em; color: #9c4f30; }
.card-vomdat__when { font-size: 3.8cqi; color: #5d4033; }
.card-vomdat__venue { font-size: 3.7cqi; line-height: 1.45; color: #5d4033; }
.card-vomdat__venue-name { font-weight: 600; font-size: 4.1cqi; color: #4a2c1f; }
.card-vomdat__map { color: #9c4f30; font-size: 3.6cqi; }

/* Tên dài xuống dòng không để dấu tiếng Việt chạm nhau (thắng .premium .card-names) */
.premium :is(.card-caudoi__names, .card-phongbi__names, .card-dongho__names, .card-gomlam__names, .card-timhue__names, .card-lich__names, .card-vomdat__names, .card-trongdong__names) { line-height: 1.3; }
.premium :is(.card-sonmai__names, .card-hoadai__names, .card-toigian__names, .card-vemoi__names) { line-height: 1.25; }
.premium :is(.card-luahd__names, .card-maunuoc__names, .card-donglua__names, .card-polaroid__names) { line-height: 1.22; }
/* Bố cục xếp dọc có khối lớn (phong bì, lụa, trống đồng): cho bìa tự cao thêm khi nội dung dài */
.card-phongbi, .card-luahd, .card-dongho { aspect-ratio: auto; min-height: 140cqi; }

/* ===== Mục bên dưới bìa của 16 mẫu bổ sung: đồng bộ màu, font và viền với bìa ===== */
.tpl-cau-doi { --sec-bg: #fbf1dc; --sec-text: #4a1e16; --sec-muted: #6a4a3c; --sec-border: #e3c88f; --sec-accent: var(--accent, #9a1d1d); --sec-title-font: var(--font-display); --sec-radius: 2px; }
.tpl-cau-doi .card-section { border: 1px solid #c9a24f; border-left: 6px solid #a51c1c; border-right: 6px solid #a51c1c; }
.tpl-phong-bi { --sec-bg: #fdf6e6; --sec-text: #4a2420; --sec-muted: #6a4a3c; --sec-border: #e6cfa4; --sec-accent: var(--accent, #7a1622); --sec-title-font: var(--font-display); }
.tpl-phong-bi .card-section { border-top: 0; padding-top: 30px; background: linear-gradient(160deg, #7a1622 50%, transparent 50.5%) 0 0 / 50% 14px no-repeat, linear-gradient(200deg, #7a1622 50%, transparent 50.5%) 100% 0 / 50% 14px no-repeat, var(--sec-bg); }
.tpl-dong-ho { --sec-bg: #f1e4c6; --sec-text: #2a1f16; --sec-muted: #5a4a3a; --sec-border: #241a12; --sec-accent: var(--accent, #8c2f1c); --sec-title-font: var(--font-display); --sec-radius: 0; }
.tpl-dong-ho .card-section { border: 3px solid #241a12; outline: 1px solid #241a12; outline-offset: -7px; }
.tpl-dong-ho .card-section__title { text-transform: uppercase; letter-spacing: 0.1em; }
.tpl-gom-lam { --sec-bg: #ffffff; --sec-text: #1d3557; --sec-muted: #4a5d78; --sec-border: #c9d6ea; --sec-accent: var(--accent, #1f4e8c); --sec-title-font: var(--font-display); --sec-radius: 16px; }
.tpl-gom-lam .card-section { border-top: 0; padding-top: 28px; background: radial-gradient(circle at 50% 100%, transparent 6px, #1f4e8c 6.5px, #1f4e8c 8px, transparent 8.5px) 0 0 / 16px 10px repeat-x, var(--sec-bg); }
.tpl-son-mai { --sec-bg: #160c0a; --sec-text: #efdfb9; --sec-muted: #cdb98c; --sec-border: rgba(217, 179, 93, 0.38); --sec-accent: #e2bf6e; --sec-title-font: var(--font-display); --sec-btn-text: #160c0a; }
.tpl-son-mai .card-section { border-top: 2px solid #b8913e; }
.tpl-trong-dong { --sec-bg: #2f1f14; --sec-text: #f0dfb6; --sec-muted: #cfba8c; --sec-border: rgba(224, 184, 102, 0.38); --sec-accent: #e0b866; --sec-title-font: var(--font-display); --sec-btn-text: #2f1f14; }
.tpl-trong-dong .card-section { border-top: 0; padding-top: 28px; background: repeating-linear-gradient(90deg, #b98a3e 0 6px, transparent 6px 12px) 0 6px / 100% 3px no-repeat, linear-gradient(#b98a3e, #b98a3e) 0 0 / 100% 2px no-repeat, var(--sec-bg); }
.card-page:is(.tpl-son-mai, .tpl-trong-dong) .card-section input,
.card-page:is(.tpl-son-mai, .tpl-trong-dong) .card-section textarea { background: rgba(255, 255, 255, 0.95); color: #2a2a26; }
.card-page:is(.tpl-son-mai, .tpl-trong-dong) .card-section label { color: var(--sec-text); }
.tpl-tim-hue { --sec-bg: #faf6fb; --sec-text: #3d2a52; --sec-muted: #5f4d6e; --sec-border: #ddcde6; --sec-accent: var(--accent, #5b3b78); --sec-title-font: var(--font-display); --sec-radius: 20px 20px 6px 6px; }
.tpl-tim-hue .card-section__title { font-style: italic; font-size: 1.4rem; }
.tpl-lua-ha-dong { --sec-bg: #fbf7ee; --sec-text: #22325a; --sec-muted: #4a5577; --sec-border: #dcd2b8; --sec-accent: var(--accent, #263f73); --sec-title-font: var(--font-vibes); }
.tpl-lua-ha-dong .card-section { border: 1px solid #c9a24f; border-top: 4px solid #3b5a99; }
.tpl-lua-ha-dong .card-section__title { font-size: 1.9rem; font-weight: 400; }
.tpl-dong-lua { --sec-bg: #fbf6e4; --sec-text: #2e4420; --sec-muted: #55623f; --sec-border: #e3d29d; --sec-accent: var(--accent, #3f5d24); --sec-title-font: var(--font-script); --sec-radius: 14px; }
.tpl-dong-lua .card-section { border-top: 0; border-bottom: 5px solid #d9b24c; }
.tpl-dong-lua .card-section__title { font-size: 1.6rem; }
.tpl-toi-gian { --sec-bg: #ffffff; --sec-text: #1f1f1f; --sec-muted: #5d5d5d; --sec-border: #e3e3e3; --sec-accent: var(--accent, #1f1f1f); --sec-title-font: var(--font-sans); --sec-radius: 0; }
.tpl-toi-gian .card-section { border: 0; border-top: 1px solid #1f1f1f; text-align: left; }
.tpl-toi-gian .card-section__title { text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.9rem; }
.tpl-toi-gian .card-section__title::after { display: none; }
.tpl-mau-nuoc { --sec-bg: #fbfaf5; --sec-text: #2f4a3e; --sec-muted: #546a5f; --sec-border: #d7e3da; --sec-accent: var(--accent, #3f6b55); --sec-title-font: var(--font-vibes); --sec-radius: 24px; }
.tpl-mau-nuoc .card-section { border-top: 1px solid var(--sec-border); background: radial-gradient(120% 60% at 0 0, rgba(122, 168, 140, 0.18), transparent 60%), var(--sec-bg); }
.tpl-mau-nuoc .card-section__title { font-size: 1.9rem; font-weight: 400; }
.tpl-polaroid { --sec-bg: #fffefb; --sec-text: #3d2f2a; --sec-muted: #6a5850; --sec-border: #eadfd6; --sec-accent: var(--accent, #8a4b3b); --sec-title-font: var(--font-script); --sec-radius: 2px; }
.tpl-polaroid .card-section { border-top: 0; box-shadow: 0 4px 14px rgba(61, 47, 42, 0.12); }
.tpl-polaroid .card-section__title { font-size: 1.7rem; }
.tpl-ve-moi { --sec-bg: #fffdf7; --sec-text: #17353d; --sec-muted: #4d6469; --sec-border: #c9d6d4; --sec-accent: var(--accent, #1f4f5c); --sec-title-font: var(--font-sans); --sec-radius: 14px; }
.tpl-ve-moi .card-section { border-top: 0; border-bottom: 2px dashed #9fb4b1; }
.tpl-ve-moi .card-section__title { text-transform: uppercase; letter-spacing: 0.16em; font-size: 0.95rem; }
.tpl-lich-thang { --sec-bg: #ffffff; --sec-text: #3a2b28; --sec-muted: #6a5852; --sec-border: #ead9cf; --sec-accent: var(--accent, #b0413e); --sec-title-font: var(--font-display); --sec-radius: 12px; }
.tpl-lich-thang .card-section { border-top: 10px solid #b0413e; }
.tpl-hoa-dai { --sec-bg: #fbf9f2; --sec-text: #3c4a37; --sec-muted: #5d6857; --sec-border: #dfe5d3; --sec-accent: var(--accent, #56704f); --sec-title-font: var(--font-display); --sec-radius: 18px; }
.tpl-hoa-dai .card-section { border-top: 1px solid var(--sec-border); background: url('/assets/orn/hoa-dai.svg') right -14px top -14px / 70px no-repeat, var(--sec-bg); }
.tpl-hoa-dai .card-section__title { font-style: italic; font-size: 1.4rem; }
.tpl-vom-dat { --sec-bg: #f8efe4; --sec-text: #4a2c1f; --sec-muted: #6d4d3e; --sec-border: #e5cdb6; --sec-accent: var(--accent, #9c4f30); --sec-title-font: var(--font-display); --sec-radius: 40px 40px 8px 8px; }
.tpl-vom-dat .card-section__title { text-transform: uppercase; letter-spacing: 0.16em; font-size: 1.05rem; }

/* Bìa đầy đủ trên điện thoại (bìa ≈ 313px): chữ phụ của Bộ Hỷ Sự Đỏ và 16 mẫu bổ sung không nhỏ hơn 12.5px.
   Ảnh thu nhỏ trong bộ sưu tập không có .card-cover nên giữ nguyên tỉ lệ. */
.card-cover :is(.card-hyson, .card-senvang, .card-traudo, .card-thuphap, .card-denlong, .card-mayvang, .card-hoadao, .card-nguyet,
  .card-caudoi, .card-phongbi, .card-dongho, .card-gomlam, .card-sonmai, .card-trongdong, .card-timhue, .card-luahd, .card-donglua,
  .card-toigian, .card-maunuoc, .card-polaroid, .card-vemoi, .card-lich, .card-hoadai, .card-vomdat)
  :is([class*='__map'], [class*='__eyebrow'], [class*='__venue-address'], [class*='__lintel'], [class*='__when'], [class*='__invitation'], [class*='__address'], .card-lich__wd, .card-lich__cell, .card-vemoi__grid dt, .card-vemoi__stub span) { font-size: max(12.5px, 3.6cqi); }

/* =====================================================================================================
   BỘ THIỆP HOÀN CHỈNH: bìa → thư mời (hai họ, ngày dương – âm) → câu chuyện → lịch trình → album → tương tác.
   Phần chung cho mọi mẫu, rồi chủ đề riêng của bốn mẫu đại diện: Cổ điển, Truyền thống (miễn phí),
   Song Hỷ Đỏ Son (29k), Cửa Nguyệt Đỏ Đô (129k). Họa tiết do Tùng Chi vẽ (assets/orn), chất liệu nền bằng CSS.
   ===================================================================================================== */

/* Ngày âm lịch dưới ngày dương trên bìa */
.card-lunar { font-family: var(--font-display); font-style: italic; font-size: 3.4cqi; line-height: 1.35; opacity: 0.92; }
.card-cover .card-lunar { font-size: max(12px, 3.4cqi); }

/* Lời gửi riêng khi mở bằng link mời riêng */
.guest-banner { margin: 0 auto; text-align: center; font-family: var(--font-display); font-size: 1.12rem; color: var(--sec-accent); letter-spacing: 0.02em; }
.guest-banner strong { font-family: var(--font-vibes); font-weight: 400; font-size: 1.7rem; margin-left: 4px; }

/* Tiêu đề mục: họa tiết vạch vàng thay cho gạch ngang mảnh */
.card-page .card-section__title::after { display: none; }
.card-section__orn { display: block; width: 150px; height: 16px; margin: 6px auto 14px; background: url('/assets/orn/vach-vang.svg') center / contain no-repeat; }

/* ----- Thư mời ----- */
.card-page .invite { text-align: center; padding: 30px 22px 26px; }
.invite p { margin: 0; }
.invite__kicker { font-family: var(--font-sans); font-size: 0.78rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--sec-accent); font-weight: 600; }
.invite__guest { font-family: var(--font-vibes); font-size: 2.1rem; line-height: 1.25; color: var(--sec-accent); margin: 6px auto 4px !important; overflow-wrap: anywhere; }
.invite__guest--blank { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; min-width: 60%; display: inline-block; padding: 0 18px 4px; border-bottom: 1px dotted color-mix(in srgb, var(--sec-accent) 55%, transparent); }
.invite__families { display: grid; gap: 14px; margin: 18px auto 16px !important; max-width: 560px; }
.invite__families--2 { grid-template-columns: 1fr 1fr; }
.invite__families--2 .invite__family + .invite__family { border-left: 1px solid var(--sec-border); }
.invite__family { padding: 0 8px; display: grid; gap: 3px; align-content: start; }
.invite__family-label { font-family: var(--font-sans); font-size: 0.74rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--sec-accent); font-weight: 600; margin-bottom: 4px !important; }
.invite__parent { font-family: var(--font-display); font-size: 1.12rem; line-height: 1.3; color: var(--sec-text); font-weight: 600; overflow-wrap: anywhere; }
.invite__address { font-family: var(--font-sans); font-size: 0.82rem; line-height: 1.45; color: var(--sec-muted); margin-top: 4px !important; overflow-wrap: anywhere; }
.invite__lead { font-family: var(--font-display); font-style: italic; font-size: 1.08rem; color: var(--sec-muted); }
.invite__couple { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 10px 0 14px; }
.invite__person { display: grid; gap: 0; }
.invite__role { font-family: var(--font-sans); font-size: 0.72rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--sec-muted); }
.invite__name { font-family: var(--font-vibes); font-size: clamp(2rem, 9vw, 2.9rem); line-height: 1.2; color: var(--sec-accent); overflow-wrap: anywhere; }
.invite__amp { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; color: var(--sec-muted); line-height: 1; }
.invite__when { display: grid; gap: 4px; padding: 14px 0; border-block: 1px solid var(--sec-border); max-width: 440px; margin: 0 auto; }
.invite__time { font-family: var(--font-sans); font-size: 0.86rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--sec-text); font-weight: 600; }
.invite__date { display: flex; justify-content: center; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.invite__weekday { font-family: var(--font-display); font-style: italic; font-size: 1.15rem; color: var(--sec-muted); }
.invite__day { font-family: var(--font-display); font-size: 2rem; font-weight: 600; letter-spacing: 0.06em; color: var(--sec-accent); }
.invite__lunar { font-family: var(--font-display); font-style: italic; font-size: 1rem; color: var(--sec-muted); }
.invite__venue { margin-top: 14px; display: grid; gap: 2px; }
.invite__at { font-family: var(--font-display); font-style: italic; color: var(--sec-muted); }
.invite__venue-name { font-family: var(--font-sans); font-size: 0.98rem; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 600; color: var(--sec-text); overflow-wrap: anywhere; }
.invite__venue-address { font-size: 0.9rem; color: var(--sec-muted); overflow-wrap: anywhere; }
.invite__closing { margin: 18px auto 0 !important; max-width: 460px; font-family: var(--font-display); font-style: italic; font-size: 1.02rem; line-height: 1.5; color: var(--sec-muted); }
.event-item__lunar { font-family: var(--font-display); font-style: italic; font-size: 0.92rem; color: var(--sec-muted); margin: 0 0 4px; }
@media (max-width: 420px) {
  .invite__families--2 { grid-template-columns: 1fr; }
  .invite__families--2 .invite__family + .invite__family { border-left: 0; border-top: 1px solid var(--sec-border); padding-top: 12px; }
}

/* ===================== 1. CỔ ĐIỂN (miễn phí): giấy ngà, khung vàng đôi, nhành hoa ===================== */
.card-classic {
  position: relative;
  background-color: #fbf7ee;
  background-image:
    radial-gradient(120% 60% at 0% 0%, rgba(201, 164, 92, 0.12), transparent 60%),
    radial-gradient(120% 60% at 100% 100%, rgba(201, 164, 92, 0.12), transparent 60%),
    repeating-linear-gradient(115deg, rgba(160, 130, 80, 0.035) 0 2px, transparent 2px 9px);
}
.card-classic__frame { position: relative; z-index: 1; border: 0; outline: 0.35cqi solid #c9a45c; outline-offset: -2cqi; box-shadow: inset 0 0 0 0.9cqi #fbf7ee, inset 0 0 0 1.25cqi #c9a45c; gap: 2.6cqi; padding: 9cqi 8cqi; background: none; }
.card-classic__sprig { position: absolute !important; width: 30cqi; opacity: 0.85; pointer-events: none; z-index: 0; }
.card-classic__sprig--tl { top: 1cqi; left: 1cqi; }
.card-classic__sprig--br { bottom: 1cqi; right: 1cqi; transform: rotate(180deg); }
.card-classic__eyebrow { color: #8c6d3e; letter-spacing: 0.36em; }
.card-classic__names { font-family: var(--font-display); font-size: 9.4cqi; font-weight: 600; color: #3b3326; letter-spacing: 0.01em; }
.card-classic__amp { font-family: var(--font-vibes); font-size: 10cqi; color: #b38e55; margin: -1cqi 0; }
.card-classic__rule { width: 62cqi; height: auto; margin: 0.5cqi 0; }
.card-classic__invitation { font-family: var(--font-display); font-size: 3.7cqi; color: #5c5040; }
.card-classic__date { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3cqi; width: 84%; margin-top: 1cqi; }
.card-classic__date-side { font-family: var(--font-sans); font-size: 3cqi; letter-spacing: 0.2em; text-transform: uppercase; color: #6d5326; padding: 1.4cqi 0; border-block: 0.3cqi solid #c9a45c; }
.card-classic__date-main { font-family: var(--font-display); font-size: 11cqi; font-weight: 600; line-height: 1; color: #3b3326; }
.card-classic__time { font-family: var(--font-sans); font-size: 3.4cqi; font-weight: 600; letter-spacing: 0.08em; color: #3b3326; }
.card-classic__lunar { color: #6d5326; }
.card-classic__venue-name { color: #3b3326; letter-spacing: 0.06em; text-transform: uppercase; font-size: 3.4cqi; }
.card-cover .card-classic__date-side { font-size: max(11px, 3cqi); }

.card-page.tpl-co-dien {
  --sec-bg: #fbf7ee; --sec-text: #3b3326; --sec-muted: #6f6450; --sec-border: #e3d3ad; --sec-accent: var(--accent, #765a2e);
  --sec-title-font: var(--font-display); --sec-radius: 4px;
}
.tpl-co-dien .card-section {
  border: 0; border-radius: 4px;
  background-color: #fbf7ee;
  background-image: repeating-linear-gradient(115deg, rgba(160, 130, 80, 0.03) 0 2px, transparent 2px 9px);
  box-shadow: inset 0 0 0 6px #fbf7ee, inset 0 0 0 7px #c9a45c, inset 0 0 0 9px #fbf7ee, inset 0 0 0 10px rgba(201, 164, 92, 0.5), 0 10px 28px rgba(59, 51, 38, 0.08);
}
.tpl-co-dien .card-section__title { font-size: 1.55rem; font-weight: 600; letter-spacing: 0.02em; }
.tpl-co-dien .invite__name { color: #6d5326; }

/* ===================== 2. TRUYỀN THỐNG (miễn phí): giấy dó kem, khung đỏ son, góc hồi văn, ấn Hỷ ===================== */
.card-traditional {
  position: relative;
  background-color: #f6ead2;
  background-image:
    radial-gradient(90% 55% at 50% 0%, rgba(255, 250, 238, 0.85), transparent 70%),
    repeating-linear-gradient(92deg, rgba(122, 74, 30, 0.035) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(3deg, rgba(122, 74, 30, 0.03) 0 1px, transparent 1px 11px);
  background-size: auto;
}
.card-traditional__corner { position: absolute !important; width: 15cqi; height: 15cqi; z-index: 2; pointer-events: none; }
.card-traditional__corner--tl { top: 2.2cqi; left: 2.2cqi; }
.card-traditional__corner--tr { top: 2.2cqi; right: 2.2cqi; transform: scaleX(-1); }
.card-traditional__corner--bl { bottom: 2.2cqi; left: 2.2cqi; transform: scaleY(-1); }
.card-traditional__corner--br { bottom: 2.2cqi; right: 2.2cqi; transform: scale(-1, -1); }
.card-traditional__border { position: relative; z-index: 1; border: 0.7cqi solid #a3241c; outline: 0.3cqi solid #c9a45c; outline-offset: -2cqi; padding: 9cqi 8cqi; gap: 2.4cqi; }
.card-traditional__seal { width: 24cqi; height: 24cqi; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #c43a2c, #8e1a14 72%); box-shadow: 0 0 0 0.8cqi #f6ead2, 0 0 0 1.2cqi #c9a45c, 0 1.6cqi 3cqi rgba(110, 30, 25, 0.25); }
.card-traditional__seal .card-traditional__symbol { font-size: 13cqi; color: #f8e3a8; font-family: var(--font-han); }
.card-traditional__eyebrow { margin-top: 1.5cqi; letter-spacing: 0.4em; font-size: 3.6cqi; }
.card-traditional__names { font-family: var(--font-vibes); font-weight: 400; font-size: 10cqi; line-height: 1.15; color: #8e1a14; }
.card-traditional__amp { font-family: var(--font-display); font-size: 3.8cqi; color: #8a5a2b; margin: -1cqi 0; }
.card-traditional__invitation { font-family: var(--font-display); font-style: italic; font-size: 3.6cqi; color: #4a2a1f; }
.card-traditional__when { display: grid; gap: 0.8cqi; padding: 2.4cqi 6cqi; border-block: 0.3cqi solid #c9a45c; margin-top: 1cqi; }
.card-traditional__time { font-family: var(--font-sans); font-size: 3.2cqi; letter-spacing: 0.14em; text-transform: uppercase; color: #5b1712; font-weight: 600; }
.card-traditional__date { font-family: var(--font-display); font-size: 7.4cqi; font-weight: 600; letter-spacing: 0.06em; color: #a3241c; line-height: 1.1; }
.card-traditional__lunar { color: #6b3a24; }
.card-traditional__venue-name { letter-spacing: 0.08em; text-transform: uppercase; font-size: 3.4cqi; }

.card-page.tpl-truyen-thong {
  --sec-bg: #f6ead2; --sec-text: #4a2a1f; --sec-muted: #7a5236; --sec-border: #dcc08a; --sec-accent: var(--accent, #a3241c);
  --sec-title-font: var(--font-display); --sec-radius: 2px;
}
.tpl-truyen-thong .card-section {
  border: 2px solid #a3241c; outline: 1px solid #c9a45c; outline-offset: -7px; border-radius: 2px;
  background-color: #f6ead2;
  background-image:
    url('/assets/orn/hoi-van-do.svg'), url('/assets/orn/hoi-van-do-phai.svg'),
    repeating-linear-gradient(92deg, rgba(122, 74, 30, 0.03) 0 1px, transparent 1px 7px);
  background-position: 10px 10px, calc(100% - 10px) 10px, 0 0;
  background-size: 34px 34px, 34px 34px, auto;
  background-repeat: no-repeat, no-repeat, repeat;
}
.tpl-truyen-thong .card-section__title { font-size: 1.55rem; font-weight: 700; letter-spacing: 0.04em; }
.tpl-truyen-thong .invite__kicker::before, .tpl-truyen-thong .invite__kicker::after { content: '◆'; color: #c9a45c; font-size: 0.6rem; margin: 0 10px; vertical-align: middle; }
.tpl-truyen-thong .invite__name { color: #8e1a14; }

/* ===================== 3. SONG HỶ ĐỎ SON (29k): nhung đỏ son, chữ vàng kim; thư mời là tờ kem lồng trong ===================== */
.card-page.tpl-song-hy-son {
  --sec-bg: #8f1616; --sec-text: #fbe8c4; --sec-muted: #f0d29c; --sec-border: rgba(230, 198, 116, 0.45); --sec-accent: #f3d98f;
  --sec-title-font: var(--font-display); --sec-btn-text: #7a1212; --sec-radius: 6px;
}
.tpl-song-hy-son .card-section {
  border: 0; border-radius: 6px; position: relative;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 196, 120, 0.16), transparent 60%),
    repeating-radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.05) 0 1px, transparent 1px 4px),
    linear-gradient(160deg, #a51c1c, #7e1212 70%, #6a0f0f);
  box-shadow: inset 0 0 0 5px #8f1616, inset 0 0 0 6px #d8b45e, inset 0 0 0 9px #8f1616, inset 0 0 0 10px rgba(216, 180, 94, 0.55), 0 14px 30px rgba(90, 14, 14, 0.25);
}
.tpl-song-hy-son .card-section__title { font-size: 1.6rem; font-weight: 600; color: #f3d98f; letter-spacing: 0.04em; }
.tpl-song-hy-son .invite {
  --sec-text: #5a1a14; --sec-muted: #7d4a2e; --sec-accent: #a51c1c; --sec-border: #e3c78f;
  padding: 22px; background: linear-gradient(160deg, #a51c1c, #7e1212);
}
.tpl-song-hy-son .invite > * { position: relative; z-index: 1; }
.tpl-song-hy-son .invite::before {
  content: ''; position: absolute; inset: 16px; border-radius: 4px; z-index: 0;
  background-color: #fbf1dc;
  background-image: radial-gradient(90% 50% at 50% 0%, #fffaf0, transparent 70%), repeating-linear-gradient(115deg, rgba(160, 110, 50, 0.04) 0 2px, transparent 2px 9px);
  box-shadow: inset 0 0 0 3px #fbf1dc, inset 0 0 0 4px #d8b45e;
}
.tpl-song-hy-son .invite { padding: 44px 34px 40px; }
.tpl-song-hy-son .invite__guest--blank { border-bottom-color: #c9a45c; }
.tpl-song-hy-son .guest-banner, .tpl-song-hy-son .guest-banner strong { color: #a51c1c; }
.tpl-song-hy-son .card-section input, .tpl-song-hy-son .card-section textarea { background: rgba(255, 252, 244, 0.96); color: #2a2a26; }
.tpl-song-hy-son .card-section label { color: var(--sec-text); }
.tpl-song-hy-son .event-item__time, .tpl-song-hy-son .event-item__venue { color: #fff4dc; }

/* ===================== 4. CỬA NGUYỆT ĐỎ ĐÔ (129k): kem và đỏ đô, mỗi mục mở ra dưới một vòm trăng ===================== */
.card-page.tpl-cua-nguyet {
  --sec-bg: #fbf3e2; --sec-text: #4a1418; --sec-muted: #7a4c40; --sec-border: #e6cfa0; --sec-accent: var(--accent, #7a1622);
  --sec-title-font: var(--font-display); --sec-radius: 14px;
}
.tpl-cua-nguyet .card-section {
  border: 0; border-radius: 14px; position: relative; overflow: hidden; padding-top: 0;
  background-color: #fbf3e2;
  background-image: radial-gradient(70% 40% at 50% 100%, rgba(201, 164, 92, 0.12), transparent 70%);
  box-shadow: 0 0 0 1px #e6cfa0, 0 12px 30px rgba(74, 20, 24, 0.1);
}
.tpl-cua-nguyet .card-section__title {
  margin: 0 -24px 0; padding: 22px 16px 26px; color: #f3dc9b; font-size: 1.5rem; font-weight: 600; letter-spacing: 0.03em;
  background: radial-gradient(120% 140% at 50% 0%, #8a2230, #5c0f19 75%);
  border-radius: 0 0 50% 50% / 0 0 34px 34px;
}
.tpl-cua-nguyet .card-section__orn { margin-top: -10px; position: relative; }
.tpl-cua-nguyet .invite { padding-top: 34px; }
.tpl-cua-nguyet .invite::before {
  content: ''; position: absolute; left: 50%; top: 14px; transform: translateX(-50%); width: min(78%, 420px); height: 120px;
  border: 1.5px solid #c9a45c; border-bottom: 0; border-radius: 210px 210px 0 0; pointer-events: none;
}
.tpl-cua-nguyet .invite__kicker { margin-top: 26px !important; }
.tpl-cua-nguyet .invite__name { color: #7a1622; }
.tpl-cua-nguyet .card-section .btn-primary { background: #7a1622; border-color: #7a1622; }

/* Màn hình rộng: thư mời hai họ đặt cạnh nhau, chữ lớn hơn */
@container (min-width: 640px) {
  .card-page .invite { padding: 40px 48px 34px; }
  .invite__name { font-size: 3.2rem; }
  .invite__parent { font-size: 1.2rem; }
}

/* Bìa trong khung xem: giữ cỡ chữ ngày lớn (quy tắc tối thiểu 12.5px ở trên chỉ dành cho chữ thân) */
.card-cover .card-traditional p.card-traditional__date { font-size: max(19px, 7.4cqi); }
.card-cover .card-traditional p.card-traditional__time { font-size: max(12px, 3.2cqi); }
.card-cover .card-classic span.card-classic__date-main { font-size: max(28px, 11cqi); }
.card-cover .card-classic p.card-classic__time { font-size: max(12.5px, 3.4cqi); }
/* Giấy dó: thớ giấy mảnh một chiều và đốm sợi, không thành ô kẻ */
.card-traditional {
  background-image:
    radial-gradient(90% 55% at 50% 0%, rgba(255, 250, 238, 0.9), transparent 70%),
    radial-gradient(rgba(122, 74, 30, 0.07) 0.6px, transparent 0.8px),
    repeating-linear-gradient(97deg, rgba(122, 74, 30, 0.025) 0 1px, transparent 1px 13px);
  background-size: auto, 7px 9px, auto;
}
.tpl-truyen-thong .card-section {
  background-image:
    url('/assets/orn/hoi-van-do.svg'), url('/assets/orn/hoi-van-do-phai.svg'),
    radial-gradient(rgba(122, 74, 30, 0.07) 0.6px, transparent 0.8px);
  background-size: 34px 34px, 34px 34px, 7px 9px;
  background-repeat: no-repeat, no-repeat, repeat;
}
.card-classic__date { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 2.4cqi; width: 90%; }
.card-classic__date-side { white-space: nowrap; letter-spacing: 0.1em; font-size: 2.8cqi; }
.card-cover .card-classic span.card-classic__date-side { font-size: max(10.5px, 2.8cqi); }

/* Lịch trình dạng dòng thời gian (mọi mẫu): giờ lớn bên trái, nghi lễ bên phải, đường nối mảnh */
.card-page .event-list { gap: 0; }
.card-page .event-item { display: grid; grid-template-columns: 78px minmax(0, 1fr); column-gap: 16px; padding: 14px 0; border: 0; border-bottom: 1px dashed var(--sec-border); position: relative; text-align: left; }
.card-page .event-item:last-child { border-bottom: 0; }
.event-item__when { text-align: right; padding-right: 14px; border-right: 1.5px solid color-mix(in srgb, var(--sec-accent) 55%, transparent); position: relative; }
.event-item__when::after { content: ''; position: absolute; right: -5.5px; top: 9px; width: 9px; height: 9px; border-radius: 50%; background: var(--sec-accent); box-shadow: 0 0 0 3px var(--sec-bg); }
.event-item__clock { font-family: var(--font-display); font-size: 1.55rem; font-weight: 600; line-height: 1.1; color: var(--sec-accent); margin: 0; }
.event-item__day { font-family: var(--font-sans); font-size: 0.72rem; line-height: 1.35; color: var(--sec-muted); margin: 4px 0 0; }
.card-page .event-item__name { font-family: var(--font-display); font-size: 1.22rem; font-weight: 600; margin: 0; }
.card-page .event-item__time { font-size: 0.86rem; color: var(--sec-muted); margin: 0; }
@container (min-width: 640px) {
  .card-page .event-list { grid-template-columns: 1fr; max-width: 620px; margin: 0 auto; gap: 0; }
  .card-page .event-item { border: 0; border-bottom: 1px dashed var(--sec-border); border-radius: 0; padding: 16px 0; grid-template-columns: 110px minmax(0, 1fr); }
  .card-page .event-item:last-child { border-bottom: 0; padding-bottom: 16px; }
}
/* Tên dài: xếp dọc, trục vàng nằm ngang */
.card-hyson__pair--stack { grid-template-columns: 1fr; gap: 1.6cqi; }
.card-hyson__pair--stack .card-hyson__name { text-align: center !important; }
.card-hyson__pair--stack .card-hyson__axis { width: 22cqi; height: 0.5cqi; min-height: 0; justify-self: center; background: linear-gradient(90deg, transparent, #e6c674 20%, #e6c674 80%, transparent); }
/* Tên và lời gửi tự cân dòng, không để một chữ lẻ ở dòng sau */
.invite__guest, .invite__name, .card-names, .guest-banner { text-wrap: balance; }
.invite__guest { font-size: clamp(1.7rem, 7.6vw, 2.1rem); }
/* Nền đỏ: chữ phụ trong mục tương tác dùng kem vàng cho đủ tương phản */
.tpl-song-hy-son .card-section .muted, .tpl-song-hy-son .card-section .small { color: #f0d29c; }
.tpl-song-hy-son .wish-list li { background: rgba(255, 244, 220, 0.1); color: #fbe8c4; }

/* =====================================================================================================
   BỘ THIỆP HOÀN CHỈNH CHO 28 MẪU CÒN LẠI (cùng chuẩn với 4 mẫu đại diện).
   Hai kiểu theo bìa: (A) KHUNG GIẤY cho bìa sáng – mục nền giấy riêng, khung lồng màu của mẫu và chi tiết lấy từ bìa;
   (B) NỀN ĐẬM + TỜ THƯ LỒNG cho bìa tối – mục nền đậm chữ vàng kem, thư mời là tờ giấy kem lồng trong khung.
   Biến chung: --paper (nền mục), --frame (màu khung), --dark1/--dark2 (nền đậm).
   ===================================================================================================== */

/* ---------- Bảng màu từng mẫu ---------- */
.card-page.tpl-trau-cau-do  { --paper: #fbf3e4; --sec-text: #3f1f1a; --sec-muted: #6e4a3a; --sec-accent: var(--accent, #7a1622); --frame: #7a1622; --sec-border: #e3c99a; }
.card-page.tpl-thu-phap     { --paper: #fbf8f1; --sec-text: #2b2420; --sec-muted: #6a5d50; --sec-accent: var(--accent, #a3241c); --frame: #a3241c; --sec-border: #e5d8c2; }
.card-page.tpl-may-vang     { --paper: #fbf3e3; --sec-text: #4d1a14; --sec-muted: #74503c; --sec-accent: var(--accent, #9c1c1c); --frame: #c9a45c; --sec-border: #e6cf9f; }
.card-page.tpl-hoa-dao      { --paper: #fffaf6; --sec-text: #4a2a2a; --sec-muted: #7a5552; --sec-accent: var(--accent, #b0303a); --frame: #e3a3a8; --sec-border: #f0d7d4; }
.card-page.tpl-cau-doi      { --paper: #fbf3e2; --sec-text: #3f1f1a; --sec-muted: #6e4a3a; --sec-accent: var(--accent, #a3241c); --frame: #c9a45c; --sec-border: #e6cf9f; }
.card-page.tpl-phong-bi     { --paper: #fbf5e6; --sec-text: #3f1f1a; --sec-muted: #6e4a3a; --sec-accent: var(--accent, #7e1414); --frame: #7e1414; --sec-border: #e6cf9f; }
.card-page.tpl-sen-hong     { --paper: #fff8f6; --sec-text: #5b3a45; --sec-muted: #7f5d68; --sec-accent: var(--accent, #974763); --frame: #d9a0b2; --sec-border: #efd6dc; }
.card-page.tpl-dong-duong   { --paper: #f4ecd9; --sec-text: #23443f; --sec-muted: #4f6a64; --sec-accent: var(--accent, #2f6f6b); --frame: #2f6f6b; --sec-border: #d9caa4; }
.card-page.tpl-trau-cau     { --paper: #f6f3e6; --sec-text: #2f4535; --sec-muted: #5a6b5c; --sec-accent: var(--accent, #3f6b45); --frame: #b3262e; --sec-border: #ddd8bd; }
.card-page.tpl-dong-ho      { --paper: #f6efdc; --sec-text: #2a211a; --sec-muted: #5f5040; --sec-accent: var(--accent, #9b2c22); --frame: #2a211a; --sec-border: #d8c79f; }
.card-page.tpl-gom-lam      { --paper: #f7f9fb; --sec-text: #1d2f4a; --sec-muted: #4d5f78; --sec-accent: var(--accent, #1f4f8f); --frame: #1f4f8f; --sec-border: #cbd8e8; }
.card-page.tpl-tim-hue      { --paper: #faf6fb; --sec-text: #3a2a4a; --sec-muted: #64567a; --sec-accent: var(--accent, #5b3a7a); --frame: #c9a45c; --sec-border: #e3d7ea; }
.card-page.tpl-lua-ha-dong  { --paper: #fbf8f0; --sec-text: #22304f; --sec-muted: #55617c; --sec-accent: var(--accent, #2c3e6b); --frame: #c9a45c; --sec-border: #e2dcc6; }
.card-page.tpl-dong-lua     { --paper: #fbf8ec; --sec-text: #2f3f22; --sec-muted: #5c6a4c; --sec-accent: var(--accent, #3d5a2a); --frame: #c9a45c; --sec-border: #e6dcb4; }
.card-page.tpl-toi-gian     { --paper: #ffffff; --sec-text: #1f1f1f; --sec-muted: #5f5f5f; --sec-accent: var(--accent, #1f1f1f); --frame: #1f1f1f; --sec-border: #e3e3e3; --sec-title-font: var(--font-sans); }
.card-page.tpl-mau-nuoc     { --paper: #fbfdf9; --sec-text: #2f4535; --sec-muted: #5c6e60; --sec-accent: var(--accent, #4f7a5a); --frame: #a9c7ad; --sec-border: #dbe8dc; }
.card-page.tpl-polaroid     { --paper: #fbfaf5; --sec-text: #2d2a26; --sec-muted: #5f5a52; --sec-accent: var(--accent, #8a5a44); --frame: #d8cfc0; --sec-border: #e5ddd0; }
.card-page.tpl-ve-moi       { --paper: #fdf9f0; --sec-text: #2d2622; --sec-muted: #5f544c; --sec-accent: var(--accent, #b0303a); --frame: #b0303a; --sec-border: #eadfca; }
.card-page.tpl-lich-thang   { --paper: #fffdf8; --sec-text: #2d2622; --sec-muted: #5f544c; --sec-accent: var(--accent, #b0303a); --frame: #b0303a; --sec-border: #eadfca; }
.card-page.tpl-hoa-dai      { --paper: #fbfaf3; --sec-text: #34432f; --sec-muted: #5f6b58; --sec-accent: var(--accent, #5f7a5a); --frame: #d9a5b0; --sec-border: #e3e3d0; }
.card-page.tpl-vom-dat      { --paper: #f7efe6; --sec-text: #3d2a20; --sec-muted: #6e5646; --sec-accent: var(--accent, #a0522d); --frame: #a0522d; --sec-border: #e3cdb8; }

.card-page.tpl-nhung-do     { --dark1: #7a1a24; --dark2: #45090f; --gold: #e0c27a; }
.card-page.tpl-sen-vang     { --dark1: #7d1a26; --dark2: #3f0910; --gold: #e9cf8a; }
.card-page.tpl-den-long     { --dark1: #6c1a2e; --dark2: #350a17; --gold: #f0d48a; }
.card-page.tpl-ngoc-luc-bao { --dark1: #1f5a45; --dark2: #0d2620; --gold: #d9b96a; }
.card-page.tpl-o-thuoc      { --dark1: #1d2f63; --dark2: #0b1430; --gold: #e9cf8a; }
.card-page.tpl-son-mai      { --dark1: #2a1512; --dark2: #080505; --gold: #d9b45e; }
.card-page.tpl-trong-dong   { --dark1: #4b3220; --dark2: #2c1d13; --gold: #e0b866; }

/* ---------- (A) KHUNG GIẤY ---------- */
.card-page:is(.tpl-trau-cau-do, .tpl-thu-phap, .tpl-may-vang, .tpl-hoa-dao, .tpl-cau-doi, .tpl-phong-bi, .tpl-sen-hong, .tpl-dong-duong, .tpl-trau-cau, .tpl-dong-ho, .tpl-gom-lam, .tpl-tim-hue, .tpl-lua-ha-dong, .tpl-dong-lua, .tpl-toi-gian, .tpl-mau-nuoc, .tpl-polaroid, .tpl-ve-moi, .tpl-lich-thang, .tpl-hoa-dai, .tpl-vom-dat) {
  --sec-bg: var(--paper); --sec-title-font: var(--font-display); --sec-btn-text: #fff;
}
.card-page:is(.tpl-trau-cau-do, .tpl-thu-phap, .tpl-may-vang, .tpl-hoa-dao, .tpl-cau-doi, .tpl-phong-bi, .tpl-sen-hong, .tpl-dong-duong, .tpl-trau-cau, .tpl-dong-ho, .tpl-gom-lam, .tpl-tim-hue, .tpl-lua-ha-dong, .tpl-dong-lua, .tpl-toi-gian, .tpl-mau-nuoc, .tpl-polaroid, .tpl-ve-moi, .tpl-lich-thang, .tpl-hoa-dai, .tpl-vom-dat) .card-section {
  position: relative; border: 0; border-radius: 6px; outline: 0;
  background: radial-gradient(110% 60% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%), var(--paper);
  box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 7px var(--frame), inset 0 0 0 9px var(--paper), inset 0 0 0 10px color-mix(in srgb, var(--frame) 40%, transparent), 0 10px 28px rgba(40, 30, 20, 0.08);
}
.card-page:is(.tpl-trau-cau-do, .tpl-thu-phap, .tpl-may-vang, .tpl-hoa-dao, .tpl-cau-doi, .tpl-phong-bi, .tpl-sen-hong, .tpl-dong-duong, .tpl-trau-cau, .tpl-dong-ho, .tpl-gom-lam, .tpl-tim-hue, .tpl-lua-ha-dong, .tpl-dong-lua, .tpl-toi-gian, .tpl-mau-nuoc, .tpl-polaroid, .tpl-ve-moi, .tpl-lich-thang, .tpl-hoa-dai, .tpl-vom-dat) .card-section__title { font-size: 1.5rem; font-weight: 600; }

/* Chi tiết riêng lấy từ bìa */
.tpl-trau-cau-do .card-section { border-left: 12px solid #7a1622 !important; }
.tpl-thu-phap .card-section__title::before { content: ''; display: block; width: 26px; height: 26px; margin: 0 auto 8px; border: 2px solid #a3241c; border-radius: 3px; background: radial-gradient(circle, #a3241c 0 3px, transparent 4px); }
.tpl-thu-phap .card-section__title { font-family: var(--font-vibes); font-weight: 400; font-size: 2rem; color: #2b2420; }
.tpl-may-vang .card-section { border-block: 10px solid #9c1c1c !important; }
.tpl-hoa-dao .card-section { background-image: url('/assets/orn/hoa-dao.svg'), radial-gradient(110% 60% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%) !important; background-repeat: no-repeat !important; background-position: right -26px top -10px, 0 0 !important; background-size: 130px auto, auto !important; background-color: var(--paper) !important; }
.tpl-cau-doi .card-section { border-inline: 12px solid #a3241c !important; }
.tpl-phong-bi .card-section { border-top: 8px solid #7e1414 !important; }
.tpl-phong-bi .card-section__title::before { content: '囍'; display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 8px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8c873, #b38a3c); color: #7e1414; font-family: var(--font-han); font-size: 1rem; }
.tpl-sen-hong .card-section { background-image: url('/assets/orn/sen-bud.svg'), radial-gradient(110% 60% at 50% 0%, rgba(255, 255, 255, 0.55), transparent 70%) !important; background-repeat: no-repeat !important; background-position: left 14px bottom 10px, 0 0 !important; background-size: 54px auto, auto !important; background-color: var(--paper) !important; }
.tpl-sen-hong .card-section__title { font-style: italic; }
.tpl-trau-cau .card-section__title::after { display: none; }
.tpl-dong-ho .card-section { box-shadow: inset 0 0 0 6px var(--paper), inset 0 0 0 9px #2a211a, 0 10px 28px rgba(40, 30, 20, 0.1) !important; }
.tpl-dong-ho .card-section__title { display: inline-block; padding: 4px 16px; background: #f1e3c0; border: 2px solid #2a211a; font-size: 1.25rem; }
.tpl-gom-lam .card-section { background-image: repeating-radial-gradient(circle at 50% 120%, transparent 0 10px, rgba(31, 79, 143, 0.07) 10px 11px) !important; background-color: var(--paper) !important; }
.tpl-tim-hue .card-section { border-top: 6px solid #5b3a7a !important; }
.tpl-lua-ha-dong .card-section::before { content: ''; position: absolute; top: 0; right: 0; width: 46%; height: 8px; background: linear-gradient(90deg, transparent, #2c3e6b 40%, #4a5f94); border-top-right-radius: 6px; }
.tpl-dong-lua .card-section { border-bottom: 10px solid #d9b45e !important; }
.tpl-toi-gian .card-section { box-shadow: 0 0 0 1px #e3e3e3 !important; border-radius: 0 !important; }
.tpl-toi-gian .card-section__title { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.22em; font-size: 0.95rem; }
.tpl-toi-gian .card-section__orn { width: 40px; height: 1px; background: #1f1f1f; }
.tpl-mau-nuoc .card-section { background-image: radial-gradient(45% 35% at 8% 10%, rgba(127, 175, 135, 0.22), transparent 70%), radial-gradient(40% 30% at 95% 90%, rgba(127, 175, 135, 0.18), transparent 70%) !important; background-color: var(--paper) !important; border-radius: 18px !important; }
.tpl-polaroid .card-section { background-image: repeating-linear-gradient(transparent 0 27px, rgba(138, 90, 68, 0.1) 27px 28px) !important; background-color: var(--paper) !important; }
.tpl-polaroid .card-section::before { content: ''; position: absolute; top: -9px; left: 50%; width: 92px; height: 22px; transform: translateX(-50%) rotate(-3deg); background: rgba(232, 214, 170, 0.75); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.tpl-polaroid .card-section__title { font-family: var(--font-script); font-size: 1.7rem; }
.tpl-ve-moi .card-section { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px #b0303a, 0 10px 28px rgba(40, 30, 20, 0.08) !important; border: 2px dashed rgba(176, 48, 58, 0.45) !important; }
.tpl-ve-moi .card-section__title { font-family: var(--font-sans); text-transform: uppercase; letter-spacing: 0.18em; font-size: 1rem; }
.tpl-lich-thang .card-section { padding-top: 38px !important; }
.tpl-lich-thang .card-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 22px; background: #b0303a; border-radius: 6px 6px 0 0; }
.tpl-lich-thang .card-section::after { content: ''; position: absolute; top: -6px; left: 50%; width: 120px; height: 14px; transform: translateX(-50%); background: radial-gradient(circle, #f4efe6 0 4px, #6b5f55 4px 5px, transparent 5.5px) 0 0 / 20px 14px repeat-x; }
.tpl-hoa-dai .card-section { background-image: url('/assets/orn/hoa-dai.svg'), url('/assets/orn/hoa-dai.svg') !important; background-repeat: no-repeat !important; background-position: left 4px top 4px, right 4px bottom 4px !important; background-size: 76px, 76px !important; background-color: var(--paper) !important; }
.tpl-vom-dat .card-section { border-radius: 160px 160px 10px 10px / 70px 70px 10px 10px !important; padding-top: 34px !important; }

/* ---------- (B) NỀN ĐẬM + TỜ THƯ LỒNG ---------- */
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) {
  --sec-bg: var(--dark2); --sec-text: #f6e8c8; --sec-muted: #e2cc9c; --sec-border: color-mix(in srgb, var(--gold) 40%, transparent);
  --sec-accent: var(--gold); --sec-title-font: var(--font-display); --sec-btn-text: var(--dark2);
}
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .card-section {
  position: relative; border: 0; border-radius: 6px; outline: 0;
  background: radial-gradient(120% 80% at 50% 0%, rgba(255, 220, 150, 0.12), transparent 60%), linear-gradient(160deg, var(--dark1), var(--dark2));
  box-shadow: inset 0 0 0 5px var(--dark2), inset 0 0 0 6px var(--gold), inset 0 0 0 9px var(--dark2), inset 0 0 0 10px color-mix(in srgb, var(--gold) 50%, transparent), 0 14px 30px rgba(0, 0, 0, 0.25);
}
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .card-section__title { font-size: 1.55rem; font-weight: 600; color: var(--gold); }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .invite {
  --sec-text: #3a221a; --sec-muted: #6e5040; --sec-border: #e3c78f; --sec-accent: var(--dark1);
  padding: 44px 34px 40px;
}
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .invite > * { position: relative; z-index: 1; }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .invite::before {
  content: ''; position: absolute; inset: 16px; border-radius: 4px; z-index: 0;
  background-color: #fbf3e2; background-image: radial-gradient(90% 50% at 50% 0%, #fffaf0, transparent 70%);
  box-shadow: inset 0 0 0 3px #fbf3e2, inset 0 0 0 4px var(--gold);
}
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) :is(.card-section .muted, .card-section .small, .wish-list li) { color: #e2cc9c; }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .wish-list li { background: rgba(255, 244, 220, 0.08); }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) :is(.card-section input, .card-section textarea) { background: rgba(255, 252, 244, 0.96); color: #2a2a26; }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .card-section label { color: var(--sec-text); }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) :is(.event-item__time, .event-item__venue) { color: #fbefd2; }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .guest-banner { color: var(--dark1); }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong) .guest-banner strong { color: var(--dark1); }
/* Chi tiết riêng nền đậm */
.tpl-nhung-do .card-section { background-image: url('/assets/orn/van-sen.svg'), linear-gradient(160deg, var(--dark1), var(--dark2)) !important; background-size: 64px, auto !important; }
.tpl-den-long .card-section__title::before { content: ''; display: block; width: 26px; height: 40px; margin: 0 auto 4px; background: url('/assets/orn/long-den.svg') center / contain no-repeat; }
.tpl-sen-vang .card-section__title::before { content: ''; display: block; width: 46px; height: 26px; margin: 0 auto 4px; background: url('/assets/orn/sen-vang.svg') center / contain no-repeat; }
.tpl-o-thuoc .card-section { background-image: radial-gradient(1px 1px at 12% 18%, #fff8, transparent), radial-gradient(1px 1px at 78% 12%, #fff9, transparent), radial-gradient(1.5px 1.5px at 60% 70%, #fff7, transparent), radial-gradient(1px 1px at 30% 85%, #fff8, transparent), linear-gradient(160deg, var(--dark1), var(--dark2)) !important; }
.tpl-son-mai .card-section { background-image: radial-gradient(circle at 4% 96%, #f3ead2 0 2px, transparent 2.5px), radial-gradient(circle at 7% 92%, #e9dcb8 0 1.5px, transparent 2px), linear-gradient(100deg, transparent 30%, rgba(217, 180, 94, 0.14) 45%, transparent 60%), linear-gradient(160deg, var(--dark1), var(--dark2)) !important; }
.tpl-trong-dong .card-section { background-image: repeating-radial-gradient(circle at 50% -40%, transparent 0 18px, rgba(224, 184, 102, 0.08) 18px 19px), linear-gradient(160deg, var(--dark1), var(--dark2)) !important; }

/* Thư mời mỗi mẫu có họa tiết riêng ở đầu tờ thư (lấy từ bìa), không chỉ khác màu */
.invite__kicker::before { content: none; }
.card-page:is(.tpl-nhung-do, .tpl-sen-vang, .tpl-den-long, .tpl-ngoc-luc-bao, .tpl-o-thuoc, .tpl-son-mai, .tpl-trong-dong, .tpl-hoa-dao, .tpl-sen-hong, .tpl-dong-ho, .tpl-gom-lam, .tpl-tim-hue, .tpl-lua-ha-dong, .tpl-dong-lua, .tpl-mau-nuoc, .tpl-hoa-dai, .tpl-vom-dat, .tpl-trau-cau, .tpl-may-vang, .tpl-cau-doi) .invite::after {
  content: ''; display: block; position: relative; z-index: 1; order: -1; width: 150px; height: 70px; margin: 0 auto 10px; background: center / contain no-repeat;
}
.card-page .invite { display: flex; flex-direction: column; align-items: center; }
.card-page .invite > * { width: 100%; }
.card-page .invite > .invite__guest--blank { width: auto; }
.card-page.tpl-nhung-do .invite::after { background-image: url('/assets/orn/song-hy-ring.svg'); }
.card-page.tpl-sen-vang .invite::after { background-image: url('/assets/orn/sen-vang.svg'); }
.card-page.tpl-den-long .invite::after { background-image: url('/assets/orn/long-den.svg'); height: 70px; }
.card-page.tpl-ngoc-luc-bao .invite::after { background-image: url('/assets/orn/deco-arch.svg'); height: 64px; }
.card-page.tpl-o-thuoc .invite::after { background-image: url('/assets/orn/o-thuoc.svg'); width: 180px; }
.card-page.tpl-son-mai .invite::after { background-image: url('/assets/orn/cuon-van.svg'); width: 150px; height: 40px; }
.card-page.tpl-trong-dong .invite::after { width: 74px; height: 74px; border-radius: 50%; background: repeating-radial-gradient(circle, #8a6a2c 0 1.5px, transparent 1.5px 7px), radial-gradient(circle, #e0b866 0 10px, transparent 11px); box-shadow: 0 0 0 2px #b38e55; }
.card-page.tpl-hoa-dao .invite::after { background-image: url('/assets/orn/hoa-dao.svg'); width: 160px; }
.card-page.tpl-sen-hong .invite::after { background-image: url('/assets/orn/sen-bouquet.svg'); height: 64px; }
.card-page.tpl-dong-ho .invite::after { content: 'Tranh Hỷ Sự'; width: auto; height: auto; padding: 4px 14px; background: #f1e3c0; border: 2px solid #2a211a; font-family: var(--font-display); font-weight: 600; color: #9b2c22; }
.card-page.tpl-gom-lam .invite::after { width: 86px; height: 86px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 9px, #1f4f8f 9px 10px), #f7f9fb; box-shadow: 0 0 0 3px #1f4f8f; }
.card-page.tpl-tim-hue .invite::after { width: 140px; height: 40px; background: linear-gradient(#5b3a7a, #5b3a7a) center 70% / 100% 4px no-repeat, linear-gradient(#5b3a7a, #5b3a7a) center 30% / 60% 4px no-repeat, linear-gradient(#c9a45c, #c9a45c) center 50% / 80% 2px no-repeat; }
.card-page.tpl-lua-ha-dong .invite::after { width: 160px; height: 22px; border-radius: 50%; background: linear-gradient(100deg, transparent 5%, #2c3e6b 30%, #4a5f94 55%, #2c3e6b 75%, transparent 95%); }
.card-page.tpl-dong-lua .invite::after { background-image: url('/assets/orn/lua-vang.svg'); width: 170px; }
.card-page.tpl-mau-nuoc .invite::after { width: 140px; height: 50px; background: radial-gradient(40% 60% at 35% 55%, rgba(127, 175, 135, 0.55), transparent 70%), radial-gradient(35% 55% at 65% 45%, rgba(170, 205, 175, 0.6), transparent 70%); }
.card-page.tpl-hoa-dai .invite::after { background-image: url('/assets/orn/hoa-dai.svg'); width: 70px; height: 70px; }
.card-page.tpl-vom-dat .invite::after { width: 90px; height: 54px; border: 3px solid #a0522d; border-bottom: 0; border-radius: 45px 45px 0 0; background: none; }
.card-page.tpl-trau-cau .invite::after { background-image: url('/assets/orn/trau-cau.svg'); width: 110px; height: 60px; }
.card-page.tpl-may-vang .invite::after { background-image: url('/assets/orn/cuon-van.svg'); width: 150px; height: 40px; filter: sepia(1) saturate(2) hue-rotate(-20deg); }
.card-page.tpl-cau-doi .invite::after { content: 'Trăm năm hạnh phúc'; width: auto; height: auto; padding: 6px 16px; background: #a3241c; color: #f3d98f; font-family: var(--font-display); font-weight: 600; letter-spacing: 0.08em; border-radius: 2px; }

/* Hai họ: xếp một cột khi khung thiệp hẹp (điện thoại) để tên cha mẹ không bị ngắt dòng */
@container (max-width: 460px) {
  .invite__families--2 { grid-template-columns: 1fr; }
  .invite__families--2 .invite__family + .invite__family { border-left: 0; border-top: 1px solid var(--sec-border); padding-top: 12px; }
}
.card-page.tpl-thu-phap .invite::after { content: '囍'; display: grid; place-items: center; order: -1; width: 46px; height: 46px; margin: 0 auto 10px; border: 2.5px solid #a3241c; border-radius: 4px; color: #a3241c; font-family: var(--font-han); font-size: 1.4rem; background: rgba(163, 36, 28, 0.05); transform: rotate(-4deg); }
.card-page.tpl-phong-bi .invite::after { content: '囍'; display: grid; place-items: center; order: -1; width: 52px; height: 52px; margin: 0 auto 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e8c873, #b38a3c); color: #7e1414; font-family: var(--font-han); font-size: 1.4rem; box-shadow: 0 0 0 4px rgba(179, 138, 60, 0.25); }
.card-page.tpl-dong-duong .invite::after { content: ''; display: block; order: -1; width: 180px; height: 18px; margin: 0 auto 12px; background: url('/assets/orn/gach-bong.svg') 0 0 / 18px 18px repeat-x; }
