/* ===========================================================================
   DOCS  —  shared chrome and components for every page under /docs.
   Loads after style.css and reuses its tokens (--bg, --sf, --bd, --tx, --pur,
   --grad, --nav); the extra tokens below are the ones style.css has no
   equivalent for, and they are defined for both themes.

   Layout: 1320px shell with 12px gutters, matching Bootstrap's .container in
   the navbar, so the sidebar lines up with the logo and the on-this-page rail
   with the trial button.
   =========================================================================== */

:root {
  /* code surfaces - replaces the hardcoded #0a0a12 that ignored the theme */
  --code-bg: #0f0f1c;
  --code-bd: rgba(255, 255, 255, .09);
  --code-tx: #d8d8f0;
  --c-key: #c4b5fd;
  --c-str: #86efac;
  --c-num: #fbbf24;
  --c-punc: #6b6b8a;
  /* semantic callout hues */
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --info: #60a5fa;
}
.lm {
  --code-bg: #f7f7fd;
  --code-bd: rgba(99, 71, 246, .16);
  --code-tx: #1e1e35;
  --c-key: #7c3aed;
  --c-str: #047857;
  --c-num: #b45309;
  --c-punc: #8b8bb0;
  --ok: #059669;
  --warn: #b45309;
  --danger: #dc2626;
  --info: #2563eb;
}

html { scroll-padding-top: calc(var(--nav) + 24px); }

/* --- search trigger, sits in the navbar ---------------------------------- */
.docs-sbtn {
  display: flex; align-items: center; gap: 9px;
  width: 230px; height: 38px; padding: 0 12px;
  border-radius: 12px; cursor: pointer;
  background: var(--sf); border: 1px solid var(--bd2);
  color: var(--tx3); font: inherit; font-size: .86rem; text-align: left;
}
.docs-sbtn:hover { border-color: var(--pur); color: var(--tx2); }
.docs-sbtn kbd {
  margin-left: auto; font-family: inherit; font-size: .72rem; font-weight: 600;
  border: 1px solid var(--bd2); border-radius: 5px; padding: 1px 5px; color: var(--tx3);
}
@media (max-width: 991px) { .docs-sbtn { display: none; } }

/* --- shell ---------------------------------------------------------------- */
#docs { padding-top: var(--nav); }
.docs-shell {
  max-width: 1320px; margin: 0 auto; padding: 36px 12px 80px;
  display: flex; align-items: flex-start; gap: 0;
}

/* --- sidebar -------------------------------------------------------------- */
.docs-side {
  width: 244px; flex-shrink: 0; padding-right: 24px; position: sticky;
  top: calc(var(--nav) + 24px); max-height: calc(100vh - var(--nav) - 48px); overflow-y: auto;
}
.docs-side h4 {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--tx3); margin: 22px 0 6px;
}
.docs-side h4:first-child { margin-top: 0; }
.docs-sub { list-style: none; margin: 0 0 2px; padding: 0; }
.docs-sub li { margin: 0; }
.docs-sub a {
  display: flex; align-items: center; gap: 9px; padding: 7px 11px;
  border-radius: 8px; font-size: .87rem; line-height: 1.4;
  color: var(--tx2); text-decoration: none;
}
.docs-sub a i { font-size: .78rem; width: 15px; text-align: center; color: var(--tx3); flex-shrink: 0; }
.docs-sub a:hover { color: var(--tx); background: var(--sf); }
.docs-sub a.active { color: #fff; background: var(--grad); font-weight: 600; }
.docs-sub a.active i { color: #fff; }

/* --- article -------------------------------------------------------------- */
.docs-content {
  flex: 1; min-width: 0; padding: 0 40px;
  border-left: 1px solid var(--bd); border-right: 1px solid var(--bd);
}
.docs-crumb {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: .79rem; color: var(--tx3); margin-bottom: 14px;
}
.docs-crumb a { color: var(--tx3); text-decoration: none; }
.docs-crumb a:hover { color: var(--pur); }
.docs-crumb i { font-size: .6rem; }

.docs-content h1 {
  font-size: 2.15rem; font-weight: 800; letter-spacing: -.02em;
  color: var(--tx); margin: 0 0 12px; line-height: 1.15; text-align: left;
}
.docs-lede { font-size: 1.02rem; line-height: 1.7; color: var(--tx2); margin: 0 0 10px; }
.docs-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: .78rem; color: var(--tx3);
  padding-bottom: 22px; margin-bottom: 28px; border-bottom: 1px solid var(--bd);
}
.docs-meta span { display: inline-flex; align-items: center; gap: 6px; }

.docs-content h2 {
  font-size: 1.32rem; font-weight: 700; color: var(--tx);
  margin: 46px 0 14px; text-align: left;
  scroll-margin-top: calc(var(--nav) + 20px);
}
.docs-content h2:first-of-type { margin-top: 0; }
.docs-content h3 { font-size: 1rem; font-weight: 700; color: var(--tx); margin: 26px 0 10px; }
.docs-content h4 { font-size: .92rem; font-weight: 700; color: var(--tx2); margin: 20px 0 8px; }
.docs-content p { font-size: .95rem; line-height: 1.75; color: var(--tx2); margin: 0 0 14px; }
.docs-content strong, .docs-content b { color: var(--tx); font-weight: 700; }
.docs-content a { color: var(--pur); }
.docs-content a.orange-font { color: #f59e0b; }

.docs-content ul.list-item-one,
.docs-content ol.list-item-one { padding-left: 20px; margin: 0 0 16px; }
.docs-content ul.list-item-one li,
.docs-content ol.list-item-one li {
  font-size: .95rem; line-height: 1.7; color: var(--tx2); margin-bottom: 8px;
}
.docs-content ul ul, .docs-content ol ol { margin-top: 8px; }

/* --- inline + block code --------------------------------------------------- */
.docs-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .85em; background: var(--bg3); border: 1px solid var(--bd);
  border-radius: 5px; padding: 1px 6px; color: var(--pur);
}
.docs-code {
  position: relative; margin: 0 0 16px; border: 1px solid var(--code-bd);
  border-radius: 10px; background: var(--code-bg); overflow: hidden;
}
.docs-code-h {
  display: flex; align-items: center; gap: 8px; padding: 8px 12px 8px 14px;
  border-bottom: 1px solid var(--code-bd); background: var(--bg2);
}
.docs-code-h span {
  font-size: .74rem; font-weight: 600; color: var(--tx3);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.docs-cpy {
  margin-left: auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px; border-radius: 7px; cursor: pointer;
  background: transparent; border: 1px solid var(--bd2);
  color: var(--tx3); font: inherit; font-size: .74rem; font-weight: 600;
}
.docs-cpy:hover { color: var(--tx); border-color: var(--pur); }
.docs-cpy.done { color: var(--ok); border-color: var(--ok); }
.docs-code pre {
  margin: 0; padding: 14px 16px; overflow-x: auto; max-height: 460px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .82rem; line-height: 1.65; color: var(--code-tx); white-space: pre;
}
.docs-code pre code {
  background: none; border: 0; padding: 0; color: inherit; font-size: inherit;
}
.docs-code .k { color: var(--c-key); }
.docs-code .s { color: var(--c-str); }
.docs-code .n { color: var(--c-num); }
.docs-code .p { color: var(--c-punc); }

/* --- semantic callouts ----------------------------------------------------- */
.docs-note {
  display: flex; gap: 13px; padding: 14px 17px; margin: 0 0 18px;
  border-radius: 11px; border: 1px solid; font-size: .9rem; line-height: 1.65;
}
.docs-note > i { font-size: .95rem; margin-top: 2px; flex-shrink: 0; }
.docs-note b {
  display: block; margin-bottom: 3px; font-size: .78rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.docs-note p { margin: 0; font-size: .9rem; color: var(--tx2); }
.docs-note p + p { margin-top: 6px; }
.docs-note code { white-space: nowrap; }
.n-info { background: color-mix(in srgb, var(--info) 8%, transparent); border-color: color-mix(in srgb, var(--info) 26%, transparent); }
.n-info > i, .n-info b { color: var(--info); }
.n-warn { background: color-mix(in srgb, var(--warn) 10%, transparent); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.n-warn > i, .n-warn b { color: var(--warn); }
.n-danger { background: color-mix(in srgb, var(--danger) 9%, transparent); border-color: color-mix(in srgb, var(--danger) 28%, transparent); }
.n-danger > i, .n-danger b { color: var(--danger); }
.n-ok { background: color-mix(in srgb, var(--ok) 9%, transparent); border-color: color-mix(in srgb, var(--ok) 28%, transparent); }
.n-ok > i, .n-ok b { color: var(--ok); }

/* --- tables ---------------------------------------------------------------- */
.docs-tw {
  overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--bd);
  border-radius: 12px; background: var(--sf);
}
.docs-tw table { width: 100%; border-collapse: collapse; font-size: .88rem; margin: 0; }
.docs-tw thead th {
  text-align: left; font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--tx3); padding: 11px 16px;
  border-bottom: 1px solid var(--bd); white-space: nowrap; background: var(--bg2);
}
.docs-tw tbody td {
  padding: 12px 16px; border-bottom: 1px solid var(--bd);
  color: var(--tx2); vertical-align: top; line-height: 1.6;
}
.docs-tw tbody tr:last-child td { border-bottom: 0; }
.docs-tw tbody td:first-child { color: var(--tx); font-weight: 600; }
.docs-tw tbody tr:hover td { background: var(--bg2); }

/* --- platform tabs ---------------------------------------------------------- */
.docs-tabs {
  margin: 0 0 20px; border: 1px solid var(--bd2); border-radius: 12px;
  overflow: hidden; background: var(--sf);
}
.docs-tabbar {
  display: flex; gap: 2px; padding: 6px; background: var(--bg2);
  border-bottom: 1px solid var(--bd);
}
.docs-tabbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--tx3);
}
.docs-tabbtn:hover { color: var(--tx2); }
.docs-tabbtn[aria-selected="true"] {
  background: var(--sf); color: var(--tx); box-shadow: 0 1px 3px rgba(0, 0, 0, .1);
}
.docs-tabpanel { padding: 20px 22px; }
.docs-tabpanel[hidden] { display: none !important; }
.docs-tabpanel > :last-child { margin-bottom: 0; }

/* --- numbered procedure ------------------------------------------------------ */
.docs-steps { list-style: none; counter-reset: s; margin: 0 0 20px; padding: 0; }
.docs-steps > li { counter-increment: s; position: relative; padding: 0 0 22px 42px; }
.docs-steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -1px;
  width: 27px; height: 27px; border-radius: 9px; background: var(--grad);
  color: #fff; font-size: .8rem; font-weight: 700; display: grid; place-items: center;
}
.docs-steps > li::after {
  content: ""; position: absolute; left: 13px; top: 32px; bottom: 2px;
  width: 1px; background: var(--bd2);
}
.docs-steps > li:last-child { padding-bottom: 0; }
.docs-steps > li:last-child::after { display: none; }
.docs-steps h3 { font-size: .97rem; font-weight: 700; color: var(--tx); margin: 3px 0 7px; }
.docs-steps p { font-size: .92rem; margin: 0 0 9px; }
.docs-steps > li > :last-child { margin-bottom: 0; }

.docs-badge {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: middle;
  padding: 2px 8px; border-radius: 20px; font-size: .68rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.b-req { background: color-mix(in srgb, var(--danger) 13%, transparent); color: var(--danger); }

/* --- figures ------------------------------------------------------------------ */
.docs-fig { margin: 0 0 18px; }
.docs-fig img {
  width: 100%; height: auto; display: block; border-radius: 11px;
  border: 1px solid var(--bd2);
}
.docs-fig figcaption { font-size: .81rem; color: var(--tx3); line-height: 1.6; margin-top: 9px; }
.docs-fig figcaption b { color: var(--tx2); }
/* pages mark a figure .noimg via onerror when the capture is not in yet */
.docs-fig.noimg {
  border: 1px dashed var(--bd2); border-radius: 12px;
  padding: 16px 18px; background: var(--sf);
}
.docs-fig.noimg img { display: none; }
.docs-fig.noimg figcaption { margin-top: 0; }
.docs-fig.noimg figcaption::before { content: "Screenshot pending \2014 "; color: #f59e0b; font-weight: 700; }

/* --- walkthrough step badges (web-scan, findings) ---------------------------- */
.docs-content .dlead { font-size: 1.02rem; line-height: 1.7; color: var(--tx2); margin: 0 0 10px; }
.dstep { display: flex; align-items: center; gap: 12px; margin: 46px 0 12px;
         scroll-margin-top: calc(var(--nav) + 20px); }
.dstep span {
  width: 30px; height: 30px; border-radius: 9px; background: var(--grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 800; flex: none;
}
.dstep h2 { margin: 0 !important; }
.docs-content ol.dsteps-list { padding-left: 20px; margin-bottom: 16px; }
.docs-content ol.dsteps-list li { font-size: .95rem; line-height: 1.7; color: var(--tx2); margin-bottom: 7px; }

/* policies puts a check count in the second column - keep it numeric and accented */
.docs-tw table.dtable td:nth-child(2) {
  color: var(--pur); font-weight: 700; font-variant-numeric: tabular-nums;
}

/* --- on this page --------------------------------------------------------------- */
.docs-toc {
  width: 218px; flex-shrink: 0; padding-left: 26px; position: sticky;
  top: calc(var(--nav) + 24px); max-height: calc(100vh - var(--nav) - 48px); overflow-y: auto;
}
.docs-toc h4 {
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--tx3); margin: 0 0 9px;
}
.docs-toc ul { list-style: none; margin: 0 0 20px; padding: 0; border-left: 1px solid var(--bd); }
.docs-toc li { margin: 0; }
.docs-toc a {
  display: block; padding: 6px 0 6px 13px; margin-left: -1px;
  border-left: 2px solid transparent; font-size: .81rem; line-height: 1.45;
  color: var(--tx3); text-decoration: none; transition: .18s;
}
.docs-toc a:hover { color: var(--tx2); }
.docs-toc a.on { color: var(--pur); border-left-color: var(--pur); font-weight: 600; }
.docs-toc-act {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 8px 11px; border-radius: 9px; cursor: pointer;
  background: var(--sf); border: 1px solid var(--bd2);
  color: var(--tx2); font: inherit; font-size: .79rem; font-weight: 600;
}
.docs-toc-act:hover { border-color: var(--pur); color: var(--tx); }
.docs-toc-act i { color: var(--pur); }

/* --- prev / next + feedback -------------------------------------------------------- */
.docs-pn {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 52px; padding-top: 26px; border-top: 1px solid var(--bd);
}
.docs-pn a {
  display: block; padding: 15px 17px; border-radius: 12px;
  border: 1px solid var(--bd2); background: var(--sf); text-decoration: none;
}
.docs-pn a:hover { border-color: var(--pur); }
.docs-pn small {
  display: block; font-size: .73rem; color: var(--tx3); text-transform: uppercase;
  letter-spacing: .07em; font-weight: 700; margin-bottom: 4px;
}
.docs-pn strong { font-size: .93rem; color: var(--tx); font-weight: 600; }
.docs-pn .nx { text-align: right; }
.docs-pn .ph { visibility: hidden; }

/* --- search palette ------------------------------------------------------------------ */
dialog.docs-pal { border: 0; padding: 0; background: transparent; width: 92vw; max-width: 560px; margin-top: 12vh; }
dialog.docs-pal::backdrop { background: rgba(5, 5, 15, .55); backdrop-filter: blur(3px); }
.docs-pal-in {
  background: var(--bg2); border: 1px solid var(--bd2); border-radius: 15px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .4); overflow: hidden;
}
.docs-pal-in input {
  width: 100%; padding: 17px 19px; border: 0; outline: 0; background: none;
  color: var(--tx); font: inherit; font-size: 1rem; border-bottom: 1px solid var(--bd);
}
.docs-pal-in input::placeholder { color: var(--tx3); }
.docs-pal-res { max-height: 320px; overflow-y: auto; padding: 7px; }
.docs-pal-res a {
  display: flex; align-items: center; gap: 11px; padding: 10px 13px;
  border-radius: 9px; color: var(--tx2); text-decoration: none; font-size: .89rem;
}
.docs-pal-res a:hover, .docs-pal-res a.hi { background: var(--sf); color: var(--tx); }
.docs-pal-res a i { color: var(--tx3); font-size: .8rem; width: 15px; flex-shrink: 0; }
.docs-pal-res a em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--tx3); padding-left: 10px; }
.docs-pal-none { padding: 26px; text-align: center; color: var(--tx3); font-size: .88rem; }

.docs-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(14px);
  background: var(--tx); color: var(--bg); padding: 10px 18px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; opacity: 0; pointer-events: none;
  transition: .2s; z-index: 3000;
}
.docs-toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- responsive ------------------------------------------------------------------------ */
@media (max-width: 1199px) {
  .docs-toc { display: none; }
  .docs-content { border-right: 0; padding-right: 0; max-width: 860px; }
}
@media (max-width: 900px) {
  .docs-shell { flex-direction: column; }
  .docs-side {
    position: static; width: 100%; max-height: none; padding-right: 0;
    border-bottom: 1px solid var(--bd); margin-bottom: 24px; padding-bottom: 12px;
  }
  .docs-content { border-left: 0; padding-left: 0; max-width: 100%; }
  .docs-pn { grid-template-columns: 1fr; }
  .docs-content h1 { font-size: 1.75rem; }
}
