:root {
  --font: "Be Vietnam Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e9f0;
  --line-2: #d6dbe5;
  --brand: #4f46e5;
  --brand-ink: #4338ca;
  --brand-50: #eef2ff;
  --brand-100: #e0e7ff;
  --violet: #7c3aed;
  --ok: #047857;
  --ok-bg: #ecfdf5;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --r: 12px;
  --r-lg: 16px;
  --sh-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --sh-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --sh: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 34px -14px rgba(15, 23, 42, 0.2);
  --sh-lg: 0 2px 4px rgba(15, 23, 42, 0.04), 0 32px 64px -24px rgba(30, 27, 75, 0.38);
  --ring: 0 0 0 4px rgba(79, 70, 229, 0.16);
}

:root:lang(zh) { --font: "Be Vietnam Pro", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif; }
:root:lang(ja) { --font: "Be Vietnam Pro", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif; }
:root:lang(ko) { --font: "Be Vietnam Pro", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; }
:root:lang(th) { --font: "Be Vietnam Pro", "Noto Sans Thai", Thonburi, "Leelawadee UI", sans-serif; }
:lang(zh) :is(h1, h2, h3), :lang(ja) :is(h1, h2, h3), :lang(ko) :is(h1, h2, h3), :lang(th) :is(h1, h2, h3) { letter-spacing: 0; }
:lang(ko) { word-break: keep-all; }
:lang(ja), :lang(zh) { line-break: strict; }
h1, h2 { hyphens: auto; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-ink); }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.02em; color: var(--ink); text-wrap: balance; }
h1 { font-size: 28px; margin: 0; font-weight: 700; }
h2 { font-size: 20px; margin: 0; font-weight: 700; }
h3 { font-size: 16px; margin: 0; font-weight: 600; }
p { margin: 0; }
img { max-width: 100%; }
.i { flex: none; display: block; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.only-sm { display: none; }
.inline { display: inline; margin: 0; }

/* ---------- đầu trang ---------- */
.top { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line); }
.top-in { max-width: 1200px; height: 64px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; }
.editor-page .top-in { max-width: none; height: 56px; padding: 0 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; color: var(--ink);
  letter-spacing: -0.01em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  font: italic 600 16px/1 Georgia, "Times New Roman", serif;
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.18), 0 2px 6px rgba(79, 70, 229, 0.35); }
.nav { display: flex; align-items: center; gap: 4px; }
.nav > a { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; font-weight: 500; white-space: nowrap; }
.nav > a:hover { background: rgba(15, 23, 42, 0.05); color: var(--ink); }
.nav > a.on { background: var(--brand-50); color: var(--brand-ink); }
.nav > a.btn { color: #fff; height: 36px; margin-left: 6px; }
.nav > a.btn:hover { background: var(--brand-ink); color: #fff; }
.nav .tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); }
.lang-menu { position: relative; }
.lang-menu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px;
  border-radius: 9px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 600; user-select: none; }
.lang-menu summary::-webkit-details-marker { display: none; }
.lang-menu summary:hover, .lang-menu[open] summary { background: rgba(15, 23, 42, 0.05); color: var(--ink); }
.lang-menu .menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; display: grid; min-width: 210px; padding: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--sh-lg); }
.lang-menu .menu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-radius: 9px;
  color: var(--ink-2); font-size: 14px; }
.lang-menu .menu a:hover { background: var(--surface-2); color: var(--ink); }
.lang-menu .menu a.on { background: var(--brand-50); color: var(--brand-ink); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding-left: 14px; border-left: 1px solid var(--line); }
.avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, var(--brand-100), #ede9fe); color: var(--brand-ink); font-weight: 700; font-size: 13px; }
.me-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; }
.icon-btn:hover { background: rgba(15, 23, 42, 0.06); color: var(--ink); }
.icon-btn:disabled { opacity: 0.35; pointer-events: none; }

/* ---------- nút, ô nhập ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px;
  border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: #fff;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.05s; }
.btn:hover { background: var(--brand-ink); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn.secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: var(--sh-xs); }
.btn.secondary:hover { background: var(--surface-2); border-color: #c3c9d6; }
.btn.ghost { background: transparent; color: var(--ink-2); box-shadow: none; }
.btn.ghost:hover { background: rgba(15, 23, 42, 0.05); }
.btn.dark { background: var(--ink); }
.btn.dark:hover { background: #1e293b; }
.btn.white { background: #fff; color: var(--ink); }
.btn.white:hover { background: #f1f5f9; }
.btn.danger { color: var(--danger); }
.btn.lg { height: 48px; padding: 0 22px; font-size: 15px; border-radius: 12px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 9px; gap: 6px; }
.btn.block { width: 100%; }
.kbd { font: 600 11px/1 var(--font); padding: 4px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28); }

.field { display: grid; gap: 6px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 500; color: var(--ink-2); }
input, select, textarea { width: 100%; height: 42px; padding: 0 12px; font: 14px var(--font); color: var(--ink);
  background: #fff; border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color 0.15s, box-shadow 0.15s; }
textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; }
select { appearance: none; -webkit-appearance: none; padding-right: 34px; cursor: pointer;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E") no-repeat right 10px center; }
input:hover, select:hover, textarea:hover { border-color: #c3c9d6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--ink-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.8; }
.badge.plain::before { display: none; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.brand { background: var(--brand-50); color: var(--brand-ink); }

/* ---------- thông báo ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px;
  width: max-content; max-width: calc(100vw - 32px); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--sh-lg); animation: toast-in 0.22s ease-out; }
.toast .i { color: #a5b4fc; }
.toast.err .i { color: #fca5a5; }
.toast.ok .i { color: #6ee7b7; }
.toast button { margin-left: 4px; color: #94a3b8; width: 28px; height: 28px; }
.toast button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- khung trang, thẻ, bảng ---------- */
.page { max-width: 1200px; margin: 0 auto; padding: 40px 24px 72px; }
.page.narrow { max-width: 960px; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }
.page-h p { margin-top: 6px; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.page > * + * { margin-top: 20px; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--line); }
.card-h h2 { font-size: 16px; display: flex; align-items: center; gap: 10px; }
.card-h p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.card-b { padding: 22px; }
.count { font-size: 12px; font-weight: 600; color: var(--muted); background: #f1f5f9; padding: 2px 8px; border-radius: 999px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.table th { padding: 10px 22px; text-align: left; font-size: 12px; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; }
.table td { padding: 14px 22px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfe; }
.table .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions form + form { margin-left: 4px; }
.mono { font-variant-numeric: tabular-nums; font-weight: 600; }
.who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who b { display: block; font-weight: 600; }
.who .sub { display: block; font-size: 13px; color: var(--muted); }
.empty-row { text-align: center; color: var(--muted); padding: 40px 22px !important; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand); }
.stat-ico.ok { background: var(--ok-bg); color: var(--ok); }
.stat-ico.warn { background: var(--warn-bg); color: var(--warn); }
.stat-ico.violet { background: #f5f3ff; color: var(--violet); }
.stat b { display: block; font-size: 24px; line-height: 1.15; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }

.invoice-form { display: grid; grid-template-columns: 1.4fr 2fr 0.8fr 0.7fr auto; gap: 14px; align-items: end; }
.form-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 13px; color: var(--muted); }

/* ---------- trang chủ ---------- */
.hero { position: relative; padding: 76px 24px 0; text-align: center; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(720px 360px at 50% -80px, rgba(99, 102, 241, 0.20), transparent 70%),
    radial-gradient(420px 260px at 88% 8%, rgba(124, 58, 237, 0.12), transparent 70%),
    radial-gradient(420px 260px at 10% 22%, rgba(56, 189, 248, 0.10), transparent 70%); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border-radius: 999px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-xs); font-size: 13px; font-weight: 500; color: var(--ink-2); }
.eyebrow b { padding: 3px 9px; border-radius: 999px; background: var(--brand-50); color: var(--brand-ink); font-size: 12px; }
.hero h1 { max-width: 920px; margin: 24px auto 18px; font-size: clamp(34px, 5.6vw, 62px); line-height: 1.08;
  letter-spacing: -0.035em; font-weight: 700; }
.grad { background: linear-gradient(92deg, #4f46e5 0%, #7c3aed 55%, #c026d3 100%); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.lead { text-wrap: pretty; max-width: 660px; margin: 0 auto; font-size: 18px; line-height: 1.6; color: var(--muted); }
.cta { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; font-size: 13px; color: var(--muted); }
.trust span { display: inline-flex; align-items: center; gap: 6px; }
.trust .i { color: var(--ok); }

.demo { max-width: 1080px; margin: 56px auto 0; padding: 0 24px; }
.window { background: #fff; border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--sh-lg); overflow: hidden; }
.window-bar { position: relative; display: flex; align-items: center; gap: 7px; height: 44px; padding: 0 16px;
  background: var(--surface-2); border-bottom: 1px solid var(--line); }
.window-bar i { width: 11px; height: 11px; border-radius: 50%; background: #e2e8f0; }
.window-bar span { position: absolute; left: 50%; transform: translateX(-50%); font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.compare { --pos: 50%; position: relative; aspect-ratio: 1600 / 732; background: #f4f2ec; user-select: none; overflow: hidden; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.compare .after { clip-path: inset(0 0 0 var(--pos)); }
.compare .bar { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--brand);
  pointer-events: none; }
.compare .knob { position: absolute; top: 50%; left: 50%; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; color: var(--brand); border: 2px solid var(--brand); box-shadow: var(--sh); }
.compare input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.compare input:focus-visible ~ .bar .knob { box-shadow: var(--ring), var(--sh); }
.compare .tag { position: absolute; top: 14px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(15, 23, 42, 0.78); color: #fff; pointer-events: none; }
.compare .tag.l { left: 14px; }
.compare .tag.r { right: 14px; background: var(--brand); }
.spot { position: absolute; left: calc(var(--x) * 100%); top: calc(var(--y) * 100%); width: calc(var(--w) * 100%);
  height: calc(var(--h) * 100%); opacity: 0; pointer-events: none; }
.spot.on { opacity: 1; }
.spot .ink { position: absolute; inset: 0; overflow: hidden; clip-path: inset(0 calc(100% - var(--t, 0) * 100%) 0 0); }
.spot .ink img { position: absolute; max-width: none; width: calc(100% / var(--w)); height: calc(100% / var(--h));
  left: calc(-100% * var(--x) / var(--w)); top: calc(-100% * var(--y) / var(--h)); }
.spot::after { content: ""; position: absolute; inset: -2px; border: 2px solid var(--brand); border-radius: 5px;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.16); opacity: var(--f, 0); transition: opacity 0.2s; }
.spot::before { content: attr(data-label); position: absolute; left: -2px; bottom: calc(100% + 8px); padding: 5px 8px; border-radius: 6px;
  background: var(--ink); color: #fff; font: 500 11px/1 var(--font); white-space: nowrap; opacity: var(--f, 0); transition: opacity 0.2s; }
.compare .bar, .compare .tag { transition: opacity 0.3s; }
.build .compare:not(.live) .bar, .build .compare:not(.live) .tag { opacity: 0; }
.build .compare input { pointer-events: none; }
.build [data-build] { opacity: 0; }
.build .trust > span { opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
.build .trust > span.in { opacity: 1; transform: none; }

.stage { position: relative; }
.cursors { position: absolute; inset: 0; z-index: 5; overflow: hidden; pointer-events: none; }
.mc { position: absolute; left: 0; top: 0; opacity: 0; will-change: transform; transition: opacity 0.4s; }
.mc.on { opacity: 1; }
.mc svg { display: block; width: 24px; height: 24px; overflow: visible; transform-origin: 4.5px 2.5px; transition: transform 0.1s;
  filter: drop-shadow(0 2px 3px rgba(15, 23, 42, 0.28)); }
.mc path { fill: var(--c); stroke: #fff; stroke-width: 1.6; stroke-linejoin: round; }
.mc.down svg { transform: scale(0.8); }
.mc b { position: absolute; left: 17px; top: 21px; padding: 3px 9px; border-radius: 3px 999px 999px 999px; background: var(--c);
  color: #fff; font: 600 12px/1.4 var(--font); white-space: nowrap; box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18); }
.mc .ring { position: absolute; left: -10.5px; top: -12.5px; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; }
.mc.click .ring { animation: ring 0.5s ease-out; }
@keyframes ring { from { transform: scale(0.3); opacity: 0.9; } to { transform: scale(1.5); opacity: 0; } }
.marquee { position: absolute; border: 1.5px solid var(--c); border-radius: 4px; background: color-mix(in srgb, var(--c) 7%, transparent);
  transition: opacity 0.35s; }
.marquee.gone { opacity: 0; }

.vs { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 980px; margin: 0 auto; }
.vs-col { display: flex; flex-direction: column; padding: 28px 30px 0; overflow: hidden; }
.vs-col h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 18px; }
.vs-col.old h3 { color: var(--muted); }
.vs-col.old .ticks .i { color: #ef4444; }
.vs-col.new { border: 1.5px solid var(--brand); box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.07), var(--sh); }
.vs-col .ticks { margin-bottom: 26px; }
.mock-old, .mock-new { position: relative; display: grid; place-items: center; height: 104px; margin: auto -30px 0;
  background: #f4f2ec; border-top: 1px solid var(--line); color: #232122; font: 30px "Times New Roman", Times, serif; }
.mock-old .mo-text, .mock-new span { filter: blur(0.45px); }
.mock-old .mo-patch { position: absolute; padding: 2px 10px; transform: translate(14px, 6px); background: #fff; color: #000;
  font: 21px Arial, Helvetica, sans-serif; box-shadow: 0 0 0 1px #d4d4d4, 0 1px 3px rgba(0, 0, 0, 0.12); }
.works { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; margin-top: 32px; }
.works span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); box-shadow: var(--sh-xs); font-size: 14px; color: var(--ink-2); }
.works .i { color: var(--brand); }
.works .works-h { padding: 0 4px; background: none; border: 0; box-shadow: none; color: var(--muted); font-weight: 600; }
.logo.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 13px; }

.changes { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }
.change { display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; background: #fff;
  border: 1px solid var(--line); font-size: 13px; color: var(--ink-2); box-shadow: var(--sh-xs); }
.change s { color: var(--muted); }
.change b { color: var(--ink); }
.change em { font-style: normal; color: var(--brand-ink); font-weight: 500; padding-left: 8px; border-left: 1px solid var(--line); }

.section { max-width: 1200px; margin: 0 auto; padding: 104px 24px 0; }
.section-h { max-width: 700px; margin: 0 auto 48px; text-align: center; }
.kicker { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
.section-h h2 { margin: 10px 0 14px; font-size: clamp(26px, 3.4vw, 40px); letter-spacing: -0.03em; }
.section-h p { color: var(--muted); font-size: 17px; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step { position: relative; padding: 28px; }
.step-n { position: absolute; top: 22px; right: 24px; font-size: 44px; font-weight: 700; line-height: 1; color: #eef0f6; letter-spacing: -0.04em; }
.tile-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, var(--brand-50), #f5f3ff); color: var(--brand); border: 1px solid var(--brand-100); }
.step h3, .feature h3 { font-size: 17px; margin-bottom: 8px; }
.step p, .feature p { color: var(--muted); font-size: 15px; }

.fonts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 14px; max-width: 980px; margin: 0 auto; }
.fonts span { padding: 12px 20px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-xs);
  font-size: 24px; line-height: 1.2; color: var(--ink); }
.fonts small { display: block; margin-top: 4px; font: 500 11px/1 var(--font); color: var(--muted); letter-spacing: 0.02em; }

.features { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.feature { display: flex; gap: 18px; padding: 26px 28px; }
.feature .tile-ico { margin: 0; }

.pricing { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 880px; margin: 0 auto; }
.price-card { position: relative; padding: 32px; display: flex; flex-direction: column; }
.price-card.pro { border: 1.5px solid var(--brand); box-shadow: 0 0 0 6px rgba(79, 70, 229, 0.07), var(--sh); }
.price-card .ribbon { position: absolute; top: -13px; left: 32px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #fff; background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.price-card h3 { font-size: 18px; }
.price-card .for { color: var(--muted); font-size: 14px; margin-top: 4px; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 24px; }
.price b { font-size: 48px; line-height: 1; letter-spacing: -0.04em; }
.price span { color: var(--muted); font-size: 15px; }
.ticks { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; flex: 1; }
.ticks li { display: flex; gap: 10px; font-size: 15px; color: var(--ink-2); }
.ticks .i { color: var(--ok); margin-top: 3px; }
.ticks li.off { color: var(--muted); }
.ticks li.off .i { color: #cbd5e1; }

.faq { max-width: 760px; margin: 0 auto; display: grid; gap: 12px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 22px; box-shadow: var(--sh-xs); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 0; font-weight: 600; font-size: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 22px; font-weight: 400; color: var(--muted); transition: transform 0.2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 20px; color: var(--muted); }

.band { max-width: 1152px; margin: 104px auto 0; padding: 56px 40px; border-radius: 24px; text-align: center; color: #e0e7ff;
  background: radial-gradient(600px 240px at 80% 0%, rgba(192, 38, 211, 0.35), transparent 70%),
    linear-gradient(135deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%); box-shadow: var(--sh-lg); }
.band h2 { color: #fff; font-size: clamp(24px, 3.2vw, 36px); letter-spacing: -0.03em; }
.band p { margin: 12px auto 28px; max-width: 560px; font-size: 17px; color: #c7d2fe; }
.band-wrap { padding: 0 24px; }

.foot { max-width: 1200px; margin: 88px auto 0; padding: 28px 24px 40px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.foot nav { display: flex; gap: 20px; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--ink); }

/* ---------- đăng nhập / đăng ký ---------- */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: calc(100vh - 65px); }
.auth-side { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; gap: 28px;
  padding: 56px clamp(32px, 5vw, 72px); color: #c7d2fe;
  background: radial-gradient(520px 300px at 90% 0%, rgba(192, 38, 211, 0.35), transparent 70%),
    linear-gradient(150deg, #1e1b4b 0%, #312e81 55%, #4c1d95 100%); }
.auth-side h2 { color: #fff; font-size: 30px; letter-spacing: -0.03em; max-width: 460px; }
.auth-side .shot { border-radius: 14px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5); background: #f4f2ec; max-width: 560px; }
.auth-side .shot img { display: block; width: 100%; }
.auth-side ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 15px; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li .i { color: #a5b4fc; }
.auth-main { display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; }
.auth-card .sub { margin: 8px 0 28px; color: var(--muted); }
.auth-card form { display: grid; gap: 16px; }
.auth-card .btn { margin-top: 6px; }
.auth-terms { margin-top: 16px; font-size: 12px; color: var(--muted); text-align: center; }
.auth-switch { margin-top: 24px; text-align: center; font-size: 14px; color: var(--muted); }
.auth-switch a { font-weight: 600; }

/* ---------- tài khoản ---------- */
.profile { display: flex; align-items: center; gap: 16px; }
.profile .avatar { width: 56px; height: 56px; font-size: 20px; }
.profile b { display: block; font-size: 18px; }
.plan-state { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.plan-big { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; margin-top: 10px; }
.plan-big small { font-size: 15px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.progress { height: 8px; border-radius: 999px; background: #eef0f5; overflow: hidden; margin: 18px 0 10px; }
.progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); }

/* ---------- trình sửa ---------- */
body.editor-page { height: 100vh; height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.editor { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ed-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px;
  background: #fff; border-bottom: 1px solid var(--line); }
.ed-file { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.file-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: var(--brand-50); color: var(--brand); }
.ed-file div { min-width: 0; }
.ed-file strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-file small { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; }
.pager { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2);
  border: 1px solid var(--line); }
.pager .icon-btn { width: 30px; height: 30px; border-radius: 8px; }
.pager .icon-btn:hover { background: #fff; box-shadow: var(--sh-xs); }
#page-label { min-width: 88px; padding: 0 6px; text-align: center; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ed-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex: 1; }
.ed-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 372px; }
.viewer { position: relative; overflow: auto; padding: 36px;
  background-color: #eceef4; background-image: radial-gradient(#d3d8e2 1px, transparent 1px); background-size: 20px 20px; }
.sheet { position: relative; max-width: 940px; margin: 0 auto; background: #fff; border-radius: 3px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 24px 56px -24px rgba(15, 23, 42, 0.4); }
.sheet img { display: block; width: 100%; height: auto; border-radius: 3px; }
.overlay { position: absolute; inset: 0; }
.line-box { position: absolute; padding: 0; border: 1px solid rgba(79, 70, 229, 0.3); border-radius: 4px;
  background: rgba(79, 70, 229, 0.035); cursor: pointer; transition: background 0.12s, border-color 0.12s, box-shadow 0.12s; }
.line-box:hover { border-color: var(--brand); background: rgba(79, 70, 229, 0.08); z-index: 2; }
.line-box.edited { border-color: rgba(5, 150, 105, 0.65); background: rgba(16, 185, 129, 0.07); }
.line-box.selected { border: 2px solid var(--brand); background: rgba(79, 70, 229, 0.1); box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.16); z-index: 3; }
.line-box:hover::after { content: attr(data-label); position: absolute; left: -2px; bottom: calc(100% + 6px);
  padding: 5px 8px; border-radius: 6px; background: var(--ink); color: #fff; font: 500 11px/1 var(--font); white-space: nowrap;
  pointer-events: none; }

.dropzone { max-width: 580px; margin: 7vh auto; padding: 52px 40px; text-align: center; background: #fff;
  border: 2px dashed #c7cbe8; border-radius: 22px; box-shadow: var(--sh); transition: border-color 0.15s, background 0.15s; }
.dropzone.over { border-color: var(--brand); background: var(--brand-50); }
.dz-ico { width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 20px; display: grid; place-items: center;
  color: #fff; background: linear-gradient(135deg, #6366f1, #7c3aed); box-shadow: 0 12px 24px -10px rgba(79, 70, 229, 0.6); }
.dropzone h2 { font-size: 22px; }
.dropzone p { margin: 8px auto 26px; max-width: 420px; color: var(--muted); }
.dz-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.dz-meta { margin-top: 22px; font-size: 13px; color: var(--muted); }

.inspector { display: flex; flex-direction: column; min-height: 0; overflow: auto; background: #fff; border-left: 1px solid var(--line); }
.insp-sec { padding: 20px 22px; border-bottom: 1px solid var(--line); }
.insp-sec:last-child { border-bottom: 0; }
.insp-title { margin: 0 0 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
  display: flex; justify-content: space-between; align-items: center; }
.font-name { font-size: 23px; line-height: 1.25; color: var(--ink); word-break: break-word; }
.font-face { font-size: 12px; color: var(--muted); margin-top: 2px; }
.match { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: 13px; color: var(--muted); }
.match b { color: var(--ink); font-variant-numeric: tabular-nums; }
.meter { flex: 1; height: 6px; border-radius: 999px; background: #eef0f5; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #8b5cf6); transition: width 0.3s; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.tiles div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.tiles span { display: block; font-size: 12px; color: var(--muted); }
.tiles b { display: flex; align-items: center; gap: 7px; font-size: 14px; font-variant-numeric: tabular-nums; }
.swatch { width: 14px; height: 14px; border-radius: 4px; border: 1px solid rgba(15, 23, 42, 0.15); display: inline-block; flex: none; }
.alt-label { display: block; margin-top: 16px; font-size: 12px; color: var(--muted); }
.alts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-2); background: #fff; color: var(--ink-2); font: 500 12px/1 var(--font); }
.chip:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-50); }
.chip em { font-style: normal; color: var(--muted); }
#line-panel { scroll-margin-top: 64px; }
.edit-form { display: grid; gap: 14px; }
.two { display: grid; grid-template-columns: 1fr 92px; gap: 10px; }
.help { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: flex-start; }
.help .i { margin-top: 2px; }
.btn-col { display: grid; gap: 8px; }
.insp-empty { padding: 36px 26px; text-align: center; }
.insp-empty .tile-ico { margin: 0 auto 16px; }
.insp-empty h3 { margin-bottom: 6px; }
.insp-empty > p { color: var(--muted); font-size: 14px; }
.howto { list-style: none; counter-reset: s; margin: 24px 0 0; padding: 0; display: grid; gap: 12px; text-align: left; }
.howto li { counter-increment: s; display: flex; gap: 12px; align-items: flex-start; font-size: 14px; color: var(--ink-2); }
.howto li::before { content: counter(s); flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; background: var(--brand-50); color: var(--brand-ink); }
.callout { display: flex; gap: 12px; margin: auto 16px 16px; padding: 14px 16px; border-radius: 14px; font-size: 13px; color: var(--ink-2);
  background: linear-gradient(135deg, #eef2ff, #f5f3ff); border: 1px solid var(--brand-100); }
.callout .i { color: var(--brand); margin-top: 2px; }
.callout b { color: var(--ink); }
.callout a { font-weight: 600; }
.busy { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(246, 247, 251, 0.6);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.busy-card { display: flex; align-items: center; gap: 14px; max-width: 400px; margin: 16px; padding: 18px 22px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--sh-lg); font-size: 14px; font-weight: 500; }
.spinner { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 3px solid var(--brand-100); border-top-color: var(--brand);
  animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- hoá đơn ---------- */
.inv-tools { max-width: 840px; margin: 28px auto 0; padding: 0 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.inv-tools a.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; font-size: 14px; }
.inv-tools a.back:hover { color: var(--ink); }
.inv-wrap { padding: 16px 24px 72px; }
.inv { position: relative; max-width: 792px; margin: 0 auto; padding: 52px 56px; background: #fff; border: 1px solid var(--line);
  border-radius: 16px; box-shadow: var(--sh); overflow: hidden; }
.inv::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px; background: linear-gradient(90deg, #4f46e5, #7c3aed, #c026d3); }
.inv-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.inv-top .brand { font-size: 17px; }
.inv-title { text-align: right; }
.inv-title h1 { font-size: 30px; letter-spacing: 0.02em; }
.inv-title p { color: var(--muted); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; }
.inv-meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 40px 0 32px; padding: 18px 20px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.inv-meta span, .inv-party h3 { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.inv-meta b { display: block; margin-top: 4px; font-size: 15px; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; margin-bottom: 36px; }
.inv-party h3 { margin-bottom: 8px; }
.inv-party p { font-size: 14px; color: var(--ink-2); }
.inv-party p.name { font-size: 16px; font-weight: 600; color: var(--ink); }
.inv-items { width: 100%; border-collapse: collapse; font-size: 14px; }
.inv-items th { padding: 10px 0; text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); border-bottom: 2px solid var(--ink); }
.inv-items th + th, .inv-items td + td { padding-left: 20px; }
.inv-items td { padding: 16px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.inv-items .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.inv-items td small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.inv-total { display: flex; justify-content: flex-end; margin-top: 20px; }
.inv-total div { min-width: 280px; display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 16px 20px;
  border-radius: 12px; background: var(--ink); color: #fff; }
.inv-total span { font-size: 13px; color: #cbd5e1; }
.inv-total b { font-size: 24px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.inv-note { margin-top: 44px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.stamp { display: inline-block; margin-top: 16px; padding: 7px 14px; border: 2.5px solid currentColor; border-radius: 10px;
  font-size: 14px; font-weight: 800; letter-spacing: 0.06em; text-align: center; line-height: 1.25; transform: rotate(-5deg);
  color: var(--warn); opacity: 0.9; }
.stamp small { display: block; font-size: 10px; font-weight: 600; letter-spacing: 0.1em; }
.stamp.paid { color: #059669; }
.stamp.void { color: #94a3b8; }

/* ---------- màn nhỏ ---------- */
@media (max-width: 1080px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .invoice-form { grid-template-columns: 1fr 1fr; }
  .invoice-form .wide { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .steps, .features, .pricing, .grid-2, .vs { grid-template-columns: 1fr; }
  .pricing { gap: 28px; }
  body.editor-page { height: auto; overflow: visible; }
  .ed-body { grid-template-columns: 1fr; }
  .viewer { padding: 16px; min-height: 55vh; }
  .inspector { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
  .callout { margin-top: 0; }
  .ed-bar { flex-wrap: wrap; }
  .ed-file { flex-basis: 100%; }
  .ed-actions { flex: 1; }
}
@media (max-width: 720px) {
  .lbl, .hide-sm { display: none; }
  .only-sm { display: inline; }
  .me { margin-left: 2px; padding-left: 8px; }
  .me-name { display: none; }
  .nav > a { padding: 0 9px; font-size: 13px; }
  .nav > a.lbl { display: none; }
  .brand { font-size: 15px; gap: 8px; }
  .top-in { padding: 0 16px; }
  .page { padding: 28px 16px 56px; }
  .hero { padding-top: 48px; }
  .lead { font-size: 16px; }
  .demo, .section { padding-left: 16px; padding-right: 16px; }
  .section { padding-top: 72px; }
  .fonts span { font-size: 19px; padding: 10px 14px; }
  .feature { flex-direction: column; gap: 14px; padding: 24px; }
  .band { padding: 40px 22px; margin-top: 72px; }
  .band-wrap { padding: 0 16px; }
  .foot { margin-top: 64px; }
  .compare .tag { top: 8px; font-size: 11px; }
  .compare .tag.l { left: 8px; }
  .compare .tag.r { right: 8px; }
  .compare .knob { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .window-bar span { display: none; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ico { width: 36px; height: 36px; }
  .stat b { font-size: 20px; }
  .invoice-form { grid-template-columns: 1fr; }
  .card-h, .card-b { padding-left: 16px; padding-right: 16px; }
  .table th, .table td { padding-left: 16px; padding-right: 16px; }
  .inv { padding: 36px 22px; }
  .inv-top { flex-direction: column; }
  .inv-title { text-align: left; }
  .inv-meta { grid-template-columns: 1fr; gap: 10px; }
  .inv-parties { grid-template-columns: 1fr; gap: 20px; }
  .inv-total div { min-width: 0; width: 100%; }
  .inv-tools, .inv-wrap { padding-left: 16px; padding-right: 16px; }
}

@media print {
  .top, .toasts, .no-print { display: none !important; }
  body { background: #fff; }
  .inv-wrap { padding: 0; }
  .inv { border: 0; box-shadow: none; border-radius: 0; padding: 0; max-width: none; }
  .inv::before { display: none; }
  @page { margin: 16mm; }
}
