:root {
  --bg: #0b0f14;
  --bg2: #11171f;
  --bg3: #161e28;
  --line: #1f2a37;
  --text: #d7e2ee;
  --muted: #7d8fa3;
  --accent: #22d3ee;
  --accent-dark: #0e7490;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 10px;
  --mono: "Cascadia Code", "Consolas", "SF Mono", monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  display: flex;
  flex-direction: column;
}

/* ---------- topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.lang-switch {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.lang-switch button {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}
.lang-switch button.active {
  background: var(--bg3);
  color: var(--accent);
}
.logo {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, var(--accent), #a5f3fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub { color: var(--muted); font-size: 12px; }
.chip {
  font-size: 11.5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg3);
  color: var(--muted);
  white-space: nowrap;
}
.chip.ok { color: var(--ok); border-color: #14532d; }
.chip.warn { color: #fbbf24; border-color: #78350f; }

/* ---------- tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  padding: 10px 18px 0;
  background: var(--bg2);
  border-bottom: 1px solid var(--line);
}
.tab {
  background: transparent;
  border: 1px solid transparent;
  border-bottom: none;
  color: var(--muted);
  padding: 8px 14px;
  font-size: 13.5px;
  cursor: pointer;
  border-radius: 8px 8px 0 0;
}
.tab small { color: var(--muted); font-size: 10.5px; }
.tab:hover { color: var(--text); }
.tab.active {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--line);
  position: relative;
  top: 1px;
}

/* ---------- panels ---------- */
main { flex: 1; overflow: hidden; padding: 14px 18px; }
.panel { display: none; height: 100%; flex-direction: column; gap: 10px; }
.panel.active { display: flex; }

.code {
  flex: 1;
  width: 100%;
  resize: none;
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  min-height: 240px;
}
.code:focus { outline: none; border-color: var(--accent-dark); }
.code[readonly] { color: #b7c6d6; }

/* overlay chọn code mẫu — hiện khi input rỗng, gõ text thì ẩn */
.editor-wrap { position: relative; flex: 1; display: flex; min-height: 240px; }
.editor-wrap .code { min-height: 0; }
.src-samples {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none; /* click xuyên xuống textarea → focus, con trỏ nhấp nháy */
}
.src-samples[hidden] { display: none; }
.src-samples-label { color: var(--muted); font-size: 12px; }
.src-samples-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.src-samples button {
  pointer-events: auto;
  background: var(--bg3);
  color: var(--accent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}
.src-samples button:hover { border-color: var(--accent-dark); background: var(--bg2); }

.meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}
.hint { flex: 1; text-align: right; }

/* ---------- upload ---------- */
.dropzone {
  flex: 1;
  min-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus { border-color: var(--accent-dark); outline: none; }
.dropzone.drag { border-color: var(--accent); background: rgba(34, 211, 238, 0.05); }
.dz-inner { text-align: center; color: var(--muted); }
.dz-icon { font-size: 42px; margin-bottom: 10px; }
.dz-title { color: var(--text); font-size: 15px; margin-bottom: 6px; }
.dz-sub { font-size: 12.5px; }

.file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
}
.file-name { font-family: var(--mono); font-size: 13px; color: var(--accent); word-break: break-all; }
.file-size { color: var(--muted); font-size: 12px; }

/* ---------- output stats ---------- */
.stats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg3);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 14px;
  font-size: 12.5px;
}
.stats .arrow { color: var(--muted); }
.ratio { color: var(--ok); }
.time { color: var(--muted); }
.badge {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--accent-dark);
  color: var(--accent);
  font-size: 11px;
  text-transform: uppercase;
}

/* ---------- options (tab Tuỳ Chọn) ---------- */
#tab-options { overflow-y: auto; }
.opt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.opt-title { font-weight: 600; font-size: 15px; }
.opt-sub { color: var(--muted); font-size: 12px; margin-top: 4px; max-width: 640px; }
/* FREE: ghi chú khoá tuỳ chọn trong tab Options (hiện khi plan không có customOptions) */
.opt-lock {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #78350f;
  border-radius: var(--radius);
  background: rgba(120, 53, 15, 0.12);
  color: #fbbf24;
  font-size: 13px;
}
.opt-groups { display: flex; flex-direction: column; gap: 18px; padding-top: 14px; }
.opt-group-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 10px;
}
.opt-group-count { color: var(--accent); font-size: 11.5px; font-weight: 500; }
.opt-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 10px;
}
.opt-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.opt-item:hover { border-color: var(--accent-dark); }
.opt-item input {
  appearance: none;
  flex-shrink: 0;
  width: 34px;
  height: 19px;
  margin: 2px 0 0;
  border-radius: 999px;
  background: var(--line);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.opt-item input::after {
  content: '';
  position: absolute;
  top: 2.5px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.15s, background 0.15s;
}
.opt-item input:checked { background: var(--accent-dark); }
.opt-item input:checked::after { left: 17px; background: var(--accent); }
.opt-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.opt-label { font-size: 12.5px; font-weight: 600; }
.opt-desc { color: var(--muted); font-size: 11px; line-height: 1.45; }
/* Landing: dialog Options (teaser Pro) — item tái dùng .opt-item ở trên.
   Selector .modal.ld-opt-modal để thắng width 430px của .modal (rule nằm sau trong file) */
.modal.ld-opt-modal {
  width: min(800px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
}
.ld-opt-modal .ld-opt-grid { overflow-y: auto; }
.ld-opt-note {
  padding: 8px 10px;
  margin-bottom: 12px;
  border: 1px solid #78350f;
  border-radius: 8px;
  background: rgba(120, 53, 15, 0.12);
  color: #fbbf24;
  font-size: 12.5px;
  line-height: 1.5;
}
.ld-opt-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* ---------- history ---------- */
.hist-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hist-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.hist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  flex-wrap: wrap;
}
.hist-main { flex: 1; min-width: 220px; }
.hist-name { font-family: var(--mono); color: var(--text); font-size: 13px; word-break: break-all; }
.hist-meta { color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.hist-actions { display: flex; gap: 6px; }
.hist-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* ---------- action bar ---------- */
.actionbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: var(--bg2);
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.actionbar label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12.5px;
}
select {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 12.5px;
}
.status { flex: 1; text-align: right; color: var(--muted); font-size: 12.5px; }
.status.busy { color: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  background: var(--bg3);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: linear-gradient(135deg, var(--accent-dark), #155e75);
  border-color: var(--accent-dark);
  color: #e0feff;
  font-weight: 600;
  padding: 9px 22px;
}
.btn.primary:hover { filter: brightness(1.15); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #7f1d1d; }
.btn.sm { padding: 4px 10px; font-size: 11.5px; }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  width: min(430px, calc(100vw - 40px));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.modal h3 { font-size: 15.5px; margin-bottom: 10px; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.55; word-break: break-word; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

@media (max-width: 640px) {
  .actionbar { gap: 8px; }
  .status { text-align: left; width: 100%; }
  .hint { display: none; }
  .pay-plans { grid-template-columns: 1fr; }
}

/* ================= PUBLIC PAGES (/, /pricing, /docs, /login, /register) ================= */
body.pub { display: block; overflow-y: auto; }
.pubnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 10px 28px;
  background: rgba(11, 15, 20, 0.86);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.pubnav::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.4), transparent);
  pointer-events: none;
}
.pubbrand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.pubbrand-ic {
  width: 30px; height: 30px; border-radius: 8px; flex: 0 0 auto;
  display: grid; place-items: center;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.32);
}
.pubbrand-ic svg { width: 15px; height: 15px; }
.pubbrand-txt {
  font-size: 16px; font-weight: 800; letter-spacing: 0.3px;
  background: linear-gradient(90deg, var(--accent), #a5f3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.publinks {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 6px;
}
.pubnav-side { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pubnav-side [hidden] { display: none; } /* ẩn link Sign In/Register ↔ Open App khi đổi trạng thái (EJS render cả 2) */
.publink {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 7px 13px; border-radius: 999px; border: 1px solid transparent; background: transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.publink:hover { color: var(--text); background: var(--bg3); }
.publink.active {
  color: var(--accent); font-weight: 600;
  background: rgba(34, 211, 238, 0.08);
  border-color: rgba(34, 211, 238, 0.30);
}
.publink.cta {
  color: #e0feff; font-weight: 600;
  background: linear-gradient(135deg, var(--accent-dark), #155e75);
  border-color: var(--accent-dark);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.18);
}
.publink.cta:hover { color: #fff; box-shadow: 0 0 24px rgba(34, 211, 238, 0.32); }
.publink.cta svg { width: 13px; height: 13px; }
@media (max-width: 860px) {
  .pubnav { flex-wrap: wrap; row-gap: 8px; }
  .publinks { position: static; transform: none; order: 3; width: 100%; justify-content: center; }
}
@media (max-width: 640px) {
  .pubnav { padding: 10px 14px; }
  .publink { padding: 6px 10px; font-size: 12.5px; }
  .pubbrand-txt { font-size: 15px; }
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 22px; }
.container.narrow { max-width: 640px; }
.section { padding: 46px 0; }
.sec-title { font-size: 26px; font-weight: 700; margin-bottom: 8px; text-align: center; }
.sec-sub { color: var(--muted); text-align: center; margin-bottom: 26px; font-size: 13.5px; }

.hero { padding: 70px 0 40px; text-align: center; }
.hero-kicker {
  color: var(--accent); font-size: 13px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 14px;
}
.hero-title { font-size: 42px; line-height: 1.15; font-weight: 800; max-width: 820px; margin: 0 auto 16px; }
.hero-title .grad {
  background: linear-gradient(90deg, var(--accent), #a5f3fc);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { color: var(--muted); font-size: 15px; max-width: 640px; margin: 0 auto 26px; line-height: 1.6; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 12px; }
.hero-note { color: var(--muted); font-size: 12.5px; }
.hero-note a { color: var(--accent); }

.feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.feat { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.feat-icon { font-size: 26px; margin-bottom: 10px; }
.feat-title { font-weight: 700; font-size: 14.5px; margin-bottom: 6px; }
.feat-desc { color: var(--muted); font-size: 12.5px; line-height: 1.55; }

/* ---------- pricing ---------- */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: stretch; }
.plan-card {
  position: relative; background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 12px;
}
.plan-card.pop { border-color: var(--accent-dark); box-shadow: 0 0 0 1px var(--accent-dark), 0 18px 40px rgba(0, 0, 0, 0.35); }
.plan-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-dark), #155e75); color: #e0feff;
  font-size: 10.5px; font-weight: 700; letter-spacing: 1px;
  padding: 3px 12px; border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}
.plan-name { font-size: 16px; font-weight: 700; }
.plan-desc { color: var(--muted); font-size: 12px; min-height: 16px; }
.plan-price { display: flex; align-items: baseline; gap: 6px; }
.plan-price .amount { font-size: 32px; font-weight: 800; }
.plan-price .per { color: var(--muted); font-size: 12px; }
.plan-feats { list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: #b7c6d6; flex: 1; }
.plan-feats li::before { content: '✓  '; color: var(--ok); font-weight: 700; }
.plan-feats li.no { color: var(--muted); }
.plan-feats li.no::before { content: '—  '; color: var(--muted); }

.compare-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.compare-table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 640px; }
.compare-table th, .compare-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.compare-table th { background: var(--bg3); color: var(--text); font-size: 12px; }
.compare-table td:first-child { color: var(--muted); }
.compare-table tr:last-child td { border-bottom: none; }

.faq { display: flex; flex-direction: column; gap: 10px; max-width: 760px; margin: 0 auto; }
.faq-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.faq-q { padding: 13px 16px; cursor: pointer; font-weight: 600; font-size: 13.5px; display: flex; justify-content: space-between; gap: 10px; }
.faq-q::after { content: '+'; color: var(--muted); }
.faq-item.open .faq-q::after { content: '–'; }
.faq-a { display: none; padding: 0 16px 14px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.faq-item.open .faq-a { display: block; }

.pubfoot { border-top: 1px solid var(--line); margin-top: 40px; padding: 26px 0 34px; color: var(--muted); font-size: 12px; }
.pubfoot .container { display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pubfoot a { color: var(--muted); text-decoration: none; }
.pubfoot a:hover { color: var(--accent); }

/* ---------- auth ---------- */
.auth-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; padding: 40px 0; }
.auth-card {
  width: min(400px, calc(100vw - 40px)); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 14px; padding: 28px; display: flex; flex-direction: column; gap: 14px;
}
.auth-title { font-size: 19px; font-weight: 700; text-align: center; }
.auth-sub { color: var(--muted); font-size: 12.5px; text-align: center; line-height: 1.5; }
.auth-alt { text-align: center; color: var(--muted); font-size: 12.5px; }
.auth-alt a { color: var(--accent); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12px; color: var(--muted); font-weight: 600; }
.input {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; font-size: 13.5px; font-family: inherit; width: 100%;
}
.input:focus { outline: none; border-color: var(--accent-dark); }
textarea.input { font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.form-msg { font-size: 12.5px; min-height: 18px; }
.form-msg.ok { color: var(--ok); }
.form-msg.err { color: var(--danger); }

/* ---------- form dùng chung (select đã có ở trên) ---------- */
.btn.wide { width: 100%; display: inline-flex; align-items: center; justify-content: center; text-align: center; }

/* ================= ACCOUNT PAGES (/client/profile|billing|apikeys|admin) ================= */
body.acct { display: block; overflow-y: auto; }
.acct-wrap { max-width: 960px; margin: 0 auto; padding: 26px 22px 60px; display: flex; flex-direction: column; gap: 18px; }
#payBox { display: flex; flex-direction: column; gap: 18px; }
.page-title { font-size: 22px; font-weight: 700; }
.card { background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.card-title { font-size: 15.5px; font-weight: 700; }
.card-sub { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.card-row { display: flex; gap: 14px; flex-wrap: wrap; }
.card-row .field { flex: 1; min-width: 220px; }
.kv { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.kv-row { display: flex; justify-content: space-between; gap: 14px; padding: 10px 14px; font-size: 13px; border-bottom: 1px solid var(--line); }
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--muted); }
.kv-val { font-weight: 600; text-align: right; word-break: break-all; }
.usage-bar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent-dark), var(--accent)); transition: width 0.3s; }
.usage-fill.warn { background: linear-gradient(90deg, #b45309, #fbbf24); }
.usage-fill.over { background: linear-gradient(90deg, #7f1d1d, var(--danger)); }
.danger-zone { border-color: #7f1d1d; }
.danger-zone .card-title { color: var(--danger); }

.badge-role, .badge-plan, .badge-status {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; white-space: nowrap;
}
.badge-role { background: rgba(34, 211, 238, 0.12); color: var(--accent); border: 1px solid var(--accent-dark); }
.badge-plan { background: rgba(52, 211, 153, 0.1); color: var(--ok); border: 1px solid #14532d; }
.badge-status { background: var(--bg3); color: var(--muted); border: 1px solid var(--line); }
.badge-status.banned { background: rgba(248, 113, 113, 0.12); color: var(--danger); border-color: #7f1d1d; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 700px; }
.table th { text-align: left; padding: 10px 12px; background: var(--bg3); font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: rgba(34, 211, 238, 0.03); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.stat-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--accent); }
.stat-label { color: var(--muted); font-size: 11.5px; margin-top: 4px; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input { max-width: 260px; }
.pager { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; }

/* menu dropdown (Profile group) */
.menu { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: 8px; background: var(--bg3);
  border: 1px solid var(--line); color: var(--text); border-radius: 8px;
  padding: 6px 12px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.menu-btn:hover { border-color: var(--accent-dark); }
.menu-drop {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 10px; min-width: 180px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45); overflow: hidden; z-index: 60;
}
.menu-drop[hidden] { display: none; }
.menu-item {
  display: block; width: 100%; text-align: left; background: transparent; border: none;
  color: var(--text); padding: 10px 14px; font-size: 12.5px; cursor: pointer; font-family: inherit;
}
.menu-item:hover { background: var(--bg3); color: var(--accent); }
.menu-item.danger { color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); }

.key-box {
  font-family: var(--mono); font-size: 12px; background: var(--bg);
  border: 1px dashed var(--accent-dark); border-radius: 8px; padding: 10px 12px;
  word-break: break-all; color: var(--accent);
}
.muted { color: var(--muted); }

/* nav client dùng chung — link trong topbar */
.ctop-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ctop-link {
  color: var(--muted); text-decoration: none; font-size: 12.5px;
  padding: 6px 10px; border-radius: 8px; background: transparent; border: 1px solid transparent;
}
.ctop-link:hover { color: var(--text); background: var(--bg3); }
.ctop-link.active { color: var(--accent); }

/* code samples trên trang docs */
.codeblock {
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.6;
  overflow-x: auto; white-space: pre; color: #b7c6d6;
}
.codeblock .c { color: var(--muted); }

/* ---- payment page (/client/payment.html — chọn plan → ACB QR / Binance USDT) ---- */
.pay-plans { grid-template-columns: repeat(3, 1fr); }
.pay-cycles { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pay-cycles select { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--card, #fff); }
.pay-cycles input[type="number"] { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); }
.n-step { display: inline-flex; align-items: center; gap: 6px; }
.n-step input[type="number"] { width: 84px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.n-step input::-webkit-outer-spin-button, .n-step input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pay-plan { cursor: pointer; transition: border-color 0.15s; }
.pay-plan:hover { border-color: var(--accent-dark); }
.pay-plan.sel { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pay-acb { display: flex; gap: 22px; flex-wrap: wrap; }
.pay-qr { display: flex; flex-direction: column; gap: 10px; align-items: center; font-size: 12px; max-width: 350px; }
.pay-qr img { border-radius: 10px; border: 1px solid var(--line); background: #fff; padding: 8px; }
.pay-info { flex: 1; min-width: 280px; display: flex; flex-direction: column; gap: 10px; }
.pay-copy { display: flex; align-items: center; gap: 10px; }
.pay-copy-l { color: var(--muted); font-size: 12.5px; min-width: 90px; }
.pay-copy-v { flex: 1; font-weight: 600; font-size: 13.5px; word-break: break-all; }
.pay-copy-v.strong { color: var(--accent); font-size: 15px; }
.pay-vat { font-size: 12px; }

/* ================= LANDING 2026 (design system: ui-ux-pro-max — product-demo-features, OLED dark, cyan brand) ================= */

.ld {
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.14);
  --pane-bg: #0a101a;
  --win-bg: #0d1420;
}

/* ---------- hero ---------- */
.ld-hero {
  position: relative;
  padding: 84px 0 40px;
  text-align: center;
  overflow: hidden;
  background:
    radial-gradient(640px 340px at 50% -60px, rgba(34, 211, 238, 0.13), transparent 70%),
    radial-gradient(1px 1px at 0 0, rgba(125, 143, 163, 0.28) 1px, transparent 1px);
  background-size: auto, 28px 28px;
}
.ld-badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 14px 5px 10px; margin-bottom: 22px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(17, 23, 31, 0.7);
  font-family: "JetBrains Mono", var(--mono); font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--muted); text-transform: uppercase;
}
.ld-badge svg { width: 15px; height: 15px; stroke: var(--cyan); }
.ld-title {
  font-size: clamp(34px, 5.6vw, 56px); line-height: 1.08; font-weight: 700;
  letter-spacing: -0.022em; max-width: 840px; margin: 0 auto 18px;
}
.ld-grad {
  background: linear-gradient(92deg, #7dd3fc 0%, var(--cyan) 55%, #0ea5b7 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 26px rgba(34, 211, 238, 0.22);
}
.ld-sub { color: var(--muted); font-size: 15.5px; max-width: 620px; margin: 0 auto 30px; line-height: 1.65; }
.ld-cta-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ld .btn.ld-ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.ld .btn.ld-ghost:hover { border-color: var(--cyan-dark); color: var(--cyan); }
.ld-stats {
  display: flex; justify-content: center; gap: clamp(24px, 6vw, 64px);
  margin-top: 44px; flex-wrap: wrap;
}
.ld-stat { display: flex; flex-direction: column; gap: 3px; }
.ld-stat .n {
  font-family: "JetBrains Mono", var(--mono); font-size: 21px; font-weight: 600; color: var(--cyan);
  text-shadow: 0 0 12px rgba(34, 211, 238, 0.35);
}
.ld-stat .l { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }

/* ---------- editor window (demo + tool dùng chung) ---------- */
.ld-window {
  background: var(--win-bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 24px 60px rgba(2, 6, 12, 0.55), 0 0 0 1px rgba(34, 211, 238, 0.04);
  overflow: hidden;
}
.ld-win-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  background: rgba(16, 22, 32, 0.85);
}
.ld-dots { display: inline-flex; gap: 6px; }
.ld-dots i { width: 10px; height: 10px; border-radius: 50%; background: #2a3646; }
.ld-dots i:nth-child(1) { background: #4a3038; }
.ld-dots i:nth-child(2) { background: #454030; }
.ld-dots i:nth-child(3) { background: #2c4a3c; }
.ld-tab {
  font-family: "JetBrains Mono", var(--mono); font-size: 11.5px; color: var(--muted);
  padding: 4px 12px; border-radius: 7px; border: 1px solid transparent;
}
.ld-tab.active { color: var(--text); background: var(--bg3); border-color: var(--line); }
.ld-win-tag, .ld-win-name {
  font-family: "JetBrains Mono", var(--mono); font-size: 11px; color: var(--muted);
}
.ld-win-name { color: var(--text); }
.ld-win-bar .ld-win-tag { margin-left: auto; }
.ld-win-bar .ld-win-name + .ld-chip-row { margin-left: auto; }

/* demo panes */
.ld-demo { padding: 8px 0 10px; }
.ld-win-body { display: grid; grid-template-columns: 1fr 56px 1fr; align-items: stretch; }
.ld-pane { background: var(--pane-bg); padding: 18px 20px; min-width: 0; }
.ld-pane pre {
  font-family: "JetBrains Mono", var(--mono); font-size: 12.5px; line-height: 1.75;
  white-space: pre; overflow: hidden; margin: 0;
}
.ld-pane .ln { display: none; }
.tk-cm { color: #5b6b7d; }
.tk-kw { color: #67e8f9; }
.tk-fn { color: #e2e8f0; font-weight: 500; }
.tk-str { color: #34d399; }
.tk-num { color: #fbbf24; }
.ld-pane.ld-out { border-left: 1px solid var(--line); }
.ld-pane.ld-out pre { color: #8b9cb0; word-break: break-all; white-space: pre-wrap; }
.ld-pane.ld-out .tk-fn { color: #a5e8f5; }
.ld-swap { display: flex; align-items: center; justify-content: center; }
.ld-swap svg {
  width: 30px; height: 30px; stroke: var(--cyan); opacity: 0.85;
  filter: drop-shadow(0 0 8px rgba(34, 211, 238, 0.45));
}
.ld-win-status {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 16px; border-top: 1px solid var(--line);
  font-family: "JetBrains Mono", var(--mono); font-size: 11px; color: var(--muted);
}
.ld-win-status svg { width: 14px; height: 14px; stroke: #34d399; flex: none; }

/* ---------- tool thật ---------- */
.ld-tool { padding: 52px 0 10px; }
.ld-tool .narrow { max-width: 860px; }
.ld-tool-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; background: rgba(10, 16, 26, 0.5); }
.ld .ld-code {
  font-family: "JetBrains Mono", var(--mono); font-size: 13px; line-height: 1.6;
  background: var(--pane-bg); border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); padding: 14px 16px; resize: vertical; width: 100%;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ld .ld-code:focus { outline: none; border-color: var(--cyan-dark); box-shadow: 0 0 0 3px var(--cyan-soft); }
.ld-code-out { color: #9fb1c4; }
.ld-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ld-lbl { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ld select {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 12px; font-size: 13px; cursor: pointer;
  transition: border-color 0.2s ease;
}
.ld select:hover { border-color: var(--cyan-dark); }
.ld .chip { font-family: "JetBrains Mono", var(--mono); font-size: 11px; }
.ld-sp { flex: 1; }
.ld-stat-line { font-family: "JetBrains Mono", var(--mono); font-size: 11.5px; color: var(--muted); }
.ld-t2 { margin-top: -2px; }
.ld-chip-row { display: inline-flex; gap: 6px; }
.ld-chip {
  font-family: "JetBrains Mono", var(--mono); font-size: 10.5px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 2.5px 9px;
}

/* ---------- section head + features ---------- */
.ld-sec-head { text-align: center; margin-bottom: 30px; }
.ld-sec-head h2 { font-size: 27px; font-weight: 700; letter-spacing: -0.015em; margin-bottom: 8px; }
.ld-sec-head p { color: var(--muted); font-size: 14px; max-width: 560px; margin: 0 auto; line-height: 1.6; }
.ld-why { padding: 64px 0 8px; }
.ld-feat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ld-feat {
  background: var(--bg2); border: 1px solid var(--line); border-radius: 13px;
  padding: 22px; transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.ld-feat:hover { border-color: var(--cyan-dark); box-shadow: 0 10px 34px rgba(2, 6, 12, 0.45); }
.ld-feat-ic {
  display: inline-flex; width: 38px; height: 38px; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--cyan-soft); margin-bottom: 14px;
}
.ld-feat-ic svg { width: 20px; height: 20px; stroke: var(--cyan); }
.ld-feat h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.ld-feat p { color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ---------- pricing teaser ---------- */
.ld-pricing { padding: 64px 0 8px; }
.ld-cta-center { text-align: center; margin-top: 28px; }
.ld-cta-center .btn.primary { padding: 11px 26px; }

/* svg icon mặc định */
.ld svg { fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- motion (subtle — entrance + hover) ---------- */
@keyframes ldUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.spin { display: inline-block; width: 13px; height: 13px; border: 2px solid var(--muted, #888); border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; vertical-align: -2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* FAQ & Blog — accordion dùng chung */
.acc { display: flex; flex-direction: column; gap: 10px; }
.acc-item { border: 1px solid var(--line); border-radius: 12px; background: var(--bg2); overflow: hidden; }
.acc-item summary { cursor: pointer; padding: 14px 16px; font-weight: 600; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 10px; }
.acc-item summary::-webkit-details-marker { display: none; }
.acc-item summary::after { content: '+'; margin-left: auto; color: var(--muted); font-size: 16px; flex-shrink: 0; }
.acc-item[open] summary::after { content: '−'; }
.acc-item summary:hover { color: var(--accent); }
.acc-body { padding: 0 16px 14px; color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.acc-body p + p { margin-top: 8px; }
.blog-list .acc-item summary { flex-direction: column; align-items: flex-start; gap: 4px; padding-right: 40px; }
.blog-title { font-size: 15px; }
.blog-meta { color: var(--muted); font-size: 12px; font-weight: 500; }
.ld-faq { padding: 56px 0 8px; }
.ld-faq .acc { max-width: 800px; margin: 0 auto; }
.ld-in { animation: ldUp 0.38s ease-out both; animation-delay: calc(var(--d, 0) * 90ms); }

/* focus rõ cho bàn phím */
.ld a:focus-visible, .ld button:focus-visible, .ld select:focus-visible, .ld textarea:focus-visible {
  outline: 2px solid var(--cyan); outline-offset: 2px; border-radius: 8px;
}
.ld a, .ld button, .ld select { cursor: pointer; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  .ld-win-body { grid-template-columns: 1fr; }
  .ld-swap { padding: 10px 0; }
  .ld-swap svg { transform: rotate(90deg); }
  .ld-pane.ld-out { border-left: 0; border-top: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .ld-hero { padding: 56px 0 32px; }
  .ld-stats { gap: 20px 28px; }
  .ld-win-tag { display: none; }
  .ld-chip-row { display: none; }
  .ld-opt-grid { grid-template-columns: 1fr; }
}

/* tôn trọng người dùng ngại chuyển động */
@media (prefers-reduced-motion: reduce) {
  .ld-in { animation: none; }
  .ld-feat, .ld .btn, .ld select, .ld .ld-code { transition: none; }
}

/* ================= DOCS (/docs — API reference, cùng design system landing) ================= */

.docs-head {
  padding: 54px 0 34px; text-align: center;
  background: radial-gradient(640px 300px at 50% -40px, rgba(34, 211, 238, 0.11), transparent 70%);
  border-bottom: 1px solid var(--line);
}
.docs-head h1 { font-size: clamp(26px, 4vw, 34px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
.docs-head p { color: var(--muted); font-size: 14.5px; max-width: 560px; margin: 0 auto; line-height: 1.65; }

.docs-layout {
  display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 40px;
  align-items: start; padding: 8px 22px 70px;
}
/* Trang nội dung 1 cột (faq/rules/disclaimer/blog) — không có TOC như /docs */
.docs-page { max-width: 800px; margin: 0 auto; padding: 8px 22px 70px; }
.docs-toc { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 2px; }
.docs-toc-title {
  font-family: "JetBrains Mono", var(--mono); font-size: 10.5px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.docs-toc a {
  color: var(--muted); text-decoration: none; font-size: 13px;
  padding: 6px 12px; border-left: 2px solid var(--line);
}
.docs-toc a:hover { color: var(--text); }
.docs-toc a.active { color: var(--cyan); border-left-color: var(--cyan); }

.docs-sec {
  display: flex; flex-direction: column; gap: 16px;
  padding: 30px 0 36px; border-bottom: 1px solid var(--line); scroll-margin-top: 72px;
}
.docs-sec:last-child { border-bottom: none; padding-bottom: 10px; }
.docs-sec-head { display: flex; align-items: center; gap: 12px; }
.docs-num {
  font-family: "JetBrains Mono", var(--mono); font-size: 12px; color: var(--cyan);
  background: var(--cyan-soft); border-radius: 7px; padding: 3px 8px;
}
.docs-sec-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.docs-ep { display: flex; align-items: center; gap: 10px; }
.docs-method {
  font-family: "JetBrains Mono", var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--cyan); background: var(--cyan-soft); border: 1px solid var(--accent-dark);
  border-radius: 6px; padding: 2px 8px;
}
.docs-ep code { font-family: var(--mono); font-size: 16.5px; color: var(--text); }

.docs-p { color: var(--muted); font-size: 13.5px; line-height: 1.65; }
.docs-p code, .docs-field .v code, .docs-note code {
  font-family: var(--mono); font-size: 12px; color: #a5e8f5;
  background: rgba(34, 211, 238, 0.08); border-radius: 5px; padding: 1px 6px;
}
.docs-note {
  color: var(--muted); font-size: 13px; line-height: 1.6;
  border-left: 2px solid var(--accent-dark); background: rgba(34, 211, 238, 0.05);
  border-radius: 0 8px 8px 0; padding: 10px 14px;
}
.docs-note a {
  color: var(--accent); font-weight: 600; text-decoration: none;
  border-bottom: 1px dashed var(--accent-dark);
}
.docs-note a:hover { color: #a5f3fc; border-bottom-color: var(--accent); }

.docs-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.docs-step {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.docs-step-n {
  flex: none; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", var(--mono); font-size: 12.5px; font-weight: 700;
  color: var(--cyan); background: var(--cyan-soft); border-radius: 8px;
}
.docs-step p { color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.docs-fields { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.docs-field { display: grid; grid-template-columns: 170px 1fr; gap: 14px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.docs-field:last-child { border-bottom: none; }
.docs-field .k { font-family: var(--mono); font-size: 12.5px; color: var(--cyan); }
.docs-field .v { color: var(--muted); font-size: 13px; line-height: 1.6; }

.docs-code { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--pane-bg); }
.docs-code-bar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  border-bottom: 1px solid var(--line); background: rgba(16, 22, 32, 0.85);
  font-family: "JetBrains Mono", var(--mono); font-size: 11px; color: var(--muted);
}
.docs-code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto;
  font-family: "JetBrains Mono", var(--mono); font-size: 12.5px; line-height: 1.65; color: #b7c6d6;
}
.docs-code .c { color: #5b6b7d; }

@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; gap: 10px; }
  .docs-toc { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .docs-toc-title { display: none; }
  .docs-toc a { border-left: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 13px; }
  .docs-toc a.active { border-color: var(--accent-dark); background: var(--cyan-soft); }
}
@media (max-width: 560px) {
  .docs-field { grid-template-columns: 1fr; gap: 4px; }
}
