/* ============================================================
   Vibe Ads by Viva — hệ thiết kế kính mờ (glassmorphism)
   Nền navy + nhấn teal (lấy theo perplexity.ai/personal-computer).
   Nguồn sự thật duy nhất về giao diện — không viết <style> trong trang.
   ============================================================ */

/* ---------- 1. Token màu / kích thước ---------- */
:root {
  /* nền */
  --ink:          #0a0e1a;
  --ink-2:        #0f1629;

  /* lớp kính — màng trắng phủ lên nền tối (kiểu liquid glass),
     KHÔNG phải panel màu tối đặc */
  --film:         rgba(255, 255, 255, 0.06);   /* màng trắng lớp vỏ ngoài */
  --film-2:       rgba(255, 255, 255, 0.10);   /* màng trắng lớp lõi trong */
  --glass-base:   rgba(13, 18, 32, 0.52);      /* nền tối phía dưới màng, giữ chữ đọc được */
  --glass-base-2: rgba(17, 23, 40, 0.72);
  --glass-strong: rgba(20, 26, 45, 0.86);
  --glass-line:   rgba(255, 255, 255, 0.14);   /* viền sáng quanh 4 cạnh */
  --glass-line-hi:rgba(255, 255, 255, 0.26);
  --rim:          inset 0 1px 0 rgba(255, 255, 255, 0.16);  /* vệt sáng mép trong */
  --rim-hi:       inset 0 1px 0 rgba(255, 255, 255, 0.34);

  /* chữ */
  --text:         #e2e8f0;
  --text-muted:   #94a3b8;
  --text-dim:     #64748b;

  /* nhấn — teal lấy đúng từ nút CTA của perplexity.ai/personal-computer */
  --accent:       #20808d;                      /* nền nút — dùng đúng hex của họ */
  --accent-hi:    #2a9aa8;                      /* trạng thái hover */
  --accent-text:  #5fd0dd;                      /* bản sáng, dùng cho CHỮ trên nền tối */
  --accent-soft:  rgba(32, 128, 141, 0.14);
  --accent-line:  rgba(32, 128, 141, 0.34);
  --primary:      #1a73e8;
  --primary-hi:   #4a9af5;
  --violet:       #8b5cf6;
  --teal:         #3fc7b8;
  --coral:        #e2725b;

  /* hình khối — bo lớn, lồng lớp: vỏ ngoài 24px → lõi trong 18px */
  --radius:       24px;
  --radius-in:    18px;
  --radius-sm:    14px;
  --radius-xs:    12px;
  --pill:         9999px;
  --blur:         22px;
  /* đổ bóng rất nhẹ — kính nổi lên chứ không đè xuống */
  --shadow:       0 18px 48px rgba(0, 0, 0, 0.32), 0 2px 8px rgba(0, 0, 0, 0.10);
  --shadow-sm:    0 4px 24px rgba(0, 0, 0, 0.16), 0 1px 3px rgba(0, 0, 0, 0.08);

  /* chữ */
  --font-body:    'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* khung */
  --nav-h:        68px;
  --wrap:         1180px;
  --wrap-narrow:  760px;
}

/* ---------- 2. Nền trang + blob gradient (cái để lớp kính làm mờ) ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 3 blob cố định phía sau — không có blob thì hiệu ứng kính vô nghĩa */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(560px circle at 50% 34%,  rgba(99, 102, 241, 0.30), transparent 66%),
    radial-gradient(700px circle at 10% 4%,   rgba(26, 115, 232, 0.40), transparent 62%),
    radial-gradient(640px circle at 90% 18%,  rgba(139, 92, 246, 0.34), transparent 64%),
    radial-gradient(720px circle at 74% 62%,  rgba(32, 128, 141, 0.30), transparent 62%),
    radial-gradient(820px circle at 26% 96%,  rgba(32, 128, 141, 0.18), transparent 62%);
}

/* lưới mờ rất nhẹ cho có chiều sâu */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 20%, transparent 75%);
}

/* ---------- 3. Lớp kính chuẩn ---------- */
/* Vỏ ngoài: màng trắng mỏng phủ lên nền tối, viền sáng quanh 4 cạnh,
   vệt sáng chạy bên trong mép trên (--rim) — đây là chữ ký của kiểu kính này. */
.glass {
  position: relative;
  background:
    linear-gradient(180deg, var(--film), rgba(255,255,255,0.015)),
    var(--glass-base);
  backdrop-filter: blur(var(--blur)) saturate(160%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(160%);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), var(--rim);
}

/* Lõi trong — lồng bên trong .glass. Sáng hơn vỏ, bo nhỏ hơn (24 → 18). */
.glass-in {
  position: relative;
  background:
    linear-gradient(180deg, var(--film-2), rgba(255,255,255,0.02)),
    var(--glass-base-2);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-in);
  box-shadow: 0 1px 3px rgba(0,0,0,.10), var(--rim-hi);
}

/* Trình duyệt không hỗ trợ backdrop-filter (Firefox cũ, máy yếu):
   đổ nền đặc hơn để không bị trong suốt lem, mất chữ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass    { background: linear-gradient(180deg, var(--film), transparent), #131a2c; }
  .glass-in { background: linear-gradient(180deg, var(--film-2), transparent), #182036; }
  .nav      { background: #0d1220; }
}

/* ---------- 4. Khung, chữ ---------- */
.wrap        { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.wrap-narrow { width: 100%; max-width: var(--wrap-narrow); margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.3rem); }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }
a  { color: var(--primary-hi); text-decoration: none; }
a:hover { text-decoration: underline; }

.muted    { color: var(--text-muted); }
.dim      { color: var(--text-dim); }
.mono     { font-family: var(--font-mono); font-size: .92em; }
.accent   { color: var(--accent-text); }
.center   { text-align: center; }
.nowrap   { white-space: nowrap; }
.hidden   { display: none !important; }

.grad-text {
  background: linear-gradient(96deg, var(--primary-hi) 0%, var(--violet) 48%, var(--accent-text) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.section       { padding: 88px 0; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-sub   { text-align: center; color: var(--text-muted); margin-bottom: 48px; }

/* ---------- 5. Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(255,255,255,.05), transparent), rgba(10, 14, 26, 0.62);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid var(--glass-line);
  box-shadow: var(--rim);
}
.nav .wrap { display: flex; align-items: center; gap: 20px; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.15rem; color: var(--text); }
.brand:hover { text-decoration: none; }
/* Logo Viva không vuông (240×213) — khoá chiều cao, để chiều rộng tự co */
.brand img { height: 32px; width: auto; display: block; }
.brand small { font-weight: 400; font-size: .8rem; color: var(--text-muted); }

.nav-links { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links a { padding: 8px 14px; border-radius: var(--radius-xs); color: var(--text-muted); font-size: .94rem; font-weight: 500; }
.nav-links a:hover { color: var(--text); background: rgba(255,255,255,.06); text-decoration: none; }

.nav-user { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: .92rem; color: var(--text-muted); }

/* ---------- 6. Nút ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;      /* Perplexity dùng 500 — chữ nhẹ tạo cảm giác điềm đạm */
  line-height: 1.2;
  cursor: pointer;
  transition: transform .12s ease, filter .18s ease, background .18s ease, border-color .18s ease;
  text-decoration: none;
}
.btn:hover  { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-busy="true"] { opacity: .55; cursor: not-allowed; transform: none; }

/* Nút chính — công thức lấy nguyên từ nút "Download for Mac" của Perplexity:
   teal đặc, viền trắng rất mờ, quầng sáng cùng màu + vệt sáng mép trong. */
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: rgba(255,255,255,.12);
  box-shadow: 0 4px 24px -2px rgba(32,128,141,.40),
              0 0 0 1px rgba(32,128,141,.20),
              inset 0 1px 0 rgba(255,255,255,.15);
}
.btn-primary:hover { background: var(--accent-hi); }

/* Nút viền trắng đặc — bản "Setup Guide" */
.btn-outline {
  background: transparent;
  border-color: #fff;
  color: #fff;
}
.btn-outline:hover { background: rgba(255,255,255,.10); }

.btn-blue {
  background: linear-gradient(180deg, var(--primary-hi), var(--primary));
  color: #fff;
  box-shadow: 0 2px 10px -2px rgba(26,115,232,.45), inset 0 1px 0 rgba(255,255,255,.32);
}
.btn-blue:hover { filter: brightness(1.06); }

/* nút kính — đúng công thức nút "Download" nhỏ trên nav của Perplexity */
.btn-ghost {
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.18);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px -2px rgba(0,0,0,.30), inset 0 1px 0 rgba(255,255,255,.10);
}
.btn-ghost:hover { background: rgba(255,255,255,.18); }

.btn-danger { background: rgba(226,114,91,.06); border-color: rgba(226,114,91,.45); color: var(--coral); }
.btn-danger:hover { background: rgba(226,114,91,.14); }

.btn-sm  { padding: 7px 15px; font-size: .85rem; }
.btn-lg  { padding: 15px 32px; font-size: 1.02rem; }
.btn-block { width: 100%; }

/* ---------- 7. Thẻ ---------- */
.card { padding: 24px; }
.card-hd {
  display: flex; align-items: center; gap: 10px;
  padding-bottom: 14px; margin-bottom: 18px;
  border-bottom: 1px solid var(--glass-line);
  font-weight: 700; font-size: 1.05rem;
}
.card-hd .spacer { margin-left: auto; }

.grid    { display: grid; gap: 20px; }
.grid-2  { grid-template-columns: repeat(2, 1fr); }
.grid-3  { grid-template-columns: repeat(3, 1fr); }
.grid-4  { grid-template-columns: repeat(4, 1fr); }

.feature { padding: 26px; transition: transform .2s ease, border-color .2s ease; }
.feature:hover { transform: translateY(-3px); border-color: var(--glass-line-hi); }
.feature .ico { font-size: 1.6rem; margin-bottom: 12px; display: block; }
.feature h3 { margin-bottom: 8px; }
.feature p  { margin: 0; color: var(--text-muted); font-size: .93rem; }

.step .num {
  font-family: var(--font-mono); font-size: 2.6rem; font-weight: 700;
  color: rgba(255,255,255,.14); line-height: 1; margin-bottom: 6px; display: block;
}

/* ---------- 8. Badge ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: 999px;
  font-size: .78rem; font-weight: 600; letter-spacing: .01em;
}
.badge-active  { background: rgba(63,199,184,.14);  color: var(--teal);    border: 1px solid rgba(63,199,184,.3); }
.badge-pending { background: rgba(226,114,91,.14);  color: var(--coral);   border: 1px solid rgba(226,114,91,.3); }
.badge-accent  { background: var(--accent-soft);   color: var(--accent-text);        border: 1px solid var(--accent-line); }
.badge-info    { background: rgba(26,115,232,.16);  color: var(--primary-hi); border: 1px solid rgba(26,115,232,.34); }
.badge-off     { background: rgba(148,163,184,.12); color: var(--text-muted); border: 1px solid rgba(148,163,184,.24); }

/* ---------- 9. Form ---------- */
.field { margin-bottom: 18px; }
.field label { display: block; margin-bottom: 7px; font-size: .9rem; font-weight: 600; color: var(--text); }
.field .hint { margin-top: 7px; font-size: .82rem; color: var(--text-dim); line-height: 1.5; }

input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], input[type=tel], input[type=search], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-family: inherit;
  font-size: .96rem;
  color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01)), rgba(8, 12, 22, 0.55);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-in);
  outline: none;
  box-shadow: var(--rim);
  transition: border-color .18s ease, box-shadow .18s ease;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(32,128,141,.75);
  box-shadow: 0 0 0 3px rgba(32,128,141,.20), var(--rim-hi);
}
textarea { resize: vertical; min-height: 90px; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2394a3b8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
select option { background: #131a2c; color: var(--text); }

/* ô mã OTP */
.otp-input {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  letter-spacing: .5em;
  text-align: center;
  padding: 14px 10px 14px 20px;
}

/* ---------- 10. Tab ---------- */
.tabs {
  display: flex; gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(15, 22, 41, 0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--glass-line);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs .wrap { display: flex; gap: 4px; }
.tab {
  padding: 15px 16px;
  font-size: .94rem; font-weight: 600;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.tab:hover  { color: var(--text); text-decoration: none; }
.tab.active { color: var(--accent-text); border-bottom-color: var(--accent-text); }

/* ---------- 11. Bảng ---------- */
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 640px; }
table.tbl th {
  text-align: left; padding: 11px 12px;
  font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--text-dim);
  border-bottom: 1px solid var(--glass-line);
}
table.tbl td { padding: 13px 12px; border-bottom: 1px solid rgba(255,255,255,.05); }
table.tbl tbody tr:hover { background: rgba(255,255,255,.03); }
table.tbl td.num, table.tbl th.num { text-align: right; font-family: var(--font-mono); }

/* ---------- 12. Ô mã / token ---------- */
.code-box {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: rgba(6, 9, 18, 0.6);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: .84rem;
  color: var(--teal);
  word-break: break-all;
}
.code-box .val { flex: 1; min-width: 0; }
.code-box button { flex-shrink: 0; }

pre.code {
  margin: 0;
  padding: 14px;
  max-height: 260px;
  overflow: auto;
  background: rgba(6, 9, 18, 0.6);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.6;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 13. Thanh tiến độ ---------- */
.bar { height: 8px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--primary), var(--accent-text));
  transition: width .4s ease;
}
.bar.warn > i { background: linear-gradient(90deg, #e8b04b, var(--coral)); }

/* ---------- 14. Trạng thái rỗng ---------- */
.empty-state { padding: 56px 24px; text-align: center; }
.empty-state .ico { font-size: 2.6rem; display: block; margin-bottom: 14px; opacity: .85; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p  { color: var(--text-muted); margin: 0 auto; max-width: 460px; font-size: .94rem; }

/* ---------- 15. Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(4, 7, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.modal-backdrop.open { display: flex; }
/* Cột dọc: đầu và chân đứng yên, chỉ .modal-body cuộn. Trước đây cả .modal
   cuộn nên tiêu đề trôi mất và thanh cuộn cắt ngang góc bo. */
.modal {
  width: 100%; max-width: 460px;
  max-height: min(90vh, 940px);
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  background: linear-gradient(180deg, var(--film-2), rgba(255,255,255,.02)), var(--glass-strong);
  backdrop-filter: blur(28px) saturate(170%);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid var(--glass-line-hi);
  border-radius: var(--radius);
  box-shadow: var(--shadow), var(--rim-hi);
  animation: modal-in .22s ease;
}
.modal-lg { max-width: 660px; }
@keyframes modal-in { from { opacity: 0; transform: translateY(14px) scale(.98); } }

.modal-hd {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto;
  padding: 22px 26px 14px;
  border-bottom: 1px solid var(--glass-line);
}
.modal-hd h3 { margin: 0; font-size: 1.12rem; }
.modal-hd .x {
  margin-left: auto; background: none; border: 0; cursor: pointer;
  color: var(--text-muted); font-size: 1.5rem; line-height: 1; padding: 0 4px;
  border-radius: var(--radius-xs); transition: color .15s ease, background .15s ease;
}
.modal-hd .x:hover { color: var(--text); background: rgba(255,255,255,.07); }

/* Vùng cuộn. Padding nằm trong đây để thanh cuộn chạy sát mép trong, không
   đè lên viền bo của .modal. */
.modal-body { flex: 1 1 auto; overflow-y: auto; padding: 20px 26px 24px; }
.modal-body > :first-child { margin-top: 0; }
/* Chân cố định cho nút hành động — form dài không phải cuộn xuống mới bấm được */
.modal-ft {
  flex: 0 0 auto; padding: 14px 26px 20px;
  border-top: 1px solid var(--glass-line);
  background: linear-gradient(180deg, rgba(255,255,255,.02), transparent);
}

/* Nhóm trường trong form dài */
.form-section { margin: 0 0 6px; }
.form-section + .form-section { margin-top: 22px; }
.form-section > h4 {
  margin: 0 0 14px; font-size: .82rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase; color: var(--accent-text);
  display: flex; align-items: center; gap: 9px;
}
.form-section > h4::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--accent-line), transparent);
}

/* ---------- 15b. Thanh cuộn theo theme ----------
   Mặc định của trình duyệt là thanh trắng dày, chọi hẳn với nền kính tối. */
.modal-body, .table-wrap, pre.code, textarea, .scroll-y {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.18) transparent;
}
.modal-body::-webkit-scrollbar,
.table-wrap::-webkit-scrollbar,
pre.code::-webkit-scrollbar,
textarea::-webkit-scrollbar,
.scroll-y::-webkit-scrollbar { width: 11px; height: 11px; }

.modal-body::-webkit-scrollbar-track,
.table-wrap::-webkit-scrollbar-track,
pre.code::-webkit-scrollbar-track,
textarea::-webkit-scrollbar-track,
.scroll-y::-webkit-scrollbar-track { background: transparent; }

/* border trong suốt + background-clip tạo khoảng đệm quanh thanh kéo,
   nhìn thanh mảnh mà vùng bấm vẫn đủ rộng */
.modal-body::-webkit-scrollbar-thumb,
.table-wrap::-webkit-scrollbar-thumb,
pre.code::-webkit-scrollbar-thumb,
textarea::-webkit-scrollbar-thumb,
.scroll-y::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,.16);
  border: 3px solid transparent;
  background-clip: padding-box;
  border-radius: var(--pill);
}
.modal-body::-webkit-scrollbar-thumb:hover,
.table-wrap::-webkit-scrollbar-thumb:hover,
pre.code::-webkit-scrollbar-thumb:hover,
textarea::-webkit-scrollbar-thumb:hover,
.scroll-y::-webkit-scrollbar-thumb:hover {
  background: var(--accent-line);
  border: 3px solid transparent;
  background-clip: padding-box;
}
.modal-body::-webkit-scrollbar-corner,
.table-wrap::-webkit-scrollbar-corner { background: transparent; }

/* ---------- 16. Toast ---------- */
#toasts {
  position: fixed; z-index: 200;
  right: 20px; bottom: 20px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: min(380px, calc(100vw - 40px));
}
.toast {
  padding: 13px 17px;
  background: linear-gradient(180deg, var(--film-2), rgba(255,255,255,.02)), var(--glass-strong);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--glass-line-hi);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius-in);
  box-shadow: var(--shadow), var(--rim);
  font-size: .92rem;
  animation: toast-in .22s ease;
}
.toast.ok   { border-left-color: var(--teal); }
.toast.err  { border-left-color: var(--coral); }
.toast.warn { border-left-color: #e8b04b; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px); } }

/* ---------- 17. Bảng giá ---------- */
.plan { padding: 26px 22px; display: flex; flex-direction: column; }
.plan.current { border-color: var(--accent-line); box-shadow: 0 0 0 1px rgba(32,128,141,.30), var(--shadow-sm); }
.plan .plan-name { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 12px; }
.plan .price { font-family: var(--font-mono); font-size: 1.9rem; font-weight: 600; color: var(--text); line-height: 1.1; }
.plan .price small { display: block; font-family: var(--font-body); font-size: .82rem; font-weight: 400; color: var(--text-dim); margin-top: 2px; }
.plan ul { list-style: none; margin: 18px 0; padding: 0; flex: 1; }
.plan li { padding: 5px 0; font-size: .89rem; color: var(--text-muted); }
.plan li strong { color: var(--text); font-family: var(--font-mono); }
.plan li.no { color: var(--text-dim); }

.toggle {
  display: inline-flex; padding: 4px; gap: 4px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--glass-line);
  border-radius: 999px;
}
.toggle button {
  padding: 8px 18px; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.toggle button.on { background: var(--accent); color: #fff; }

/* ---------- 18. Phiếu chờ duyệt (ticket stub) ---------- */
.ticket {
  position: relative;
  padding: 16px 20px;
  margin-bottom: 12px;
  background: linear-gradient(180deg, var(--film-2), rgba(255,255,255,.02)), var(--glass-base-2);
  border: 1px solid var(--glass-line);
  border-left: 3px solid var(--coral);
  border-radius: var(--radius-in);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 3px rgba(0,0,0,.10), var(--rim);
}
.ticket .t-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 600; }
.ticket .t-hd .spacer { margin-left: auto; }
.ticket .t-body { font-size: .9rem; color: var(--text-muted); }

/* ---------- 19. Footer ---------- */
.footer {
  margin-top: 40px;
  padding: 32px 0;
  border-top: 1px solid var(--glass-line);
  background: rgba(8, 11, 21, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: .88rem;
  color: var(--text-dim);
}
.footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; }
.footer .links { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer a { color: var(--text-muted); }

/* ---------- 20. Trang nội dung (privacy/terms) ---------- */
.doc { padding: 40px 34px; }
.doc h2 { font-size: 1.3rem; margin-top: 32px; }
.doc h2:first-of-type { margin-top: 0; }
.doc ul { padding-left: 20px; color: var(--text-muted); }
.doc li { margin-bottom: 7px; }

/* ---------- 21. Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
}
@media (max-width: 680px) {
  :root { --blur: 10px; }              /* giảm blur cho đỡ tụt khung hình trên mobile */
  .grid-2, .grid-4 { grid-template-columns: 1fr; }
  .wrap, .wrap-narrow { padding: 0 16px; }
  .nav-links a { padding: 8px 10px; font-size: .88rem; }
  .nav-links .hide-sm { display: none; }
  .card, .doc { padding: 20px 18px; }
  .footer .wrap { flex-direction: column; align-items: flex-start; }
  .footer .links { margin-left: 0; }
  #toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; }
}

/* ---------- 22. Tôn trọng cài đặt giảm chuyển động ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
