/* ManhTool Thiệp — design system (màu theo logo ManhTool) */
:root {
  --brand-900: #0b3d2c;
  --brand-700: #0f6b47;
  --brand-600: #12855a;
  --brand-500: #19a96f;
  --brand-400: #3fcf7f;
  --lime: #a6e22e;
  --grad: linear-gradient(135deg, #0f7a52 0%, #19b46f 50%, #a6e22e 100%);
  --grad-soft: linear-gradient(135deg, #e9f9ef 0%, #f4fbe6 100%);
  --ink: #12221c;
  --ink-2: #3d4f47;
  --muted: #6b7c74;
  --line: #e3ece7;
  --bg: #f7faf8;
  --surface: #ffffff;
  --surface-2: #f1f6f3;
  --danger: #d93a3a;
  --warn: #e08a00;
  --ok: #12855a;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 8px 24px rgba(16, 40, 30, .06);
  --shadow-lg: 0 24px 60px rgba(16, 40, 30, .16);
  --font: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; font-size: 15px; }
img { max-width: 100%; display: block; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
button, input, select, textarea { font: inherit; color: inherit; }
.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 40px; }
.text-grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font-weight: 600; font-size: 15px; white-space: nowrap; transition: transform .15s, box-shadow .15s, background .15s;
  background: var(--surface); color: var(--ink); border-color: var(--line);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); color: var(--ink); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary { background: var(--grad); color: #fff; border: 0; box-shadow: 0 6px 18px rgba(25, 169, 111, .35); }
.btn-primary:hover { color: #fff; box-shadow: 0 10px 26px rgba(25, 169, 111, .45); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); box-shadow: none; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 14px 26px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .85); backdrop-filter: saturate(1.6) blur(12px); border-bottom: 1px solid var(--line); }
.site-header .container { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; font-size: 18px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; }
.brand small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); letter-spacing: .02em; margin-top: -2px; }
.brand:hover { color: var(--ink); }
.nav { display: flex; gap: 4px; margin-left: 12px; }
.nav a { color: var(--ink-2); padding: 8px 12px; border-radius: 999px; font-weight: 500; font-size: 14px; }
.nav a:hover, .nav a.active { background: var(--surface-2); color: var(--ink); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; padding: 4px; border-radius: 999px; }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); min-width: 230px; padding: 8px; display: none; }
.dropdown.open { display: block; }
.dropdown .who { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.dropdown .who b { display: block; font-size: 14px; }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 9px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; cursor: pointer; font-size: 14px; }
.dropdown a:hover, .dropdown button:hover { background: var(--surface-2); }
.menu-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; padding: 6px; }
@media (max-width: 820px) {
  .nav { display: none; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; background: #fff; padding: 8px 16px 16px; border-bottom: 1px solid var(--line); margin: 0; }
  .nav.open { display: flex; }
  .menu-toggle { display: block; }
  .header-right .btn-create { display: none; }
}

/* ---------- footer ---------- */
.site-footer { margin-top: 80px; background: var(--brand-900); color: #cfe3d9; padding: 48px 0 28px; font-size: 14px; }
.site-footer a { color: #e6f5ed; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; }
.footer-grid h4 { color: #fff; font-size: 15px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; color: #9fbfb0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- cards / surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.panel h2, .panel h3 { font-size: 18px; }
.page-head { padding: 36px 0 20px; }
.page-head h1 { font-size: 30px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } .grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat .value { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.02em; }
.stat .sub { font-size: 12px; color: var(--muted); }
.stat.highlight { background: var(--grad); color: #fff; border: 0; }
.stat.highlight .label, .stat.highlight .sub { color: rgba(255, 255, 255, .85); }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); }
.badge-premium { background: linear-gradient(135deg, #ffe08a, #f5b700); color: #5a3d00; }
.badge-ok { background: #dff5e9; color: var(--ok); }
.badge-warn { background: #fff1d6; color: #9a5b00; }
.badge-danger { background: #fde3e3; color: var(--danger); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
.input:focus { border-color: var(--brand-500); box-shadow: 0 0 0 4px rgba(25, 169, 111, .15); }
textarea.input { resize: vertical; min-height: 110px; line-height: 1.55; }
.hint { font-size: 12px; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); font-weight: 600; }
.table tr:last-child td { border-bottom: 0; }
.table td.wrap { white-space: normal; min-width: 200px; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--brand-700); border-bottom-color: var(--brand-500); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 500; font-size: 14px; transition: all .15s; }
.chip:hover { border-color: var(--brand-400); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(10, 25, 18, .55); backdrop-filter: blur(4px); z-index: 100; display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal { background: #fff; border-radius: 20px; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); position: relative; animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-lg { max-width: 760px; }
.modal-body { padding: 28px; }
.modal-close { position: absolute; top: 12px; right: 12px; background: var(--surface-2); border: 0; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; z-index: 2; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }

.login-box { text-align: center; }
.login-box img.logo { width: 72px; margin: 0 auto 12px; border-radius: 16px; }
.login-box .gbtn { display: flex; justify-content: center; min-height: 44px; margin: 18px 0 8px; }

/* ---------- payment modal ---------- */
.pay-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.pay-qr { background: var(--grad-soft); border-radius: 16px; padding: 12px; text-align: center; }
.pay-qr img { width: 100%; border-radius: 10px; background: #fff; min-height: 240px; }
.pay-info { display: grid; gap: 10px; }
.pay-line { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; }
.pay-line span { color: var(--muted); font-size: 13px; }
.pay-line b { font-size: 15px; word-break: break-all; }
.pay-line .code { font-size: 18px; color: var(--brand-700); letter-spacing: .05em; }
.copy { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 12px; cursor: pointer; flex-shrink: 0; }
.copy:hover { border-color: var(--brand-400); }
.pay-status { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: #fff7e6; color: #8a5300; font-weight: 500; font-size: 14px; }
.spinner { width: 18px; height: 18px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.pay-success { text-align: center; padding: 20px 0; }
.pay-success .icon { width: 84px; height: 84px; border-radius: 50%; background: var(--grad); color: #fff; font-size: 44px; display: grid; place-items: center; margin: 0 auto 16px; animation: pop .4s; }
@media (max-width: 640px) { .pay-grid { grid-template-columns: 1fr; } .pay-qr { max-width: 280px; margin: 0 auto; } }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; width: max-content; max-width: calc(100vw - 32px); }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: pop .25s; }
.toast.error { background: var(--danger); }
.toast.ok { background: var(--brand-600); }

/* ---------- landing ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; background: radial-gradient(1200px 500px at 85% -10%, #d9f7c4 0%, transparent 60%), radial-gradient(900px 500px at -10% 10%, #c9f2dd 0%, transparent 55%); }
.hero-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(32px, 5vw, 54px); font-weight: 800; letter-spacing: -.03em; }
.hero p.lead { font-size: 18px; color: var(--ink-2); max-width: 540px; }
.hero .eyebrow { display: inline-flex; gap: 8px; align-items: center; background: #fff; border: 1px solid var(--line); padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; margin-bottom: 18px; box-shadow: var(--shadow); }
.hero .eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-400); box-shadow: 0 0 0 4px rgba(63, 207, 127, .25); }
.hero-trust { display: flex; gap: 24px; margin-top: 28px; flex-wrap: wrap; }
.hero-trust div b { display: block; font-size: 22px; }
.hero-trust div span { font-size: 13px; color: var(--muted); }
.hero-stack { position: relative; height: 460px; }
.hero-stack .mini { position: absolute; width: 260px; height: 360px; border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; transition: transform .4s; }
.hero-stack .mini:nth-child(1) { left: 0; top: 60px; transform: rotate(-8deg); }
.hero-stack .mini:nth-child(2) { left: 50%; margin-left: -130px; top: 0; z-index: 2; }
.hero-stack .mini:nth-child(3) { right: 0; top: 70px; transform: rotate(8deg); }
.hero-stack:hover .mini:nth-child(1) { transform: rotate(-12deg) translateX(-10px); }
.hero-stack:hover .mini:nth-child(3) { transform: rotate(12deg) translateX(10px); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero-stack { height: 400px; max-width: 520px; margin: 0 auto; width: 100%; } .hero-stack .mini { width: 210px; height: 300px; } .hero-stack .mini:nth-child(2) { margin-left: -105px; } }
@media (max-width: 480px) { .hero-stack { height: 330px; } .hero-stack .mini { width: 170px; height: 250px; } .hero-stack .mini:nth-child(2) { margin-left: -85px; } }

.section { padding: 64px 0 0; }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 32px; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 800; }
.section-head p { color: var(--muted); }

.occasion-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.occasion { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px 14px; text-align: center; cursor: pointer; transition: all .2s; color: var(--ink); }
.occasion:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--brand-400); color: var(--ink); }
.occasion .em { font-size: 34px; }
.occasion b { display: block; margin-top: 6px; font-size: 14px; }
.occasion span { font-size: 12px; color: var(--muted); }
@media (max-width: 900px) { .occasion-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .occasion-grid { grid-template-columns: repeat(2, 1fr); } }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.tpl { background: #fff; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); transition: all .2s; cursor: pointer; color: var(--ink); display: block; }
.tpl:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: var(--ink); }
.tpl .thumb { aspect-ratio: 3 / 4; position: relative; overflow: hidden; }
.tpl .meta { padding: 12px 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.tpl .meta b { font-size: 14px; }
.tpl .meta span { font-size: 12px; color: var(--muted); }
.tpl .ribbon { position: absolute; top: 10px; right: 10px; z-index: 3; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; position: relative; }
.step::before { counter-increment: s; content: counter(s); width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; margin-bottom: 14px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.price-card { background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; }
.price-card.featured { border: 2px solid var(--brand-500); box-shadow: 0 20px 50px rgba(25, 169, 111, .18); position: relative; }
.price-card.featured::before { content: 'Phổ biến nhất'; position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--grad); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 999px; }
.price-card .price { font-size: 36px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0; }
.price-card .price small { font-size: 14px; color: var(--muted); font-weight: 500; }
.price-card ul { list-style: none; padding: 0; margin: 12px 0 24px; display: grid; gap: 10px; flex: 1; }
.price-card li { padding-left: 26px; position: relative; font-size: 14px; }
.price-card li::before { content: '✓'; position: absolute; left: 0; width: 18px; height: 18px; border-radius: 50%; background: #dff5e9; color: var(--ok); font-size: 11px; font-weight: 800; display: grid; place-items: center; top: 2px; }
.price-card li.no { color: var(--muted); }
.price-card li.no::before { content: '–'; background: var(--surface-2); color: var(--muted); }
@media (max-width: 860px) { .pricing { grid-template-columns: 1fr; max-width: 420px; margin: 0 auto; } }

.cta-band { background: var(--brand-900); color: #fff; border-radius: 28px; padding: 48px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; position: relative; overflow: hidden; }
.cta-band::after { content: ''; position: absolute; width: 420px; height: 420px; right: -120px; top: -140px; background: radial-gradient(circle, rgba(166, 226, 46, .35), transparent 65%); }
.cta-band h2 { font-size: clamp(24px, 3vw, 34px); }
.cta-band p { color: #cfe3d9; }
.cta-band .perks { display: grid; gap: 10px; position: relative; z-index: 1; }
.cta-band .perk { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 14px 16px; }
.cta-band .perk b { color: var(--lime); font-size: 20px; }
@media (max-width: 760px) { .cta-band { grid-template-columns: 1fr; padding: 28px; } }

.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; font-size: 20px; color: var(--brand-600); line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

/* ---------- editor ---------- */
.editor { display: grid; grid-template-columns: 420px 1fr; gap: 24px; align-items: start; padding-top: 24px; }
.editor-side { display: grid; gap: 16px; }
.editor-preview { position: sticky; top: 84px; }
.preview-stage { border-radius: 24px; overflow: hidden; height: calc(100vh - 170px); min-height: 520px; position: relative; box-shadow: var(--shadow-lg); }
.tpl-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpl-pick { border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: none; padding: 0; position: relative; }
.tpl-pick.active { border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(25, 169, 111, .2); }
.tpl-pick .sw { aspect-ratio: 3/4; display: grid; place-items: center; font-size: 26px; }
.tpl-pick .nm { font-size: 11px; padding: 4px; background: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpl-pick .pr { position: absolute; top: 4px; right: 4px; font-size: 10px; padding: 1px 6px; }
.suggest { display: grid; gap: 6px; margin-top: 6px; }
.suggest button { text-align: left; background: var(--surface-2); border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.suggest button:hover { border-color: var(--brand-400); color: var(--ink); }
.photo-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 16px; text-align: center; cursor: pointer; color: var(--muted); font-size: 14px; position: relative; }
.photo-drop:hover { border-color: var(--brand-400); }
.photo-drop img { max-height: 140px; margin: 0 auto 8px; border-radius: 10px; }
.editor-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 16px 0 8px; display: flex; gap: 10px; }
@media (max-width: 960px) {
  .editor { grid-template-columns: 1fr; }
  .editor-preview { position: relative; top: 0; order: -1; }
  .preview-stage { height: 520px; min-height: 0; }
}

/* ---------- my cards ---------- */
.my-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.my-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; overflow: hidden; display: flex; flex-direction: column; }
.my-card .thumb { aspect-ratio: 4/3; position: relative; overflow: hidden; }
.my-card .body { padding: 14px 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.my-card .actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 16px 16px; }

/* ---------- affiliate ---------- */
.ref-link { display: flex; gap: 8px; background: var(--surface-2); border-radius: 12px; padding: 6px; align-items: center; }
.ref-link input { flex: 1; border: 0; background: transparent; padding: 8px; font-weight: 600; color: var(--brand-700); min-width: 0; outline: none; }
.aff-hero { background: var(--grad); color: #fff; border-radius: 24px; padding: 40px; position: relative; overflow: hidden; }
.aff-hero h1 { font-size: clamp(26px, 4vw, 40px); }
.aff-hero p { color: rgba(255, 255, 255, .9); max-width: 620px; }
.aff-hero .btn { background: #fff; color: var(--brand-700); }

.amount-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- editor: hiệu ứng & QR ---------- */
.fx-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-grid .chip { padding: 6px 11px; font-size: 13px; }
.qr-studio { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.qr-studio canvas { width: 100%; height: auto; border-radius: 16px; box-shadow: var(--shadow); display: block; }
.qr-shapes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.qr-shape { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 6px; cursor: pointer; font-weight: 600; font-size: 13px; display: grid; gap: 4px; justify-items: center; }
.qr-shape .ic { font-size: 24px; line-height: 1; }
.qr-shape.active { border-color: var(--brand-500); background: #effaf4; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--ink); }
@media (max-width: 720px) { .qr-studio { grid-template-columns: 1fr; } }

/* ---------- editor: album, lặp nhóm, cách mở ---------- */
.album-edit { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.album-edit:empty { display: none; }
.album-edit .it { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.album-edit .it img { width: 100%; height: 100%; object-fit: cover; }
.album-edit .it.over::after { content: 'Premium'; position: absolute; inset: auto 0 0; background: rgba(0, 0, 0, .55); color: #ffd166; font-size: 10px; font-weight: 700; text-align: center; padding: 2px; }
.album-edit .it button { position: absolute; top: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; font-size: 13px; line-height: 1; }
.album-edit .it .rm { right: 4px; }
.album-edit .it .mv { left: 4px; }
.album-edit .it.loading { display: grid; place-items: center; }
details.sub { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 10px; }
details.sub summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.sub[open] summary { margin-bottom: 10px; }
.rep-item { background: var(--surface-2); border-radius: 12px; padding: 12px; margin-bottom: 10px; position: relative; }
.rep-item .field { margin-bottom: 8px; }
.rep-item .rep-rm { position: absolute; top: 8px; right: 8px; }
.toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; margin-top: 8px; cursor: pointer; }
.toggle input { width: 18px; height: 18px; accent-color: var(--brand-600); }
.open-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.open-opt { border: 2px solid var(--line); background: #fff; border-radius: 12px; padding: 10px 4px; cursor: pointer; font-size: 12px; font-weight: 600; display: grid; gap: 4px; justify-items: center; }
.open-opt .ic { font-size: 26px; line-height: 1; }
.open-opt.active { border-color: var(--brand-500); background: #effaf4; }
@media (max-width: 420px) { .open-grid { grid-template-columns: repeat(2, 1fr); } .album-edit { grid-template-columns: repeat(3, 1fr); } }

/* ---------- editor: chọn nhạc ---------- */
.music-current { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--grad-soft); border: 1px solid #d5efdf; }
.music-current img { width: 64px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.music-current .ic { width: 64px; height: 36px; border-radius: 6px; display: grid; place-items: center; background: #fff; font-size: 18px; flex-shrink: 0; }
.music-current .t { min-width: 0; flex: 1; line-height: 1.3; }
.music-current .t b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.music-current .t span { font-size: 12px; color: var(--muted); }
.song-list { display: grid; gap: 6px; max-height: 280px; overflow-y: auto; margin-top: 8px; padding-right: 4px; }
.song { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; text-align: left; width: 100%; }
.song:hover { border-color: var(--brand-400); }
.song.active { border-color: var(--brand-500); background: #effaf4; }
.song img { width: 72px; height: 40px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--surface-2); }
.song .t { min-width: 0; flex: 1; line-height: 1.3; }
.song .t b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song .t span { font-size: 12px; color: var(--muted); }
.song .chk { color: var(--brand-600); font-weight: 800; }
.yt-preview:empty { display: none; }
.yt-preview { margin-top: 10px; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.yt-preview iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ---------- xưởng thiệp in ---------- */
.print-studio { display: grid; grid-template-columns: 1fr 290px; gap: 22px; align-items: start; }
.print-preview { position: relative; background: repeating-conic-gradient(#f1f3f2 0 25%, #fff 0 50%) 0 0 / 22px 22px; border-radius: 14px; padding: 14px; display: grid; place-items: center; min-height: 300px; }
.print-preview canvas { max-width: 100%; max-height: 62vh; height: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, .18); background: #fff; }
.print-loading { position: absolute; inset: auto 14px 14px auto; background: rgba(0, 0, 0, .65); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.ps-designs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ps-designs .qr-shape { font-size: 12px; }
.modal-lg:has(.print-studio) { max-width: 1040px; }
@media (max-width: 820px) { .print-studio { grid-template-columns: 1fr; } }

/* ---------- trang chủ: đang hot ---------- */
.trend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trend { background: #0b0b12; border-radius: 22px; overflow: hidden; color: #fff; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.trend:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); color: #fff; }
.trend .stage { aspect-ratio: 4 / 5; position: relative; overflow: hidden; }
.trend .meta { padding: 14px 16px 18px; display: grid; gap: 4px; }
.trend .meta b { font-size: 16px; }
.trend .meta span { font-size: 13px; color: rgba(255, 255, 255, .7); }
.print-promo { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.print-promo:hover { color: var(--ink); }
.print-promo .meta span { color: var(--muted); }
.print-art { background: linear-gradient(135deg, #f6efe6, #e9dccb); display: grid; place-items: center; }
.pp-card { width: 82%; aspect-ratio: 1.41; background: #fbfaf8; box-shadow: 0 14px 30px rgba(0, 0, 0, .2); display: grid; grid-template-columns: 1fr 1fr 1.2fr; grid-template-rows: 1fr 1fr; gap: 6%; padding: 6%; transform: rotate(-3deg); }
.pp-ph { background: #fff; padding: 5% 5% 14%; box-shadow: 0 2px 6px rgba(0, 0, 0, .15); position: relative; }
.pp-ph::before { content: ''; position: absolute; inset: 5% 5% 14%; background: linear-gradient(135deg, #ffd6a5, #ffadad); }
.pp-ph:nth-child(2)::before { background: linear-gradient(135deg, #a0c4ff, #bdb2ff); }
.pp-ph:nth-child(3)::before { background: linear-gradient(135deg, #caffbf, #9bf6ff); }
.pp-ph:nth-child(4)::before { background: linear-gradient(135deg, #ffc6ff, #ffadad); }
.pp-ph:nth-child(1) { transform: rotate(-4deg); } .pp-ph:nth-child(2) { transform: rotate(3deg); } .pp-ph:nth-child(4) { transform: rotate(-2deg); }
.pp-ph:nth-child(3) { grid-column: 1; grid-row: 2; transform: rotate(2deg); }
.pp-ph:nth-child(4) { grid-column: 2; grid-row: 2; }
.pp-txt { grid-column: 3; grid-row: 1 / 3; display: grid; align-content: center; justify-items: center; gap: 6px; text-align: center; }
.pp-txt i { font-family: 'Great Vibes', cursive; font-style: normal; font-size: clamp(16px, 2.2vw, 26px); line-height: 1.1; color: #c2185b; }
.pp-txt small { font-family: 'Dancing Script', cursive; font-size: 13px; }
.pp-qr { width: 42%; aspect-ratio: 1; background: repeating-conic-gradient(#333 0 25%, #fff 0 50%) 0 0 / 25% 25%; border: 3px solid #fff; outline: 1px solid #ddd; }
@media (max-width: 900px) { .trend-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .trend-grid { grid-template-columns: 1fr; } }

/* ---------- bảng giá 4 cột + cưới ---------- */
.pricing-4 { grid-template-columns: repeat(4, 1fr); }
.pricing-4 .price-card { padding: 22px; }
.pricing-4 .price { font-size: 32px; }
.wedding-price { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.wp-tier { background: var(--surface-2); border-radius: 14px; padding: 10px 16px; display: grid; text-align: center; }
.wp-tier span { font-size: 12px; color: var(--muted); }
.wp-tier b { font-size: 24px; }
.wp-tier.vip { background: linear-gradient(135deg, #fff7d6, #ffe08a); }
@media (max-width: 1000px) { .pricing-4 { grid-template-columns: repeat(2, 1fr); max-width: none; } }
@media (max-width: 560px) { .pricing-4 { grid-template-columns: 1fr; } }
.tier-filter { justify-content: center; margin: -12px 0 24px; }
.tier-filter .chip { font-size: 13px; padding: 6px 12px; }
#tpl-filter { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start !important; padding-bottom: 6px; scrollbar-width: thin; }
@media (min-width: 1100px) { #tpl-filter { flex-wrap: wrap; justify-content: center !important; } }

/* nút Google không tràn hộp đăng nhập trên màn hình hẹp */
.modal { overflow-x: hidden; }
.login-box .gbtn { max-width: 100%; overflow: hidden; }
@media (max-width: 400px) { .modal-body { padding: 22px 16px; } .login-box h2 { font-size: 22px; } }

/* ---------- Lời mời tư vấn (giống trang chủ) ---------- */
.nudge {
  position: fixed; left: 20px; bottom: 24px; z-index: 99; width: 320px; padding: 20px;
  background: var(--surface, #fff); color: var(--ink, #1f2937); border: 1px solid var(--border, #e5e7eb); border-radius: 18px;
  box-shadow: 0 20px 50px -12px rgba(15,23,42,.28), 0 2px 6px rgba(15,23,42,.06);
  animation: nudge-in .35s ease-out;
}
.nudge[hidden] { display: none !important; }
@keyframes nudge-in { from { opacity: 0; transform: translateY(12px); } }
.nudge-close {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center; width: 30px; height: 30px; padding: 0;
  background: none; border: 0; border-radius: 8px; color: var(--muted, #6b7280); cursor: pointer; font-size: 18px;
}
.nudge-close:hover { background: var(--surface-2, #f3f4f6); color: var(--ink, #1f2937); }
.nudge-head { display: flex; align-items: center; gap: 12px; padding-right: 24px; }
.nudge-head img { width: 50px; height: 30px; object-fit: contain; flex: none; }
.nudge-head p { font-size: .95rem; font-weight: 700; line-height: 1.35; margin: 0; }
.nudge-text { margin-top: 8px; font-size: .88rem; line-height: 1.55; color: var(--muted, #6b7280); margin-bottom: 0; }
.nudge-actions { display: flex; gap: 8px; margin-top: 16px; }
.nudge-actions .btn-primary {
  flex: 1; height: 42px; padding: 0 12px;
  background: linear-gradient(135deg, #0e7c5a, #12b886);
  border-radius: 10px; color: #fff !important; font-weight: 600; font-size: .88rem;
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none; border: none;
}
.nudge-actions .btn-primary:hover { background: linear-gradient(135deg, #0a5c44, #0e7c5a); }
.nudge-actions .btn-ghost {
  height: 42px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border, #d1d5db); color: var(--ink, #1f2937);
  font-weight: 600; font-size: .88rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; background: transparent;
}
.nudge-actions .btn-ghost:hover { background: var(--surface-2, #f3f4f6); }
@media (max-width: 1023px) { .nudge { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .nudge { animation: none; } }

