/* Sanad developer section: the selling page's tokens and faces, plus the API reference viewer themed to match. */
:root {
  --bg: #F2F5FA; --band: #E5EAF3; --panel: #FFFFFF; --ink: #0E1526; --ink-2: #3F4960; --ink-3: #566076;
  --line: #D5DBE7; --mark-off: #D3DAE8; --accent: #2950EC; --accent-ink: #FFFFFF; --accent-soft: #E4EAFF; --accent-line: #A8B9FA;
  --sand: #8F6020; --sand-soft: #F6EAD3; --ok: #1D7650; --ok-soft: #DCF0E5; --crit: #B0332A; --crit-soft: #FADFDB;
  --code-bg: #0E1526; --code-ink: #DCE3F2; --code-dim: #8F9AB1; --code-key: #8FA8FF; --code-str: #E3B062;
  --font-display: "Readex Pro", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 14px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0A0F1C; --band: #0F1626; --panel: #131B2E; --ink: #EEF2FA; --ink-2: #B3BCD0; --ink-3: #95A0B7;
  --line: #232C42; --mark-off: #2A3452; --accent: #6F8CFF; --accent-ink: #0A1030; --accent-soft: #1A2448; --accent-line: #34489A;
  --sand: #E3B062; --sand-soft: #3A2C14; --ok: #55C792; --ok-soft: #163A2A; --crit: #F2786D; --crit-soft: #45201C;
  --code-bg: #070B15; color-scheme: dark; } }
:root[data-theme="dark"], body.dark-mode {
  --bg: #0A0F1C; --band: #0F1626; --panel: #131B2E; --ink: #EEF2FA; --ink-2: #B3BCD0; --ink-3: #95A0B7;
  --line: #232C42; --mark-off: #2A3452; --accent: #6F8CFF; --accent-ink: #0A1030; --accent-soft: #1A2448; --accent-line: #34489A;
  --sand: #E3B062; --sand-soft: #3A2C14; --ok: #55C792; --ok-soft: #163A2A; --crit: #F2786D; --crit-soft: #45201C;
  --code-bg: #070B15; color-scheme: dark; }
body.light-mode {
  --bg: #F2F5FA; --band: #E5EAF3; --panel: #FFFFFF; --ink: #0E1526; --ink-2: #3F4960; --ink-3: #566076;
  --line: #D5DBE7; --mark-off: #D3DAE8; --accent: #2950EC; --accent-ink: #FFFFFF; --accent-soft: #E4EAFF; --accent-line: #A8B9FA;
  --sand: #8F6020; --sand-soft: #F6EAD3; --ok: #1D7650; --ok-soft: #DCF0E5; --crit: #B0332A; --crit-soft: #FADFDB;
  --code-bg: #0E1526; color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.6; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; text-wrap: balance; letter-spacing: -.01em; }
p { margin: 0; }
a { color: var(--accent); }
code, .mono { font-family: var(--font-mono); }
:not(pre) > code { font-size: .88em; background: var(--accent-soft); color: var(--ink); border-radius: 5px; padding: 1px 6px; }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.in { max-width: 1120px; margin: 0 auto; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* Hidden until focused. Clipped, not moved off screen: in Arabic (right to left) a link far to the left would widen the page. */
.skip { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 50; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.skip:not(:focus) { width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Nav (shared by the landing page and the reference pages) */
.nav { position: sticky; top: 0; z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); }
.nav .in { display: flex; align-items: center; gap: 18px; height: 60px; }
.nav.full .in { max-width: none; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand-mark { width: 26px; height: 26px; flex: none; display: block; }
.brand-mark .m-on { fill: var(--accent); } .brand-mark .m-off { fill: var(--mark-off); }
/* The logo lockup reads mark-then-name in both directions (docs/brand). */
[dir="rtl"] .brand { direction: ltr; }
.brand small { font-family: var(--font-body); font-weight: 500; font-size: 13px; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: 999px; padding: 1px 9px; }
.nav-links { display: flex; gap: 4px; font-size: 14.5px; }
.nav-links a { color: var(--ink-2); text-decoration: none; padding: 6px 10px; border-radius: 8px; white-space: nowrap; }
.nav-links a:hover { color: var(--accent); background: var(--accent-soft); }
.nav-links a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.spacer { flex: 1; }
.icon-btn { border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 8px; height: 34px; min-width: 34px; padding: 0 9px; font: inherit; font-size: 14px; cursor: pointer; display: inline-grid; place-items: center; }
.icon-btn:hover { border-color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 10px; padding: 11px 18px; font: inherit; font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line); color: var(--ink); background: var(--panel); }
.btn-ghost:hover { border-color: var(--accent); }
.nav .btn { padding: 7px 13px; font-size: 14px; }

/* Landing */
.hero { padding-block: 64px 40px; }
.hero .in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.eyebrow { font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.hero h1 { font-size: clamp(32px, 4.4vw, 50px); line-height: 1.1; font-weight: 600; margin-top: 14px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.lede { font-size: 18px; color: var(--ink-2); margin-top: 18px; max-width: 34em; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.facts { list-style: none; margin: 22px 0 0; padding: 0; display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.facts li { display: flex; gap: 8px; align-items: center; }
.facts li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }

.band { background: var(--band); }
.sec { padding-block: 64px; }
.sec-head { display: grid; gap: 10px; max-width: 46em; margin-bottom: 32px; }
.sec-head h2 { font-size: clamp(26px, 3vw, 34px); line-height: 1.15; font-weight: 600; }
.sec-head p { font-size: 17px; color: var(--ink-2); }

.apis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.api { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 26px; display: grid; gap: 14px; align-content: start; text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.api:hover { border-color: var(--accent); transform: translateY(-2px); }
.api .who { font-size: 13.5px; color: var(--accent); font-weight: 600; }
.api h3 { font-size: 22px; font-weight: 600; }
.api p { color: var(--ink-2); font-size: 15.5px; }
.api ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.api li { font-size: 12.5px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; color: var(--ink-2); }
.api .go { font-weight: 600; color: var(--accent); }
.api .go::after { content: " →"; }

/* Code blocks with tabs and a copy button */
.code { background: var(--code-bg); border-radius: 14px; overflow: hidden; border: 1px solid #232C42; min-width: 0; }
.code-top { display: flex; align-items: center; gap: 2px; padding: 6px 6px 0 10px; border-bottom: 1px solid #232C42; }
.code-title { color: var(--code-dim); font-size: 12.5px; font-family: var(--font-mono); margin-inline-end: auto; padding: 6px 4px 8px; }
.tab { background: none; border: 0; color: var(--code-dim); font: 500 13px var(--font-body); padding: 7px 11px 9px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab[aria-selected="true"] { color: var(--code-ink); border-bottom-color: #6F8CFF; }
.tab:hover { color: var(--code-ink); }
.copy { margin-inline-start: 6px; background: #1A2236; border: 1px solid #2C3650; color: var(--code-ink); font: 500 12px var(--font-body); border-radius: 7px; padding: 4px 10px; cursor: pointer; margin-bottom: 6px; }
.copy:hover { border-color: #6F8CFF; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; color: var(--code-ink); font: 13px/1.65 var(--font-mono); tab-size: 2; }
.code pre[hidden] { display: none; }
.code .k { color: var(--code-key); }
.code .s { color: var(--code-str); }
.code .c { color: var(--code-dim); }

/* Quickstart steps */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 28px; counter-reset: s; }
.step { counter-increment: s; display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.step-text { display: grid; gap: 8px; }
.step-text h3 { font-size: 19px; font-weight: 600; display: flex; gap: 12px; align-items: center; }
.step-text h3::before { content: counter(s); flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; border: 2px solid var(--accent); color: var(--accent); }
.step-text p { color: var(--ink-2); font-size: 15.5px; }

/* Flows table */
.table-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: start; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: top; }
thead th { border-top: 0; font-size: 12.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 600; background: var(--band); }
td:first-child { white-space: nowrap; font-weight: 600; }
.dir { display: inline-block; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 1px 9px; white-space: nowrap; }
.dir.in { background: var(--accent-soft); color: var(--accent); }
.dir.out { background: var(--sand-soft); color: var(--sand); }
.verb { font: 600 11.5px var(--font-mono); border-radius: 5px; padding: 1px 6px; margin-inline-end: 6px; }
.verb.get { background: var(--ok-soft); color: var(--ok); }
.verb.post { background: var(--accent-soft); color: var(--accent); }
.verb.put { background: var(--sand-soft); color: var(--sand); }

/* Rules grid */
.rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rule { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 8px; align-content: start; }
.rule b { font-family: var(--font-display); font-weight: 600; font-size: 16.5px; }
.rule p { color: var(--ink-2); font-size: 15px; }
.status { display: grid; gap: 8px; margin-top: 4px; }
.status div { display: flex; gap: 10px; align-items: baseline; font-size: 14px; color: var(--ink-2); }
.status code { flex: none; }

.split { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 32px; align-items: start; }
.checks { margin: 14px 0 0; padding-inline-start: 20px; display: grid; gap: 8px; color: var(--ink-2); font-size: 15px; }

/* Resources */
.res { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.res a { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.res a:hover { border-color: var(--accent); }
.res b { font-size: 15px; }
.res span { font-size: 13px; color: var(--ink-3); }
.res .file { font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

.help { background: var(--accent); color: var(--accent-ink); border-radius: 18px; padding: 32px; display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.help h2 { font-size: 26px; font-weight: 600; }
.help p { opacity: .9; margin-top: 6px; max-width: 40em; }
.help .btn { background: var(--accent-ink); color: var(--accent); }

footer { border-top: 1px solid var(--line); padding-block: 28px; font-size: 13.5px; color: var(--ink-3); }
footer .in { display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
footer a { color: var(--ink-3); }

@media (max-width: 960px) {
  .hero .in, .step, .split { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .rules { grid-template-columns: minmax(0, 1fr); }
  .res { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .apis, .res { grid-template-columns: minmax(0, 1fr); }
  .nav-links { display: none; }
  .nav .btn-ghost { display: none; }
  .brand small { display: none; }
  .hero { padding-block: 40px 24px; }
  .sec { padding-block: 48px; }
  .help { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) { .api { transition: none; } .api:hover { transform: none; } }

/* Reference pages: the viewer fills the page under the nav */
.ref-bar { display: flex; gap: 8px; align-items: center; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; background: var(--bg); }
.switch a { text-decoration: none; color: var(--ink-2); font-size: 14px; padding: 5px 12px; border-radius: 7px; white-space: nowrap; }
.switch a[aria-current="page"] { background: var(--panel); color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(14,21,38,.12); }
#reference-fallback { padding: 48px 16px; text-align: center; color: var(--ink-2); }
@media (max-width: 720px) { .switch a { padding: 5px 8px; font-size: 13px; } .ref-bar .hide-sm { display: none; } }

/* Scalar, in Sanad's colours. Its own variables (theme: 'none'). */
.light-mode, .dark-mode { --scalar-font: var(--font-body); --scalar-font-code: var(--font-mono); --scalar-radius: 8px; --scalar-radius-lg: 12px; --scalar-radius-xl: 14px; }
.light-mode {
  --scalar-color-1: #0E1526; --scalar-color-2: #3F4960; --scalar-color-3: #566076; --scalar-color-accent: #2950EC;
  --scalar-background-1: #FFFFFF; --scalar-background-2: #F2F5FA; --scalar-background-3: #E5EAF3; --scalar-background-accent: #E4EAFF;
  --scalar-border-color: #D5DBE7;
  --scalar-color-green: #1D7650; --scalar-color-blue: #2950EC; --scalar-color-orange: #B07A2A; --scalar-color-yellow: #9A6B12;
  --scalar-color-red: #B0332A; --scalar-color-purple: #6A4C93;
  --scalar-sidebar-background-1: #F2F5FA; --scalar-sidebar-color-1: #0E1526; --scalar-sidebar-color-2: #3F4960;
  --scalar-sidebar-border-color: #D5DBE7; --scalar-sidebar-item-hover-background: #E5EAF3; --scalar-sidebar-item-hover-color: #2950EC;
  --scalar-sidebar-item-active-background: #E4EAFF; --scalar-sidebar-color-active: #2950EC;
  --scalar-sidebar-search-background: #FFFFFF; --scalar-sidebar-search-color: #566076; --scalar-sidebar-search-border-color: #D5DBE7;
}
.dark-mode {
  --scalar-color-1: #EEF2FA; --scalar-color-2: #B3BCD0; --scalar-color-3: #95A0B7; --scalar-color-accent: #6F8CFF;
  --scalar-background-1: #0A0F1C; --scalar-background-2: #131B2E; --scalar-background-3: #1A2236; --scalar-background-accent: #1A2448;
  --scalar-border-color: #232C42;
  --scalar-color-green: #55C792; --scalar-color-blue: #6F8CFF; --scalar-color-orange: #E3B062; --scalar-color-yellow: #E3C062;
  --scalar-color-red: #F2786D; --scalar-color-purple: #B79BE0;
  --scalar-sidebar-background-1: #0F1626; --scalar-sidebar-color-1: #EEF2FA; --scalar-sidebar-color-2: #B3BCD0;
  --scalar-sidebar-border-color: #232C42; --scalar-sidebar-item-hover-background: #1A2236; --scalar-sidebar-item-hover-color: #6F8CFF;
  --scalar-sidebar-item-active-background: #1A2448; --scalar-sidebar-color-active: #6F8CFF;
  --scalar-sidebar-search-background: #131B2E; --scalar-sidebar-search-color: #95A0B7; --scalar-sidebar-search-border-color: #232C42;
}
/* Sticky elements inside the viewer sit under our 60px nav. */
.ref-page { --scalar-custom-header-height: 61px; }
.ref-page .scalar-app h1, .ref-page .scalar-app h2 { font-family: var(--font-display); }
/* "Generate SDK" sends readers to Scalar's paid service; the contracts are downloadable instead. The viewer's own
   rules are scoped as tightly as these, so these need !important. */
.ref-page .selected-client-action, .ref-page .generate-sdk-button { display: none !important; }
/* Short codes in description tables (status values) stay on one line. */
.ref-page .scalar-app td code { white-space: nowrap !important; }
/* Description tables scroll on their own on a phone instead of widening the page. */
.ref-page .scalar-app .markdown table { display: block; max-width: 100%; overflow-x: auto; }
/* The smallest phones (320px): keep the top bar on screen. */
@media (max-width: 400px) {
  .brand { font-size: 16px; gap: 8px; }
  .nav .in { gap: 10px; }
  #themeBtn { display: none; }
  .switch a { padding: 5px 6px; }
}

/* Arabic (right to left). Code, paths and the API viewer stay left to right. */
.lang-btn { font-size: 13.5px; padding: 0 10px; }
[dir="rtl"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: 14px; }
[dir="rtl"] .api .go::after { content: " ←"; }
[dir="rtl"] thead th { letter-spacing: 0; font-size: 13px; }
[dir="rtl"] .hero h1 { line-height: 1.25; }
.code { direction: ltr; text-align: left; }
[dir="rtl"] .copy { margin-inline-start: 6px; }
#reference { direction: ltr; }
/* Reference pages on the smallest phones: the logo alone, so the API switch and language button fit. */
@media (max-width: 400px) { .ref-page .brand-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } }
