/* Neperi Search — trang chủ (tĩnh, không CDN). Màu: biến trên :root; nền tối mặc định. */
/* Space Grotesk (SIL OFL 1.1, assets/fonts/OFL.txt) — tự host vì CSP chỉ cho 'self'; chỉ dùng cho logo, menu, tiêu đề */
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/spacegrotesk-vietnamese.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: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/spacegrotesk-latin-ext.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Space Grotesk"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/spacegrotesk-latin.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; }
:root {
  --bg: #121417;
  --bg2: #171a1e;
  --panel: #1b1f24;
  --line: #2a3038;
  --line2: #39414b;
  --text: #e8ebef;
  --soft: #c6cdd5;
  --muted: #a8b1bb;
  --dim: #6c7580;
  --accent: #3ccfc0;
  --accent2: #2aa79b;
  --accent-ink: #062320;
  --bar0: #4a525c;
  --bar1: #616a75;
  --bar2: #7b8590;
  --bar3: #959faa;
  --bar4: #b1bac4;
  --radius: 6px;
  --maxw: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-head: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
img, svg { display: block; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.sep { height: 2px; background: linear-gradient(90deg, transparent, var(--accent2) 12%, var(--accent2) 88%, transparent); opacity: .55; }

/* ---------------------------------------------------------------- thanh trên */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(18, 20, 23, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: 700; font-size: 19px; letter-spacing: 0; }
.brand svg { width: 26px; height: 26px; }
.brand small {
  font-weight: 700; font-size: 15px; letter-spacing: .3px;
  background: linear-gradient(90deg, #3ccfc0 0%, #6ee7f9 50%, #a5b4fc 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nav { display: flex; gap: 22px; font-family: var(--font-head); font-weight: 500; font-size: 14px; color: var(--muted); }
.nav a:hover { color: var(--text); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.lang {
  background: none; border: 1px solid var(--line2); color: var(--muted);
  border-radius: var(--radius); height: 34px; padding: 0 10px; font: 600 13px var(--font); cursor: pointer;
}
.lang:hover { color: var(--text); border-color: var(--muted); }
.lang[hidden] { display: none; }
/* "Sign in with Google" in the dark theme of Google's branding guidelines: fill #131314, 1px #8E918F stroke,
   #E3E3E3 text, the standard colour G; 12px before the G, 10px after it, 12px after the text */
.google {
  display: inline-flex; align-items: center; gap: 10px; height: 36px; padding: 0 12px;
  background: #131314; color: #e3e3e3; border: 1px solid #8e918f; border-radius: 18px;
  font: 500 14px/20px var(--font); white-space: nowrap;
}
.google:hover { color: #e3e3e3; background: #242425; }
.google svg { width: 18px; height: 18px; flex: none; }

/* ---------------------------------------------------------------- hero */
.hero { position: relative; overflow: hidden; padding: 80px 0 76px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% 0 -10%; z-index: 0; pointer-events: none;
  /* lưới chấm trên mặt phẳng phối cảnh + vũng sáng trên «sàn» (lớp cuối, cùng phối cảnh) */
  background-image: radial-gradient(rgba(94, 227, 214, .9) 1.1px, transparent 1.8px), radial-gradient(rgba(255, 255, 255, .32) 1px, transparent 1.6px),
    linear-gradient(rgba(94, 227, 214, .13) 1px, transparent 1px), linear-gradient(90deg, rgba(94, 227, 214, .13) 1px, transparent 1px),
    radial-gradient(closest-side at 68% 62%, rgba(60, 207, 192, .5), rgba(60, 207, 192, .12) 55%, transparent 100%);
  background-size: 48px 48px, 32px 32px, 48px 48px, 48px 48px, 100% 100%;
  background-position: 0 0, 13px 17px, 0 24px, 24px 0, 0 0;
  animation: gridflow 16s linear infinite;
  transform: perspective(700px) rotateX(58deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 70%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 45%, #000 70%, transparent 100%);
  opacity: .75;
}
/* quầng sáng mờ phía sau lưới (góc dưới phải), thở chậm */
.hero::after {
  content: ""; position: absolute; z-index: 0; pointer-events: none; left: 38%; right: -12%; bottom: -35%; height: 95%;
  background: radial-gradient(closest-side, rgba(60, 207, 192, .26), rgba(94, 140, 255, .12) 55%, transparent 100%);
  filter: blur(12px);
  animation: heroglow 10s ease-in-out infinite alternate;
}
@keyframes gridflow { to { background-position: 0 96px, 13px 113px, 0 120px, 24px 96px, 0 0; } }
@keyframes heroglow { from { opacity: .65; transform: translateX(-4%); } to { opacity: 1; transform: translateX(4%); } }
.hero .wrap { position: relative; z-index: 1; }
.hero h1 { margin: 0; font-family: var(--font-head); font-weight: 400; font-size: clamp(34px, 6vw, 60px); line-height: 1.12; letter-spacing: -1.2px; }
.hero h1 b { display: block; font-weight: 700; }
.hero p { max-width: 620px; color: var(--soft); font-size: 18px; margin: 22px 0 34px; }
.hero-btns { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--radius); overflow: hidden; flex-wrap: wrap; }
.hbtn { display: inline-flex; align-items: center; gap: 9px; padding: 14px 20px; font-weight: 600; font-size: 15px; border-right: 1px solid var(--line2); }
.hbtn:last-child { border-right: 0; }
.hbtn:hover { background: var(--panel); color: var(--text); }
.hbtn svg { width: 18px; height: 18px; }
.hbtn.primary { background: var(--accent); color: var(--accent-ink); }
.hbtn.primary:hover { background: #5ce0d3; color: var(--accent-ink); }

/* ---------------------------------------------------------------- khung API */
.api { padding: 56px 0; }
.panel { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); overflow: hidden; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
/* tabs like a code editor's: a darker strip, the open tab raised into the panel under a glowing edge, monospace
   labels with the HTTP method of each call, so they never look like the round example chips below */
.ptabs { display: flex; align-items: flex-end; gap: 4px; padding: 10px 10px 0; background: #121519;
  border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.ptabs::-webkit-scrollbar { display: none; }
.ptab {
  position: relative; display: inline-flex; align-items: center; gap: 8px; margin-bottom: -1px; padding: 9px 14px 11px;
  border: 1px solid transparent; border-bottom: 0; border-radius: 8px 8px 0 0; background: none; color: var(--muted);
  font: 600 12.5px var(--mono); letter-spacing: .2px; cursor: pointer; white-space: nowrap;
}
.ptab:hover { color: var(--text); background: rgba(255, 255, 255, .03); }
.ptab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ptab[aria-selected="true"] { color: var(--text); background: var(--panel); border-color: var(--line); }
.ptab[aria-selected="true"]::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px; border-radius: 8px 8px 0 0;
  background: linear-gradient(90deg, #3ccfc0, #6ee7f9, #a5b4fc); box-shadow: 0 0 12px rgba(60, 207, 192, .55);
}
/* each call's method, coloured as API docs do; the Demo tab has a live dot */
.pm { font: 700 10px var(--mono); letter-spacing: .4px; line-height: 1.3; padding: 2px 5px; border-radius: 4px;
  color: #3ccfc0; background: rgba(60, 207, 192, .1); border: 1px solid rgba(60, 207, 192, .35); }
.pm.put { color: #e6c07b; background: rgba(230, 192, 123, .1); border-color: rgba(230, 192, 123, .35); }
.pm.del { color: #ef8a8a; background: rgba(239, 138, 138, .1); border-color: rgba(239, 138, 138, .35); }
.ptab:not([aria-selected="true"]) .pm { opacity: .7; }
.plive { width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px rgba(60, 207, 192, .15), 0 0 10px rgba(60, 207, 192, .8); animation: plive 2s ease-in-out infinite; }
@keyframes plive { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .plive { animation: none; } }
.ptabs .pkey { align-self: center; margin-left: auto; color: var(--muted); font-size: 13px; padding: 0 6px; white-space: nowrap; }
.ptabs .pkey:hover { color: var(--accent); }
.pbody { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); min-height: 360px; }
.pdesc { padding: 22px; border-right: 1px solid var(--line); }
.pdesc h3 { margin: 0 0 6px; font-size: 16px; }
.pdesc p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.params { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.params li { padding: 10px 0; border-top: 1px solid var(--line); }
.params code { font: 600 12px var(--mono); color: var(--accent); background: rgba(60, 207, 192, .08); padding: 1px 6px; border-radius: 4px; }
.params span { display: block; color: var(--muted); margin-top: 4px; }
.pcode { display: flex; flex-direction: column; min-width: 0; }

/* tab Demo: ô tìm + danh sách kết quả tô sáng (minh họa) */
.pbody[hidden], .pdemo[hidden] { display: none; }
.pdemo { padding: 20px 22px 18px; min-height: 360px; }
.dchips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.dtry { color: var(--muted); font-size: 13px; margin-right: 2px; }
.dsearch {
  display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 18px; border: 1px solid var(--line2); border-radius: 25px;
  background: var(--bg2); box-shadow: 0 0 0 4px rgba(60, 207, 192, .07), 0 10px 30px rgba(0, 0, 0, .25);
}
.dicon { flex: none; position: relative; width: 14px; height: 14px; border: 2px solid var(--muted); border-radius: 50%; margin-right: 2px; }
.dicon::after { content: ""; position: absolute; right: -5px; bottom: -6px; width: 2px; height: 7px; background: var(--muted); border-radius: 1px; transform: rotate(-45deg); }
.dq { min-width: 0; font-size: 16px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dcaret { flex: none; width: 2px; height: 20px; margin-left: -10px; background: var(--accent); animation: dblink 1s steps(1) infinite; }
.dcount { margin-left: auto; color: var(--dim); font-size: 12px; white-space: nowrap; }
@keyframes dblink { 50% { opacity: 0; } }
.dhint { margin: 10px 4px 0; color: var(--muted); font-size: 13px; }
/* kết quả dạng bảng (Excel) */
.dtwrap { margin-top: 12px; border: 1px solid var(--line); border-radius: 8px; overflow-x: auto; background: rgba(255, 255, 255, .015); }
.dtmeta { padding: 8px 14px; font-size: 12px; color: var(--dim); border-bottom: 1px solid var(--line); }
.dtable { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.dtable th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 9px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.dtable td { padding: 11px 14px; border-bottom: 1px solid var(--line); color: var(--soft); white-space: nowrap; }
.dtable tbody tr:last-child td { border-bottom: 0; }
.dtable .num { color: var(--dim); font: 12px var(--mono); }
.dtable .dsc { text-align: right; }
.dtwrap.anim tbody tr { animation: dfade .35s ease both; }
.dlist { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.dres { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; background: rgba(255, 255, 255, .015); }
.dlist.anim .dres { animation: dfade .35s ease both; }
@keyframes dfade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.dhead { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.dhead b { font-size: 15px; }
.dmeta { color: var(--dim); font-size: 12px; }
.dscore { margin-left: auto; font: 600 12px var(--mono); color: var(--accent); }
.dsnip { margin: 6px 0 0; color: var(--soft); font-size: 14.5px; line-height: 1.65; }
mark.hl { background: rgba(60, 207, 192, .2); color: var(--text); border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 rgba(60, 207, 192, .8); }
mark.hl.fz { background: rgba(230, 192, 123, .16); box-shadow: inset 0 -2px 0 rgba(230, 192, 123, .85); cursor: help; }
/* the words of the query standing close together in the text (other words may stand between them) */
.dphr { border: 1px solid rgba(230, 192, 123, .7); border-radius: 6px; padding: 1px 4px; background: rgba(230, 192, 123, .06);
  -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* keep the phrase in one piece where the line is wide enough; phones may still wrap it */
@media (min-width: 960px) { .dphr { white-space: nowrap; } }
/* each word typed -> the word found */
.dmap { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 4px 0; }
.dmc { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid rgba(60, 207, 192, .45);
  border-radius: 6px; font: 600 12.5px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--muted); }
.dmc b { color: var(--text); font-weight: 600; }
.dmc i { font-style: normal; color: var(--dim); }
.dmc.fz { border-color: rgba(230, 192, 123, .55); }
.dfoot { display: flex; flex-wrap: wrap; gap: 8px 16px; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--dim); }
.dleg mark { font-size: 12px; cursor: default; }
.pcode .pbar { display: flex; align-items: center; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.copy { background: none; border: 1px solid var(--line2); color: var(--muted); border-radius: 4px; font: 600 12px var(--font); padding: 3px 9px; cursor: pointer; }
.copy:hover { color: var(--text); }
pre.code { margin: 0; padding: 16px; font: 13px/1.6 var(--mono); color: #cfd6de; overflow-x: auto; white-space: pre; }
pre.code .k { color: var(--accent); }
pre.code .s { color: #e6c07b; }
pre.code .c { color: var(--dim); }
pre.code.resp { border-top: 1px solid var(--line); background: var(--bg2); flex: 1 0 auto; }
.pfoot { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.pfoot b { color: var(--text); font-family: var(--mono); }
.pfoot a { margin-left: auto; color: var(--accent); font-weight: 600; }
.preview { font: 600 11px var(--font); color: var(--accent-ink); background: var(--accent); border-radius: 3px; padding: 1px 6px; margin-left: 8px; }

/* ---------------------------------------------------------------- thẻ ưu điểm */
.feats { padding: 64px 0 56px; text-align: center; }
.feats h2, .bench h2, .deploy h2 { margin: 0 0 12px; font-family: var(--font-head); font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.6px; }
.lead { max-width: 700px; margin: 0 auto; color: var(--soft); font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin-top: 44px; text-align: left; }
.card { padding: 4px 4px 0; }
.card .ic { width: 64px; height: 64px; margin-bottom: 18px; color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 21px; font-weight: 600; display: flex; align-items: center; gap: 10px; }
.card p { margin: 0; color: var(--soft); font-size: 17px; line-height: 1.6; }

/* ---------------------------------------------------------------- biểu đồ so sánh */
.bench { padding: 64px 0 56px; }
.bench-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 24px; align-items: end; margin-bottom: 26px; }
.bench-head .lead { margin: 0; max-width: 700px; }
/* the pricing line in one row on a desktop; on a phone it wraps in even lines */
.pricing .lead { max-width: none; text-wrap: balance; }
.bench-ctl { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: flex-end; }
.mtabs { display: inline-flex; border: 1px solid var(--line2); border-radius: 18px; padding: 2px; }
.mtab { background: none; border: 0; color: var(--muted); font: 600 12px var(--font); padding: 6px 12px; border-radius: 16px; cursor: pointer; white-space: nowrap; }
.mtab[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.mtab:hover:not([aria-pressed="true"]) { color: var(--text); }
.arrows { display: flex; gap: 8px; }
.arrow {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line2); background: none; color: var(--text);
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.arrow:disabled { opacity: .35; cursor: default; }
/* chip ngôn ngữ + thanh chỉ số / mũi tên chung một dòng chảy: thanh điều hướng nằm cuối hàng chip cuối, sát biểu đồ */
.bench-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -6px 0 16px; }
.lchips { display: contents; }
.bench-bar .bench-ctl { margin-left: auto; padding-left: 16px; }
.lchip {
  background: none; border: 1px solid var(--line2); color: var(--muted); border-radius: 16px;
  font: 600 13px var(--font); padding: 6px 13px; cursor: pointer; white-space: nowrap;
}
.lchip:hover:not([aria-pressed="true"]) { color: var(--text); border-color: var(--muted); }
.lchip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* nút trước / sau hai bên khung biểu đồ (nằm vắt qua mép khung) — báo còn trang khác; ẩn ở trang đầu / cuối */
.slider-wrap { position: relative; }
.side {
  position: absolute; top: 50%; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line2); background: var(--bg2); color: var(--text); font: 400 26px/1 var(--font);
  display: grid; place-items: center; padding: 0 0 3px; cursor: pointer; box-shadow: 0 6px 18px rgba(0, 0, 0, .45);
  transition: opacity .2s, border-color .2s, color .2s;
}
.side.prev { left: 0; transform: translate(-50%, -50%); }
.side.next { right: 0; transform: translate(50%, -50%); }
.side:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.side:disabled { opacity: 0; pointer-events: none; }
.slider {
  display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
  padding-bottom: 6px; scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }
.slide {
  flex: 0 0 100%; scroll-snap-align: start; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); padding: 22px 22px 16px; min-width: 0;
}
.slide h3 { margin: 0; font-size: 20px; }
.slide .sub { margin: 4px 0 56px; color: var(--soft); font-size: 15px; }
.chart { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.yax { position: relative; height: 240px; font-size: 11px; color: var(--dim); }
.yax span { position: absolute; right: 0; transform: translateY(-50%); }
.plot { position: relative; height: 240px; border-bottom: 1px solid var(--line2); }
.plot .grid { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line); }
.groups { position: absolute; inset: 0; display: grid; gap: 4%; padding: 0 2%; }
.grp { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 4%; height: 100%; }
.bar { position: relative; flex: 1 1 0; max-width: 34px; min-width: 6px; border-radius: 3px 3px 0 0; background: var(--bar1); transition: height .5s ease; }
.bar.s0 { background: var(--bar0); } .bar.s1 { background: var(--bar1); } .bar.s2 { background: var(--bar2); }
.bar.s3 { background: var(--bar3); } .bar.s4 { background: var(--bar4); }
.bar.nep { background: linear-gradient(180deg, #5ee3d6, var(--accent2)); }
.bar.nep2 { background: rgba(60, 207, 192, .22); box-shadow: inset 0 0 0 1px var(--accent); }
.bar.nep2 .v { color: var(--accent); }
.bar .v { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -3px); font-size: 11px; color: var(--muted); white-space: nowrap; }
.bar.nep .v { color: var(--accent); font-weight: 700; font-size: 12px; }
/* nhãn từng cột: chữ xiên dưới trục (đuôi chữ chạm tâm cột); --lbl = số ký tự nhãn dài nhất -> chừa chỗ dưới biểu đồ */
.bar .bl {
  position: absolute; top: 100%; right: 50%; margin-top: 8px; transform-origin: 100% 50%; transform: rotate(-40deg);
  font-size: 11px; line-height: 1; color: var(--muted); white-space: nowrap; pointer-events: none;
}
.bar.nep .bl, .bar.nep2 .bl { color: var(--accent); font-weight: 700; }
.chart.labeled { margin-bottom: calc(var(--lbl, 10) * 4.3px + 16px); }
.delta {
  position: absolute; left: 50%; bottom: 100%; margin-bottom: 31px; transform: translateX(-50%); z-index: 1;
  font: 700 12px var(--font); color: var(--accent-ink); background: var(--accent); border-radius: 10px; padding: 1px 8px; white-space: nowrap;
}
.delta.neg { background: var(--line2); color: var(--text); }
.glabels { display: grid; gap: 4%; padding: 8px 2% 0; margin-left: 42px; }
.glabels div { text-align: center; font-size: 13px; color: var(--text); line-height: 1.3; }
.glabels small { display: block; color: var(--dim); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 18px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; }
.legend i { width: 11px; height: 11px; border-radius: 2px; display: inline-block; }
.legend .delta-key { font: 700 11px var(--font); color: var(--accent-ink); background: var(--accent); border-radius: 8px; padding: 0 6px; }
.params small { color: var(--dim); font-size: 11px; }
/* API · quick start: the three calls as steps (add -> search -> delete); the one picked shows on the right */
.psteps { list-style: none; margin: 0 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: step; }
.psteps li { counter-increment: step; }
.pstep { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: transparent; color: var(--soft); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.pstep::before { content: counter(step); font: 600 12px var(--mono); color: var(--dim); min-width: 12px; }
.pstep:hover { border-color: var(--line2); color: var(--text); }
.pstep[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: rgba(60, 207, 192, .06); }
.pstep:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pdesc .pmore { margin: 16px 0 0; font-size: 13px; }
.pmore a { color: var(--accent); font-weight: 600; }
.src { margin: 12px 0 0; font-size: 12px; color: var(--dim); }
.dots { display: flex; justify-content: center; gap: 8px; margin-top: 18px; }
.dot { width: 22px; height: 4px; border-radius: 2px; border: 0; background: var(--line2); cursor: pointer; padding: 0; }
.dot[aria-current="true"] { background: var(--accent); width: 34px; }
.bench-note { text-align: center; color: var(--dim); font-size: 12px; margin-top: 14px; }

/* ---------------------------------------------------------------- triển khai */
.deploy { padding: 56px 0 64px; }
.deploy .cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.dcard { border: 1px solid var(--line); border-radius: 8px; padding: 22px; background: var(--panel); }
.dcard h3 { margin: 0 0 6px; font-size: 18px; }
.dcard p { margin: 0 0 14px; color: var(--soft); font-size: 16px; }
.dcard a { color: var(--accent); font-weight: 600; font-size: 14px; }

/* ---------------------------------------------------------------- bảng giá */
.pricing { padding: 64px 0 64px; text-align: center; position: relative; }
.pricing h2 { margin: 0 0 12px; font-family: var(--font-head); font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.6px; }
.anchor { position: absolute; top: 0; }
.plans { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: 36px; text-align: left; }
.bench-sum { margin: 12px 0 0; max-width: 700px; color: var(--accent); font-size: 15px; font-weight: 600; }
/* Questions (the same text as the FAQPage JSON-LD) */
.faq { padding: 64px 0 72px; }
.faq h2 { margin: 0 0 28px; text-align: center; font-family: var(--font-head); font-size: clamp(28px, 4vw, 40px); font-weight: 700; letter-spacing: -.6px; }
.faq-list { max-width: 820px; margin: 0 auto; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); padding: 18px 4px; }
.faq summary { cursor: pointer; font-size: 17px; font-weight: 600; color: var(--text); list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-weight: 700; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 12px 0 0; color: var(--soft); font-size: 16px; line-height: 1.6; }
.plan { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); overflow: hidden; }
.plan .pl-tag { padding: 22px 22px 0; font-size: 12px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.pl-big { padding: 16px 22px 0; font-family: var(--font-head); line-height: 1.02; }
.pl-num { display: block; font-size: 56px; font-weight: 700; letter-spacing: -1.5px; color: var(--text); }
.pl-unit { display: block; margin-top: 4px; font-size: 21px; font-weight: 600; color: var(--soft); }
/* the periods under a price: a year and what it saves, a dedicated size's shortest period (plain, even on the highlighted card) */
.pl-term { display: block; min-height: 1.4em; margin-top: 8px; font-family: var(--font); font-size: 13.5px; font-weight: 500;
  letter-spacing: 0; line-height: 1.4; color: var(--muted); }
/* a word instead of a number (Dedicated): smaller, standing on the numbers' baseline so the cards of a row line up */
.pl-num.pl-word { font-size: 32px; letter-spacing: -.6px; padding-top: 24px; }
.pl-feat { list-style: none; margin: 18px 0 0; padding: 0 22px 22px; flex: 1; }
.pl-feat li { position: relative; padding: 6px 0 6px 24px; color: var(--soft); font-size: 14.5px; line-height: 1.45; }
.pl-feat li::before { content: ""; position: absolute; left: 3px; top: 11px; width: 10px; height: 5px; border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent); transform: rotate(-45deg); }
.pl-foot { display: flex; flex-direction: column; align-items: stretch; gap: 14px; padding: 18px 22px 20px; border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); }
.pl-foot b { display: block; font-family: var(--font-head); font-size: 24px; color: var(--text); white-space: nowrap; }
.pl-foot span { display: block; margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.pl-btn { padding: 10px 14px; border: 1px solid var(--line2); border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--text);
  text-align: center; white-space: nowrap; }
.pl-btn:hover { border-color: var(--accent); color: var(--accent); }
/* Dedicated: the size switch S | M | L under the big number (so the numbers of a row stay on one line) */
.pl-sizes { display: flex; gap: 6px; padding: 14px 22px 0; }
.pl-size { flex: 1; padding: 6px 0; border: 1px solid var(--line2); border-radius: 6px; background: transparent; color: var(--soft);
  font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
.pl-size:hover { border-color: var(--accent); color: var(--text); }
.pl-size.on { border-color: var(--accent); color: var(--accent); background: rgba(60, 207, 192, .08); }
.pl-size:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pl-alt { font-size: 12.5px; color: var(--muted); text-align: center; }
.pl-alt:hover { color: var(--accent); }
.pl-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
.pl-note a { color: var(--soft); text-decoration: underline; }
.plan.hl { border-color: rgba(60, 207, 192, .55); box-shadow: 0 0 0 1px rgba(60, 207, 192, .22), 0 24px 60px rgba(0, 0, 0, .35); }
.plan.hl .pl-num, .plan.hl .pl-unit { background: linear-gradient(90deg, #3ccfc0, #8ff0e6); -webkit-background-clip: text; background-clip: text; color: transparent; }
.plan.hl .pl-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.plan.hl .pl-btn:hover { background: #5ce0d3; color: var(--accent-ink); }
.pl-note { max-width: 860px; margin: 22px auto 0; color: var(--muted); font-size: 14px; }
.pl-note + .pl-note { margin-top: 8px; }
@media (max-width: 1100px) { .plans { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .plans { grid-template-columns: minmax(0, 1fr); } .pl-num { font-size: 48px; } .pl-num.pl-word { padding-top: 0; } .pricing { padding: 48px 0 56px; } }

/* ---------------------------------------------------------------- chân trang */
.foot { border-top: 1px solid var(--line); padding: 44px 0 30px; font-size: 14px; color: var(--muted); }
.fcols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; }
.fcols h4 { margin: 0 0 12px; font-size: 12px; letter-spacing: .8px; text-transform: uppercase; color: var(--text); font-weight: 600; }
.fcols a { display: block; padding: 4px 0; }
.fcols p { margin: 10px 0 0; max-width: 280px; }
.copyr { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--dim); display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- trang chữ (privacy / terms / 404) */
.doc { max-width: 780px; margin: 0 auto; padding: 56px 16px 80px; }
.doc h1 { font-family: var(--font-head); font-size: 34px; margin: 0 0 6px; }
.doc .upd { color: var(--dim); font-size: 13px; margin-bottom: 30px; }
.doc h2 { font-family: var(--font-head); font-size: 20px; margin: 34px 0 10px; }
.doc p, .doc li { color: #c9d0d7; }
.doc a { color: var(--accent); }
/* docs.html (the API reference, built by make_docs.py): code, sub-headings, the line under the title */
.doc h3 { font-family: var(--font-head); font-size: 16px; margin: 26px 0 8px; }
.doc code { font-family: var(--mono); font-size: .9em; background: rgba(255, 255, 255, .06); padding: 1px 5px; border-radius: 4px;
  overflow-wrap: anywhere; }
.doc pre { margin: 12px 0 16px; padding: 12px 14px; background: #0d1014; border: 1px solid var(--line); border-radius: 8px;
  overflow-x: auto; font: 13px/1.55 var(--mono); color: #d7dde3; }
.doc pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; }
.doc .lead2 { color: var(--muted); margin: 0 0 24px; }

/* ---------------------------------------------------------------- màn hình hẹp */
@media (max-width: 860px) {
  .nav { display: none; }
  .pbody { grid-template-columns: minmax(0, 1fr); }
  .pdesc { border-right: 0; border-bottom: 1px solid var(--line); }
  .cards { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .deploy .cols { grid-template-columns: minmax(0, 1fr); }
  .fcols { grid-template-columns: 1fr 1fr; }
  .bench-head { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1200px) {  /* lề ngoài khung < 22px: kéo nút vào trong để không bị cắt */
  .side.prev { left: 6px; }
  .side.next { right: 6px; }
}
@media (max-width: 520px) {
  .side { display: none; }  /* điện thoại: vuốt + mũi tên trên */
  .hero { padding: 56px 0 52px; }
  .hero p { font-size: 16px; }
  .lead { font-size: 16.5px; }
  .card p { font-size: 16px; }
  .lchips { display: flex; gap: 8px; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .bench-bar .bench-ctl { padding-left: 0; }
  .lchips::-webkit-scrollbar { display: none; }
  .hbtn { padding: 12px 14px; font-size: 14px; }
  .hcontact { display: none; }
  .hbtn:nth-last-child(2) { border-right: 0; }
  /* the G alone, as a round button; the words stay for screen readers */
  .google { width: 36px; padding: 0; justify-content: center; }
  .google span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .slide { padding: 16px 12px 12px; }
  .bar .v { display: none; }
  .bar.nep .v { display: block; font-size: 10px; }
  .bar .bl { font-size: 9px; margin-top: 5px; transform: rotate(-90deg); }
  .chart.labeled { margin-bottom: calc(var(--lbl, 10) * 5.2px + 10px); }
  .glabels div { font-size: 11px; }
  .chart { grid-template-columns: 26px minmax(0, 1fr); }
  .glabels { margin-left: 34px; }
  .yax, .plot { height: 200px; }
}
@media (prefers-reduced-motion: reduce) {
  .dcaret, .dlist.anim .dres, .dtwrap.anim tbody tr { animation: none; }
  .hero::before, .hero::after { animation: none; }
  html { scroll-behavior: auto; }
  .slider { scroll-behavior: auto; }
  .bar { transition: none; }
}
