/* Shared design system for the website, docs and panel (RTL first). */
@font-face { font-family: "Vazirmatn"; src: url("/static/fonts/vazirmatn.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #ffffff; --bg-soft: #f6f7fb; --bg-sunk: #eef0f6; --card: #ffffff;
  --fg: #0f1222; --fg-2: #2b3047; --muted: #5d6380; --line: #e5e7ef; --line-2: #d6d9e5;
  --brand: #5546ff; --brand-hover: #4434f0; --brand-soft: #eeecff; --brand-2: #0fb5a3; --brand-ink: #ffffff;
  --ok: #0e9f57; --ok-soft: #e3f7ec; --warn: #c27606; --warn-soft: #fdf3e1; --bad: #d92d2d; --bad-soft: #fdeaea;
  --code-bg: #0c0f1f; --code-fg: #e4e6f5; --code-line: #1f2340; --code-key: #9b8cff; --code-str: #5fe0c9; --code-num: #ffb86b; --code-com: #6b7196;
  --hero-bg: #0a0c1a; --hero-fg: #f3f4fb; --hero-muted: #a6abc6;
  --shadow: 0 1px 2px rgba(16, 20, 45, .06), 0 4px 16px rgba(16, 20, 45, .06);
  --shadow-lg: 0 12px 40px rgba(16, 20, 45, .14);
  --r: 12px; --r-lg: 18px;
  --font: "Vazirmatn", Tahoma, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0d18; --bg-soft: #10132a; --bg-sunk: #0d1022; --card: #12152b;
    --fg: #eceef9; --fg-2: #cfd3e6; --muted: #9399b5; --line: #232741; --line-2: #2e3352;
    --brand: #7f72ff; --brand-hover: #9488ff; --brand-soft: #1f1d45; --brand-2: #2fd3c0;
    --ok: #34d07f; --ok-soft: #10301f; --warn: #f0a640; --warn-soft: #332410; --bad: #f26b6b; --bad-soft: #3a1717;
    --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0d18; --bg-soft: #10132a; --bg-sunk: #0d1022; --card: #12152b;
  --fg: #eceef9; --fg-2: #cfd3e6; --muted: #9399b5; --line: #232741; --line-2: #2e3352;
  --brand: #7f72ff; --brand-hover: #9488ff; --brand-soft: #1f1d45; --brand-2: #2fd3c0;
  --ok: #34d07f; --ok-soft: #10301f; --warn: #f0a640; --warn-soft: #332410; --bad: #f26b6b; --bad-soft: #3a1717;
  --shadow: 0 1px 2px rgba(0,0,0,.4); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15.5px/1.75 var(--font); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .5em; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
code, pre, kbd, .mono { font-family: var(--mono); font-size: .88em; }
:not(pre) > code { background: var(--bg-sunk); border: 1px solid var(--line); padding: .05em .4em; border-radius: 6px; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.center { text-align: center; }
.hide { display: none !important; }
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 20px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .g3, .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .g2, .g3, .g4 { grid-template-columns: minmax(0, 1fr); } body { font-size: 15px; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 18px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--fg); font: 600 14.5px var(--font); cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--bg-soft); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-hover); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 12px; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* cards, badges */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.card h3 { font-size: 17px; }
.card-hd { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-hd h3 { margin: 0; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: var(--bg-sunk); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.badge-brand { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* forms */
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13.5px; font-weight: 600; color: var(--fg-2); margin-bottom: 6px; }
.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-2);
  background: var(--bg); color: var(--fg); font: 15px var(--font); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 140px; padding: 10px 12px; line-height: 1.7; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
.input[dir="ltr"] { text-align: left; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; margin-left: 18px; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-err { color: var(--bad); font-size: 14px; min-height: 1.4em; margin: 4px 0 10px; }

/* tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12.5px; background: var(--bg-soft); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: left; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { padding: 36px 16px; text-align: center; color: var(--muted); }

/* code window */
.code { background: var(--code-bg); color: var(--code-fg); border-radius: var(--r); border: 1px solid var(--code-line); overflow: hidden; direction: ltr; text-align: left; }
.code-hd { display: flex; align-items: center; gap: 4px; padding: 8px 10px; border-bottom: 1px solid var(--code-line); background: rgba(255,255,255,.02); }
.code-hd .tab { background: none; border: 0; color: #8d93b6; font: 600 12.5px var(--font); padding: 5px 10px; border-radius: 7px; cursor: pointer; }
.code-hd .tab.on, .code-hd .tab:hover { color: #fff; background: rgba(255,255,255,.08); }
.code-hd .copy { margin-left: auto; background: none; border: 1px solid var(--code-line); color: #a7acd0; font: 12px var(--font); border-radius: 7px; padding: 3px 10px; cursor: pointer; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.7; white-space: pre; }
.code .k { color: var(--code-key); } .code .s { color: var(--code-str); } .code .n { color: var(--code-num); } .code .c { color: var(--code-com); }
.code .fa { font-family: var(--font); direction: rtl; unicode-bidi: isolate; }

/* toast + modal */
#toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow-lg); animation: up .2s ease; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.modal-bg { position: fixed; inset: 0; background: rgba(8, 10, 25, .55); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 16px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); width: 100%; max-width: 480px; padding: 24px; box-shadow: var(--shadow-lg); max-height: 90vh; overflow: auto; }
.modal h3 { font-size: 18px; }
.keybox { display: flex; gap: 8px; align-items: center; background: var(--bg-sunk); border: 1px dashed var(--line-2); border-radius: 10px; padding: 10px 12px; direction: ltr; font-family: var(--mono); font-size: 13.5px; word-break: break-all; }
.notice { border-radius: var(--r); padding: 12px 16px; font-size: 14px; border: 1px solid transparent; }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.notice-ok { background: var(--ok-soft); color: var(--ok); }
.notice-bad { background: var(--bad-soft); color: var(--bad); }
.notice-info { background: var(--brand-soft); color: var(--brand); }

/* ---------- website ---------- */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: saturate(160%) blur(12px); background: rgba(10, 12, 26, .88); border-bottom: 1px solid rgba(255,255,255,.06); }
.nav .wrap { display: flex; align-items: center; gap: 22px; height: 64px; }
.nav a.link { color: var(--hero-muted); font-size: 14.5px; font-weight: 500; }
.nav a.link:hover { color: #fff; text-decoration: none; }
.nav .btn { height: 36px; font-size: 14px; }
.nav .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: rgba(255,255,255,.18); }
.nav .btn:not(.btn-primary):hover { background: rgba(255,255,255,.08); }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; color: inherit; letter-spacing: -.02em; text-decoration: none !important; direction: ltr; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); display: grid; place-items: center; color: #fff; }
.nav .logo { color: #fff; }
.nav-links { display: flex; gap: 22px; }
@media (max-width: 820px) { .nav-links { display: none; } }

.hero { background: var(--hero-bg); color: var(--hero-fg); position: relative; overflow: hidden; padding: 84px 0 96px; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 820px; height: 820px; background: radial-gradient(closest-side, rgba(85,70,255,.45), transparent 70%); pointer-events: none; }
.hero::after { content: ""; position: absolute; inset: auto auto -50% -15%; width: 760px; height: 760px; background: radial-gradient(closest-side, rgba(15,181,163,.28), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 960px) { .hero .wrap { grid-template-columns: minmax(0, 1fr); } .hero { padding: 56px 0 64px; } }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 850; letter-spacing: -.025em; margin-bottom: 18px; }
.hero h1 .grad { background: linear-gradient(90deg, #a99fff, #5fe0c9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--hero-muted); max-width: 560px; margin-bottom: 28px; }
.hero .pill { display: inline-flex; gap: 8px; align-items: center; font-size: 13px; color: #cfd2ea; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.05); border-radius: 999px; padding: 4px 14px 4px 6px; margin-bottom: 22px; }
.hero .pill b { background: var(--brand-2); color: #04211d; border-radius: 999px; padding: 0 9px; font-size: 12px; }
.hero .btn:not(.btn-primary) { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.16); }
.hero .code { box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.hero-note { margin-top: 18px; font-size: 13.5px; color: var(--hero-muted); }

.stats { background: var(--hero-bg); color: var(--hero-fg); border-top: 1px solid rgba(255,255,255,.06); padding: 26px 0 34px; }
.stats .grid > div { text-align: center; }
.stats b { display: block; font-size: 30px; font-weight: 800; background: linear-gradient(90deg, #fff, #b9b2ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stats span { color: var(--hero-muted); font-size: 14px; }

section.sec { padding: 88px 0; }
section.sec.soft { background: var(--bg-soft); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sec-hd { max-width: 680px; margin: 0 auto 44px; text-align: center; }
.sec-hd .eyebrow { color: var(--brand); font-weight: 700; font-size: 13.5px; letter-spacing: .02em; margin-bottom: 8px; display: block; }
.sec-hd h2 { font-size: clamp(26px, 3.2vw, 36px); font-weight: 800; }
.sec-hd p { color: var(--muted); font-size: 17px; }

.product { padding: 30px; position: relative; overflow: hidden; }
.product .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 16px; }
.product h3 { font-size: 22px; }
.product ul { list-style: none; padding: 0; margin: 16px 0 22px; }
.product li { padding: 6px 28px 6px 0; position: relative; color: var(--fg-2); }
.product li::before { content: ""; position: absolute; right: 0; top: 13px; width: 16px; height: 16px; border-radius: 50%; background: var(--ok-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230e9f57' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat; }
.product .price-tag { font-size: 14px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; }
.product .price-tag b { color: var(--fg); font-size: 18px; }

.feat { padding: 24px; }
.feat .ic { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--bg-sunk); color: var(--brand); margin-bottom: 14px; border: 1px solid var(--line); }
.feat h3 { font-size: 16.5px; margin-bottom: 6px; }
.feat p { color: var(--muted); font-size: 14.5px; margin: 0; }

.steps { counter-reset: s; }
.step { padding: 24px; position: relative; }
.step::before { counter-increment: s; content: counter(s, persian); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 14px; }
.step h3 { font-size: 16.5px; }
.step p { color: var(--muted); font-size: 14.5px; margin: 0; }

.plan { padding: 28px; display: flex; flex-direction: column; }
.plan.hot { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg); }
.plan .amt { font-size: 30px; font-weight: 800; margin: 6px 0 2px; }
.plan .amt small { font-size: 14px; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 14px 0 22px; color: var(--fg-2); font-size: 14.5px; }
.plan li { padding: 4px 0; }
.plan .btn { margin-top: auto; }
.rates { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.rate { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 22px; text-align: center; min-width: 230px; }
.rate b { display: block; font-size: 22px; }
.rate span { color: var(--muted); font-size: 13.5px; }

.faq details { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); padding: 0 20px; margin-bottom: 10px; }
.faq summary { cursor: pointer; padding: 16px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: "+"; color: var(--muted); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { color: var(--muted); margin: 0 0 16px; }

.cta { background: linear-gradient(120deg, #2a1fd6, #5546ff 45%, #0fb5a3); color: #fff; border-radius: 24px; padding: 54px 36px; text-align: center; }
.cta h2 { font-size: clamp(24px, 3vw, 34px); }
.cta p { color: rgba(255,255,255,.85); }
.cta .btn-primary { background: #fff; color: #2a1fd6; border-color: #fff; }

footer.foot { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 14px; margin-top: 70px; }
footer.foot .wrap { display: flex; gap: 20px; flex-wrap: wrap; align-items: center; }
footer.foot a { color: var(--muted); }

/* ---------- docs ---------- */
.docs { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px; padding-top: 32px; padding-bottom: 60px; }
.docs aside { position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 100px); overflow: auto; }
.docs aside h4 { font-size: 12px; color: var(--muted); letter-spacing: .04em; margin: 18px 0 6px; }
.docs aside a { display: block; padding: 5px 10px; border-radius: 8px; color: var(--fg-2); font-size: 14.5px; }
.docs aside a:hover, .docs aside a.on { background: var(--bg-sunk); text-decoration: none; color: var(--brand); }
.docs article h1 { font-size: 34px; font-weight: 800; }
.docs article h2 { font-size: 24px; margin-top: 52px; padding-top: 10px; border-top: 1px solid var(--line); scroll-margin-top: 80px; }
.docs article h3 { font-size: 17px; margin-top: 28px; }
.docs article .code { margin: 14px 0 20px; }
.docs article table.t { margin: 12px 0 20px; }
.endpoint { display: inline-flex; align-items: center; gap: 10px; direction: ltr; font-family: var(--mono); font-size: 14px; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; margin: 4px 0 12px; }
.endpoint .m { background: var(--ok); color: #fff; border-radius: 5px; padding: 0 7px; font-size: 12px; font-weight: 700; }
@media (max-width: 860px) { .docs { grid-template-columns: minmax(0, 1fr); } .docs aside { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 12px; } }
.page-nav { background: var(--bg); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.page-nav .wrap { display: flex; align-items: center; gap: 18px; height: 62px; }
.page-nav a.link { color: var(--muted); font-size: 14.5px; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: var(--hero-bg); color: var(--hero-fg); padding: 48px; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.auth-side::before { content: ""; position: absolute; width: 640px; height: 640px; left: -200px; bottom: -260px; background: radial-gradient(closest-side, rgba(85,70,255,.5), transparent 70%); }
.auth-side > * { position: relative; }
.auth-side h2 { font-size: 30px; margin-top: auto; }
.auth-side p { color: var(--hero-muted); }
.auth-side ul { padding: 0; list-style: none; color: #d6d8ee; }
.auth-side li { padding: 6px 0; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 26px; font-weight: 800; }
@media (max-width: 900px) { .auth { grid-template-columns: minmax(0, 1fr); } .auth-side { display: none; } }

/* ---------- panel ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--bg-soft); border-left: 1px solid var(--line); padding: 18px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.side .logo { padding: 4px 8px 18px; }
.side a.nav-i { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--fg-2); font-weight: 500; font-size: 14.5px; text-decoration: none; }
.side a.nav-i svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.side a.nav-i:hover { background: var(--bg-sunk); }
.side a.nav-i.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); font-weight: 600; }
.side a.nav-i.on svg { color: var(--brand); }
.side .grp { font-size: 11.5px; color: var(--muted); font-weight: 600; padding: 16px 12px 4px; letter-spacing: .03em; }
.side .bal { margin-top: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.side .bal b { display: block; font-size: 20px; margin: 2px 0 10px; }
.main { min-width: 0; }
.topbar { height: 62px; display: flex; align-items: center; gap: 12px; padding: 0 28px; border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar h2 { margin: 0; font-size: 18px; }
.content { padding: 28px; max-width: 1180px; }
.burger { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; right: 0; top: 0; bottom: 0; width: 270px; z-index: 40; transform: translateX(100%); transition: transform .2s; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .burger { display: inline-flex; }
  .content { padding: 18px 16px; }
  .topbar { padding: 0 16px; }
}
.kpi { padding: 18px 20px; }
.kpi .lbl { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 800; margin-top: 4px; letter-spacing: -.01em; }
.kpi .sub { color: var(--muted); font-size: 13px; }
.chart { width: 100%; height: 220px; display: block; }
.chart .bar-text { fill: var(--brand); } .chart .bar-stt { fill: var(--brand-2); }
.chart .axis { stroke: var(--line); } .chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-left: 6px; vertical-align: -1px; }
.seg { display: inline-flex; background: var(--bg-sunk); border: 1px solid var(--line); border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: none; color: var(--muted); font: 600 13px var(--font); padding: 5px 14px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.pkg { padding: 20px; cursor: pointer; transition: border-color .15s, box-shadow .15s; text-align: center; }
.pkg:hover { border-color: var(--brand); }
.pkg.sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.pkg .amt { font-size: 22px; font-weight: 800; }
.mark { background: color-mix(in srgb, var(--bad) 16%, transparent); border-bottom: 2px solid var(--bad); border-radius: 3px; cursor: help; }
.mark.fa { background: color-mix(in srgb, var(--brand) 16%, transparent); border-bottom-color: var(--brand); }
.checked-text { direction: ltr; text-align: left; line-height: 2.1; font-size: 16px; white-space: pre-wrap; padding: 16px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); }
.match { border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; background: var(--card); }
.match .msg { unicode-bidi: plaintext; }
.match .sugg { display: inline-block; direction: ltr; background: var(--ok-soft); color: var(--ok); border-radius: 6px; padding: 0 8px; margin: 4px 0 0 6px; font-family: var(--mono); font-size: 13px; }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r-lg); padding: 30px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--brand); color: var(--brand); }
.rec { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; cursor: pointer; display: inline-grid; place-items: center; box-shadow: 0 6px 20px color-mix(in srgb, var(--bad) 40%, transparent); }
.rec.on { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px color-mix(in srgb, var(--bad) 15%, transparent); } }
.skel { background: linear-gradient(90deg, var(--bg-sunk), var(--bg-soft), var(--bg-sunk)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; height: 18px; }
@keyframes sk { to { background-position: -200% 0; } }
@media (max-width: 620px) { .page-nav .link, .page-nav .badge, .page-nav .btn:not(.btn-primary) { display: none; } .nav .wrap { gap: 10px; } .nav .btn { padding: 0 12px; } }
@media (max-width: 620px) {
  #who { display: none; }
  .topbar h2 { white-space: nowrap; }
  .content .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .content .g4 .kpi { padding: 14px; }
  .content .g4 .kpi .val { font-size: 19px; }
}

/* audience switch in the site header */
.aud { display: inline-flex; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: 3px; }
.aud a { color: var(--hero-muted); font-size: 13.5px; font-weight: 600; padding: 4px 12px; border-radius: 7px; text-decoration: none !important; }
.aud a.on { background: rgba(255,255,255,.14); color: #fff; }
@media (max-width: 620px) { .aud a { padding: 3px 8px; font-size: 12.5px; } .nav .btn:not(.btn-primary) { display: none; } }

/* free-trial box in the learner hero */
.hero .try { background: var(--card); color: var(--fg); border-color: rgba(255,255,255,.1); box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.hero .try .btn:not(.btn-primary) { background: transparent; color: var(--muted); border-color: transparent; }
.try .checked-text { font-size: 15px; padding: 12px; }
.try-list { max-height: 260px; overflow: auto; }
.try-list .match { padding: 10px 12px; }
.kind-opt { display: block; border: 1px solid var(--line-2); border-radius: 12px; padding: 12px 14px; cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s; }
.kind-opt input { position: absolute; opacity: 0; }
.kind-opt b { display: block; font-size: 15px; }
.kind-opt span { color: var(--muted); font-size: 12.5px; }
.kind-opt:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); background: var(--brand-soft); }
.home-hero { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; background: linear-gradient(120deg, var(--brand-soft), var(--card) 60%); }
.tool-card { display: block; color: inherit; text-decoration: none !important; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--brand); transform: translateY(-2px); }
.tool-card .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 12px; }
.tool-card .ic svg { width: 22px; height: 22px; }
.hist { display: flex; gap: 10px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; }
.hist:hover { background: var(--bg-soft); }
.hist-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: left; font-size: 14px; }
.tip { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.question { font-size: 18px; line-height: 1.6; text-align: left; font-weight: 600; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; }
.stat { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; text-align: center; }
.stat span { display: block; color: var(--muted); font-size: 12.5px; }
.stat b { font-size: 18px; } .stat small { font-size: 11px; color: var(--muted); font-weight: 500; }
@media (max-width: 420px) {
  .nav .wrap { gap: 8px; padding: 0 12px; }
  .nav .logo { font-size: 15px; gap: 6px; }
  .nav .logo-mark { width: 26px; height: 26px; }
  .nav .btn { height: 32px; padding: 0 10px; font-size: 13px; }
}
.api-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, var(--brand-soft), var(--card) 65%); }
.wallet { background: linear-gradient(135deg, var(--brand-soft), var(--card)); }
.pkg .amt { font-size: 24px; }
.soon { margin-top: 18px; display: flex; gap: 16px; align-items: center; border-style: dashed; box-shadow: none; background: var(--bg-soft); }
.soon .ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.soon h3 { margin-bottom: 4px; } .soon p { margin: 0; }

/* ---------- apikit brand (2026-10-22): wordmark logo, indigo + teal from the logo squares,
   light-gray square pattern as the background of hero and soft sections ---------- */
:root { --pat-base: #f4f5f8; --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect x='1' y='1' width='5' height='5' rx='1.4' fill='%23e1e4ec'/%3E%3C/svg%3E"); --nav-bg: rgba(255, 255, 255, .9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --pat-base: #0d1020; --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect x='1' y='1' width='5' height='5' rx='1.4' fill='%231a1e34'/%3E%3C/svg%3E"); --nav-bg: rgba(11, 13, 24, .9); } }
:root[data-theme="dark"] { --pat-base: #0d1020; --pat-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28'%3E%3Crect x='1' y='1' width='5' height='5' rx='1.4' fill='%231a1e34'/%3E%3C/svg%3E"); --nav-bg: rgba(11, 13, 24, .9); }
/* light-gray grid of small squares (the logo's dots), one per 28px tile */
.pattern, .hero, .sec.soft, .auth-side, .home-hero, .api-hero {
  background-color: var(--pat-base); background-image: var(--pat-img); background-size: 28px 28px;
}
.logo { gap: 0; }
.logo .wm { height: 26px; width: auto; display: block; }
.side .logo .wm { height: 24px; }
.foot .logo .wm { height: 22px; }
.logo .wm-d { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo .wm-l { display: none; } :root:not([data-theme="light"]) .logo .wm-d { display: block; } }
:root[data-theme="dark"] .logo .wm-l { display: none; } :root[data-theme="dark"] .logo .wm-d { display: block; }

.nav { background: var(--nav-bg); border-bottom: 1px solid var(--line); }
.nav a.link { color: var(--muted); }
.nav a.link:hover { color: var(--fg); }
.nav .btn:not(.btn-primary) { background: var(--card); color: var(--fg); border-color: var(--line-2); }
.nav .btn:not(.btn-primary):hover { background: var(--bg-soft); }

.hero { color: var(--fg); border-bottom: 1px solid var(--line); }
.hero::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 16%, transparent), transparent 70%); }
.hero::after { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand-2) 14%, transparent), transparent 70%); }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead, .hero-note { color: var(--muted); }
.hero p.lead b { color: var(--fg); }
.hero .pill { color: var(--fg-2); border-color: var(--line-2); background: var(--card); }
.hero .pill b { color: #fff; }
.hero .btn:not(.btn-primary) { background: var(--card); color: var(--fg); border-color: var(--line-2); }
.hero .btn:not(.btn-primary):hover { background: var(--bg-soft); }
.hero .try { border-color: var(--line); box-shadow: var(--shadow-lg); }
.hero .code { box-shadow: var(--shadow-lg); }

.auth-side { color: var(--fg); border-left: 1px solid var(--line); }
.auth-side::before { background: radial-gradient(closest-side, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%); }
.auth-side p { color: var(--muted); }
.auth-side ul { color: var(--fg-2); }
.auth-side li::first-letter { color: var(--brand-2); }

.cta { background: linear-gradient(120deg, var(--brand), var(--brand-2)); }
.cta .btn-primary { color: var(--brand); }
.home-hero, .api-hero { border-color: var(--line); }

/* ---------- panel polish + admin panel (2026-10-24) ---------- */
/* sidebar: logo centred in a header as tall as the top bar */
.side { padding-top: 0; }
.side .logo { justify-content: center; height: 62px; margin: 0 -14px 10px; padding: 0; border-bottom: 1px solid var(--line); flex: none; }
.side .logo .wm { height: 30px; }
.side .grp { padding-top: 14px; }
.side-tag { display: flex; align-items: center; justify-content: center; gap: 6px; margin: -2px 0 10px; font-size: 12.5px; font-weight: 700; color: var(--brand); }
.side-tag svg { width: 15px; height: 15px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
/* cells written left-to-right (emails, cards, keys) still line up with their right-aligned header */
table.t td.ltr, table.t td .ltr-r, .ltr-r { direction: ltr; unicode-bidi: plaintext; text-align: right; }
table.t td .mono.ltr, table.t td.mono.ltr { display: inline-block; direction: ltr; }
table.t td { line-height: 1.55; }
table.t td .small { line-height: 1.5; }
.kv { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.kv span { color: var(--muted); }
.kv b { font-size: 17px; font-variant-numeric: tabular-nums; }
.kv b small { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi { display: flex; flex-direction: column; }
.kpi .val small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi .sub { margin-top: auto; padding-top: 2px; }
.kpi-brand { background: linear-gradient(135deg, var(--brand-soft), var(--card) 70%); border-color: color-mix(in srgb, var(--brand) 25%, var(--line)); }
.fg { color: var(--fg); }
.nowrap { white-space: nowrap; }
.tr { text-align: left; }
.content.wide { max-width: 1320px; }
@media (max-width: 620px) {
  .tool-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 0 14px; align-items: start; padding: 16px; }
  .tool-card .ic { grid-row: span 3; margin: 0; }
  .tool-card h3 { margin: 0 0 2px; font-size: 16px; }
  .tool-card p { margin: 0 0 8px; font-size: 14px; }
  .tool-card .btn { justify-self: start; }
  .legend { flex-wrap: wrap; gap: 6px 14px; }
}

/* admin: tables with search, filters, sorting, paging */
.dt-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.dt-search { position: relative; flex: 1; min-width: 220px; max-width: 360px; }
.dt-search svg { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--muted); pointer-events: none; }
.dt-search .input { padding-right: 38px; height: 38px; }
.dt-f { flex-wrap: wrap; }
.dt-f button small { color: var(--muted); font-weight: 500; }
table.t th.sortable { cursor: pointer; user-select: none; }
table.t th.sortable:hover { color: var(--fg); }
table.t th.sortable::after { content: "↕"; opacity: .35; margin-right: 5px; font-size: 11px; }
table.t th.asc::after { content: "↑"; opacity: 1; color: var(--brand); }
table.t th.desc::after { content: "↓"; opacity: 1; color: var(--brand); }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--bg-soft); }
table.t .empty { padding: 24px 8px; }
.dt-pager { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 12px; }
.dt-pager:empty { display: none; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who > div { min-width: 0; }
.who b { font-weight: 600; }
.av { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); text-transform: uppercase; }
.av-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 24px; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 6px; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none !important; border-radius: 8px; }
.li:last-child { border-bottom: 0; }
.li:hover { background: var(--bg-soft); }
.back { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; margin-bottom: 12px; }
.back svg { width: 16px; height: 16px; }
.u-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.u-head h3 { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 19px; }
.u-act { display: flex; gap: 8px; flex-wrap: wrap; }
.mini .stat b { display: block; font-size: 17px; }
.mini .stat small { display: block; }
.set-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
@media (max-width: 1000px) { .set-grid { grid-template-columns: minmax(0, 1fr); } }
.hint { display: block; margin-top: 4px; font-size: 12.5px; min-height: 1.4em; }
.preview { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin-top: 4px; }
.pkrow { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 4px 10px; align-items: center; margin-bottom: 12px; }
.pkrow .pk-out { grid-column: 1 / -1; grid-row: 2; }
.pkrow [data-rm] { grid-row: 1; grid-column: 3; }
.save-bar { display: flex; align-items: center; gap: 12px; margin-top: 18px; position: sticky; bottom: 0; padding: 12px 0; background: linear-gradient(transparent, var(--bg) 35%); }
.save-bar .form-err { margin: 0; }
/* any number of top-up packages fills the row evenly */
.pkgs-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.plans-grid { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.adm table.t th, .adm table.t td { padding-left: 10px; padding-right: 10px; }
