/* Tranzak Docs — public documentation (docs.tranzak.co). Light by default; "Dark mode" is opt-in. */
@font-face { font-family:'Plus Jakarta Sans'; font-style:normal; font-weight:400; font-display:swap; src:url('/fonts/plus-jakarta-sans-400.woff2') format('woff2'); }
@font-face { font-family:'Plus Jakarta Sans'; font-style:normal; font-weight:500; font-display:swap; src:url('/fonts/plus-jakarta-sans-500.woff2') format('woff2'); }
@font-face { font-family:'Plus Jakarta Sans'; font-style:normal; font-weight:600; font-display:swap; src:url('/fonts/plus-jakarta-sans-600.woff2') format('woff2'); }
@font-face { font-family:'Plus Jakarta Sans'; font-style:normal; font-weight:700; font-display:swap; src:url('/fonts/plus-jakarta-sans-700.woff2') format('woff2'); }

:root {
    --bg:#FFFFFF; --bg-soft:#F6F7F9; --bg-hover:#EEF0F4;
    --text:#0B0F19; --text-2:#323A49; --muted:#5B6472; --line:#E4E7EC;
    --accent:#2E6EEA; --accent-soft:#EAF1FD; --accent-text:#1D55C4;
    --inline-code-bg:#F1F3F6; --inline-code-text:#0B0F19;
    --code-bg:#0E1424; --code-line:#1D2540; --code-text:#E4E9F5; --code-muted:#8A94AD;
    --note:#2E6EEA; --note-bg:#EEF4FE;
    --tip:#0E7A55; --tip-bg:#ECF8F3;
    --warning:#B45309; --warning-bg:#FEF6E7;
    --important:#B42318; --important-bg:#FEF0EE;
    --header-h:60px; --sidebar-w:264px; --toc-w:220px;
    --font:'Plus Jakarta Sans',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
    --mono:ui-monospace,SFMono-Regular,'SF Mono',Menlo,Consolas,'Liberation Mono',monospace;
    color-scheme:light;
}
html[data-theme="dark"] {
    --bg:#0B0F19; --bg-soft:#10162A; --bg-hover:#182038;
    --text:#E8EBF2; --text-2:#C3C9D6; --muted:#9AA3B2; --line:#222A40;
    --accent:#6EA1FF; --accent-soft:#14213F; --accent-text:#8FB6FF;
    --inline-code-bg:#182038; --inline-code-text:#E8EBF2;
    --code-bg:#0A0F1E; --code-line:#1B2340;
    --note:#6EA1FF; --note-bg:#11203F;
    --tip:#34D399; --tip-bg:#0F2A24;
    --warning:#F5B450; --warning-bg:#2B2210;
    --important:#F87B70; --important-bg:#2D1614;
    color-scheme:dark;
}

* { box-sizing:border-box; }
html { scroll-behavior:smooth; scroll-padding-top:calc(var(--header-h) + 24px); -webkit-text-size-adjust:100%; }
body { margin:0; background:var(--bg); color:var(--text); font-family:var(--font); font-size:15.5px; line-height:1.7; -webkit-font-smoothing:antialiased; }
a { color:var(--accent-text); text-decoration:none; }
a:hover { text-decoration:underline; }
img { max-width:100%; }
button { font-family:inherit; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }

/* ---------- Header ---------- */
.dh { position:sticky; top:0; z-index:50; height:var(--header-h); background:var(--bg); border-bottom:1px solid var(--line); }
.dh-in { height:100%; max-width:1400px; margin:0 auto; padding:0 24px; display:flex; align-items:center; gap:28px; }
.dh-brand { display:flex; align-items:center; gap:10px; color:var(--text); font-weight:700; font-size:16px; letter-spacing:-.2px; text-decoration:none !important; }
.dh-brand img { height:40px; width:auto; display:block; }
.dh-brand .logo-dark { display:none; }
html[data-theme="dark"] .dh-brand .logo-light { display:none; }
html[data-theme="dark"] .dh-brand .logo-dark { display:block; }
.dh-brand .tag { font-weight:600; color:var(--muted); padding-left:10px; border-left:1px solid var(--line); font-size:14px; }
.dh-nav { display:flex; gap:4px; }
.dh-nav a { color:var(--text-2); font-size:14px; font-weight:600; padding:8px 12px; border-radius:8px; }
.dh-nav a:hover, .dh-nav a.on { background:var(--bg-soft); color:var(--text); text-decoration:none; }
.dh-right { margin-left:auto; display:flex; align-items:center; gap:10px; }
.dh-search { display:flex; align-items:center; gap:10px; min-width:240px; padding:8px 12px; border:1px solid var(--line); background:var(--bg-soft); color:var(--muted); border-radius:10px; font-size:14px; cursor:pointer; }
.dh-search:hover { border-color:var(--muted); }
.dh-search kbd { margin-left:auto; font-family:var(--font); font-size:12px; border:1px solid var(--line); background:var(--bg); border-radius:6px; padding:1px 7px; color:var(--muted); }
.dh-link { font-size:14px; font-weight:600; color:var(--text-2); padding:8px 10px; }
.dh-cta { background:var(--text); color:var(--bg) !important; font-size:14px; font-weight:700; padding:9px 16px; border-radius:10px; text-decoration:none !important; }
.theme-btn { display:flex; align-items:center; gap:8px; padding:7px 12px; border:1px solid var(--line); background:var(--bg); color:var(--text-2); border-radius:10px; font-size:13.5px; font-weight:600; cursor:pointer; }
.theme-btn:hover { background:var(--bg-soft); }
.theme-btn .sw { width:30px; height:17px; border-radius:99px; background:var(--line); position:relative; transition:background .2s; }
.theme-btn .sw::after { content:''; position:absolute; top:2px; left:2px; width:13px; height:13px; border-radius:50%; background:var(--bg); box-shadow:0 1px 2px rgba(0,0,0,.3); transition:transform .2s; }
html[data-theme="dark"] .theme-btn .sw { background:var(--accent); }
html[data-theme="dark"] .theme-btn .sw::after { transform:translateX(13px); }
.menu-btn { display:none; width:40px; height:40px; border:1px solid var(--line); background:var(--bg); border-radius:10px; align-items:center; justify-content:center; cursor:pointer; color:var(--text); }

/* ---------- Layout ---------- */
.dl { max-width:1400px; margin:0 auto; display:grid; grid-template-columns:var(--sidebar-w) minmax(0,1fr) var(--toc-w); gap:0 48px; padding:0 24px; }
.ds { position:sticky; top:var(--header-h); align-self:start; height:calc(100vh - var(--header-h)); overflow-y:auto; padding:28px 12px 40px 0; }
.ds-group { margin-bottom:26px; }
.ds-title { font-size:12px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); padding:0 12px; margin-bottom:8px; }
.ds a { display:block; padding:6px 12px; border-radius:8px; font-size:14.5px; color:var(--text-2); font-weight:500; line-height:1.45; }
.ds a:hover { background:var(--bg-soft); color:var(--text); text-decoration:none; }
.ds a.on { background:var(--accent-soft); color:var(--accent-text); font-weight:600; }
.dm { padding:44px 0 80px; min-width:0; }
.dt { position:sticky; top:var(--header-h); align-self:start; max-height:calc(100vh - var(--header-h)); overflow-y:auto; padding:44px 0 40px; }
.dt-title { font-size:12px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); margin-bottom:10px; }
.dt a { display:block; padding:4px 0 4px 14px; border-left:2px solid var(--line); font-size:13.5px; color:var(--muted); line-height:1.45; }
.dt a.l3 { padding-left:28px; }
.dt a:hover { color:var(--text); text-decoration:none; }
.dt a.on { border-left-color:var(--accent); color:var(--accent-text); font-weight:600; }

/* ---------- Article ---------- */
.crumb { font-size:13.5px; color:var(--muted); margin-bottom:14px; font-weight:500; }
.crumb a { color:var(--muted); }
.article { max-width:760px; }
.article h1 { font-size:36px; line-height:1.15; letter-spacing:-1.1px; margin:0 0 14px; font-weight:700; }
.lead { font-size:18px; color:var(--muted); line-height:1.6; margin:0 0 30px; }
.article h2 { font-size:25px; letter-spacing:-.6px; line-height:1.25; margin:52px 0 14px; padding-top:30px; border-top:1px solid var(--line); font-weight:700; position:relative; }
.article h2:first-of-type { border-top:0; padding-top:0; margin-top:34px; }
.article h3 { font-size:18.5px; letter-spacing:-.3px; margin:34px 0 8px; font-weight:700; position:relative; }
.article p { margin:0 0 16px; color:var(--text-2); }
.article ul, .article ol { margin:0 0 18px; padding-left:24px; color:var(--text-2); }
.article li { margin-bottom:6px; }
.article li > p { margin-bottom:8px; }
.article strong { color:var(--text); font-weight:650; }
.article hr { border:0; border-top:1px solid var(--line); margin:36px 0; }
.article a.anchor { position:absolute; left:-22px; color:var(--muted); opacity:0; font-weight:500; text-decoration:none; }
.article h2:hover a.anchor, .article h3:hover a.anchor { opacity:.7; }
.article code { font-family:var(--mono); font-size:.86em; background:var(--inline-code-bg); color:var(--inline-code-text); padding:2px 6px; border-radius:6px; }
.article pre { margin:0; }
.article pre code { background:none; color:inherit; padding:0; font-size:13.5px; border-radius:0; }

/* Code windows */
.article pre, .code-group { background:var(--code-bg); border:1px solid var(--code-line); border-radius:14px; margin:0 0 22px; overflow:hidden; position:relative; }
.article pre { padding:18px 20px; overflow-x:auto; color:var(--code-text); line-height:1.65; }
.code-group pre { border:0; border-radius:0; margin:0; display:none; }
.code-group pre.on { display:block; }
.code-group:not(.js) pre { display:block; border-top:1px solid var(--code-line); }
.code-tabs { display:flex; gap:2px; padding:8px 10px 0; border-bottom:1px solid var(--code-line); overflow-x:auto; padding-right:60px; }
.code-tabs button { background:none; border:0; color:var(--code-muted); font-size:13px; font-weight:600; padding:8px 12px; cursor:pointer; border-bottom:2px solid transparent; white-space:nowrap; }
.code-tabs button:hover { color:var(--code-text); }
.code-tabs button.on { color:#fff; border-bottom-color:var(--accent); }
.copy { position:absolute; top:10px; right:10px; z-index:2; background:rgba(255,255,255,.07); border:1px solid rgba(255,255,255,.12); color:var(--code-muted); font-size:12px; font-weight:600; padding:5px 10px; border-radius:8px; cursor:pointer; opacity:0; transition:opacity .15s; }
.article pre:hover .copy, .code-group:hover .copy, .copy:focus-visible { opacity:1; }
.copy:hover { color:#fff; background:rgba(255,255,255,.14); }
.code-group .copy { top:7px; }
.hljs { background:none !important; color:var(--code-text); }
.hljs-comment,.hljs-quote { color:#7C88A6; font-style:italic; }
.hljs-keyword,.hljs-selector-tag,.hljs-literal,.hljs-type,.hljs-built_in { color:#C8A2FF; }
.hljs-string,.hljs-regexp,.hljs-addition { color:#9FE3A4; }
.hljs-number,.hljs-symbol,.hljs-bullet { color:#F5B97A; }
.hljs-attr,.hljs-attribute,.hljs-property,.hljs-variable,.hljs-template-variable { color:#8EC1FF; }
.hljs-title,.hljs-title.function_,.hljs-section,.hljs-name { color:#FFD58A; }
.hljs-meta,.hljs-params { color:#B7C1DB; }
.hljs-deletion { color:#FF9C95; }

/* Tables */
.table-wrap { overflow-x:auto; margin:0 0 22px; border:1px solid var(--line); border-radius:12px; }
.article table { border-collapse:collapse; width:100%; font-size:14.5px; }
.article th { text-align:left; background:var(--bg-soft); font-weight:650; color:var(--text); padding:10px 14px; border-bottom:1px solid var(--line); white-space:nowrap; }
.article td { padding:10px 14px; border-bottom:1px solid var(--line); vertical-align:top; color:var(--text-2); }
.article tr:last-child td { border-bottom:0; }

/* Callouts */
.callout { margin:0 0 22px; padding:14px 18px; border-radius:12px; border:1px solid; border-left-width:4px; }
.callout p { margin:0 0 8px; color:var(--text); }
.callout p:last-child { margin-bottom:0; }
.callout-note { background:var(--note-bg); border-color:var(--note); } .callout-note > p:first-child strong { color:var(--note); }
.callout-tip { background:var(--tip-bg); border-color:var(--tip); } .callout-tip > p:first-child strong { color:var(--tip); }
.callout-warning { background:var(--warning-bg); border-color:var(--warning); } .callout-warning > p:first-child strong { color:var(--warning); }
.callout-important { background:var(--important-bg); border-color:var(--important); } .callout-important > p:first-child strong { color:var(--important); }
.article blockquote:not(.callout) { margin:0 0 18px; padding:2px 18px; border-left:3px solid var(--line); color:var(--muted); }

/* Endpoint bar */
.endpoint { display:flex; align-items:center; gap:12px; padding:10px 14px; background:var(--bg-soft); border:1px solid var(--line); border-radius:12px; margin:0 0 18px; overflow-x:auto; }
.endpoint code { background:none; padding:0; font-size:14px; color:var(--text); white-space:nowrap; }
.method { font-size:12px; font-weight:800; letter-spacing:.5px; padding:3px 9px; border-radius:7px; color:#fff; }
.method-get { background:#0E7A55; } .method-post { background:#2E6EEA; } .method-put,.method-patch { background:#B45309; } .method-delete { background:#B42318; }

/* Prev / next */
.pn { display:grid; grid-template-columns:1fr 1fr; gap:14px; margin-top:64px; padding-top:28px; border-top:1px solid var(--line); }
.pn a { display:block; padding:16px 18px; border:1px solid var(--line); border-radius:12px; color:var(--text); }
.pn a:hover { border-color:var(--accent); text-decoration:none; }
.pn small { display:block; color:var(--muted); font-size:12.5px; font-weight:600; margin-bottom:2px; }
.pn span { font-weight:650; font-size:15px; }
.pn .next { text-align:right; grid-column:2; }
.pn .prev { grid-column:1; }

/* Footer */
.df { border-top:1px solid var(--line); background:var(--bg-soft); }
.df-in { max-width:1400px; margin:0 auto; padding:30px 24px; display:flex; gap:20px; flex-wrap:wrap; align-items:center; justify-content:space-between; font-size:13.5px; color:var(--muted); }
.df-in nav { display:flex; gap:20px; flex-wrap:wrap; }
.df-in a { color:var(--muted); font-weight:500; }

/* ---------- Home ---------- */
.hero { max-width:1400px; margin:0 auto; padding:72px 24px 40px; }
.hero h1 { font-size:52px; line-height:1.06; letter-spacing:-2px; margin:0 0 18px; max-width:760px; font-weight:700; }
.hero p { font-size:19px; color:var(--muted); max-width:640px; margin:0 0 30px; line-height:1.6; }
.hero-actions { display:flex; gap:12px; flex-wrap:wrap; }
.btn { display:inline-flex; align-items:center; gap:8px; padding:12px 22px; border-radius:11px; font-weight:700; font-size:15px; text-decoration:none !important; border:1px solid var(--line); color:var(--text); background:var(--bg); cursor:pointer; }
.btn.primary { background:var(--text); color:var(--bg); border-color:var(--text); }
.cards { max-width:1400px; margin:0 auto; padding:24px 24px 24px; display:grid; grid-template-columns:repeat(4,1fr); gap:16px; }
.card { display:block; padding:22px; border:1px solid var(--line); border-radius:16px; background:var(--bg); color:var(--text); }
.card:hover { border-color:var(--accent); text-decoration:none; box-shadow:0 8px 24px -12px rgba(11,15,25,.18); }
.card h3 { margin:0 0 6px; font-size:17px; letter-spacing:-.3px; }
.card p { margin:0; font-size:14.5px; color:var(--muted); line-height:1.55; }
.card .more { display:block; margin-top:14px; font-size:14px; font-weight:650; color:var(--accent-text); }
.home-sec { max-width:1400px; margin:0 auto; padding:48px 24px 0; }
.home-sec h2 { font-size:26px; letter-spacing:-.7px; margin:0 0 6px; }
.home-sec > p { color:var(--muted); margin:0 0 22px; }
.home-grid { display:grid; grid-template-columns:1fr 1fr; gap:36px; align-items:start; }
.home-sec .code-group, .home-sec pre { margin:0; }
.home-sec pre { background:var(--code-bg); border:1px solid var(--code-line); border-radius:14px; padding:18px 20px; overflow-x:auto; color:var(--code-text); font-size:13.5px; line-height:1.65; }
.steps { list-style:none; margin:0; padding:0; counter-reset:s; }
.steps li { counter-increment:s; display:flex; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); color:var(--text-2); }
.steps li:last-child { border-bottom:0; }
.steps li::before { content:counter(s); flex:none; width:28px; height:28px; border-radius:50%; background:var(--accent); color:#fff; font-weight:700; font-size:13px; display:flex; align-items:center; justify-content:center; margin-top:1px; }
.steps strong { color:var(--text); display:block; }
.index-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:28px 36px; }
.index-grid h4 { margin:0 0 8px; font-size:13px; letter-spacing:.8px; text-transform:uppercase; color:var(--muted); }
.index-grid a { display:block; padding:4px 0; font-size:14.5px; font-weight:500; color:var(--text-2); }
.index-grid a:hover { color:var(--accent-text); }

/* ---------- Search ---------- */
.sm { position:fixed; inset:0; z-index:100; background:rgba(11,15,25,.55); display:none; align-items:flex-start; justify-content:center; padding:10vh 16px 0; }
.sm.open { display:flex; }
.sm-box { width:100%; max-width:640px; background:var(--bg); border:1px solid var(--line); border-radius:16px; box-shadow:0 24px 60px -12px rgba(0,0,0,.45); overflow:hidden; }
.sm-box input { width:100%; border:0; outline:0; background:transparent; color:var(--text); font-family:inherit; font-size:17px; padding:18px 20px; border-bottom:1px solid var(--line); }
.sm-res { max-height:50vh; overflow-y:auto; padding:8px; }
.sm-res a { display:block; padding:10px 12px; border-radius:10px; color:var(--text); }
.sm-res a.on, .sm-res a:hover { background:var(--accent-soft); text-decoration:none; }
.sm-res b { display:block; font-size:15px; font-weight:650; }
.sm-res small { color:var(--muted); font-size:12.5px; font-weight:600; }
.sm-res p { margin:2px 0 0; color:var(--muted); font-size:13.5px; line-height:1.5; }
.sm-res mark { background:none; color:var(--accent-text); font-weight:700; }
.sm-empty { padding:26px; text-align:center; color:var(--muted); font-size:14.5px; }
.sm-foot { padding:10px 16px; border-top:1px solid var(--line); color:var(--muted); font-size:12.5px; display:flex; gap:16px; }

/* ---------- Responsive ---------- */
@media (max-width:1180px) { .dl { grid-template-columns:var(--sidebar-w) minmax(0,1fr); } .dt { display:none; } .cards { grid-template-columns:repeat(2,1fr); } }
@media (max-width:900px) {
    .dh-nav, .dh-link, .theme-btn .lbl { display:none; }
    .dh-search { min-width:0; } .dh-search span, .dh-search kbd { display:none; }
    .menu-btn { display:flex; }
    .dh-in { gap:14px; padding:0 16px; }
    .dl { grid-template-columns:minmax(0,1fr); padding:0 16px; }
    .ds { position:fixed; top:var(--header-h); left:0; bottom:0; z-index:60; width:min(320px,86vw); height:auto; background:var(--bg); border-right:1px solid var(--line); padding:20px 14px 40px; transform:translateX(-102%); transition:transform .22s ease; }
    body.nav-open .ds { transform:none; box-shadow:0 0 0 100vmax rgba(11,15,25,.45); }
    .dm { padding:28px 0 56px; }
    .article h1 { font-size:30px; } .article a.anchor { display:none; }
    .hero { padding:44px 16px 24px; } .hero h1 { font-size:36px; letter-spacing:-1.2px; } .hero p { font-size:17px; }
    .cards, .home-sec { padding-left:16px; padding-right:16px; }
    .home-grid, .index-grid { grid-template-columns:1fr; }
    .df-in { padding:24px 16px; }
}
@media (max-width:560px) { .cards { grid-template-columns:1fr; } .pn { grid-template-columns:1fr; } .pn .next, .pn .prev { grid-column:1; text-align:left; } .dh-cta { display:none; } }
@media print { .dh, .ds, .dt, .df, .pn, .copy { display:none !important; } .dl { display:block; } }
