/* =====================================================================
   TRẠM HỶ – STYLES DÙNG CHUNG
   1. Biến màu & nền tảng   2. Bố cục   3. Header/Footer   4. Thành phần
   5. Trang thử váy          6. Kanban   7. Thiệp cưới       8. Responsive
   ===================================================================== */

/* ---------- 1. BIẾN MÀU & NỀN TẢNG ---------- */
:root {
  /* Màu thương hiệu Cát Hỷ: Đỏ Đô – Đỏ Chu Sa – Vàng Hoàng Kim trên nền Kem Lụa */
  --brand: #9b2335;
  --brand-dark: #7a1626;
  --brand-soft: #f9e6e3;
  --brand-light: #c23147;        /* sắc đỏ chu sa tươi cho nút & ấn hỷ */
  --gold: #b88722;               /* vàng hoàng kim trầm sang trọng */
  --gold-bright: #d9b152;        /* ánh kim viền */
  --gold-line: #e4cfa3;          /* đường chỉ vàng mảnh */
  --gold-soft: #fcf4df;          /* nền kem nhũ vàng */
  --ink: #2a2421;
  --muted: #72645a;
  --bg: #faf4ec;
  --card: #fffdf9;
  --line: #e9d7ca;
  --green: #1f7a4d;
  --green-soft: #e3f3ea;
  --red: #b3261e;
  --red-soft: #fbe7e5;
  --blue: #2457a6;
  --blue-soft: #e5eefb;
  --purple: #6b3fa0;
  --purple-soft: #efe7f8;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(90, 35, 30, .06), 0 6px 20px rgba(90, 35, 30, .05);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --font-body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-title: 'Playfair Display', 'Palatino Linotype', Cambria, 'Times New Roman', serif;   /* không dùng Georgia làm dự phòng: Georgia trên Windows tách dấu tiếng Việt ("đế n") */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* Footer luôn nằm sát đáy màn hình kể cả khi trang ít nội dung */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: radial-gradient(1200px 440px at 50% -140px, rgba(155, 35, 53, .07), rgba(217, 177, 82, .06) 46%, transparent 74%), var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font-title); line-height: 1.25; letter-spacing: -.015em; text-wrap: balance; margin: 0 0 .5em; }
h1 { font-size: clamp(26px, 4vw, 40px); }
h2 { font-size: clamp(21px, 2.6vw, 28px); }
h3 { font-size: 18px; }
p { margin: 0 0 .75em; text-wrap: pretty; }
.price, .amount, .stat-value, .ring-value, .cat-total, .cell-money, .view-money, .countdown-num, .budget-item strong {
  font-variant-numeric: tabular-nums;
}
[hidden] { display: none !important; }

/* ---------- 2. BỐ CỤC ---------- */
.container { width: min(1180px, 100%); margin: 0 auto; padding: 0 16px; }
main.container { padding-block: 28px 56px; flex: 1 0 auto; }
.section { margin-bottom: 48px; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head p { color: var(--muted); margin: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 999px;
  background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); border: 1px solid var(--gold-line);
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-dark); margin-bottom: 10px;
}
.eyebrow::before { content: "囍"; color: var(--brand); font-size: 12px; font-weight: 800; line-height: 1; }
.eyebrow::after { content: "✦"; color: var(--gold); font-size: 10px; line-height: 1; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.grid-2 { display: grid; gap: 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.price { font-weight: 700; color: var(--brand-dark); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); background: var(--card); }

/* ---------- 3. HEADER / FOOTER ---------- */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(255, 251, 245, .94); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gold-line);
  box-shadow: 0 2px 14px rgba(122, 22, 38, .04);
}
.site-header::before {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg, var(--brand-dark), var(--brand-light), var(--gold-bright), var(--brand-light), var(--brand-dark));
}
.site-header .container { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none !important; }
.brand img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); box-shadow: 0 0 0 2px var(--gold-soft), 0 0 0 3px var(--gold-line); }
.brand strong { font-family: var(--font-title); font-size: 21px; font-style: italic; color: var(--brand-dark); }
.hy-seal {
  display: inline-grid; place-items: center; width: 21px; height: 21px; border-radius: 5px;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  border: 1px solid var(--gold-bright); box-shadow: 0 2px 6px rgba(155, 35, 53, .22);
  color: #ffe8a3; font-size: 12px; font-weight: 800; line-height: 1; flex: none;
}
.nav { display: flex; gap: 4px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.nav a { padding: 8px 10px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; border: 1px solid transparent; transition: background .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out); }
.nav a:hover { color: var(--ink); background: #f6ece4; }
.nav a.active { color: var(--brand-dark); background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); border-color: var(--gold-line); }
/* Menu nhiều mục (đối tác có 9 mục): laptop → ẩn tên tài khoản (còn ảnh đại diện); màn hình vừa → rút gọn chữ */
@media (max-width: 1400px) {
  .user-name { display: none; }
  .account-button { padding: 3px; }
}
@media (max-width: 1240px) {
  .nav a { padding: 8px 9px; font-size: 13.5px; }
  .nav-suffix, .hy-seal { display: none; }
}
@media (max-width: 820px) {
  .hy-seal { display: inline-grid; }
}
@media (max-width: 1000px) {
  .nav { gap: 2px; }
  .nav a { padding: 8px 7px; font-size: 13px; }
}
.user-area { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.user-name { font-weight: 600; font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.ellipsis { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Avatar + menu tài khoản */
.user-area { position: relative; }
.account-button { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; color: var(--ink); font: inherit; }
.account-button:hover, .account-button[aria-expanded="true"] { border-color: var(--brand); }
.avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)); color: #fff; font-weight: 700; font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 16px; }
.account-menu { position: fixed; right: max(16px, calc((100vw - 1180px) / 2 + 16px)); top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 60; width: 280px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: 0 12px 32px rgba(42, 36, 33, .16); display: flex; flex-direction: column; }
.account-menu[hidden] { display: none; }
.account-head { display: flex; gap: 10px; align-items: center; padding: 8px 8px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.account-menu a, .account-signout { display: block; padding: 11px 12px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 14px; text-align: left; text-decoration: none; background: none; border: 0; cursor: pointer; font-family: inherit; }
.account-menu a:hover, .account-menu a.active { background: var(--brand-soft); color: var(--brand-dark); }
.account-signout { margin-top: 4px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--red); }
.account-signout:hover { background: var(--red-soft); }
/* ---------- Trang đăng nhập / tạo tài khoản ---------- */
.auth-shell { max-width: 500px; padding-block: 32px 56px; }
body.auth-page { background: radial-gradient(1100px 520px at 50% -120px, var(--brand-soft), transparent 70%), var(--bg); }
/* Đầu thẻ: thương hiệu Trạm Hỷ + các dịch vụ trên sàn */
.auth-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 2px; }
.auth-brand-logo { width: 52px; height: 52px; border-radius: 50%; border: 2px solid var(--brand); object-fit: cover; flex: none;
  animation: logo-in .6s .15s cubic-bezier(.2, 1.4, .4, 1) both; }
.auth-brand-name { display: block; font: italic 700 26px/1.1 var(--font-title); color: var(--brand-dark); }
.auth-brand-tagline { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }
.auth-services { list-style: none; margin: 0; padding: 10px 0 14px; display: flex; flex-wrap: wrap; gap: 5px; border-bottom: 1px solid var(--line); }
.auth-services li { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: var(--brand-soft);
  color: var(--brand-dark); font-size: 12px; font-weight: 600; animation: rise .45s both; }
.auth-services li:nth-child(2) { animation-delay: .06s; } .auth-services li:nth-child(3) { animation-delay: .12s; }
.auth-services li:nth-child(4) { animation-delay: .18s; } .auth-services li:nth-child(5) { animation-delay: .24s; }
@keyframes logo-in { from { opacity: 0; transform: scale(.6) rotate(-12deg); } to { opacity: 1; transform: none; } }
.auth-card { display: flex; flex-direction: column; gap: 14px; padding: 28px 28px 24px; border-radius: 24px; box-shadow: 0 18px 48px rgba(42, 36, 33, .10);
  animation: auth-in .6s .1s cubic-bezier(.2, .8, .2, 1) both; }
.auth-title { margin: 0; font-size: 26px; }
.auth-subtitle { margin: 4px 0 0; }
.auth-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: #f3e8e2; }
.auth-tabs .tab { position: relative; z-index: 1; text-align: center; transition: color .25s; }
.auth-tabs .tab.active { background: transparent; box-shadow: none; color: var(--brand-dark); }
.auth-tab-indicator { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 999px; background: var(--card);
  box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.3, 1.3, .5, 1); }
.auth-tabs[data-active="signup"] .auth-tab-indicator { transform: translateX(100%); }
.google-btn { transition: transform .15s, box-shadow .2s, border-color .2s; }
.google-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); border-color: var(--brand); }
.auth-form { gap: 12px; }
.form-enter { animation: form-in .35s cubic-bezier(.2, .8, .2, 1); }
.auth-row { display: flex; justify-content: space-between; align-items: center; margin-top: -4px; }
.btn-lg { padding: 13px 20px; font-size: 15px; }
.auth-form .btn-primary { transition: transform .15s, box-shadow .2s, filter .2s; }
.auth-form .btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(155, 35, 53, .28); }
.auth-form .btn-primary:not(:disabled):active { transform: translateY(0) scale(.99); }
/* ô nhập có biểu tượng + trạng thái hợp lệ / lỗi */
.input-wrap { position: relative; display: block; }
.input-wrap::before { content: ""; position: absolute; left: 13px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); background: var(--muted);
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat; transition: background .2s; pointer-events: none; }
.input-wrap:focus-within::before { background: var(--brand); }
.input-wrap .input { padding-left: 40px; transition: border-color .2s, box-shadow .2s, background .2s; }
.input-wrap .input:focus { box-shadow: 0 0 0 4px var(--brand-soft); }
.input-wrap:has(.eye-toggle) .input { padding-right: 46px; }
.input-wrap.is-valid .input { border-color: #8fd1ad; }
.input-wrap .input[aria-invalid="true"] { border-color: var(--red); background: #fffafa; }
.input-wrap[data-icon="mail"]  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E"); }
.input-wrap[data-icon="lock"]  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.input-wrap[data-icon="user"]  { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21a8 8 0 0 1 16 0'/%3E%3C/svg%3E"); }
.input-wrap[data-icon="phone"] { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2' width='10' height='20' rx='2'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }
.eye-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); display: grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; transition: background .2s, color .2s; }
.eye-toggle:hover, .eye-toggle[aria-pressed="true"] { background: var(--brand-soft); color: var(--brand-dark); }
.eye-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.eye-toggle.pop svg { animation: eye-pop .3s ease; }
.field-error { animation: error-in .25s ease; }
/* độ mạnh mật khẩu */
.pw-meter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: -4px; }
.pw-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; flex: 1; min-width: 140px; }
.pw-bars i { height: 5px; border-radius: 999px; background: #eee2db; transition: background .3s; }
.pw-meter[data-level="1"] .pw-bars i:nth-child(-n+1) { background: var(--red); }
.pw-meter[data-level="2"] .pw-bars i:nth-child(-n+2) { background: #e08a1e; }
.pw-meter[data-level="3"] .pw-bars i:nth-child(-n+3) { background: #4c9a2a; }
.pw-meter[data-level="4"] .pw-bars i { background: var(--green); }
.pw-level { font-size: 12.5px; font-weight: 700; color: var(--muted); min-width: 110px; text-align: right; }
.pw-rules { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 3px 12px; font-size: 12.5px; color: var(--muted); }
.pw-rules li { display: flex; align-items: center; gap: 6px; transition: color .2s; }
.pw-rules li::before { content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--line); background: #fff; transition: all .25s; }
.pw-rules li.ok { color: var(--green); }
.pw-rules li.ok::before { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 9px no-repeat; animation: badge-pop .3s; }
.pw-rules em { font-style: normal; opacity: .7; }
/* nút đang xử lý (withBusy): vòng xoay */
.btn[aria-busy="true"] { position: relative; color: transparent !important; }
.btn[aria-busy="true"]::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn-outline[aria-busy="true"]::after, .btn-link[aria-busy="true"]::after { border-color: rgba(155, 35, 53, .25); border-top-color: var(--brand); }
.shake { animation: shake .45s cubic-bezier(.36, .07, .19, .97); }
@keyframes auth-in { from { opacity: 0; transform: translateY(18px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes form-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-7px); } 40%, 60% { transform: translateX(7px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes eye-pop { 0% { transform: scale(.6); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
@keyframes error-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .auth-brand-logo, .auth-services li, .auth-card, .form-enter, .shake, .field-error, .eye-toggle.pop svg { animation: none !important; }
}

/* ---------- Kế hoạch cưới (ke-hoach.html) ---------- */
.text-red { color: var(--red) !important; }
.btn-light { background: rgba(255, 255, 255, .92); color: var(--brand-dark); }
.planner-tabs { margin-bottom: 18px; width: fit-content; max-width: 100%; overflow-x: auto; }
.planner-tabs a.tab { text-decoration: none; }
.save-status { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; transition: opacity .3s; }
.save-status[data-state="idle"] { opacity: 0; }
.save-status[data-state="saving"] { color: var(--muted); background: var(--bg); }
.save-status[data-state="saved"] { color: #1f7a4d; background: #e7f6ee; }
.save-status[data-state="error"] { color: var(--red); background: #fdecec; }
.planner-intro { display: flex; flex-direction: column; gap: 20px; align-items: center; padding: 28px; }
.planner-intro-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; width: 100%; }
.planner-feature { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 14px; background: var(--bg); }
.planner-feature span { font-size: 26px; }
.planner-feature p { margin: 0; }
.planner-create { max-width: 720px; }
.region-picker { border: 0; padding: 0; margin: 0; }
.region-picker legend { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.region-option { flex: 1; min-width: 220px; display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 2px solid var(--line); border-radius: 12px; cursor: pointer; font-weight: 600; }
.region-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.region-option input { accent-color: var(--brand); }
/* Tổng quan */
.overview-grid { display: grid; grid-template-columns: 1.1fr repeat(3, 1fr); gap: 14px; }
/* Thẻ đếm ngày: ".card.countdown-card" (không chỉ ".countdown-card") – vì .card khai báo SAU và đặt nền trắng,
   trước đây nền gradient bị đè thành trắng trong khi chữ vẫn trắng → không đọc được. Mỗi trạng thái có cặp nền / chữ riêng. */
.card.countdown-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center;
  color: #fff; background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)); border: 0; min-height: 170px; }
.card.countdown-card .countdown-sub { color: rgba(255, 255, 255, .92); }
.card.countdown-card .countdown-text { font-weight: 600; }
.card.countdown-card[data-state="today"] { background: linear-gradient(135deg, #9a6512, #6e4508); }          /* vàng hỷ đậm – chữ trắng vẫn đủ tương phản */
.card.countdown-card[data-state="after"] { color: var(--brand-dark); background: linear-gradient(135deg, #fdf1ec, #f6dcd5); border: 1px solid #efcfc6; }
.card.countdown-card[data-state="after"] .countdown-sub { color: #7a4a42; }
.card.countdown-card[data-state="none"] { color: var(--ink); background: var(--brand-soft); border: 1px dashed #e3c3ba; gap: 8px; }
.card.countdown-card[data-state="none"] .countdown-sub { color: var(--muted); }
.card.countdown-card[data-state="none"] .btn-light { background: var(--brand); color: #fff; }
.countdown-icon { font-size: 30px; line-height: 1; }
.countdown-num { font: 700 56px/1 var(--font-title); animation: badge-pop .6s cubic-bezier(.2, 1.4, .4, 1); }
/* Đầu trang: trạng thái lưu + nút Chia sẻ / Xuất Excel */
.planner-head-side { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.planner-actions { display: flex; gap: 8px; flex-wrap: wrap; }
button.overview-stat { font: inherit; text-align: left; cursor: pointer; }
div.overview-stat:hover { transform: none; border-color: var(--line); box-shadow: var(--shadow); }
/* Hộp chia sẻ kế hoạch */
.share-switch { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); cursor: pointer; }
.share-switch > span:last-child { display: flex; flex-direction: column; }
.share-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.share-switch-track { flex: none; position: relative; width: 46px; height: 26px; border-radius: 999px; background: #d9c9c0; transition: background .2s; }
.share-switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.share-switch input:checked + .share-switch-track { background: var(--green); }
.share-switch input:checked + .share-switch-track::after { transform: translateX(20px); }
.share-switch input:focus-visible + .share-switch-track { outline: 2px solid var(--brand); outline-offset: 2px; }
.share-switch input:disabled + .share-switch-track { opacity: .6; }
.share-link-row .input { flex: 1; min-width: 0; }
.plan-share-sheet .share-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.plan-share-sheet .share-qr { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.plan-share-sheet .share-qr img { width: 120px; height: auto; flex: none; image-rendering: pixelated; }
.share-note { margin: 0; }
.share-rotate { padding-top: 10px; border-top: 1px solid var(--line); }
/* Trang xem kế hoạch được chia sẻ (?xem=) */
.share-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 16px; border-radius: 14px;
  background: var(--blue-soft); border: 1px solid #c9d9f2; color: #1d3f78; }
.share-banner > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.share-banner-icon { font-size: 24px; }
.planner-view-bar { margin-bottom: 18px; }
.planner-view-bar .planner-tabs { margin-bottom: 0; }
.share-error { max-width: 560px; margin: 8px auto; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 32px 24px; }
.share-error h2 { margin: 6px 0 0; }
.share-error-icon { font-size: 44px; }
.card.view-category { padding: 0; overflow: hidden; }
.view-cat-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f6eee9; cursor: pointer; list-style: none; }
.view-cat-head::-webkit-details-marker { display: none; }
.view-cat-name { flex: 1; min-width: 0; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: 14.5px; }
.view-cat-head .chevron { color: var(--muted); font-size: 20px; line-height: 1; }
.view-category:not([open]) .chevron { transform: rotate(-90deg); }
.view-cat-progress { display: flex; align-items: center; gap: 10px; padding: 10px 14px 4px; }
.view-cat-progress .progress { flex: 1; }
.progress.progress-paid span { background: var(--green); }
.view-rows { list-style: none; margin: 0; padding: 4px 0 6px; }
.view-row { display: grid; grid-template-columns: minmax(0, 1fr) 140px 140px 92px; gap: 10px; align-items: center; padding: 9px 14px; border-top: 1px solid #f3ebe6; }
.view-row:first-child { border-top: 0; }
.view-row-name { min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.view-money { display: flex; flex-direction: column; text-align: right; }
.view-money > span { font-size: 11px; color: var(--muted); }
.view-money.over b { color: var(--red); }
.view-row .badge { justify-self: end; }
.view-empty { margin: 0; padding: 8px 14px 14px; }
.view-task .task-check { cursor: default; }
.view-task .task-check:hover { border-color: #d9c9c0; }
.view-task.done .task-check:hover { border-color: var(--green); }
.overview-stat { display: flex; flex-direction: column; gap: 6px; color: var(--ink); text-decoration: none; transition: transform .15s, box-shadow .2s, border-color .2s; }
.overview-stat:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: 0 10px 26px rgba(155, 35, 53, .12); }
.overview-stat strong { font-size: 22px; }
.next-tasks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.next-tasks li { display: flex; align-items: flex-start; gap: 10px; }
.next-tasks li div { flex: 1; display: flex; flex-direction: column; }
.next-tasks .dot { flex: none; width: 10px; height: 10px; margin-top: 6px; border-radius: 50%; background: var(--brand); }
.next-tasks li.late .dot { background: var(--red); }
.next-tasks li.late .muted { color: var(--red); }
/* Ngân sách: tổng quan 2 vòng tròn */
.budget-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 24px; align-items: center; margin-bottom: 16px; }
.ring-stat { display: flex; align-items: center; gap: 16px; }
.ring-stat > div:last-child { display: flex; flex-direction: column; gap: 2px; }
.ring { --p: 0; --c: var(--brand); position: relative; flex: none; width: 96px; height: 96px; border-radius: 50%;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), #efe5df 0); display: grid; place-items: center; animation: ring-in .9s ease-out both; }
.ring::before { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--card); }
.ring span { position: relative; font-weight: 800; font-size: 18px; }
.ring-label { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; }
.ring-value { font-size: 22px; font-weight: 800; }
.budget-summary-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.budget-total { display: inline-flex; gap: 6px; align-items: center; padding: 10px 18px; border: 0; border-radius: 12px;
  background: #f1e8e3; color: var(--ink); font: inherit; cursor: pointer; transition: background .2s; }
.budget-total:hover { background: var(--brand-soft); }
.budget-warning { grid-column: 1 / -1; margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.budget-warning-ai { background: #fff; color: var(--red); border: 1px solid #efc2bd; white-space: nowrap; }
.budget-warning-ai:hover { background: var(--red); color: #fff; }
/* Ngân sách: danh mục + mục */
.budget-categories { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.budget-category { padding: 0; overflow: hidden; animation: rise .35s both; }
.budget-cat-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: #f6eee9; border-bottom: 1px solid var(--line); }
.cat-name { flex: 1; min-width: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; padding: 6px 8px;
  font: 700 15px var(--font-body); text-transform: uppercase; letter-spacing: .03em; color: var(--ink); }
.cat-name:hover { border-color: var(--line); background: #fff; }
.cat-name:focus { outline: none; border-color: var(--brand); background: #fff; text-transform: none; }
.cat-total { font-weight: 800; color: var(--brand-dark); white-space: nowrap; }
.icon-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; color: var(--muted); }
.icon-btn:hover { background: #fff; color: var(--ink); }
.chevron { font-size: 20px; transition: transform .25s; }
.budget-category.collapsed .chevron { transform: rotate(-90deg); }
.budget-cat-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .3s ease; }
.budget-category.collapsed .budget-cat-body { display: none; }
.budget-cols, .budget-row, .budget-cat-foot { display: grid; grid-template-columns: 28px minmax(0, 1fr) 150px 150px 92px 32px; gap: 8px; align-items: center; padding: 0 12px; }
.budget-cols { padding-top: 10px; padding-bottom: 6px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.budget-cols span:first-child { grid-column: 2; }
.budget-rows { list-style: none; margin: 0; padding: 0; }
.budget-row { min-height: 50px; border-top: 1px solid #f3ebe6; background: var(--card); transition: background .2s, opacity .2s, transform .2s; }
.budget-row:hover { background: #fdf8f5; }
.budget-row.removing { opacity: 0; transform: translateX(20px); }
.budget-row.dragging { box-shadow: 0 12px 30px rgba(42, 36, 33, .2); border-radius: 10px; opacity: .95; }
.budget-row.dropped, .budget-category.dropped { animation: drop-flash .5s ease; }
.sort-placeholder { list-style: none; border: 2px dashed var(--brand); border-radius: 12px; background: var(--brand-soft); opacity: .6; }
.drag-handle { display: grid; place-items: center; width: 28px; height: 32px; border: 0; background: transparent; color: #b9aaa1; cursor: grab; touch-action: none; font-size: 18px; border-radius: 6px; }
.drag-handle:hover { color: var(--brand); background: var(--brand-soft); }
.drag-handle.ghost { cursor: default; font-size: 14px; }
.drag-handle.ghost:hover { background: transparent; }
.cell-name { min-width: 0; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; background: transparent; font: inherit; color: var(--ink); }
input.cell-name:hover { border-color: var(--line); }
input.cell-name:focus { outline: none; border-color: var(--brand); background: #fff; }
span.cell-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-money { display: flex; flex-direction: column; }
.cell-money > span { display: none; font-size: 11px; color: var(--muted); }
.cell-money input { width: 100%; border: 1px solid transparent; border-radius: 8px; padding: 7px 8px; background: #faf6f3; font: inherit; text-align: right; }
.cell-money input:hover { border-color: var(--line); }
.cell-money input:focus { outline: none; border-color: var(--brand); background: #fff; }
.cell-money b { text-align: right; padding: 7px 8px; }
.cell-money.over input { color: var(--red); border-color: #efc2bd; background: #fff6f5; }
.paid-toggle { padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font: 600 12px var(--font-body);
  cursor: pointer; text-align: center; text-decoration: none; white-space: nowrap; transition: all .2s; }
.paid-toggle.on { background: var(--green); border-color: var(--green); color: #fff; }
.paid-toggle.pop { animation: badge-pop .3s; }
.row-delete { width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: #c5b6ad; cursor: pointer; }
.row-delete:hover { background: var(--red-soft); color: var(--red); }
.booking-row { background: #fbf6ff; }
.booking-row:hover { background: #f6eeff; }
.add-row { margin: 6px 12px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; background: transparent; color: var(--brand-dark);
  font: 600 14px var(--font-body); cursor: pointer; text-align: left; }
.add-row:hover { border-color: var(--brand); background: var(--brand-soft); }
.budget-cat-foot { padding-top: 10px; padding-bottom: 12px; border-top: 1px solid var(--line); font-weight: 800; }
.budget-cat-foot span { grid-column: 1 / 3; text-transform: uppercase; font-size: 13px; letter-spacing: .04em; }
.budget-cat-foot b { text-align: right; padding: 0 8px; }
/* Checklist */
.checklist-head { margin-bottom: 16px; }
.task-add-slot { display: flex; justify-content: center; margin-top: 8px; }
.task-add-btn { border: 1px dashed #e3cfc6; background: transparent; color: var(--brand-dark); font: 600 14px var(--font-body); padding: 9px 18px; border-radius: 12px; cursor: pointer; transition: background .2s, border-color .2s; }
.task-add-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.task-add-inline { display: flex; gap: 8px; width: 100%; padding: 10px; border: 1px solid var(--brand); border-radius: 14px; background: var(--card); animation: task-add-in .2s ease; }
.task-add-inline .input { flex: 1; min-width: 0; }
.task-group-count { margin-left: 6px; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.task-title[contenteditable] { outline: none; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; cursor: text; transition: background .15s, box-shadow .15s; }
.task-title[contenteditable]:hover { background: #f6efeb; }
.task-title[contenteditable]:focus { background: #fff; box-shadow: 0 0 0 2px var(--brand-soft), 0 0 0 1px var(--brand) inset; text-decoration: none; }
.task-more { flex: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f1e8e3; color: var(--ink); font-size: 18px; line-height: 1; cursor: pointer; }
.task-more:hover { background: var(--brand-soft); color: var(--brand-dark); }
.task-group { margin-bottom: 18px; }
.task-group h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--brand-dark); }
.task-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.task { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  transition: opacity .3s, background .3s; animation: rise .3s both; }
.task.done { opacity: .6; background: #faf7f5; }
.task.done .task-title { text-decoration: line-through; }
.task.late { border-color: #efc2bd; background: #fffafa; }
.task.late .task-due { color: var(--red); font-weight: 600; }
.task.soon .task-due { color: #b46a00; font-weight: 600; }
.task-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.task-title { font-weight: 600; }
.task-due { font-size: 12.5px; color: var(--muted); }
.task-check { flex: none; width: 26px; height: 26px; border: 2px solid #d9c9c0; border-radius: 8px; background: #fff; cursor: pointer; transition: all .2s; }
.task-check:hover { border-color: var(--brand); }
.task.done .task-check { border-color: var(--green); background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 15px no-repeat; }
.task.just-toggled .task-check { animation: badge-pop .35s; }
@keyframes ring-in { from { opacity: 0; transform: scale(.7) rotate(-40deg); } to { opacity: 1; transform: none; } }
@keyframes drop-flash { 0% { box-shadow: 0 0 0 3px var(--brand); } 100% { box-shadow: 0 0 0 0 transparent; } }
@keyframes task-add-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Chuông thông báo ---------- */
.notif-button { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; transition: border-color .2s, background .2s; }
.notif-button:hover, .notif-button[aria-expanded="true"] { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }
.notif-button.ring svg { animation: bell-ring .9s ease-in-out; transform-origin: 50% 8%; }
.notif-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #d0312d; color: #fff; font: 700 11px/18px var(--font-body); text-align: center; border: 2px solid #fff;
  animation: badge-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
.notif-badge[hidden] { display: none; }
.notif-panel { position: fixed; right: max(16px, calc((100vw - 1180px) / 2 + 16px)); top: calc(64px + env(safe-area-inset-top, 0px)); z-index: 61;
  width: 380px; max-height: min(560px, calc(100dvh - 90px)); display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: 16px; background: var(--card); box-shadow: 0 16px 40px rgba(42, 36, 33, .18); overflow: hidden;
  animation: panel-in .22s cubic-bezier(.2, .8, .2, 1); }
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; gap: 6px; padding: 12px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.notif-head strong { font-size: 16px; }
.notif-close { display: none; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f5ebe6; cursor: pointer; font-size: 14px; }
.notif-list { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none; transition: background .15s; }
.notif-item:hover { background: #f8f1ec; }
.notif-item.unread { background: var(--brand-soft); }
.notif-item.unread:hover { background: #f3dcd7; }
.notif-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--line); font-size: 19px; }
.notif-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.35; }
.notif-item:not(.unread) .notif-text strong { font-weight: 600; color: #4a403b; }
.notif-body { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.notif-time { color: var(--brand); font-size: 12px; font-weight: 600; }
.notif-item:not(.unread) .notif-time { color: var(--muted); font-weight: 500; }
.notif-dot { flex: none; width: 10px; height: 10px; margin-top: 15px; border-radius: 50%; background: var(--brand); }
.notif-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 20px; text-align: center; }
.notif-empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--brand-soft); font-size: 30px; margin-bottom: 4px; }
.notif-skeleton { display: flex; gap: 12px; padding: 10px; }
.notif-skeleton span { flex: none; width: 40px; height: 40px; border-radius: 50%; }
.notif-skeleton div { flex: 1; display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.notif-skeleton i { display: block; height: 10px; border-radius: 6px; }
.notif-skeleton i:last-child { width: 60%; }
.notif-skeleton span, .notif-skeleton i { background: linear-gradient(90deg, #f3e8e2 25%, #faf3ef 50%, #f3e8e2 75%); background-size: 200% 100%; animation: skeleton 1.2s linear infinite; }
/* Đến từ thông báo: đơn được cuộn tới sẽ nháy sáng */
.flash { animation: flash-focus 2.4s ease-out; }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(16deg); } 30% { transform: rotate(-14deg); } 45% { transform: rotate(10deg); } 60% { transform: rotate(-6deg); } 75% { transform: rotate(3deg); } }
@keyframes badge-pop { from { transform: scale(.3); } to { transform: scale(1); } }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes panel-in { from { opacity: 0; transform: translateY(-6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@keyframes flash-focus { 0%, 30% { box-shadow: 0 0 0 4px var(--brand); } 100% { box-shadow: 0 0 0 0 transparent; } }
@media (prefers-reduced-motion: reduce) { .notif-button.ring svg, .notif-badge, .notif-panel, .flash { animation: none !important; } }

/* Thanh tab dưới đáy – chỉ điện thoại */
.tabbar { display: none; }
.site-footer {
  position: relative; border-top: 1px solid var(--gold-line);
  padding: 26px 0 calc(26px + env(safe-area-inset-bottom, 0px));
  color: var(--muted); font-size: 13px; text-align: center;
  background: linear-gradient(180deg, #fffcf7, #f6ebe0);
}
.footer-ornament {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  max-width: 260px; margin: -6px auto 12px; color: var(--brand); font-size: 14px; font-weight: 700;
}
.footer-ornament::before, .footer-ornament::after {
  content: ""; flex: 1; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-bright), transparent);
}
.footer-ornament span {
  display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--gold-soft); border: 1px solid var(--gold-line); color: var(--brand); font-size: 12px;
}

/* ---------- 4. THÀNH PHẦN ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 999px; border: 1px solid transparent;
  font: 600 14px var(--font-body); cursor: pointer; text-decoration: none !important;
  transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out), opacity .18s var(--ease-out);
}
.btn:active, .chip:active, .tab:active, .slide-nav:active { transform: scale(.97); }
.btn:focus-visible, .chip:focus-visible, .tab:focus-visible, .nav a:focus-visible, .slide-nav:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-light) 0%, var(--brand) 55%, var(--brand-dark) 100%);
  color: #fff; border-color: #8a1a2b;
  box-shadow: inset 0 1px 0 rgba(255, 232, 175, .38), 0 4px 12px rgba(155, 35, 53, .18);
}
.btn-primary:hover { opacity: .95; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-outline { background: var(--card); color: var(--ink); border-color: var(--gold-line); }
.btn-outline:hover { border-color: var(--brand); background: var(--gold-soft); }
.btn-danger { background: var(--card); color: var(--red); border-color: #efc2bd; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-link { align-self: center; appearance: none; background: none; border: 0; font: 600 inherit var(--font-body); color: var(--brand-dark); padding: 4px 8px; border-radius: 8px; cursor: pointer; transition: color .18s var(--ease-out), background .18s var(--ease-out), transform .15s var(--ease-out); }
.btn-link:hover { color: var(--brand); background: var(--brand-soft); text-decoration: none; }
.btn-link:active { transform: scale(.97); }
.btn-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-title { font-family: var(--font-title); font-size: 18px; font-weight: 700; margin: 0 0 4px; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #f3e8e2; color: var(--muted); white-space: nowrap; }
.badge-gold { background: var(--gold-soft); color: #845d0e; border: 1px solid var(--gold-line); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-red { background: var(--red-soft); color: var(--red); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }
.verified { color: var(--blue); font-weight: 700; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font: 600 13px var(--font-body); color: var(--muted); cursor: pointer; transition: border-color .18s var(--ease-out), background .18s var(--ease-out), color .18s var(--ease-out), transform .15s var(--ease-out); }
.chip:hover { border-color: var(--brand); }
.chip.active { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-dark); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  font: 15px var(--font-body); color: var(--ink); background: #fff;
}
.input:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand); }
textarea.input { min-height: 84px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--brand); }
.form-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid .full { grid-column: 1 / -1; }
/* Ô nhập số tiền: hậu tố "đ" + báo lỗi dưới ô */
.money-field { position: relative; }
.money-field .input { padding-right: 32px; }
.money-field .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.field-error { margin: 0; color: var(--red); font-size: 13px; }
.input[aria-invalid="true"] { border-color: var(--red); outline-color: var(--red-soft); }

.tabs { display: flex; gap: 4px; padding: 4px; background: #f3e8e2; border-radius: 999px; width: fit-content; max-width: 100%; overflow-x: auto; }
.tab { padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; font: 600 14px var(--font-body); color: var(--muted); cursor: pointer; white-space: nowrap; transition: background .18s var(--ease-out), color .18s var(--ease-out), box-shadow .18s var(--ease-out), transform .15s var(--ease-out); }
.tab.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* Chợ dịch vụ: Thanh chuyển chế độ xem & thanh kết quả phong cách Cát Hỷ – Soft Luxury */
.marketplace-tabs {
  padding: 5px; gap: 6px;
  background: linear-gradient(180deg, #f6ece1 0%, #efe2d3 100%);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 1px 2px rgba(90, 35, 30, .05);
}
.marketplace-tabs .tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 8px 16px; border: 1px solid transparent;
  color: var(--muted); font-weight: 600;
}
.marketplace-tabs .tab.active {
  background: var(--card); color: var(--brand-dark);
  border-color: var(--gold-line);
  box-shadow: 0 3px 10px rgba(122, 22, 38, .09);
}
.tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 24px; height: 20px; padding: 0 7px; border-radius: 999px;
  background: rgba(114, 100, 90, .12); color: var(--muted);
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background .18s var(--ease-out), color .18s var(--ease-out);
}
.marketplace-tabs .tab.active .tab-badge {
  background: var(--brand-soft); color: var(--brand-dark);
}
.result-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 16px; margin: 0 0 16px; padding: 10px 14px;
  border-radius: 12px; background: rgba(255, 253, 249, .78);
  border: 1px solid var(--line);
}
.result-count-text {
  font-size: 13.5px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.result-count-text strong {
  color: var(--ink); font-weight: 700;
}
.result-switch {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.result-switch-label {
  font-size: 12.5px; color: var(--muted); font-weight: 500;
}
.result-switch-pill {
  appearance: none; display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 5px 12px; border-radius: 999px;
  background: linear-gradient(135deg, var(--card), var(--gold-soft));
  border: 1px solid var(--gold-line);
  color: var(--brand-dark); font: 600 12.5px var(--font-body);
  font-variant-numeric: tabular-nums; cursor: pointer;
  transition: transform .18s var(--ease-out), border-color .18s var(--ease-out), background .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
.result-switch-pill b {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 1px 6px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 11.5px; font-weight: 700;
}
.result-switch-pill .arrow {
  color: var(--gold); font-size: 13px; transition: transform .18s var(--ease-out);
}
.result-switch-pill:active { transform: scale(.97); }
.result-switch-pill:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) {
  .marketplace-tabs .tab:not(.active):hover { color: var(--ink); background: rgba(255, 253, 249, .55); }
  .result-switch-pill:hover {
    border-color: var(--brand); background: var(--card);
    box-shadow: 0 4px 12px rgba(155, 35, 53, .10);
    transform: translateY(-1px);
  }
  .result-switch-pill:hover .arrow { transform: translateX(2px); color: var(--brand); }
}

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }

.stat { padding: 16px 18px; }
.stat-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; }

/* Thẻ sản phẩm (váy / đối tác) */
.item-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; transition: transform .22s var(--ease-out), box-shadow .22s var(--ease-out), border-color .22s var(--ease-out); }
.item-card .thumb { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--brand-soft), #f3dfdc); object-fit: cover; width: 100%; transition: transform .36s var(--ease-out); }
.item-card .thumb-placeholder { aspect-ratio: 4 / 3; display: grid; place-items: center; font-family: var(--font-title); font-size: 34px; color: var(--brand-dark); background: linear-gradient(135deg, var(--brand-soft), #f3dfdc); }
.item-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.item-card .body .btn { margin-top: auto; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(155, 35, 53, .22); }
  .item-card:hover { transform: translateY(-3px); border-color: #dec8bc; box-shadow: 0 12px 28px rgba(42, 36, 33, .09); }
  .item-card:hover .thumb { transform: scale(1.03); }
}
/* Logo tròn của tiệm (chưa có logo → chữ cái đầu) */
.vendor-logo { flex: none; display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand-dark); font-family: var(--font-title); font-weight: 700; border: 1px solid var(--line); }
.vendor-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vendor-title h3 { margin: 0; }
.vendor-district { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendor-rating { white-space: nowrap; }
.vendor-rating .stars { color: #e0a800; }
.item-card h3 { font-size: 16px; margin: 0; }

/* Toast */
.toast-host { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100% - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); animation: toast-in .2s ease-out; }
.toast-error { background: var(--red); }
.toast-success { background: var(--green); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

/* Hộp thoại (dùng thẻ <dialog> gốc của trình duyệt) */
dialog.modal { border: 0; border-radius: 18px; padding: 0; width: min(520px, calc(100% - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--ink); }
dialog.modal::backdrop { background: rgba(30, 24, 20, .55); }
.modal-head { padding: 18px 20px 0; }
.modal-body { padding: 14px 20px; max-height: 70vh; overflow-y: auto; }
.modal-foot { padding: 0 20px 18px; display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
/* Tấm chọn (openSheet): giữa màn hình trên máy tính, trượt từ dưới lên trên điện thoại (xem @media 640px) */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; width: min(640px, calc(100% - 32px)); max-height: min(86dvh, 820px);
  background: var(--card); color: var(--ink); box-shadow: 0 24px 70px rgba(0, 0, 0, .25); overflow: hidden; }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog.sheet::backdrop { background: rgba(30, 24, 20, .5); }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.sheet-head h3 { margin: 0; flex: 1; font-size: 19px; }
.sheet-close { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--brand-soft); color: var(--ink); font-size: 15px; cursor: pointer; }
.sheet-close:hover { background: #f0d9d2; }
.sheet-body { padding: 14px 18px 20px; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 12px; }
.sheet-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin: 4px 0 0; font: 700 13.5px var(--font-body); }
.sheet-label span { font-weight: 500; font-size: 12px; color: var(--muted); }

/* Escrow – 3 chặng */
.milestones { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.milestone { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: #fdfbf9; }
.milestone.is-paid { border-color: #e7cf9c; background: #fffaf0; }
.milestone.is-released { border-color: #b9dfc9; background: #f4fbf7; }
.milestone.is-refunded { opacity: .7; }
.milestone .amount { font-weight: 700; font-size: 16px; }

/* Hero trang chủ */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 32px; align-items: center;
  padding: 32px; border-radius: 24px;
  background: linear-gradient(135deg, #fffdf9 0%, #faece6 52%, #fcf3de 100%);
  border: 1px solid var(--gold-line);
  box-shadow: inset 0 0 0 4px #fffdf9, inset 0 0 0 5px rgba(217, 177, 82, .38), var(--shadow);
  margin-bottom: 48px;
}
.hero::after {
  content: "囍"; position: absolute; left: -16px; bottom: -36px;
  font-size: 210px; font-weight: 800; line-height: 1; color: var(--brand);
  opacity: .035; pointer-events: none; user-select: none;
}
.hero > * { position: relative; z-index: 1; }
.hero p.lead { font-size: 17px; color: var(--muted); }
.hero-image { border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 5; max-height: 520px; border: 2px solid rgba(217, 177, 82, .45); box-shadow: 0 12px 32px rgba(122, 22, 38, .12); }
.hero-image img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
/* Banner trang chủ tự đổi ảnh */
.hero-slider { position: relative; }
.hero-slider .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .8s ease; }
.hero-slider .slide.active { opacity: 1; }
.hero-slider .slide:first-child { position: relative; }        /* ảnh đầu giữ khung trước khi các ảnh khác tải */
.slide-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .85); color: var(--ink); font-size: 26px; line-height: 1; cursor: pointer; box-shadow: var(--shadow); }
.slide-nav:hover { background: #fff; }
.slide-nav.prev { left: 12px; }
.slide-nav.next { right: 12px; }
.slide-dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 8px; }
.slide-dots button { position: relative; width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255, 255, 255, .6); cursor: pointer; transition: width .25s var(--ease-out), background .25s var(--ease-out); }
.slide-dots button::after { content: ""; position: absolute; inset: -8px; }
.slide-dots button.active { width: 22px; background: #fff; }
.slide-label { position: absolute; left: 14px; top: 14px; padding: 4px 12px; border-radius: 999px; background: rgba(30, 24, 20, .55); backdrop-filter: blur(6px); color: #fff; font-size: 13px; font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .hero-slider .slide { transition: none; } }
.steps { counter-reset: step; }
.steps .card {
  position: relative; padding-top: 48px;
  border-color: var(--gold-line);
  background: linear-gradient(180deg, #fffdf9, #fdf7ee);
  transition: border-color .2s var(--ease-out), transform .2s var(--ease-out), box-shadow .2s var(--ease-out);
}
.steps .card::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: 14px; left: 18px; width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-light), var(--brand-dark));
  border: 1.5px solid var(--gold-bright);
  box-shadow: 0 2px 8px rgba(155, 35, 53, .2);
  color: #ffe9ad; font-weight: 800; display: grid; place-items: center; font-size: 14px;
}
/* Danh sách đối tác uy tín trên trang chủ */
.top-vendors-card { padding: 6px; }
.top-vendors-list { display: flex; flex-direction: column; }
.top-vendor-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 10px; color: var(--ink); text-decoration: none !important; transition: background .18s var(--ease-out), transform .18s var(--ease-out); }
.top-vendor-row + .top-vendor-row { border-top: 1px solid #f4ebe5; }
.top-vendor-row:hover { background: #fbf5f1; }
.top-vendor-row:active { transform: scale(.995); }
.top-vendor-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.top-vendor-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.top-vendor-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; white-space: nowrap; }
.top-vendor-arrow { color: var(--muted); font-weight: 700; transition: transform .2s var(--ease-out), color .2s var(--ease-out); }
.top-vendor-row:hover .top-vendor-arrow { transform: translateX(3px); color: var(--brand-dark); }

/* ---------- 5. TRANG THỬ VÁY ---------- */
.studio { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.mirror { position: sticky; top: calc(80px + env(safe-area-inset-top, 0px)); background: #1d1815; border-radius: 22px; padding: 14px; color: #f3ead9; }
.mirror-frame { position: relative; border-radius: 16px; overflow: hidden; aspect-ratio: 3 / 4; background: #2a2421; }
.mirror-frame img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mirror-label { position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 999px; background: rgba(0, 0, 0, .6); font-size: 13px; font-weight: 600; }
.mirror-scan { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(20, 15, 12, .75); font-weight: 600; text-align: center; padding: 20px; }
.mirror-scan::after { content: ''; position: absolute; left: 0; right: 0; height: 3px; background: var(--brand); box-shadow: 0 0 18px var(--brand); animation: scan 1.2s linear infinite; }
@keyframes scan { from { top: 0; } to { top: 100%; } }
/* Công cụ chia ngân sách (trang chủ): trái nhập – phải kết quả + chat */
.budget-tool { align-items: start; }
/* Cột nhập "dính" dưới thanh menu (cao ~65px) khi cuộn xem kết quả / chat ở cột phải */
.budget-tool > form { position: sticky; top: 84px; max-height: calc(100dvh - 100px); overflow-y: auto; }
.budget-result:empty::before { content: "Nhập ngân sách bên trái để xem gợi ý."; color: var(--muted); font-size: 14px; }
.budget-item { display: flex; flex-direction: column; gap: 4px; }
.budget-label { width: 150px; }
.budget-bar { height: 7px; border-radius: 999px; background: #f3e8e2; overflow: hidden; }
.budget-bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-dark), var(--brand-light), var(--gold-bright)); transition: width .4s var(--ease-out); }
.budget-chat { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }
.chat-log { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; padding: 4px 2px; }
.msg { max-width: 88%; padding: 9px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-line; }
.msg.ai { align-self: flex-start; background: #f5ece7; border-bottom-left-radius: 4px; }
.msg.user { align-self: flex-end; background: var(--brand-soft); color: var(--ink); border-bottom-right-radius: 4px; }
.msg.typing { color: var(--muted); font-style: italic; }
.chat-form { flex-wrap: nowrap; }
.chat-form .input { flex: 1; min-width: 0; }
.fit-score { display: flex; gap: 12px; align-items: center; margin-top: 12px; padding: 12px; border-radius: 12px; background: #2a2421; }
.fit-score .score { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 18px; background: var(--brand); color: #fff; }
.fit-score p { margin: 0; font-size: 13px; color: #d9cbbb; }
.models { display: flex; gap: 10px; overflow-x: auto; padding: 6px 6px 4px 0; }   /* chừa chỗ cho nút × */
.model { flex: none; width: 68px; border: 2px solid transparent; border-radius: 12px; padding: 0; background: none; cursor: pointer; text-align: center; font: 600 12px var(--font-body); color: var(--muted); }
.model img { width: 64px; height: 64px; object-fit: cover; object-position: top; border-radius: 10px; }
.model.active { border-color: var(--brand); color: var(--brand-dark); }
/* Gói dịch vụ: mô tả tối đa 3 dòng, thẻ rộng hơn thẻ váy */
.package-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-line; }
.packages-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.lightbox-note { max-width: 560px; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* ---------- Trở thành đối tác ---------- */
.footer-row { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; align-items: center; }
.footer-row a { font-weight: 600; }
.partner-banner {
  position: relative; overflow: hidden;
  display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; justify-content: space-between; padding: 26px 30px;
  border-radius: 20px; border: 1px solid var(--gold-line);
  background: linear-gradient(120deg, var(--brand-soft) 0%, #fffdf9 55%, var(--gold-soft) 100%);
  box-shadow: inset 0 0 0 3px #fffdf9, inset 0 0 0 4px rgba(217, 177, 82, .35), var(--shadow);
}
.partner-banner::after {
  content: "囍"; position: absolute; right: 18px; bottom: -24px;
  font-size: 130px; font-weight: 800; line-height: 1; color: var(--brand);
  opacity: .045; pointer-events: none; user-select: none;
}
.partner-banner > * { position: relative; z-index: 1; }
.partner-banner h2 { margin: 4px 0; }
.partner-banner p { margin: 0; }
.partner-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.partner-stats .card { display: flex; flex-direction: column; gap: 2px; text-align: center; padding: 20px 12px; }
.partner-stats strong { font-family: var(--font-title); font-size: 32px; color: var(--brand); }
.partner-stats span { color: var(--muted); font-size: 13px; }
.partner-benefits .card h3 { margin: 8px 0 4px; }
.partner-benefits .card p { margin: 0; }
.benefit-icon { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); font-size: 22px; color: var(--brand); font-weight: 800; }
.partner-steps { list-style: none; counter-reset: pstep; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.partner-steps li { counter-increment: pstep; position: relative; display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 18px 64px;
  border: 1px solid var(--gold-line); border-radius: var(--radius); background: linear-gradient(180deg, #fffdf9, #fdf7ee); }
.partner-steps li::before { content: counter(pstep); position: absolute; left: 18px; top: 16px; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; background: linear-gradient(135deg, var(--brand-light), var(--brand-dark)); border: 1.5px solid var(--gold-bright); color: #ffe9ad; font-weight: 800; }
.partner-steps span { color: var(--muted); font-size: 14px; }
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 12px; background: var(--card); padding: 14px 16px; }
.faq summary { cursor: pointer; font-weight: 700; }
.faq p { margin: 8px 0 0; color: var(--muted); }
.partner-final { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 32px 20px; }
.partner-final h2, .partner-final p { margin: 0; }
/* Form mở tiệm từng bước */
.wizard-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.wizard-steps li { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: #f5ebe6; color: var(--muted); font-size: 13px; font-weight: 600; }
.wizard-steps .num { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 1.5px solid var(--line); font-weight: 800; }
.wizard-steps li.active { background: var(--brand-soft); color: var(--brand-dark); }
.wizard-steps li.active .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.wizard-steps li.done .num { background: var(--green); border-color: var(--green); color: #fff; }
.wizard-body { animation: captcha-in .35s ease both; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; }
.review-box { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--bg); }
.review-icon { font-size: 30px; }
.review-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 12px 0 0; font-size: 14px; }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.terms { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.5; cursor: pointer; }
.terms input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
/* Dòng thời gian duyệt hồ sơ */
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 0 0 18px 34px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: 0; top: 0; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); background: #fff; box-sizing: border-box; }
.timeline li:not(:last-child)::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.timeline li.done::before { content: "✓"; display: grid; place-items: center; color: #fff; font-size: 12px; font-weight: 800; background: var(--green); border-color: var(--green); }
.timeline li.done::after { background: var(--green); }
.timeline li.active::before { border-color: var(--brand); background: var(--brand-soft); animation: captcha-pulse 1.4s ease-in-out infinite; }
.timeline li.failed::before { content: "!"; display: grid; place-items: center; color: #fff; font-weight: 800; background: var(--red); border-color: var(--red); }
/* Hoàn thiện hồ sơ đối tác */
.checklist { border-color: var(--brand-soft); }
.checklist.is-complete { border-color: #8fd1ad; }
.checklist-percent { font-size: 22px; color: var(--brand); }
.checklist.is-complete .checklist-percent { color: var(--green); }
.progress { height: 8px; border-radius: 999px; background: #f3e8e2; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-light), var(--brand)); transition: width .6s ease; }
.checklist.is-complete .progress span { background: var(--green); }
.checklist-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.checklist-items li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--bg); }
.checklist-items .check { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line); background: #fff; color: #fff; font-weight: 800; font-size: 13px; }
.checklist-items li.done .check { background: var(--green); border-color: var(--green); }
.checklist-items li.done .text strong { color: var(--muted); }
.checklist-items .text { flex: 1; min-width: 0; }
/* Ô xác minh chống bot (Cloudflare Turnstile) trên nút đăng nhập / tạo tài khoản */
.captcha-box { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px 8px; border: 1.5px solid var(--line);
  border-radius: 14px; background: linear-gradient(180deg, #fff, var(--bg)); overflow: hidden;
  animation: captcha-in .45s cubic-bezier(.2, .8, .2, 1) both; transition: border-color .35s, box-shadow .35s; }
.captcha-box[hidden] { display: none; }
.captcha-widget { min-height: 65px; display: flex; justify-content: center; }
.captcha-widget > div { width: 100%; }
.captcha-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.captcha-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); animation: captcha-pulse 1.2s ease-in-out infinite; }
/* Đang tải: dải sáng chạy ngang */
.captcha-box[data-state="loading"]::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(100deg, transparent 20%, rgba(155, 35, 53, .07) 50%, transparent 80%);
  animation: captcha-shimmer 1.4s linear infinite; }
/* Đã xác minh: viền xanh + nhịp sáng một lần */
.captcha-box[data-state="verified"] { border-color: #8fd1ad; animation: captcha-in .45s both, captcha-glow 1s ease-out .05s; }
.captcha-box[data-state="verified"] .captcha-status { color: var(--green); }
.captcha-box[data-state="verified"] .captcha-dot { background: var(--green); animation: none; transform: scale(1.15); }
.captcha-box[data-state="expired"], .captcha-box[data-state="error"] { border-color: #efc2bd; }
.captcha-box[data-state="interactive"] { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.captcha-box[data-state="interactive"] .captcha-status { color: var(--brand-dark); }
.captcha-box[data-state="error"] .captcha-status { color: var(--red); }
.captcha-box[data-state="error"] .captcha-dot { background: var(--red); animation: none; }
@keyframes captcha-in { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes captcha-shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes captcha-pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes captcha-glow { 0% { box-shadow: 0 0 0 0 rgba(31, 122, 77, .35); } 100% { box-shadow: 0 0 0 12px rgba(31, 122, 77, 0); } }
@media (prefers-reduced-motion: reduce) { .captcha-box, .captcha-box::after, .captcha-dot { animation: none !important; } }
/* Ô bẫy bot: ẩn khỏi người dùng nhưng vẫn nằm trong form */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
/* Giá giảm: giá bán nổi bật, giá gốc gạch ngang, nhãn -X% */
.price-tag { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price-tag .price { font-size: 17px; color: #d0312d; }
.price-tag:not(:has(.old-price)) .price { color: var(--brand-dark); }
.old-price { color: var(--muted); font-size: 13px; }
.sale-badge { padding: 1px 6px; border-radius: 6px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }
.price-tag.small { justify-content: flex-end; }
.price-tag.small .price { font-size: 14px; }
.price-tag.small .old-price { font-size: 12px; }
.sale-ribbon { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: var(--red); color: #fff; font-size: 12px; font-weight: 700; }
/* Hộp thoại: hỏi lại trước khi bỏ dữ liệu đã nhập */
.discard-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 0 20px 12px; padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: var(--red); font-weight: 600; font-size: 14px; }
/* Đăng ký mở tiệm: chọn loại dịch vụ bằng thẻ lớn */
.category-picker { border: 0; padding: 0; margin: 0; min-width: 0; }
.category-picker legend { font-size: 13px; font-weight: 600; color: var(--muted); padding: 0; margin-bottom: 6px; }
/* 8 loại dịch vụ → lưới 4 × 2 cân đối (tự chia cột thì máy tính ra 7 + 1), điện thoại 2 cột */
.category-options { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 6px; }
@media (max-width: 560px) { .category-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.category-option { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--card); cursor: pointer; }
.category-option:hover { border-color: var(--brand); }
.category-option input { position: absolute; opacity: 0; pointer-events: none; }
.category-option .icon { font-size: 24px; line-height: 1.2; }
.category-option:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.category-option:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Phản hồi thiệp vừa đến (realtime): nháy nền vàng vài giây */
.rsvp-item { padding: 4px 8px; margin: 0 -8px; border-radius: 8px; }
.rsvp-item.is-new { animation: rsvp-new 4s ease-out; }
@keyframes rsvp-new { from { background: var(--brand-soft); } to { background: transparent; } }
.bmi { margin: -6px 0 0; padding: 8px 12px; border-radius: 10px; background: var(--brand-soft); color: var(--ink); }
.sticky-cta { display: none; }

/* ---------- 6. KANBAN (đối tác) ---------- */
.kanban { display: grid; grid-template-columns: repeat(4, minmax(240px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { background: #f3ede7; border-radius: var(--radius); padding: 12px; min-height: 160px; }
.kanban-col h3 { font-family: var(--font-body); font-size: 14px; display: flex; justify-content: space-between; }
.kanban-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* ---------- 7. THIỆP CƯỚI ---------- */
.invite-card { border-radius: 18px; padding: 32px 24px; text-align: center; border: 1px solid; }
.invite-card .names { font-family: var(--font-title); font-size: 30px; margin: 10px 0; }
.invite-card img.qr { width: 160px; height: 160px; margin: 14px auto 6px; background: #fff; border-radius: 10px; padding: 6px; }
.theme-gold  { background: #fffaf0; border-color: #e7cf9c; color: #5c4210; }
.theme-red   { background: #8f1d1d; border-color: #c9a227; color: #fbe9c4; }
.theme-green { background: #1f4d3a; border-color: #c9a227; color: #f1ead2; }
.theme-pink  { background: #fdf0f2; border-color: #f0c4cd; color: #7a3343; }
.swatch { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; }
.swatch.active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* Ảnh bìa + lưới ảnh thực tế của tiệm */
.cover-preview { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; border-radius: 12px; }
.photo-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.photo { position: relative; margin: 0; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--brand-soft); }
.photo img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo button { position: absolute; top: 6px; right: 6px; padding: 4px 9px; }

/* Trình xem ảnh mẫu váy (lightbox) */
dialog.lightbox { width: min(760px, calc(100% - 20px)); background: #1d1815; color: #f3ead9; }
.lightbox-stage { position: relative; background: #000; display: grid; place-items: center; height: min(70vh, 640px); }
.lightbox-stage > img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox-nav, .lightbox-close { position: absolute; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer; display: grid; place-items: center; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 44px; height: 44px; font-size: 28px; line-height: 1; }
.lightbox-nav.prev { left: 10px; }
.lightbox-nav.next { right: 10px; }
.lightbox-close { top: 10px; right: 10px; width: 36px; height: 36px; font-size: 16px; }
.lightbox-count { position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); padding: 2px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); font-size: 13px; }
.lightbox-thumbs { display: flex; gap: 6px; padding: 10px; overflow-x: auto; }
.lightbox-thumbs button { flex: none; width: 56px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: none; cursor: pointer; opacity: .6; }
.lightbox-thumbs button.active { border-color: var(--brand); opacity: 1; }
.lightbox-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-info { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px 16px; }
.lightbox-info .muted { color: #b9a999; }
/* Ảnh thẻ váy bấm được để mở trình xem ảnh */
.thumb-button { position: relative; display: block; padding: 0; border: 0; background: none; cursor: zoom-in; width: 100%; overflow: hidden; }
.photo-count { position: absolute; right: 8px; bottom: 8px; padding: 2px 8px; border-radius: 999px; background: rgba(0, 0, 0, .6); color: #fff; font-size: 12px; font-weight: 700; }

/* Thông báo nổi bật trong trang (vd: xác nhận email thành công) */
.notice { padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--brand-soft); }
.notice-success { background: var(--green-soft); border-color: #b9dfc9; color: var(--green); }
.notice-error { background: var(--red-soft); border-color: #efc2bd; color: var(--red); }
.notice strong { display: block; font-size: 16px; margin-bottom: 2px; }

/* ---------- 8. RESPONSIVE ---------- */
@media (max-width: 900px) {
  .input, select.input, textarea.input { font-size: 16px; }   /* iPhone không tự phóng to khi chạm vào ô nhập */
  /* minmax(0, 1fr) thay vì 1fr: không cho nội dung bên trong (dải ảnh, chip) kéo cột rộng hơn màn hình */
  .hero, .studio, .grid-2, .grid-3, .kanban { grid-template-columns: minmax(0, 1fr); }
  .budget-tool > form { position: static; max-height: none; overflow: visible; }   /* 1 cột: không dính */
  /* Kế hoạch cưới trên màn hẹp */
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .card.countdown-card { grid-column: 1 / -1; min-height: 130px; }
  .budget-summary { grid-template-columns: 1fr; }
  .budget-cols { display: none; }
  .budget-row { grid-template-columns: 26px minmax(0, 1fr) 30px; grid-template-areas: "h name del" "h est act" "h paid paid"; padding: 8px 10px; row-gap: 6px; }
  .budget-row .drag-handle { grid-area: h; align-self: start; }
  .budget-row .cell-name { grid-area: name; }
  .budget-row .cell-est { grid-area: est; }
  .budget-row .row-delete { grid-area: del; }
  .budget-row .paid-toggle { grid-area: paid; justify-self: start; }
  .budget-row { grid-template-columns: 26px 1fr 1fr 30px; grid-template-areas: "h name name del" "h est act act" "h paid paid paid"; }
  .budget-row .cell-act { grid-area: act; }
  .booking-row > span:last-child { display: none; }
  .cell-money > span { display: block; }
  .budget-cat-foot { grid-template-columns: 1fr auto auto; }
  .budget-cat-foot span { grid-column: auto; }
  .cat-find { display: none; }
  .task-add-inline { flex-wrap: wrap; }
  .task-add-inline .input { flex-basis: 100%; }
  .task { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; grid-template-areas: "check text more del" ". link link link"; column-gap: 10px; row-gap: 8px; }
  .task .task-check { grid-area: check; } .task .task-text { grid-area: text; } .task .task-more { grid-area: more; } .task .row-delete { grid-area: del; }
  .task .btn { grid-area: link; justify-self: start; }
  .view-task { grid-template-areas: "check text"; grid-template-columns: 26px minmax(0, 1fr); }
  .view-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; grid-template-areas: "name name badge" "est act act"; row-gap: 4px; }
  .view-row > :nth-child(1) { grid-area: name; }
  .view-row > :nth-child(2) { grid-area: est; text-align: left; }
  .view-row > :nth-child(3) { grid-area: act; text-align: left; }
  .view-row > :nth-child(4) { grid-area: badge; align-self: start; }
  .view-row.booking-row > span:last-child { display: inline-block; }   /* bảng chủ kế hoạch ẩn ô cuối của dòng đơn – trang xem thì cần huy hiệu % */
  .planner-head-side { width: 100%; justify-content: flex-start; }
  .planner-head-side .planner-actions { order: -1; }          /* nút lên trước, chữ "Đã lưu" (lúc ẩn) không chiếm chỗ đầu dòng */
  /* Đăng nhập trên điện thoại: thẻ rộng hết màn hình */
  .auth-shell { padding-block: 16px 32px; }
  .auth-card { padding: 20px 18px; }
  .auth-title { font-size: 23px; }
  .kanban { overflow-x: visible; }
  .hero { padding: 20px; gap: 20px; }
  .hero-image { max-height: 420px; }
  .mirror { position: static; padding: 10px; }
  .mirror-frame { max-height: 72vh; }
  .milestones { grid-template-columns: minmax(0, 1fr); }
  .site-header .container { flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  .nav { order: 3; flex-basis: 100%; margin-inline: -16px; padding-inline: 12px; }
  .brand { flex: 1; }
  .section { margin-bottom: 36px; }
  /* Nút đặt lịch dính đáy màn hình trên điện thoại */
  .sticky-cta { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 10px; align-items: center; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(42, 36, 33, .06); }
  /* Điện thoại: bỏ menu kéo ngang ở header, dùng thanh tab cố định dưới đáy (kiểu Shopee/Tiki) */
  .nav { display: none; }
  .user-name { display: none; }
  .account-button { padding: 3px; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom, 0px)); background: rgba(255, 251, 245, .96); backdrop-filter: blur(10px);
    border-top: 1px solid var(--gold-line); box-shadow: 0 -2px 12px rgba(122, 22, 38, .05); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; border: 0; background: none;
    color: var(--muted); font: 600 11px var(--font-body); text-decoration: none; cursor: pointer; border-radius: 10px; min-width: 0; }
  .tabbar a span[aria-hidden] { font-size: 20px; line-height: 24px; }
  .tabbar .active { color: var(--brand-dark); background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); }
  body.has-tabbar { padding-bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
  body.has-tabbar .toast-host { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
  /* Menu tài khoản thành tấm trượt từ dưới lên, nằm trên thanh tab */
  .account-menu { position: fixed; left: 8px; right: 8px; top: auto; width: auto; bottom: calc(66px + env(safe-area-inset-bottom, 0px)); z-index: 46; }
  body.account-open::after, body.notif-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(30, 24, 20, .35); }
  /* Thông báo trên điện thoại: tấm trượt từ dưới lên, cao tối đa 80% màn hình */
  .notif-panel { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 82dvh; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  .notif-panel::before { content: ""; display: block; width: 40px; height: 4px; margin: 8px auto 0; border-radius: 999px; background: var(--line); }
  .notif-close { display: grid; place-items: center; }
  .notif-button { width: 36px; height: 36px; }
  /* Thanh "Đặt lịch" ở Phòng thử nằm ngay trên thanh tab */
  .sticky-cta { bottom: calc(58px + env(safe-area-inset-bottom, 0px)); padding-bottom: 10px; }
  body.has-sticky-cta.has-tabbar { padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px)); }
  body.has-sticky-cta.has-tabbar .toast-host { bottom: calc(144px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 560px) {
  .budget-label { width: 100%; font-weight: 600; }
  .msg { max-width: 95%; }
  main.container { padding-block: 18px 40px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 14px; }
  .user-name { display: none; }
  .section-head { align-items: flex-start; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .wizard-steps .label { display: none; }
  .wizard-steps li.active .label { display: inline; }
  .wizard-steps { grid-template-columns: auto 1fr auto; }
  .checklist-items li { flex-wrap: wrap; }
  .checklist-items .btn { margin-left: 36px; }
  .partner-banner { padding: 18px 16px; }
  .partner-banner::after { font-size: 96px; right: 10px; bottom: -16px; }
  .hero { padding: 18px 16px; border-radius: 20px; }
  .hero::after { font-size: 140px; left: -10px; bottom: -24px; }
  .hero .row .btn { flex: 1 1 auto; }
  .eyebrow { font-size: 11px; padding: 3px 9px; }
  /* Phòng thử & Chợ dịch vụ: 3 tab chia đều, không bị cắt chữ */
  .studio .tabs, .marketplace-tabs { width: 100%; }
  .studio .tab, .marketplace-tabs .tab { flex: 1; padding: 8px 6px; font-size: 12.5px; white-space: normal; line-height: 1.2; gap: 4px; }
  .marketplace-tabs .tab-badge { min-width: 20px; height: 18px; padding: 0 5px; font-size: 10.5px; }
  .result-bar { padding: 10px 12px; gap: 8px; }
  .result-switch { width: 100%; }
  .result-switch-label { width: 100%; }
  .result-switch-pill { flex: 1 1 auto; justify-content: center; min-height: 36px; }
  /* Thẻ tiệm 2 cột trên điện thoại: logo nhỏ trên tên, tên tối đa 2 dòng, chữ gọn */
  .item-card .body { padding: 10px 12px 12px; gap: 4px; }
  .item-card .body .badge { font-size: 11px; padding: 2px 8px; }
  .item-card .body .row .btn.sm { flex: 1 1 auto; padding: 6px 10px; font-size: 12px; text-align: center; }
  .item-card .vendor-title { flex-direction: column; align-items: flex-start; gap: 6px; }
  .item-card .vendor-title .vendor-logo { width: 28px !important; height: 28px !important; font-size: 11px !important; }
  .item-card h3 { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .item-card .body > .small { font-size: 12px; }
  .grid.grid-3 { grid-template-columns: minmax(0, 1fr); }
  .item-card .body { padding: 10px 12px 12px; }
  .item-card h3 { font-size: 15px; }
  /* iPhone tự phóng to khi bấm vào ô nhập có chữ nhỏ hơn 16px */
  .input, select.input, textarea.input { font-size: 16px; }
  .btn { padding: 10px 16px; }
  dialog.modal { width: calc(100% - 20px); max-height: calc(100% - 20px); }
  .modal-body { max-height: 60vh; }
  .modal-foot .btn { flex: 1; }
  .invite-card { padding: 24px 16px; }
  .invite-card .names { font-size: 24px; }
  .top-vendor-row { flex-wrap: wrap; gap: 8px 12px; padding: 10px; }
  .top-vendor-meta { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; padding-left: 54px; }
  .top-vendor-arrow { display: none; }
}

/* ---------- Kế hoạch cưới: Trợ lý AI ---------- */
.text-green { color: #1f7a4d; }
.plan-ai { max-width: 820px; }
.plan-ai-log { max-height: min(60vh, 560px); min-height: 160px; }
.ai-proposal { align-self: stretch; border: 1px solid var(--line); border-radius: 14px; background: var(--card); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 6px 18px rgba(80, 30, 30, .06); animation: drop-flash .6s ease; }
.ai-proposal-head { font-size: 14px; }
.ai-changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; }
.ai-changes li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--bg); transition: opacity .2s; }
.ai-changes li.off { opacity: .5; }
.ai-changes label { display: flex; align-items: flex-start; gap: 8px; cursor: pointer; min-width: 0; flex: 1; }
.ai-changes input { margin-top: 3px; accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.ai-change-name { display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.ai-change-money { display: flex; flex-direction: column; align-items: flex-end; font-size: 13px; white-space: nowrap; }
.ai-change-money b.down { color: #1f7a4d; }
.ai-change-money b.up { color: #b86b00; }
.ai-proposal-total { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.save-plan-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 6px; border-top: 1px dashed var(--line); }
.budget-ai-btn { white-space: nowrap; }
.planner-draft { display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) {
  .ai-changes li { align-items: flex-start; }
  .save-plan-cta .btn { width: 100%; }
  /* Tấm chọn: sát đáy màn hình, bo 2 góc trên, trượt lên */
  dialog.sheet { width: 100%; max-width: 100%; max-height: 88dvh; margin: auto 0 0; border-radius: 20px 20px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px); animation: sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
  .sheet-head::before { content: ""; position: absolute; top: 6px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 999px; background: var(--line); }
  .sheet-head { position: relative; padding-top: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .btn, .chip, .item-card, .item-card .thumb, .budget-bar span, .top-vendor-row, .top-vendor-arrow { transition: none !important; }
}

/* Hoãn dựng các khối nằm sâu dưới màn hình đầu để tăng tốc hiển thị lần đầu */
#budget, .partner-banner {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 420px;
}
.site-footer {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 84px;
}

/* ---------- Kết nối Dịch vụ cưới ↔ Kế hoạch cưới & Khay so sánh ---------- */
.plan-sync-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 16px; margin-bottom: 14px; padding: 11px 16px;
  border-radius: 14px; border: 1px solid var(--gold-line);
  background: linear-gradient(135deg, var(--gold-soft), var(--brand-soft));
  box-shadow: 0 2px 10px rgba(155, 35, 53, .05);
}
.plan-sync-text {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1;
}
.plan-sync-icon { font-size: 20px; line-height: 1; }
.btn-pinned {
  background: var(--green-soft); color: var(--green); border-color: #b7e1c9; font-weight: 700;
}
.btn-compare-icon {
  padding: 6px 10px; min-width: 34px; border: 1px solid var(--gold-line);
  background: var(--card); color: var(--muted);
}
.btn-compare-icon.active {
  background: var(--gold-soft); border-color: var(--brand); color: var(--brand-dark);
  box-shadow: 0 0 0 2px var(--brand-soft);
}
.card-action-row { gap: 6px; flex-wrap: wrap; }

/* Khay so sánh nổi ở đáy màn hình */
.compare-tray {
  position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 55;
  width: min(920px, calc(100% - 24px));
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 10px 16px; padding: 12px 16px; border-radius: 18px;
  background: rgba(255, 252, 247, .96); backdrop-filter: blur(12px);
  border: 1px solid var(--gold-bright);
  box-shadow: 0 14px 36px rgba(42, 36, 33, .18);
}
body.has-tabbar .compare-tray {
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}
.compare-tray-items {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0;
}
.compare-pill {
  display: flex; align-items: center; gap: 8px; padding: 5px 8px 5px 6px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--bg);
  max-width: 210px; min-width: 0;
}
.compare-pill img {
  width: 34px; height: 34px; border-radius: 8px; object-fit: cover; flex: none;
}
.compare-pill-info {
  display: flex; flex-direction: column; min-width: 0; font-size: 12px; line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.compare-remove {
  appearance: none; border: 0; background: none; color: var(--muted);
  cursor: pointer; padding: 2px 4px; border-radius: 6px; font-size: 12px;
}
.compare-remove:hover { color: var(--red); background: var(--red-soft); }
.compare-tray-actions {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.compare-table th, .compare-table td {
  min-width: 140px; font-variant-numeric: tabular-nums;
}

/* ---------- Phân bổ Ngân sách theo Bên (Chung / Nhà Trai / Nhà Gái) ---------- */
.budget-party-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 8px 14px; margin: 14px 0; padding: 10px 14px;
  border-radius: 14px; background: rgba(255, 253, 249, .82); border: 1px solid var(--line);
}
.party-chip-amount {
  display: inline-block; margin-left: 5px; padding: 1px 7px; border-radius: 999px;
  background: rgba(155, 35, 53, .08); color: var(--brand-dark);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.party-pill {
  appearance: none; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line);
  font: 600 11.5px var(--font-body); white-space: nowrap; cursor: pointer;
  transition: transform .15s var(--ease-out), background .18s var(--ease-out), border-color .18s var(--ease-out);
}
.party-pill:active { transform: scale(.96); }
.party-pill.party-both  { background: var(--gold-soft); color: #7a540c; border-color: var(--gold-line); }
.party-pill.party-groom { background: var(--blue-soft); color: var(--blue); border-color: #c2d7f8; }
.party-pill.party-bride { background: var(--brand-soft); color: var(--brand-dark); border-color: #e9c2bc; }

/* ---------- Minh bạch Hoa hồng Sàn (10%) & Thực nhận Đối tác (90%) ---------- */
.vendor-stats-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
@media (max-width: 1080px) {
  .vendor-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .vendor-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 440px) {
  .vendor-stats-grid { grid-template-columns: 1fr; }
}

.vendor-filter-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 6px; border-radius: 14px;
  background: var(--bg-soft); border: 1px solid var(--line);
}
.vendor-stage-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; min-height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent;
  color: var(--ink); font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease;
}
.vendor-stage-pill:active { transform: scale(0.97); }
.vendor-stage-pill.active {
  background: #fff; border-color: var(--line);
  color: var(--brand-dark); box-shadow: 0 2px 8px rgba(42, 36, 33, .06);
}
.vendor-stage-pill.is-alert {
  color: var(--red); background: var(--red-soft); border-color: #efc2bd;
}
.vendor-stage-pill.is-alert.active {
  background: var(--red); color: #fff; border-color: var(--red);
}
.pill-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px; padding: 0 6px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
  background: rgba(42, 36, 33, .08); color: inherit;
}
.vendor-stage-pill.is-alert.active .pill-count {
  background: rgba(255, 255, 255, .22); color: #fff;
}

.vendor-order-list {
  display: flex; flex-direction: column; gap: 16px;
}
.vendor-order-card {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 14px;
  padding: 18px 20px;
}
.vendor-order-card.is-disputed {
  border-color: #e5a9a2;
}
.vendor-order-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.vendor-order-title-group {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-width: 0;
}
.vendor-order-service {
  font-family: var(--font-title); font-size: 18px; color: var(--ink);
}
.vendor-order-code {
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  padding: 3px 9px; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.vendor-order-head-right {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
}
.vendor-order-appt {
  font-size: 13.5px; color: var(--ink); font-variant-numeric: tabular-nums;
}
.vendor-order-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px;
  font-size: 13.5px; color: var(--muted);
  padding-bottom: 12px; border-bottom: 1px solid var(--line);
}
.vendor-order-meta strong { color: var(--ink); }
.vendor-order-note {
  color: #6e450d; background: var(--gold-soft); padding: 3px 10px; border-radius: 8px;
}

.booking-finance-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.bf-cell {
  display: flex; flex-direction: column; gap: 3px;
  min-width: 0;
}
.bf-cell + .bf-cell {
  border-left: 1px solid var(--line);
  padding-left: 12px;
}
.bf-label {
  font-size: 12px; color: var(--muted);
}
.bf-val {
  font-size: 15px; font-weight: 700; color: var(--ink);
}
.bf-cell.is-fee .bf-val { color: #8a5b10; }
.bf-cell.is-net .bf-val { color: var(--brand-dark); font-size: 16px; }
.bf-sub {
  font-size: 12.5px; color: var(--ink); line-height: 1.4;
}
@container (max-width: 680px) {
  .booking-finance-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .bf-cell:nth-child(3) {
    border-left: none; padding-left: 0;
  }
}
@media (max-width: 520px) {
  .booking-finance-strip {
    grid-template-columns: 1fr;
  }
  .bf-cell + .bf-cell {
    border-left: none; padding-left: 0;
    border-top: 1px dashed var(--line); padding-top: 8px;
  }
}

.finance-table th, .finance-table td {
  font-variant-numeric: tabular-nums;
}
.fee-cell { color: #8a5b10; font-weight: 600; white-space: nowrap; }
.net-cell { color: var(--brand-dark); font-weight: 700; white-space: nowrap; }
.finance-total-row td {
  background: var(--gold-soft); border-top: 2px solid var(--gold-bright);
  padding-block: 12px;
}

/* ---------- Hộp Khiếu nại, Đếm ngược SLA 48h/72h & Thanh cảnh báo khẩn ---------- */
.dispute-box {
  container-type: inline-size;
  display: flex; flex-direction: column; gap: 12px;
  background: #fdf4f2;
  border: 1px solid #eabbb5;
  border-radius: 14px;
  padding: 14px 16px;
}
.dispute-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 10px;
}
.dispute-title {
  color: var(--red); font-size: 14.5px;
}
.sla-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 700; padding: 5px 11px;
  border-radius: 999px; font-variant-numeric: tabular-nums;
  max-width: 100%; overflow-wrap: anywhere;
}
.sla-pill.is-countdown {
  background: #fff8ea; color: #8c5a14; border: 1px solid #e6c687;
}
.sla-pill.is-info {
  background: var(--green-soft); color: var(--green); border: 1px solid #b5dec4;
}
.sla-pill.is-overdue {
  background: var(--red); color: #fff;
}
.dispute-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid rgba(220, 160, 152, .45);
  border-bottom: 1px solid rgba(220, 160, 152, .45);
}
@container (min-width: 580px) {
  .dispute-compare-grid:has(.is-response) {
    grid-template-columns: 1fr 1.25fr;
    gap: 18px;
  }
  .dispute-col.is-response {
    border-left: 1px solid rgba(220, 160, 152, .5);
    padding-left: 18px;
  }
}
.dispute-col {
  display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.dispute-col-label {
  font-size: 12.5px; font-weight: 700; color: var(--ink);
}
.dispute-foot {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.dispute-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.dispute-response-card {
  padding: 10px 12px; border-radius: 10px;
  background: #fffdf9; border: 1px solid var(--gold-bright);
}
.dispute-response-card.is-vendor {
  background: var(--bg-soft); border-color: var(--line);
}
.vendor-order-foot {
  display: flex; flex-direction: column; gap: 8px;
}
.vendor-milestones-details summary {
  cursor: pointer; font-weight: 600; color: var(--muted);
}
.dispute-sla-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 9px 12px; border-radius: 10px; font-size: 13px;
  background: var(--gold-soft); border: 1px solid #e6c687; color: #6e450d;
  font-variant-numeric: tabular-nums;
}
.urgent-alert-banner {
  border-bottom: 1px solid #efc2bd;
  background: linear-gradient(90deg, #fdf0ee 0%, #fff8ea 100%);
  padding: 10px 0;
}
.urgent-alert-banner.is-warn {
  background: #fff8ea; border-bottom-color: #e6c687;
}
.urgent-alert-banner.is-info {
  background: var(--bg-soft); border-bottom-color: var(--line);
}
.urgent-alert-inner {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.urgent-alert-icon {
  font-size: 20px; line-height: 1;
}
.urgent-alert-copy {
  flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 2px; font-size: 13px;
}
.urgent-alert-copy strong {
  color: var(--ink); font-size: 14px;
}
.urgent-alert-copy span {
  color: var(--muted); font-variant-numeric: tabular-nums;
}
.urgent-alert-cta {
  white-space: nowrap;
}

/* ---------- Thanh Phân Trang (Pagination) Soft Luxury ---------- */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 14px;
}
.pagination-info {
  font-size: 13.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pagination-info strong {
  color: var(--ink);
  font-weight: 700;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}
.btn-page:active:not(:disabled) {
  transform: scale(0.97);
}
.btn-page:hover:not(:disabled):not(.active) {
  background: var(--bg-soft);
  border-color: #d1c5b8;
  color: var(--brand-dark);
}
.btn-page.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 6px rgba(155, 35, 53, 0.25);
}
.btn-page:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.btn-page-nav {
  padding: 0 12px;
  font-weight: 500;
}
.page-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  color: var(--muted);
  font-size: 14px;
  user-select: none;
}
.page-size-select {
  height: 36px;
  padding: 4px 10px;
  font-size: 13px;
  width: auto;
  min-width: 95px;
  border-radius: 8px;
}
@media (max-width: 580px) {
  .pagination-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 10px 12px;
  }
  .pagination-controls {
    justify-content: center;
    width: 100%;
  }
  .pagination-info {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .plan-sync-bar { padding: 10px 12px; }
  .plan-sync-bar .row { width: 100%; }
  .plan-sync-bar .row .btn { flex: 1; }
  .compare-tray { padding: 10px 12px; gap: 8px; }
  .compare-pill { max-width: 100%; flex: 1 1 140px; }
  .compare-tray-actions { width: 100%; }
  .compare-tray-actions .btn { flex: 1; }
  .budget-party-bar { padding: 10px 12px; }
  #admin-head-actions, #partner-finance-actions { width: 100%; }
  #admin-head-actions .btn, #partner-finance-actions .btn { flex: 1; }
}

/* ---------- Chế độ Bản In / PDF Sổ tay Cưới Cát Hỷ ---------- */
@media print {
  .site-header, .site-footer, .mobile-tabbar, .planner-tabs, .planner-actions,
  .planner-view-bar, .share-banner, .budget-party-bar, .budget-summary-actions,
  .add-row, [data-add-cat], .drag-handle, .icon-btn, .row-delete, [data-feedback],
  .compare-tray, .toast-host {
    display: none !important;
  }
  body {
    background: #fff !important; color: #1f1a17 !important; font-size: 13px;
  }
  main.container {
    width: 100% !important; max-width: 100% !important; padding: 0 !important; margin: 0 !important;
  }
  .planner-panel[hidden] {
    display: block !important; margin-top: 18px;
  }
  #panel-ai {
    display: none !important;
  }
  .card, details.view-category, .budget-category {
    box-shadow: none !important; border: 1px solid #d8c7b8 !important;
    break-inside: avoid; margin-bottom: 10px;
  }
  .budget-category.collapsed .budget-cat-body {
    display: block !important;
  }
}
