/* Kartik developer docs (/docs). Builds on base.css (brand colors, Vazirmatn, light/dark).
   The server sends a strict CSP: no inline styles anywhere, everything is a class here. */

:root {
  --head-h: 60px;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, 'Liberation Mono', 'Vazirmatn', monospace;
  --code-bg: #0B1B2E;
  --code-bar: #10243A;
  --code-line: #1E3752;
  --code-text: #E3EBF2;
  --code-muted: #93A7BA;
  --tok-c: #8397AC;   /* comments */
  --tok-s: #8BE3B6;   /* strings */
  --tok-k: #86C5FF;   /* keywords, flags */
  --tok-n: #CDB8FF;   /* numbers, true/false/null */
  --tok-p: #A9D9FF;   /* JSON keys, HTTP header names */
  --tok-v: #F4B9D3;   /* variables */
  --tint-green: #E3F6EC; --ink-green: #057A55;
  --tint-blue: #E7F0FD;  --ink-blue: #1C5DBA;
  --tint-slate: #ECF0F4; --ink-slate: #334E68;
}

@media (prefers-color-scheme: dark) {
  :root {
    --code-bg: #07121F;
    --code-bar: #0C1B2C;
    --code-line: #1B3149;
    --tint-green: #12372F; --ink-green: #4ADE9E;
    --tint-blue: #142D4D;  --ink-blue: #8AB6F4;
    --tint-slate: #1B2D40; --ink-slate: #A9BED3;
  }
}

[hidden] { display: none !important; }

html { scroll-padding-top: calc(var(--head-h) + 18px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
html.toc-lock { overflow: hidden; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.skip {
  position: absolute; inset-inline-start: 12px; top: -80px; z-index: 80;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 10px; text-decoration: none;
}
.skip:focus { top: 10px; }

:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

/* ---------- top bar ---------- */

.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--head-h);
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-in {
  max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: inline-flex; align-items: center; gap: 8px; min-width: 0; color: var(--text); text-decoration: none; }
.brand img { flex: none; border-radius: 8px; }
.brand-name { font-weight: 800; font-size: 17px; }
.brand-sep { width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.brand-sub { color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.top-links { display: flex; align-items: center; gap: 8px; }
.top-link {
  padding: 6px 10px; border-radius: 10px; color: var(--muted);
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.top-link:hover { color: var(--text); background: var(--soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 6px 14px; border-radius: 12px; border: 1px solid transparent;
  font-weight: 700; font-size: 14px; line-height: 1.4; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.btn .i { width: 18px; height: 18px; }
.btn-green { background: #057A55; color: #fff; }
.btn-green:hover { background: #04684A; }
.btn-quiet { background: var(--soft); border-color: var(--line); color: var(--text); }
.btn-quiet:hover { border-color: var(--muted); }
.toc-toggle { display: none; }

@media (max-width: 1023.98px) { .toc-toggle { display: inline-flex; } }
@media (max-width: 640px) { .top-link, .wide-only { display: none; } }
@media (max-width: 400px) { .brand-sep, .brand-sub { display: none; } }

/* ---------- hero ---------- */

.hero {
  color: #fff; border-bottom: 1px solid var(--line);
  background:
    radial-gradient(640px 320px at 88% -20%, rgba(14, 159, 110, 0.34), transparent 70%),
    radial-gradient(520px 260px at 6% 125%, rgba(14, 159, 110, 0.16), transparent 70%),
    linear-gradient(160deg, #0B1B2E 0%, #11294A 100%);
}
.hero-in { max-width: 1240px; margin: 0 auto; padding: 44px 16px 38px; }
.eyebrow {
  display: inline-block; margin: 0; padding: 2px 12px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.14);
  color: #BFE8D5; font-size: 13px; font-weight: 600;
}
.hero h1 {
  margin: 14px 0 10px; max-width: 900px;
  font-size: clamp(27px, 4.2vw, 42px); line-height: 1.35; font-weight: 800; letter-spacing: -0.2px;
}
.lead { max-width: 780px; margin: 0; color: #C9D6E2; font-size: 17px; line-height: 1.95; }
.facts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px;
  max-width: 1000px; margin: 24px 0 0;
}
.facts > div {
  position: relative; min-width: 0; padding: 10px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.12);
}
.facts dt { min-height: 26px; color: #9FB3C6; font-size: 12.5px; font-weight: 600; }
.facts dd { margin: 2px 0 0; font-size: 14.5px; line-height: 1.7; }
.facts code { color: #E6F6EE; font-size: 13.5px; overflow-wrap: anywhere; }
.legal-note {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 1000px; margin: 18px 0 0; padding: 11px 14px; border-radius: 14px;
  background: rgba(14, 159, 110, 0.14); border: 1px solid rgba(61, 213, 152, 0.35);
  color: #E6F6EE; font-size: 14.5px; line-height: 1.9;
}
.legal-note .i { margin-top: 4px; color: #3DD598; }

/* ---------- layout + table of contents ---------- */

.layout {
  max-width: 1240px; margin: 0 auto; padding: 0 16px;
  display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 52px; align-items: start;
}
.content { min-width: 0; max-width: 840px; padding: 6px 0 56px; }

.toc {
  position: sticky; top: calc(var(--head-h) + 12px);
  max-height: calc(100vh - var(--head-h) - 24px); overflow-y: auto; overscroll-behavior: contain;
  padding: 24px 0; scrollbar-width: thin;
}
.toc-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 0 12px 8px; color: var(--muted); font-size: 13px; font-weight: 800;
}
.toc-close {
  display: none; place-items: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--text); cursor: pointer;
}
.toc-list, .toc-list ol { list-style: none; margin: 0; padding: 0; }
.toc-list ol { margin: 2px 0 6px; padding-inline-start: 12px; }
.toc a {
  display: flex; align-items: center; gap: 7px; padding: 5px 12px; border-radius: 10px;
  color: var(--muted); font-size: 14.5px; line-height: 1.6; text-decoration: none;
}
.toc ol ol a { font-size: 13.5px; }
.toc a:hover { color: var(--text); background: var(--soft); }
.toc a.active { color: var(--ink-green); background: var(--tint-green); font-weight: 700; }
.toc .m { min-width: 40px; text-align: center; }

.toc-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(7, 18, 31, 0.5); }

@media (max-width: 1023.98px) {
  .layout { display: block; }
  .toc {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; z-index: 60;
    width: min(330px, 86vw); max-height: none; padding: 0 8px 28px;
    background: var(--surface); border-inline-end: 1px solid var(--line);
    box-shadow: 0 0 40px rgba(7, 18, 31, 0.3);
    transform: translateX(100%); visibility: hidden;
    transition: transform 0.25s ease, visibility 0s linear 0.25s;
  }
  .toc.open { transform: none; visibility: visible; transition: transform 0.25s ease; }
  .toc-head {
    position: sticky; top: 0; z-index: 1; padding: 12px 8px 10px;
    background: var(--surface); color: var(--text); font-size: 15px;
  }
  .toc-close { display: inline-grid; }
  .toc a { padding: 8px 12px; }
}
@media (min-width: 1024px) { .toc-backdrop { display: none !important; } }

/* ---------- content typography ---------- */

.sec { padding-top: 8px; }
.content h2 {
  margin: 48px 0 14px; padding-top: 28px; border-top: 1px solid var(--line);
  font-size: 26px; line-height: 1.45; font-weight: 800;
}
.content .sec:first-child h2 { margin-top: 26px; padding-top: 0; border-top: 0; }
.content h3 { margin: 34px 0 10px; font-size: 20px; line-height: 1.5; font-weight: 800; }
.content h4 { margin: 22px 0 8px; font-size: 16px; font-weight: 800; }
.content p { margin: 0 0 14px; }
.content ul, .content ol { margin: 0 0 16px; padding-inline-start: 22px; }
.content li { margin: 4px 0; }
.content li::marker { color: var(--muted); }
.content strong { font-weight: 800; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.anchor {
  margin-inline-start: 6px; color: var(--muted); font-weight: 600; text-decoration: none;
  opacity: 0; transition: opacity 0.15s ease;
}
h2:hover > .anchor, h3:hover > .anchor, .anchor:focus-visible { opacity: 1; }
@media (hover: none) { .anchor { opacity: 0.4; } }

code { font-family: var(--mono); font-size: 0.88em; direction: ltr; unicode-bidi: isolate; }
.content :not(pre) > code {
  padding: 1px 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--soft);
  overflow-wrap: anywhere;
}
.content h2 code, .content h3 code { font-size: 0.85em; }
a code { color: inherit; }

/* ---------- code blocks + language tabs ---------- */

.code {
  min-width: 0; margin: 14px 0 18px; overflow: hidden;
  border-radius: 14px; background: var(--code-bg); border: 1px solid var(--code-line);
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 42px; padding: 4px 6px; background: var(--code-bar); border-bottom: 1px solid var(--code-line);
}
.code-label { min-width: 0; padding: 0 8px; color: var(--code-muted); font-size: 13px; font-weight: 700; }
.code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; direction: ltr; text-align: left;
  color: var(--code-text); font-family: var(--mono); font-size: 13.5px; line-height: 1.7; tab-size: 2;
  scrollbar-width: thin; scrollbar-color: var(--code-line) transparent;
}
.code pre:focus-visible { outline-offset: -2px; }
.code pre code { font-size: inherit; white-space: pre; }

.tab-list { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tab-list::-webkit-scrollbar { display: none; }
.tab-list button {
  flex: none; padding: 6px 12px; border: 0; border-radius: 9px; background: transparent;
  color: var(--code-muted); font-size: 13.5px; font-weight: 700; cursor: pointer;
}
.tab-list button:hover { color: #fff; background: rgba(255, 255, 255, 0.05); }
.tab-list button[aria-selected="true"] { color: #fff; background: rgba(14, 159, 110, 0.28); }

.copy-btn {
  display: inline-flex; flex: none; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 9px; border: 1px solid var(--code-line);
  background: rgba(255, 255, 255, 0.04); color: var(--code-muted);
  font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.copy-btn .i { width: 15px; height: 15px; }
.copy-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.copy-btn.done { color: #8BE3B6; border-color: rgba(139, 227, 182, 0.45); }
/* In the hero the button sits in the card's corner, so adding it after load shifts nothing. */
.facts .copy-btn {
  position: absolute; top: 7px; inset-inline-end: 8px; padding: 2px 9px;
  border-color: rgba(255, 255, 255, 0.2); color: #C9D6E2;
}
.facts .copy-btn.done { color: #8BE3B6; border-color: rgba(139, 227, 182, 0.45); }
.copy-buffer { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.tok-c { color: var(--tok-c); }
.tok-s { color: var(--tok-s); }
.tok-k { color: var(--tok-k); }
.tok-n { color: var(--tok-n); }
.tok-p { color: var(--tok-p); }
.tok-v { color: var(--tok-v); }

/* ---------- tables ---------- */

.table-wrap {
  margin: 14px 0 18px; overflow-x: auto;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.75; }
.table-wrap th {
  padding: 9px 12px; background: var(--soft); color: var(--muted);
  font-size: 13px; font-weight: 700; text-align: start; white-space: nowrap;
}
.table-wrap td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }
.table-wrap td:first-child code { font-weight: 700; }
.table-wrap td:first-child > code, .ep-table code { white-space: nowrap; }
.table-wrap tr.sub td:first-child { padding-inline-start: 26px; }
.type {
  display: inline-block; direction: ltr; unicode-bidi: isolate; white-space: nowrap;
  color: var(--muted); font-family: var(--mono); font-size: 12.5px;
}
.req { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.req-yes { background: var(--tint-green); color: var(--ink-green); }
.req-no { background: var(--soft); color: var(--muted); }
.req-one { background: var(--tint-blue); color: var(--ink-blue); }
.http { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.compare td:not(:first-child), .compare th:not(:first-child) { text-align: center; white-space: nowrap; }
.compare th code { font-weight: 600; }

/* Narrow screens: rows of .rt tables become cards (no sideways scrolling). */
@media (max-width: 640px) {
  .table-wrap.rt { overflow: visible; border: 0; border-radius: 0; background: transparent; }
  .rt table, .rt tbody, .rt tr, .rt td { display: block; width: auto; }
  .rt thead { display: none; }
  .rt tr {
    margin-bottom: 8px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  }
  .rt td { padding: 0; border: 0; }
  .rt td.inl { display: inline-block; margin: 0 0 4px; margin-inline-end: 8px; vertical-align: middle; }
  .rt td:not(.inl) { margin-top: 2px; }
  .rt td[data-label]::before {
    content: attr(data-label); display: block; margin-top: 6px;
    color: var(--muted); font-size: 12.5px; font-weight: 700;
  }
  .rt tr.sub td:first-child { padding-inline-start: 0; }
  .rt tr.sub { margin-inline-start: 14px; }
  .rt .compare td:first-child { font-weight: 700; }
  .rt .compare td.inl { min-width: 112px; margin-inline-end: 18px; text-align: start; }
}

/* ---------- callouts, chips, small bits ---------- */

.callout {
  display: flex; align-items: flex-start; gap: 12px;
  margin: 16px 0 20px; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--soft);
}
.callout > .i { margin-top: 4px; color: var(--muted); }
.callout > div { min-width: 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout.tip { background: var(--mint); border-color: rgba(14, 159, 110, 0.25); }
.callout.tip > .i { color: var(--green-dark); }
.callout.danger { background: var(--danger-bg); border-color: rgba(180, 35, 24, 0.22); }
.callout.danger > .i { color: var(--danger); }

.m {
  display: inline-block; padding: 1px 7px; border-radius: 6px; direction: ltr;
  font-family: var(--mono); font-size: 11.5px; font-weight: 800; letter-spacing: 0.3px; line-height: 1.6;
}
.m.post { background: var(--tint-green); color: var(--ink-green); }
.m.get { background: var(--tint-blue); color: var(--ink-blue); }

.chip {
  display: inline-flex; align-items: center; padding: 1px 10px; border-radius: 999px; direction: ltr;
  font-family: var(--mono); font-size: 12.5px; font-weight: 700; line-height: 1.7; white-space: nowrap;
}
.st-pending { background: var(--amber); color: #0B1B2E; }
.st-paid { background: var(--tint-green); color: var(--ink-green); }
.st-expired { background: var(--tint-slate); color: var(--ink-slate); }
.st-canceled { background: var(--danger-bg); color: var(--danger); }
.fa-name { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.rt .fa-name { display: inline; margin: 0 6px; }

.tag {
  display: inline-block; padding: 1px 9px; border-radius: 999px; vertical-align: middle;
  font-size: 12px; font-weight: 700; line-height: 1.7; white-space: nowrap;
}
.tag-test { background: var(--tint-blue); color: var(--ink-blue); }
.tag-live { background: var(--tint-green); color: var(--ink-green); }

.states { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 14px; }
.states .or { color: var(--muted); font-size: 14px; }
.arrow { width: 18px; height: 18px; color: var(--muted); }

.formula {
  padding: 10px 14px; border-radius: 12px; border: 1px dashed var(--line); background: var(--surface);
  font-weight: 700;
}

/* ---------- money path / confirmation path ---------- */

.paths { display: grid; gap: 12px; margin: 20px 0 8px; }
.path { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.path-money { border-color: rgba(14, 159, 110, 0.4); }
.path-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px !important; font-weight: 800; }
.path-title .i { color: var(--green-dark); }
.path-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.node {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap;
}
.node .i { width: 17px; height: 17px; color: var(--green-dark); }
.node-strong { background: var(--tint-green); border-color: transparent; color: var(--ink-green); }
.node-strong .i { color: inherit; }
.path-note { margin: 10px 0 0 !important; color: var(--muted); font-size: 13.5px; }

/* ---------- order flow ---------- */

.flow { list-style: none; margin: 14px 0 18px; padding: 0 !important; }
.flow > li { position: relative; display: flex; gap: 14px; margin: 0; padding-bottom: 16px; }
.flow > li::before {
  content: ''; position: absolute; inset-inline-start: 15px; top: 34px; bottom: 2px;
  width: 2px; background: var(--line);
}
.flow > li:last-child::before { display: none; }
.flow-n {
  display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: var(--tint-green); color: var(--ink-green); font-weight: 800; font-size: 15px;
}
.flow-n .i { width: 17px; height: 17px; }
.flow-body { min-width: 0; padding-top: 2px; }
.flow-body p { margin: 0 0 4px; }
.flow-who { color: var(--muted); font-size: 13px; font-weight: 600; }
.flow-title { font-weight: 800; }
.flow > li.side .flow-n { background: var(--surface); border: 2px dashed var(--green); }
.flow > li.side .flow-body {
  flex: 1; padding: 10px 14px; border: 1px dashed var(--line); border-radius: 14px; background: var(--surface);
}

/* ---------- quick start ---------- */

.step h3 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.step-n {
  display: inline-grid; place-items: center; flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--tint-green); color: var(--ink-green); font-size: 15px; font-weight: 800;
}
.keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 12px 0 14px; }
.key-card { padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.key-card p { margin: 0; font-size: 14.5px; }
.key-name { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px !important; }
.key-name code { font-weight: 700; }

/* ---------- endpoints ---------- */

.endpoint { margin-top: 30px; padding-top: 4px; border-top: 1px dashed var(--line); }
.endpoint h3 { margin-top: 22px; }
.route {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 14px;
  padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.content .route code {
  padding: 0; border: 0; background: none; font-size: 14.5px; font-weight: 700; overflow-wrap: anywhere;
}
.errs { list-style: none; padding: 0 !important; }
.errs li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin: 6px 0; }
.errs li > code { font-weight: 700; }
.errs li > span { flex: 1 1 240px; min-width: 0; }

.numbered li { margin: 6px 0; }

.retries { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; list-style: none; margin: 10px 0 14px; padding: 0 !important; }
.retries li {
  margin: 0; padding: 3px 12px; border-radius: 999px;
  background: var(--soft); border: 1px solid var(--line); font-size: 14px; font-weight: 600;
}
.retries li.end { background: var(--danger-bg); border-color: transparent; color: var(--danger); }

/* ---------- test mode ---------- */

.test-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 760px) { .test-grid { grid-template-columns: minmax(0, 1fr); } }
.checks { list-style: none; padding: 0 !important; }
.checks li { position: relative; margin: 8px 0; padding-inline-start: 26px; }
.checks li::before {
  content: ''; position: absolute; inset-inline-start: 5px; top: 8px; width: 6px; height: 11px;
  border: solid var(--green-dark); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.mock { margin: 4px 0 0; }
.mock-screen {
  display: grid; gap: 8px; padding: 14px; border-radius: 20px;
  border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow);
}
.mock-banner {
  margin: 0 !important; padding: 10px 12px; border-radius: 12px;
  background: var(--tint-blue); color: var(--ink-blue); font-size: 13.5px; line-height: 1.8;
}
.mock-banner b { display: block; }
.mock-btn {
  display: block; padding: 9px 12px; border-radius: 12px; border: 1.5px solid var(--line);
  text-align: center; font-size: 14px; font-weight: 700;
}
.mock-primary { background: #057A55; border-color: #057A55; color: #fff; }
.mock figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- tips + FAQ ---------- */

.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin: 16px 0; }
.tip-card { padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.content .tip-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 16px; }
.tip-card h3 .i { color: var(--green-dark); }
.tip-card p { margin: 0; font-size: 14.5px; }

.faq details { margin-bottom: 8px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; font-weight: 700; cursor: pointer; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary .i { color: var(--muted); transition: transform 0.2s ease; }
.faq details[open] > summary .i { transform: rotate(180deg); }
.faq details > div { padding: 0 16px 6px; }

/* ---------- footer ---------- */

.foot { border-top: 1px solid var(--line); background: var(--surface); }
.foot-in { display: grid; gap: 10px; max-width: 1240px; margin: 0 auto; padding: 26px 16px 34px; }
.foot-brand { display: flex; align-items: center; gap: 10px; }
.foot-brand img { border-radius: 9px; }
.foot-brand span { display: grid; line-height: 1.5; }
.foot-brand small { color: var(--muted); font-size: 13px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { font-weight: 600; font-size: 14.5px; text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }
.foot .legal, .foot .copy { margin: 0; color: var(--muted); font-size: 13.5px; }

/* ---------- small screens ---------- */

@media (max-width: 640px) {
  .hero-in { padding: 30px 16px 28px; }
  .lead { font-size: 16px; }
  .content h2 { font-size: 23px; margin-top: 40px; padding-top: 24px; }
  .content h3 { font-size: 18.5px; }
  .code { border-radius: 12px; }
  .code pre { padding: 12px 14px; font-size: 13px; }
  .callout { padding: 12px 14px; gap: 10px; }
}

@media print {
  .topbar, .toc, .toc-backdrop, .copy-btn, .anchor, .skip { display: none !important; }
  .layout { display: block; }
  .hero { color: var(--text); background: none; }
  .lead, .facts code, .legal-note { color: var(--text); }
  .code pre { white-space: pre-wrap; }
  .code pre code { white-space: pre-wrap; }
}
