/* Font Be Vietnam Pro (SIL Open Font License, xem fonts/OFL-LICENSE.txt), tự lưu trên server để tải nhanh */
/* Font dự phòng có số đo khớp Be Vietnam Pro: chữ không xô lệch khi font tải xong */
@font-face{font-family:"BVP Fallback";font-weight:100 500;src:local("Arial"),local("ArialMT"),local("Helvetica");size-adjust:107.81%;ascent-override:92.75%;descent-override:24.58%;line-gap-override:0%}
@font-face{font-family:"BVP Fallback";font-weight:600;src:local("Arial Bold"),local("Arial-BoldMT"),local("Helvetica Bold");size-adjust:103.34%;ascent-override:96.77%;descent-override:25.64%;line-gap-override:0%}
@font-face{font-family:"BVP Fallback";font-weight:700 900;src:local("Arial Bold"),local("Arial-BoldMT"),local("Helvetica Bold");size-adjust:104.52%;ascent-override:95.68%;descent-override:25.35%;line-gap-override:0%}
/* Trình duyệt xét các @font-face trùng dải ký tự theo thứ tự NGƯỢC (khai báo sau được xét trước).
   Gói tiếng Việt đặt cuối để chữ ơ, ư, đ, ạ... dùng gói vietnamese, không kéo thêm gói latin-ext (~14 KB mỗi độ đậm). */
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/be-vietnam-pro-latin-ext-400-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/be-vietnam-pro-latin-400-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:400;font-display:swap;src:url(fonts/be-vietnam-pro-vietnamese-400-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:500;font-display:swap;src:url(fonts/be-vietnam-pro-latin-ext-500-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:500;font-display:swap;src:url(fonts/be-vietnam-pro-latin-500-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:500;font-display:swap;src:url(fonts/be-vietnam-pro-vietnamese-500-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:600;font-display:swap;src:url(fonts/be-vietnam-pro-latin-ext-600-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:600;font-display:swap;src:url(fonts/be-vietnam-pro-latin-600-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:600;font-display:swap;src:url(fonts/be-vietnam-pro-vietnamese-600-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:700;font-display:swap;src:url(fonts/be-vietnam-pro-latin-ext-700-normal.woff2) format("woff2");unicode-range:U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:700;font-display:swap;src:url(fonts/be-vietnam-pro-latin-700-normal.woff2) format("woff2");unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD}
@font-face{font-family:"Be Vietnam Pro";font-style:normal;font-weight:700;font-display:swap;src:url(fonts/be-vietnam-pro-vietnamese-700-normal.woff2) format("woff2");unicode-range:U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB}

/* ==========================================================================
   Màu sắc và kích thước
   ========================================================================== */
:root {
  --font: "Be Vietnam Pro", "BVP Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;

  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --surface-3: #e7eaf3;
  --border: #e3e7f0;
  --border-strong: #ccd3e2;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #5b6780;

  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-ink: #ffffff;
  --primary-soft: #eef2ff;
  --primary-soft-2: #dfe4ff;
  --focus: rgba(99, 102, 241, 0.5);

  --accent: #10b981;
  --accent-soft: #d6f7ea;
  --accent-ink: #047857;
  --sky: #0284c7;
  --sky-soft: #e0f2fe;

  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --warn-line: rgba(180, 83, 9, 0.18);
  --ok: #047857;
  --ok-soft: #d1fae5;
  --unknown: #475569;
  --unknown-soft: #e2e8f0;

  --hero-bg: #0b1022;
  --hero-text: #e8ebf7;
  --hero-muted: #aab2cf;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 18px rgba(15, 23, 42, 0.07);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, 0.05), 0 28px 56px -16px rgba(15, 23, 42, 0.22);

  --radius: 16px;
  --radius-sm: 10px;
  --container: 1160px;
  --header-h: 68px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f1e;
    --surface: #11182b;
    --surface-2: #172036;
    --surface-3: #1f2a44;
    --border: #243049;
    --border-strong: #34415f;
    --text: #e8ebf5;
    --text-2: #c4cadc;
    --muted: #94a0bc;

    --primary: #8b93ff;
    --primary-hover: #a9afff;
    --primary-ink: #0b1022;
    --primary-soft: rgba(139, 147, 255, 0.13);
    --primary-soft-2: rgba(139, 147, 255, 0.24);
    --focus: rgba(139, 147, 255, 0.55);

    --accent: #34d399;
    --accent-soft: rgba(52, 211, 153, 0.13);
    --accent-ink: #6ee7b7;
    --sky: #38bdf8;
    --sky-soft: rgba(56, 189, 248, 0.13);

    --danger: #f87171;
    --danger-soft: rgba(248, 113, 113, 0.14);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --warn-line: rgba(251, 191, 36, 0.22);
    --ok: #34d399;
    --ok-soft: rgba(52, 211, 153, 0.13);
    --unknown: #a3adc2;
    --unknown-soft: rgba(148, 163, 184, 0.14);

    --hero-bg: #070b18;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.3), 0 30px 60px -18px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}

/* ==========================================================================
   Nền tảng
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 700;
  color: var(--text);
}

p {
  margin: 0;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-hover);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  display: inline-block;
  width: 1.15em;
  height: 1.15em;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.2em;
}

.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  top: 12px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.container-narrow {
  max-width: 820px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Nút
   ========================================================================== */
.btn {
  --btn-h: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--btn-h);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s, transform 0.06s;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  color: var(--primary-ink);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.btn-light {
  background: #fff;
  color: #1e1b4b;
}

.btn-light:hover {
  background: #eef2ff;
  color: #1e1b4b;
}

.btn-outline-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.btn-danger-solid {
  background: #dc2626;
  color: #fff;
}

.btn-danger-solid:hover:not(:disabled) {
  background: #b91c1c;
  color: #fff;
}

.btn-sm {
  --btn-h: 36px;
  padding: 0 12px;
  border-radius: 10px;
  font-size: 14px;
}

.btn-lg {
  --btn-h: 52px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 16px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.icon-btn:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn-danger:hover:not(:disabled) {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}

.icon-btn.spinning .icon {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Đầu trang
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 16, 34, 0.86);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.logo:hover {
  color: inherit;
}

.logo-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.main-nav {
  display: flex;
  flex: 1;
  gap: 2px;
  margin-left: 16px;
}

.main-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: rgba(232, 235, 247, 0.78);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}

.main-nav a:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.main-nav a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.mobile-nav {
  display: none;
  margin-left: auto;
}

.mobile-nav summary {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fff;
  list-style: none;
  cursor: pointer;
}

.mobile-nav summary::-webkit-details-marker {
  display: none;
}

.mobile-nav summary .icon {
  width: 22px;
  height: 22px;
}

.mobile-nav .icon-close,
.mobile-nav[open] .icon-open {
  display: none;
}

.mobile-nav[open] .icon-close {
  display: inline-block;
}

.mobile-panel {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  padding: 12px 16px 20px;
  background: #0b1022;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 24px 40px rgba(0, 0, 0, 0.4);
}

.mobile-panel a:not(.btn) {
  padding: 12px;
  border-radius: 10px;
  color: #e8ebf7;
  font-weight: 500;
  text-decoration: none;
}

.mobile-panel a:not(.btn):hover,
.mobile-panel a[aria-current="page"] {
  background: rgba(255, 255, 255, 0.07);
}

.mobile-panel .btn {
  margin-top: 10px;
}

@media (max-width: 980px) {
  .main-nav,
  .header-cta {
    display: none;
  }

  .mobile-nav {
    display: block;
  }
}

/* ==========================================================================
   Phần đầu trang chủ
   ========================================================================== */
.hero,
.page-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--hero-bg);
  color: var(--hero-text);
}

.hero {
  padding: 64px 0 148px;
}

.hero::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 70% at 12% 0%, rgba(99, 102, 241, 0.42), transparent 62%),
    radial-gradient(50% 60% at 92% 8%, rgba(168, 85, 247, 0.3), transparent 60%),
    radial-gradient(45% 55% at 50% 108%, rgba(16, 185, 129, 0.2), transparent 70%);
}

.hero-alt::before {
  background:
    radial-gradient(60% 70% at 12% 0%, rgba(37, 99, 235, 0.45), transparent 62%),
    radial-gradient(50% 60% at 92% 8%, rgba(14, 165, 233, 0.32), transparent 60%),
    radial-gradient(45% 55% at 50% 108%, rgba(99, 102, 241, 0.24), transparent 70%);
}

.hero::after,
.page-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 50% 30%, #000 30%, transparent 75%);
}

.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: #c7d2fe;
  font-size: 13.5px;
  font-weight: 600;
}

.hero h1 {
  color: #fff;
  font-size: clamp(34px, 5.6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.text-grad {
  white-space: nowrap;
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd 45%, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-alt .text-grad {
  background-image: linear-gradient(90deg, #93c5fd, #a5b4fc 50%, #67e8f9);
}

.hero-lead {
  max-width: 660px;
  margin: 18px auto 0;
  color: var(--hero-muted);
  font-size: clamp(16px, 2vw, 18.5px);
  line-height: 1.6;
}

.trust-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 24px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: #cbd2ea;
  font-size: 14.5px;
  font-weight: 500;
}

.trust-list li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.trust-list .icon {
  color: #34d399;
  stroke-width: 2.6;
}

/* ==========================================================================
   Thẻ địa chỉ email
   ========================================================================== */
.mailbox-card {
  width: 100%;
  max-width: 820px;
  margin-top: 36px;
  padding: 24px;
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 30px 70px -24px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.mailbox-card.flash {
  animation: flash 1s ease;
}

@keyframes flash {
  0%,
  100% {
    box-shadow: 0 30px 70px -24px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
  }
  35% {
    box-shadow: 0 30px 70px -24px rgba(2, 6, 23, 0.6), 0 0 0 5px rgba(129, 140, 248, 0.65);
  }
}

.mailbox-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.mailbox-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 11px 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.live-pill[data-state="live"] {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.live-pill[data-state="live"] .live-dot {
  background: var(--accent);
  animation: pulse 2s infinite;
}

.live-pill[data-state="polling"] {
  background: var(--warn-soft);
  color: var(--warn);
}

.live-pill[data-state="offline"] {
  background: var(--danger-soft);
  color: var(--danger);
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

.address-field {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 6px;
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-2);
  transition: border-color 0.2s;
}

.address-field:hover {
  border-color: var(--primary);
}

.address {
  display: flex;
  flex: 1;
  align-items: center;
  min-width: 0;
  min-height: 50px;
  padding: 6px 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: clamp(16px, 2.6vw, 22px);
  font-weight: 600;
  letter-spacing: -0.01em;
  word-break: break-all;
  user-select: all;
}

.btn-copy {
  --btn-h: 50px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 15.5px;
}

.btn-copy.copied,
.btn-copy.copied:hover:not(:disabled) {
  background: var(--accent-ink);
}

.skeleton {
  display: inline-block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  color: transparent;
  user-select: none;
  animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

.mailbox-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.chip-btn .icon {
  width: 16px;
  height: 16px;
}

.chip-btn:hover:not(:disabled) {
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
  color: var(--primary);
}

.chip-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chip-danger {
  margin-left: auto;
}

.chip-danger:hover:not(:disabled) {
  border-color: transparent;
  background: var(--danger-soft);
  color: var(--danger);
}

.lbl-short {
  display: none;
}

.chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 12px;
}

.mailbox-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
}

.mailbox-meta p {
  display: flex;
  align-items: center;
  gap: 8px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.link-btn:hover:not(:disabled) {
  text-decoration: underline;
}

.link-btn:disabled {
  color: var(--muted);
  opacity: 0.6;
  cursor: not-allowed;
}

.notice {
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--text-2);
  font-size: 14px;
}

.notice-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.turnstile {
  margin-top: 14px;
}

@media (max-width: 640px) {
  .hero {
    padding: 40px 0 128px;
  }

  .mailbox-card {
    margin-top: 28px;
    padding: 16px;
    border-radius: 18px;
  }

  .mailbox-top {
    flex-wrap: wrap;
  }

  .address-field {
    flex-direction: column;
  }

  .address {
    justify-content: center;
    text-align: center;
  }

  .btn-copy {
    width: 100%;
  }

  .mailbox-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .chip-btn {
    justify-content: center;
    min-width: 0;
    padding: 0 8px;
  }

  .chip-btn span:not(.chip-count) {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .chip-danger {
    grid-column: 1 / -1;
    margin-left: 0;
  }

  .lbl-full {
    display: none;
  }

  .lbl-short {
    display: inline;
  }

  .trust-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    justify-items: start;
    text-align: left;
    font-size: 14px;
  }
}

/* ==========================================================================
   Hộp thư đến
   ========================================================================== */
.inbox-wrap {
  position: relative;
  z-index: 2;
  margin-top: -92px;
}

.inbox {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.inbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 14px 22px;
  border-bottom: 1px solid var(--border);
}

.inbox-head h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  letter-spacing: -0.01em;
}

.inbox-head h2 .icon {
  color: var(--primary);
}

.inbox-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 13px;
  font-weight: 700;
}

.inbox-body {
  display: grid;
  grid-template-columns: minmax(300px, 390px) 1fr;
  min-height: 440px;
}

.inbox-list {
  min-width: 0;
  max-height: 660px;
  overflow: auto;
  border-right: 1px solid var(--border);
}

.msg-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 8px;
  list-style: none;
}

.msg-item {
  position: relative;
  border-radius: 14px;
  transition: background-color 0.15s;
}

.msg-item:hover {
  background: var(--surface-2);
}

.msg-item.active {
  background: var(--primary-soft);
}

.msg-item.is-new {
  animation: slide-in 0.4s ease-out;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.msg-btn {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 1px 12px;
  align-items: start;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.avatar {
  display: grid;
  place-items: center;
  grid-row: span 3;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
}

.av-0 { background: #4f46e5; }
.av-1 { background: #0369a1; }
.av-2 { background: #047857; }
.av-3 { background: #b45309; }
.av-4 { background: #be185d; }
.av-5 { background: #7c3aed; }
.av-6 { background: #0f766e; }
.av-7 { background: #b91c1c; }

.msg-from {
  overflow: hidden;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.msg-time {
  padding-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.msg-subject,
.msg-preview {
  grid-column: 2 / 4;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.msg-subject {
  color: var(--text-2);
  font-size: 14px;
}

.msg-preview {
  color: var(--muted);
  font-size: 13px;
}

.msg-item.unread .msg-from,
.msg-item.unread .msg-subject {
  color: var(--text);
  font-weight: 700;
}

.msg-item.unread::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
}

.msg-extra {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 12px 12px 64px;
  margin-top: -4px;
}

.code-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--mono);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.code-chip:hover {
  background: var(--primary-soft-2);
}

.code-chip .icon {
  width: 14px;
  height: 14px;
}

.att-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.att-chip .icon {
  width: 14px;
  height: 14px;
}

.inbox-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 100%;
  padding: 48px 24px;
  text-align: center;
}

.empty-art {
  position: relative;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  margin-bottom: 12px;
  border-radius: 24px;
  background: var(--primary-soft);
  color: var(--primary);
}

.empty-art::after {
  content: "";
  position: absolute;
  inset: -8px;
  border: 2px solid var(--primary-soft-2);
  border-radius: 30px;
  animation: ring 2.4s ease-out infinite;
}

@keyframes ring {
  0% {
    opacity: 0.9;
    transform: scale(0.92);
  }
  100% {
    opacity: 0;
    transform: scale(1.18);
  }
}

.empty-art .icon {
  width: 34px;
  height: 34px;
  stroke-width: 1.6;
}

.empty-title {
  color: var(--text);
  font-size: 16.5px;
  font-weight: 700;
}

.empty-text {
  max-width: 290px;
  color: var(--muted);
  font-size: 14px;
}

.waiting {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.dots {
  display: inline-flex;
  gap: 3px;
}

.dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  animation: blink 1.4s infinite both;
}

.dots i:nth-child(2) {
  animation-delay: 0.2s;
}

.dots i:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}

.reader {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.reader-placeholder {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px;
  color: var(--muted);
  font-size: 14.5px;
}

.reader-placeholder .icon {
  width: 46px;
  height: 46px;
  stroke-width: 1.4;
  opacity: 0.55;
}

.reader-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 16px 22px 22px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.reader-actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.reader-subject {
  font-size: 20px;
  line-height: 1.35;
  word-break: break-word;
}

.reader-from {
  display: flex;
  align-items: center;
  gap: 12px;
}

.reader-from .avatar {
  grid-row: auto;
  flex-shrink: 0;
}

.reader-who {
  flex: 1;
  min-width: 0;
}

.reader-sender,
.reader-email {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.reader-sender {
  font-size: 14.5px;
  font-weight: 600;
}

.reader-email,
.reader-time {
  color: var(--muted);
  font-size: 13px;
}

.reader-time {
  white-space: nowrap;
}

.attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.attachments a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
  word-break: break-all;
}

.attachments a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.reader-frame {
  flex: 1;
  width: 100%;
  min-height: 460px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fff;
}

@media (min-width: 901px) {
  .reader-back {
    display: none;
  }
}

@media (max-width: 900px) {
  .inbox-body {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .inbox-list {
    max-height: none;
    border-right: 0;
  }

  .reader,
  .reader-placeholder {
    display: none;
  }

  .inbox.is-reading .inbox-list {
    display: none;
  }

  .inbox.is-reading .reader {
    display: flex;
  }

  .reader-content {
    padding: 14px 16px 16px;
  }

  .reader-frame {
    min-height: 62vh;
  }
}

/* ==========================================================================
   Số liệu
   ========================================================================== */
.stats-strip {
  padding: 40px 0 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat {
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.stat-value {
  display: block;
  color: var(--text);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.stat-label {
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Khối nội dung
   ========================================================================== */
.section {
  --card-bg: var(--surface);
  padding: 96px 0;
}

.section-tight {
  padding: 56px 0;
}

.section-alt {
  --card-bg: var(--bg);
  border-block: 1px solid var(--border);
  background: var(--surface);
}

.section-head {
  max-width: 720px;
  margin: 0 auto 48px;
  text-align: center;
}

.kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-head h2 {
  font-size: clamp(26px, 3.6vw, 38px);
  letter-spacing: -0.025em;
}

.section-head p:not(.kicker) {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
}

@media (max-width: 640px) {
  .section {
    padding: 64px 0;
  }

  .section-tight {
    padding: 44px 0;
  }

  .section-head {
    margin-bottom: 32px;
  }
}

/* Các bước */
.steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.steps::before {
  content: "";
  position: absolute;
  top: 50px;
  left: 16%;
  right: 16%;
  height: 2px;
  background: repeating-linear-gradient(90deg, var(--border-strong) 0 8px, transparent 8px 16px);
}

.step {
  position: relative;
  padding: 28px 24px 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg, var(--surface));
  box-shadow: var(--shadow-sm);
}

.step-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 10px 20px -8px rgba(99, 102, 241, 0.7);
}

.step h3 {
  margin-bottom: 8px;
  font-size: 18.5px;
}

.step p {
  color: var(--muted);
  font-size: 15px;
}

.step strong {
  color: var(--text-2);
}

@media (max-width: 860px) {
  .steps {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .steps::before {
    display: none;
  }
}

/* Tính năng */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.feature-grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.feature {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg, var(--bg));
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.feature:hover {
  border-color: var(--primary-soft-2);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.feature-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
}

.feature-icon .icon {
  width: 24px;
  height: 24px;
}

.feature-icon-alt {
  background: var(--sky-soft);
  color: var(--sky);
}

.feature-icon-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.feature h3 {
  margin-bottom: 8px;
  font-size: 18px;
}

.feature p {
  color: var(--muted);
  font-size: 15px;
}

@media (max-width: 960px) {
  .feature-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .feature-grid,
  .feature-grid-2 {
    grid-template-columns: 1fr;
  }

  .feature {
    padding: 22px;
  }
}

/* Tình huống sử dụng */
.usecase-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.usecase {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-bg, var(--surface));
}

.usecase-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.usecase-icon .icon {
  width: 22px;
  height: 22px;
}

.usecase h3 {
  margin-bottom: 4px;
  font-size: 16.5px;
}

.usecase p {
  color: var(--muted);
  font-size: 14.5px;
}

@media (max-width: 960px) {
  .usecase-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .usecase-grid {
    grid-template-columns: 1fr;
  }
}

/* Ghi chú nổi bật */
.callout {
  display: flex;
  gap: 16px;
  margin-top: 28px;
  padding: 22px 24px;
  border: 1px solid var(--warn-line);
  border-radius: 18px;
  background: var(--warn-soft);
  color: var(--text-2);
}

.callout-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--warn-line);
  color: var(--warn);
}

.callout h3 {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16.5px;
}

.callout p,
.callout li {
  font-size: 15px;
}

.callout ul {
  display: grid;
  gap: 4px;
  margin: 0;
  padding-left: 18px;
}

.callout-info {
  border-color: var(--primary-soft-2);
  background: var(--primary-soft);
}

.callout-info .callout-icon {
  background: var(--primary-soft-2);
  color: var(--primary);
}

/* So sánh */
.compare {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 980px;
  margin: 0 auto;
}

.compare-card {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg, var(--bg));
}

.compare-head {
  display: flex;
  align-items: center;
  gap: 16px;
}

.compare-head .feature-icon {
  margin: 0;
}

.compare-head h3 {
  font-size: 20px;
}

.compare-sample {
  margin-top: 2px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.check-list {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-2);
  font-size: 15px;
}

.check-list .icon {
  width: 18px;
  height: 18px;
  margin-top: 3px;
}

.check-list .yes .icon {
  color: var(--accent);
}

.check-list .no .icon {
  color: var(--muted);
}

.compare-card .btn {
  align-self: flex-start;
}

@media (max-width: 760px) {
  .compare {
    grid-template-columns: 1fr;
  }

  .compare-card {
    padding: 22px;
  }
}

/* Bài viết */
.prose {
  max-width: 760px;
  margin: 0 auto;
  color: var(--text-2);
  font-size: 17px;
  line-height: 1.75;
}

.prose > * + * {
  margin-top: 1.1em;
}

.prose h2 {
  color: var(--text);
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
}

.prose > h2:not(:first-child) {
  margin-top: 1.8em;
}

.prose h3 {
  margin-top: 1.8em;
  color: var(--text);
  font-size: 21px;
}

.prose h2 + *,
.prose h3 + * {
  margin-top: 0.7em;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
}

.prose li + li {
  margin-top: 0.45em;
}

.prose li::marker {
  color: var(--primary);
  font-weight: 700;
}

.prose strong {
  color: var(--text);
  font-weight: 600;
}

.prose code {
  padding: 0.12em 0.4em;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  font-family: var(--mono);
  font-size: 0.86em;
  word-break: break-all;
}

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.prose table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 15px;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

.prose thead th {
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.prose tbody th {
  color: var(--text);
  font-weight: 600;
}

.prose tbody tr:last-child th,
.prose tbody tr:last-child td {
  border-bottom: 0;
}

/* Hỏi đáp */
.faq-list {
  display: grid;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg, var(--bg));
  transition: border-color 0.2s, box-shadow 0.2s;
}

.faq-item[open] {
  border-color: var(--primary-soft-2);
  box-shadow: var(--shadow-sm);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  list-style: none;
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item h3 {
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
}

.faq-chevron {
  width: 20px;
  height: 20px;
  color: var(--muted);
  transition: transform 0.2s, color 0.2s;
}

.faq-item[open] .faq-chevron {
  color: var(--primary);
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 15.5px;
  line-height: 1.7;
}

/* Kêu gọi hành động */
.cta-section {
  padding: 88px 0;
}

.cta-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  overflow: hidden;
  padding: 44px 48px;
  border-radius: 28px;
  background: linear-gradient(120deg, #4f46e5, #7c3aed 55%, #9333ea);
  color: #fff;
  box-shadow: 0 30px 60px -26px rgba(79, 70, 229, 0.6);
  isolation: isolate;
}

.cta-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(40% 80% at 100% 0%, rgba(255, 255, 255, 0.18), transparent 60%),
    radial-gradient(30% 60% at 0% 100%, rgba(52, 211, 153, 0.25), transparent 60%);
}

.cta-band h2 {
  color: #fff;
  font-size: clamp(24px, 3vw, 32px);
  letter-spacing: -0.02em;
}

.cta-band p {
  max-width: 560px;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.86);
}

@media (max-width: 760px) {
  .cta-section {
    padding: 64px 0;
  }

  .cta-band {
    flex-direction: column;
    align-items: stretch;
    padding: 32px 24px;
    border-radius: 22px;
  }
}

/* ==========================================================================
   Trang con
   ========================================================================== */
.page-hero {
  padding: 48px 0 60px;
}

.page-hero h1 {
  margin-top: 12px;
  color: #fff;
  font-size: clamp(30px, 4.5vw, 46px);
  letter-spacing: -0.03em;
}

.page-lead {
  max-width: 680px;
  margin-top: 14px;
  color: var(--hero-muted);
  font-size: 17.5px;
}

.page-hero-center {
  padding: 96px 0 104px;
  text-align: center;
}

.page-hero-center .page-lead {
  margin-inline: auto;
}

.error-code {
  background: linear-gradient(90deg, #a5b4fc, #c4b5fd 50%, #6ee7b7);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(72px, 12vw, 112px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--hero-muted);
  font-size: 14px;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  opacity: 0.5;
}

.breadcrumb a {
  color: #c7d2fe;
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

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

.contact-card {
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
}

.contact-card h2 {
  margin-bottom: 8px;
  font-size: 19px;
}

.contact-card p {
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 15px;
}

.contact-link {
  font-weight: 600;
  word-break: break-all;
}

@media (max-width: 640px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Chân trang
   ========================================================================== */
.site-footer {
  padding-top: 64px;
  background: var(--hero-bg);
  color: #aab2cf;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand .logo {
  color: #fff;
}

.footer-brand p {
  max-width: 340px;
  margin-top: 16px;
  font-size: 14.5px;
  line-height: 1.7;
}

.footer-points {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 14px;
}

.footer-points li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-points .icon {
  color: #34d399;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h2 {
  margin-bottom: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.footer-col a,
.footer-bottom a {
  color: #aab2cf;
  font-size: 14.5px;
  text-decoration: none;
}

.footer-col a:hover,
.footer-bottom a:hover {
  color: #fff;
}

/* Nút "Cài đặt cookie" trông giống các liên kết khác ở chân trang */
.footer-link-btn {
  padding: 0;
  border: 0;
  background: none;
  color: #aab2cf;
  font: inherit;
  font-size: 14.5px;
  text-align: left;
  cursor: pointer;
}

.footer-link-btn:hover {
  color: #fff;
}

.footer-bottom {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-top: 48px;
  padding-top: 24px;
  padding-bottom: 28px;
  font-size: 13.5px;
}

.footer-bottom::before {
  content: "";
  position: absolute;
  top: 0;
  left: 20px;
  right: 20px;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.footer-bottom p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-bottom a {
  font-size: 13.5px;
}

@media (max-width: 860px) {
  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

@media (max-width: 520px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px 20px;
  }
}

/* ==========================================================================
   Hộp thoại
   ========================================================================== */
.dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  padding: 28px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.dialog[open] {
  animation: dialog-in 0.18s ease-out;
}

@keyframes dialog-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dialog::backdrop {
  background: rgba(2, 6, 23, 0.6);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dialog-sm {
  width: min(420px, calc(100vw - 32px));
  text-align: center;
}

.dialog h2 {
  padding-right: 40px;
  font-size: 21px;
}

.dialog-sm h2 {
  padding-right: 0;
}

.dialog-x {
  position: absolute;
  top: 16px;
  right: 16px;
}

.dialog-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  word-break: break-word;
}

.dialog-desc strong {
  color: var(--text);
  font-family: var(--mono);
  font-weight: 600;
}

.dialog-form {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.field-label {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.field {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15.5px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 4px var(--primary-soft);
}

.field-mono {
  font-family: var(--mono);
}

select.field {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  cursor: pointer;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group input {
  flex: 1.2;
  min-width: 0;
}

.input-group select {
  flex: 1;
  min-width: 0;
}

.input-addon {
  color: var(--muted);
  font-weight: 700;
}

.field-error {
  color: var(--danger);
  font-size: 14px;
}

.preview-line {
  color: var(--muted);
  font-size: 14px;
  word-break: break-all;
}

.preview-line strong {
  color: var(--text);
  font-family: var(--mono);
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
}

.dialog-sm .dialog-actions {
  justify-content: center;
  margin-top: 22px;
}

.token-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 10px 10px 14px;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  background: var(--surface-2);
}

.token-box code {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14.5px;
  word-break: break-all;
}

.dialog-notes {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.dialog-notes li {
  display: flex;
  gap: 10px;
  color: var(--text-2);
  font-size: 14px;
}

.dialog-notes .icon {
  margin-top: 2px;
  color: var(--warn);
}

.my-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.my-list li {
  display: flex;
  align-items: center;
  gap: 8px;
}

.my-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.my-open:hover,
.my-open[aria-current="true"] {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.my-addr {
  overflow: hidden;
  font-family: var(--mono);
  font-size: 14px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.kind-tag {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 11.5px;
  font-weight: 700;
}

.kind-tag.hotmail {
  background: var(--sky-soft);
  color: var(--sky);
}

.my-empty {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14.5px;
}

.confirm-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: var(--danger-soft);
  color: var(--danger);
}

.confirm-icon .icon {
  width: 26px;
  height: 26px;
}

@media (max-width: 520px) {
  .dialog {
    padding: 22px 18px;
  }

  .input-group {
    flex-wrap: wrap;
  }

  .input-group input {
    flex-basis: 100%;
  }

  .dialog-actions .btn {
    flex: 1;
  }
}

/* ==========================================================================
   Thông báo nổi
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 100;
  max-width: calc(100vw - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  font-size: 14.5px;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 16px 40px -12px rgba(2, 6, 23, 0.5);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast[data-kind="error"] {
  background: #b91c1c;
}

.toast[data-kind="success"] {
  background: #047857;
}

/* ==========================================================================
   Nhãn trạng thái (dùng chung với trang quản trị)
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--unknown-soft);
  color: var(--unknown);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.badge.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

.badge.warn {
  background: var(--warn-soft);
  color: var(--warn);
}

.badge.critical {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge.primary {
  background: var(--primary-soft);
  color: var(--primary);
}

.hint {
  color: var(--muted);
  font-size: 13.5px;
}

/* ==========================================================================
   Mã khôi phục
   ========================================================================== */
.recovery {
  margin-top: 16px;
  padding: 16px;
  border: 1.5px solid var(--warn-line);
  border-radius: 16px;
  background: var(--warn-soft);
}

.recovery.attention {
  animation: attention 1.1s ease 3;
}

@keyframes attention {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
  40% {
    box-shadow: 0 0 0 6px rgba(245, 158, 11, 0.4);
  }
}

.recovery-head {
  display: flex;
  gap: 12px;
}

.recovery-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: #f59e0b;
  color: #fff;
}

.recovery-icon .icon {
  width: 20px;
  height: 20px;
}

.recovery-title {
  color: var(--text);
  font-size: 15.5px;
  font-weight: 700;
}

.recovery-text {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.55;
}

.recovery-code {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 6px 6px 6px 12px;
  border: 1.5px dashed var(--warn-line);
  border-radius: 12px;
  background: var(--surface);
}

.recovery-code code {
  flex: 1;
  min-width: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  word-break: break-all;
}

.recovery-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.recovery-done {
  margin-left: auto;
}

.recovery-saved {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  color: var(--accent-ink);
  font-size: 13.5px;
  font-weight: 600;
}

.recovery-saved .icon {
  color: var(--accent);
}

.recovery-saved .link-btn {
  margin-left: auto;
}

.token-address {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 14px;
}

.token-address strong {
  color: var(--text);
  font-family: var(--mono);
  word-break: break-all;
}

@media (max-width: 640px) {
  .recovery-code {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
  }

  .recovery-code .btn {
    width: 100%;
  }

  .recovery-actions .chip-btn {
    flex: 1 1 100%;
    justify-content: center;
  }

  .recovery-done {
    margin: 4px auto 0;
  }
}

/* ==========================================================================
   Hướng dẫn chi tiết
   ========================================================================== */
.guide {
  display: grid;
  gap: 14px;
  max-width: 880px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.guide-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--card-bg, var(--surface));
}

.guide-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 18px;
  font-weight: 700;
}

.guide-num .icon {
  width: 22px;
  height: 22px;
}

.guide-step.is-key {
  border-color: var(--warn-line);
  background: var(--warn-soft);
}

.guide-step.is-key .guide-num {
  background: #f59e0b;
  color: #fff;
}

.guide-body h3 {
  margin-bottom: 6px;
  font-size: 18px;
}

.guide-body p {
  color: var(--text-2);
  font-size: 15.5px;
  line-height: 1.7;
}

.guide-body strong {
  color: var(--text);
}

.guide-body .guide-tip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14.5px;
}

.guide-step.is-key .guide-tip {
  background: var(--surface);
}

.guide-tip .icon {
  margin-top: 4px;
  color: var(--warn);
}

@media (max-width: 640px) {
  .guide-step {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .guide-num {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 16px;
  }
}

/* ==========================================================================
   Chọn ngôn ngữ
   ========================================================================== */
.lang-menu {
  position: relative;
}

.lang-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #e8ebf7;
  font-size: 14px;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}

.lang-menu summary::-webkit-details-marker {
  display: none;
}

.lang-menu summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

.lang-chevron {
  width: 14px;
  height: 14px;
  opacity: 0.7;
  transition: transform 0.2s;
}

.lang-menu[open] .lang-chevron {
  transform: rotate(180deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 180px;
  margin: 0;
  padding: 6px;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

.lang-list a {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--text);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}

.lang-list a:hover {
  background: var(--surface-2);
}

.lang-list a[aria-current="true"] {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}

.mobile-langs {
  display: none;
}

.footer-langs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.footer-langs a[aria-current="true"] {
  color: #fff;
  font-weight: 600;
}

@media (max-width: 980px) {
  .lang-menu {
    margin-left: auto;
  }

  .mobile-nav {
    margin-left: 8px;
  }
}

/* Ngăn xếp đáy trang: banner cookie và gợi ý ngôn ngữ xếp chồng, không đè lên nhau.
   Khung cao 0, banner mọc lên phía trên: khung không bao giờ dịch chuyển nên không tính là xô lệch bố cục (CLS). */
.bottom-stack {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  height: 0;
  pointer-events: none;
}

.bottom-stack > * {
  width: 100%;
  max-width: 540px;
  pointer-events: auto;
}

.bottom-stack > [hidden] {
  display: none;
}

.consent {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  line-height: 1.5;
  animation: slide-in 0.3s ease-out;
}

.consent a {
  color: var(--primary);
  font-weight: 600;
}

.consent-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

@media (max-width: 520px) {
  .consent-actions .btn {
    flex: 1;
  }
}

.lang-banner {
  position: fixed;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 540px;
  margin: 0 auto;
  padding: 12px 10px 12px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  font-size: 14.5px;
  animation: slide-in 0.3s ease-out;
}

.lang-banner p {
  flex: 1;
}

.bottom-stack .lang-banner {
  position: static;
  margin: 0;
}

.lang-banner-x {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.lang-banner-x:hover {
  background: var(--surface-2);
}

@media (max-width: 520px) {
  .lang-banner {
    flex-wrap: wrap;
  }

  .lang-banner p {
    flex-basis: calc(100% - 44px);
  }

  .lang-banner .btn {
    order: 3;
    width: 100%;
  }
}

/* Cân dòng: tránh một chữ bị rớt một mình xuống dòng cuối */
h1,
h2,
h3,
.hero-lead,
.page-lead,
.section-head p {
  text-wrap: balance;
}

.prose p,
.faq-answer p,
.guide-body p {
  text-wrap: pretty;
}

/* Đã lưu mã khôi phục (biết trước khi vẽ trang): thu gọn ô mã ngay từ đầu */
.rc-saved #recovery {
  display: none;
}

.rc-saved #recovery-saved[hidden] {
  display: flex !important;
}
