/* =============================================================================
   SecureFlag Knowledge Base — 2026 theming layer
   -----------------------------------------------------------------------------
   Mirrors the blog's dark/white theming (IdeaProjects/blog redesign-2026.css):
     • HEADER + FOOTER  → exact replica of landing-website-2026, ported verbatim
       from the blog (l26 classes). Theme-aware: light chrome in white mode,
       dark chrome in dark mode.
     • BODY / CONTENT   → the KB uses the just-the-docs theme, so the dark-theme
       overrides below re-colour just-the-docs selectors (.side-bar, .main-content,
       .nav-list, .search-*, tables, code, …). White/light theme keeps the KB's
       existing just-the-docs light design; only the chrome + fonts change.
     • FONTS            → Inter (body) / Poppins (headings) / IBM Plex Mono (code),
       applied in BOTH themes, exactly like the blog.
   Loaded LAST in _includes/head.html so it wins. Remove that <link> to revert.
   Theme is stored in localStorage('sf-theme') and applied via html[data-theme].
   ========================================================================== */

/* Exact font set from landing-website-2026 — same families AND weights. */
@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@300;400;500;600&family=Poppins:wght@400;500;600;700&display=swap");

/* ============================================================ tokens ======= */
/* Chrome (header/footer) tokens are theme-aware — defined in BOTH blocks and
   consumed by the l26 header/footer. Body tokens are consumed inside the
   html[data-theme="dark"] overrides further down. */
:root,
html[data-theme="dark"] {
  --sf-bg:            #000000;
  --sf-bg-soft:       #05070d;
  --sf-surface:       #0c1120;   /* dark-inner */
  --sf-surface-2:     #141a2b;   /* dark-card  */
  --sf-panel:         #0e1320;   /* dark-panel */
  --sf-border:        rgba(255, 255, 255, 0.09);   /* border-dark */
  --sf-border-soft:   rgba(255, 255, 255, 0.06);
  --sf-text:          #e5e6e8;   /* subdued */
  --sf-heading:       #ffffff;
  --sf-muted:         rgba(255, 255, 255, 0.60);
  --sf-muted-2:       rgba(255, 255, 255, 0.44);
  --sf-primary:       #2f6fd6;
  --sf-primary-dark:  #245bb5;
  --sf-primary-light: #6ba4ff;

  /* theme-aware chrome */
  --sf-header-bg:        rgba(0, 0, 0, 0.64);       /* Header.jsx: top state */
  --sf-header-bg-scroll: rgba(0, 0, 0, 0.85);       /* Header.jsx: scrolled  */
  --sf-glass:            rgba(255, 255, 255, 0.08);
  --sf-glass-2:          rgba(255, 255, 255, 0.07);
  --sf-dropdown-bg:      rgba(15, 15, 15, 0.95);     /* #0f0f0f/95 */
  --sf-dropdown-border:  rgba(255, 255, 255, 0.27);  /* border-white/[0.27] */
  --sf-mobile-bg:        rgba(10, 10, 10, 0.98);
  --sf-nav-text:         rgba(255, 255, 255, 0.70);  /* text-white/70 */
  --sf-nav-hover-text:   #ffffff;                    /* hover:text-white */
  --sf-dropdown-text:    rgba(255, 255, 255, 0.60);  /* text-white/60 */
  --sf-footer-heading:   #ffffff;
  --sf-footer-text:      rgba(255, 255, 255, 0.70);
  --sf-footer-hover-text:#ffffff;
  --sf-footer-copyright: rgba(255, 255, 255, 0.50);
  --sf-btn-solid-bg:     #ffffff;
  --sf-btn-solid-text:   #1a1b1c;   /* `dark` token */
  --sf-btn-solid-hover:  rgba(255, 255, 255, 0.90);
  --sf-burger:           #ffffff;
  --sf-header-border:    rgba(255, 255, 255, 0.06);
}

html[data-theme="light"] {
  --sf-header-bg:        rgba(255, 255, 255, 0.80);
  --sf-header-bg-scroll: rgba(255, 255, 255, 0.92);
  --sf-glass:            rgba(17, 20, 26, 0.06);
  --sf-glass-2:          rgba(17, 20, 26, 0.05);
  --sf-dropdown-bg:      rgba(255, 255, 255, 0.98);
  --sf-dropdown-border:  rgba(17, 20, 26, 0.12);
  --sf-mobile-bg:        rgba(255, 255, 255, 0.98);
  --sf-nav-text:         #14161a;   /* solid black for legibility on white */
  --sf-nav-hover-text:   #000000;
  --sf-dropdown-text:    #14161a;
  --sf-footer-heading:   #14161a;
  --sf-footer-text:      #14161a;   /* solid black footer links */
  --sf-footer-hover-text:#000000;
  --sf-footer-copyright: rgba(20, 24, 31, 0.70);
  --sf-btn-solid-bg:     #1a1b1c;
  --sf-btn-solid-text:   #ffffff;
  --sf-btn-solid-hover:  #2c2c2d;
  --sf-burger:           #14161a;
  --sf-header-border:    rgba(17, 20, 26, 0.10);
}

/* chrome cross-fades when the theme flips */
header.l26-header, .l26-dropdown, footer.l26-footer, .l26-mobile,
.l26-btn, .l26-nav__item, .l26-theme-toggle, .l26-fcol a {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease;
}

/* ============================================ KB font (both themes) ======== */
/* The ONLY change applied to the KB body in both themes: the typeface. */
body,
p, li, span, td, th, dd, dt, blockquote, figcaption {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif !important;
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-synthesis: none;
}
header.l26-header, footer.l26-footer, .l26-mobile {
  font-family: 'Inter', sans-serif;
  font-weight: 300;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4, h5, h6,
.main-content h1, .main-content h2, .main-content h3,
.main-content h4, .main-content h5, .main-content h6 {
  font-family: 'Poppins', 'Inter', sans-serif !important;
}
code, pre, tt, kbd, samp,
.highlight, .highlight pre, .highlight code,
.main-content code, .main-content pre {
  font-family: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, monospace !important;
}

/* ===================================================== header (l26) ======= */
/* Exact landing-website-2026 Header.jsx: 78px, blurred, centered nav w/ 15px
   items and 13px dropdowns; theme-aware colours via the tokens above. */
header.l26-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 78px;                            /* landing: h-[78px] (border-box, incl. border) */
  z-index: 100;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;                      /* landing: py-5 px-6 */
  background: var(--sf-header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);              /* landing: backdrop-blur-[8px] */
  border-bottom: 1px solid var(--sf-header-border);
  transition: background-color .2s ease, border-color .2s ease;
}
header.l26-header.is-scrolled { background: var(--sf-header-bg-scroll); }

.l26-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.l26-logo img { height: 38px; width: 152px; object-fit: contain; object-position: left center; display: block; max-width: none; }   /* landing: h-[38px] w-[152px] object-contain */
/* logo swap — !important + parent scope beats `.l26-logo img { display:block }` */
.l26-logo .l26-logo-light { display: none !important; }
html[data-theme="light"] .l26-logo .l26-logo-dark { display: none !important; }
html[data-theme="light"] .l26-logo .l26-logo-light { display: block !important; }

.l26-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 2px;                                /* landing: gap-0.5 */
}
.l26-nav__item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;                         /* landing: text-[15px] */
  font-weight: 300;                        /* landing base body weight (Inter Light) */
  line-height: 1;
  color: var(--sf-nav-text);               /* solid black in light / white/70 in dark */
  background: transparent;
  border: none;
  border-radius: 999px;                    /* rounded-full */
  padding: 6px 12px;                       /* py-1.5 px-3 */
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.l26-nav__item:hover { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass); }
.l26-chevron {
  width: 13px; height: 13px;
  flex-shrink: 0;
  display: block;
  max-width: none;
  opacity: 1;
  color: var(--sf-nav-hover-text) !important;   /* #fff dark / #14161a light */
  stroke: var(--sf-nav-hover-text) !important;
  stroke-width: 2;
  transition: transform .2s ease, color .15s ease;
}

.l26-nav__group { position: relative; }
/* invisible hover bridge so the dropdown stays open across the gap */
.l26-nav__group::after { content: ""; position: absolute; top: 100%; left: 0; right: 0; height: 14px; }
.l26-nav__group:hover .l26-nav__item { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass); }
.l26-nav__group:hover .l26-chevron { transform: rotate(180deg); }

.l26-dropdown {
  position: absolute;
  top: calc(100% + 10px);                  /* landing: pt-2.5 */
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;                        /* landing: min-w-[220px] */
  max-width: 340px;                        /* landing: max-w-[260px] */
  background: var(--sf-dropdown-bg);       /* #0f0f0f/95 */
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);             /* backdrop-blur-xl */
  border: 1px solid var(--sf-dropdown-border);   /* border-white/[0.27] */
  border-radius: 12px;                     /* rounded-xl */
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);   /* shadow-2xl */
  padding: 6px 0;                          /* py-1.5 */
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
  z-index: 60;
}
.l26-dropdown--wide { min-width: 240px; max-width: 300px; }
.l26-nav__group:hover .l26-dropdown { opacity: 1; pointer-events: auto; }
.l26-dropdown a {
  display: flex;
  align-items: center;
  margin: 2px 6px;                         /* landing: mx-1.5 my-0.5 */
  padding: 9px 12px;                       /* landing: px-3 py-[9px] */
  border-radius: 8px;                      /* rounded-lg */
  font-family: 'Inter', sans-serif;
  font-size: 13px;                         /* landing: text-[13px] */
  font-weight: 300;                        /* landing dropdown rows inherit body 300 */
  line-height: 1.375;                      /* leading-snug */
  color: var(--sf-dropdown-text);          /* text-white/60 */
  white-space: nowrap;
  text-decoration: none !important;
  transition: background-color .15s ease, color .15s ease;
}
.l26-dropdown a:hover { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass-2); }

.l26-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }   /* gap-3 */
.l26-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  font-size: 14px;                         /* landing: text-[14px] */
  font-weight: 500;                        /* solid CTA: font-semibold -> 500 (landing utility remap) */
  line-height: 1;
  border: none;
  border-radius: 999px;
  padding: 6px 12px;                        /* landing: py-1.5 px-3 */
  white-space: nowrap;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.l26-btn--ghost { color: var(--sf-nav-text); background: transparent; font-weight: 300; }   /* Log in: no weight class -> body 300 */
.l26-btn--ghost:hover { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass); }
.l26-btn--solid { color: var(--sf-btn-solid-text); background: var(--sf-btn-solid-bg); }     /* Book a demo */
.l26-btn--solid:hover { color: var(--sf-btn-solid-text) !important; background: var(--sf-btn-solid-hover); }

/* theme toggle — sun (dark mode → click for light) / moon (light mode → click for dark) */
.l26-theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  flex-shrink: 0;
  border: 1px solid var(--sf-border);
  border-radius: 999px;
  background: transparent;
  color: var(--sf-nav-hover-text);   /* solid: #fff (sun, dark) / #14161a (moon, light) */
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.l26-theme-toggle:hover { background: var(--sf-glass); color: var(--sf-nav-hover-text); }
.l26-theme-toggle svg { width: 20px; height: 20px; display: block; stroke: currentColor; max-width: none; }
/* Dark theme → SUN in white; light theme → MOON in black. */
.l26-theme-toggle .l26-icon-sun  { display: block !important; color: #ffffff; stroke: #ffffff; }   /* dark theme: white sun */
.l26-theme-toggle .l26-icon-moon { display: none !important; }
html[data-theme="light"] .l26-theme-toggle .l26-icon-sun  { display: none !important; }
html[data-theme="light"] .l26-theme-toggle .l26-icon-moon { display: block !important; }   /* light theme: moon */

/* hamburger */
.l26-burger {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 34px; height: 34px;
  background: transparent;
  border: none;
  cursor: pointer;
}
.l26-burger span {
  display: block;
  width: 20px; height: 1.5px;
  background: var(--sf-burger);
  border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.l26-burger.is-open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.l26-burger.is-open span:nth-child(2) { opacity: 0; }
.l26-burger.is-open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* mobile menu */
.l26-mobile {
  position: fixed;
  top: 78px; left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--sf-mobile-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.l26-mobile.is-open { opacity: 1; pointer-events: auto; }
.l26-mobile__nav { display: flex; flex-direction: column; padding: 16px; }

.l26-mobile__nav > a,
.l26-mobile__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  background: transparent;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;                         /* landing: text-[15px] */
  font-weight: 300;                        /* landing mobile rows inherit body 300 */
  color: var(--sf-nav-text);
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.l26-mobile__nav > a:hover,
.l26-mobile__trigger:hover { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass-2); }

.l26-mobile__group { display: flex; flex-direction: column; }
.l26-mobile__chev {
  width: 16px; height: 16px; flex-shrink: 0;
  color: var(--sf-nav-hover-text) !important;
  stroke: var(--sf-nav-hover-text) !important;
  stroke-width: 2;
  opacity: 1;
  max-width: none;
  transition: transform .2s ease, color .15s ease;
}
.l26-mobile__group.is-open .l26-mobile__chev { transform: rotate(180deg); }

.l26-mobile__sub {
  display: none;
  flex-direction: column;
  margin: 2px 0 6px 16px;
  padding-left: 8px;
  border-left: 1px solid var(--sf-border);
}
.l26-mobile__group.is-open .l26-mobile__sub { display: flex; }
.l26-mobile__sub a {
  display: block;
  padding: 11px 16px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 300;                        /* landing depth>0 rows inherit body 300 */
  color: var(--sf-dropdown-text);
  text-decoration: none !important;
  transition: background-color .15s ease, color .15s ease;
}
.l26-mobile__sub a:hover { color: var(--sf-nav-hover-text) !important; background: var(--sf-glass-2); }

.l26-mobile__login { margin-top: 12px; padding-top: 20px !important; border-top: 1px solid var(--sf-border); }

.l26-mobile__nav > a.l26-mobile__demo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;                        /* font-semibold -> 500 (landing utility remap) */
  color: var(--sf-btn-solid-text) !important;
  background: var(--sf-btn-solid-bg);
  text-align: center;
  text-decoration: none !important;
  transition: background-color .15s ease;
}
.l26-mobile__nav > a.l26-mobile__demo:hover {
  color: var(--sf-btn-solid-text) !important;
  background: var(--sf-btn-solid-hover);
}

@media (min-width: 1101px) { .l26-burger, .l26-mobile { display: none !important; } }
@media (max-width: 1100px) {
  .l26-nav { display: none; }
  .l26-btn--ghost { display: none; }
  .l26-btn--solid { display: none; }   /* moved into the mobile drawer under Log in */
  .l26-burger { display: flex; }
  .l26-actions { margin-left: auto; margin-right: 8px; }
}

/* ===================================================== footer (l26) ======= */
footer.l26-footer {
  background-color: var(--sf-bg);
  width: 100%;
  height: auto;
  padding: 0;
  display: block;
  position: relative;
  z-index: 103;
  border-top: 1px solid var(--sf-header-border);
  margin-top: 80px;
}
html[data-theme="light"] footer.l26-footer { background-color: #ffffff; }

.l26-fnav {
  max-width: 1300px;                       /* landing: max-w-[1300px] */
  margin: 0 auto;
  padding: 40px 24px;                      /* landing: px-6 py-10 */
  display: flex;
  flex-direction: column;
  gap: 40px;                               /* gap-10 */
}
.l26-fnav__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));   /* brand + 4 nav columns */
  gap: 40px;
}
.l26-fnav__brand img { height: 37px; width: auto; display: block; max-width: none; }   /* landing logomark h-[37px] */
.l26-fnav__brand .l26-logo-light { display: none !important; }
html[data-theme="light"] .l26-fnav__brand .l26-logo-dark { display: none !important; }
html[data-theme="light"] .l26-fnav__brand .l26-logo-light { display: block !important; }
.l26-fcol { display: flex; flex-direction: column; gap: 8px; }        /* gap-2 */
.l26-fcol__heading {
  color: var(--sf-footer-heading);
  font-family: 'Inter', sans-serif;
  font-weight: 400;                        /* font-medium -> 400 */
  font-size: 16px;                         /* text-base */
  line-height: 1.5;                        /* leading-6 */
  margin: 0 0 4px;
}
.l26-fcol a {
  align-self: flex-start;
  color: var(--sf-footer-text);            /* solid black in light / white/70 in dark */
  font-family: 'Inter', sans-serif;
  font-weight: 400;                        /* landing: font-medium -> 400 */
  font-size: 15px;                         /* landing: text-[15px] */
  line-height: 1.6;                        /* -> 24px, matches landing leading-6 */
  border-radius: 6px;
  padding: 2px 8px;
  margin-left: -8px;
  text-decoration: none !important;
  transition: background-color .15s ease, color .15s ease;
}
.l26-fcol a:hover { color: var(--sf-footer-hover-text) !important; background: var(--sf-glass); }

/* kill any legacy theme underline on hover for all header/footer/menu links */
.l26-header a:hover, .l26-mobile a:hover, .l26-footer a:hover { text-decoration: none !important; }
.l26-fnav__divider { height: 1px; width: 100%; background: var(--sf-border); }   /* bg-white/10 */
.l26-fnav__bottom { display: flex; align-items: center; justify-content: space-between; }
.l26-fnav__bottom p { color: var(--sf-footer-copyright); font-family: 'Inter', sans-serif; font-weight: 400; font-size: 12px; margin: 0; }   /* text-xs text-white/50 */

@media (max-width: 900px) {
  .l26-fnav__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .l26-fnav__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .l26-fnav__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
}

/* ============================================ KB layout adjustments ======== */
/* Old KB header was 90px; the l26 header is 78px. Pull the content up to match
   so nothing sits under the fixed header, in both themes. */
.main-container .content { margin-top: 78px; }
/* Let the page grow past the viewport so the l26 footer sits below the content
   instead of being pinned to a 100vh box. */
.main-container { height: auto; min-height: 100vh; }

/* Sidebar fills the full height below the fixed 78px header on desktop, so short
   pages don't leave it as a stub with empty space beneath. min-height (not height)
   keeps it growing on long pages. */
@media (min-width: 50rem) {
  .side-bar { min-height: calc(100vh - 78px); }
}

/* Search bar keeps its width across the whole header row instead of being capped
   at the theme's 536px, so it lines up with the content below it. */
@media (min-width: 50rem) {
  .search-input-wrap { max-width: none; }
}

/* =================================================================================
   DARK THEME BODY
   Everything below applies ONLY in dark mode. White/light mode is left entirely
   to the just-the-docs light theme, so the existing white design is unchanged.
   These rules re-colour just-the-docs's existing layout — they do not alter
   sizes or spacing.
   ================================================================================= */
html[data-theme="dark"] body {
  background-color: var(--sf-bg) !important;
  color: var(--sf-text) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- sidebar / docs navigation ---- */
html[data-theme="dark"] .side-bar {
  background-color: var(--sf-surface) !important;
  border-right: 1px solid var(--sf-border);
}
html[data-theme="dark"] .site-header { border-bottom: 1px solid var(--sf-border); }
html[data-theme="dark"] .site-button,
html[data-theme="dark"] #menu-button,
html[data-theme="dark"] .site-title { color: var(--sf-heading) !important; }
/* "Topics" button (mobile) + site title: replace the theme's light-grey hover
   gradient with the dark blue-tinted highlight used by the nav links. */
html[data-theme="dark"] .site-button:hover,
html[data-theme="dark"] #menu-button:hover,
html[data-theme="dark"] .site-title:hover {
  background-image: linear-gradient(-90deg, rgba(47, 111, 214, 0.28) 0%, rgba(47, 111, 214, 0.14) 80%, rgba(47, 111, 214, 0) 100%);
  color: #ffffff !important;
}
html[data-theme="dark"] .nav-category {
  color: var(--sf-muted);
  border-bottom-color: var(--sf-border);
}
html[data-theme="dark"] .nav-list .nav-list-item .nav-list-link { color: var(--sf-text) !important; }
html[data-theme="dark"] .nav-list .nav-list-item .nav-list-link:hover,
html[data-theme="dark"] .nav-list .nav-list-item .nav-list-link.active {
  background-image: linear-gradient(-90deg, rgba(47, 111, 214, 0.28) 0%, rgba(47, 111, 214, 0.14) 80%, rgba(47, 111, 214, 0) 100%);
  color: #ffffff !important;
}
html[data-theme="dark"] .nav-list .nav-list-item .nav-list-expander { color: var(--sf-primary-light); }
html[data-theme="dark"] .nav-list .nav-list-item .nav-list-expander:hover {
  background-image: linear-gradient(-90deg, rgba(47, 111, 214, 0.28) 0%, rgba(47, 111, 214, 0.14) 100%);
}
html[data-theme="dark"] .nav-list .nav-list-item > .nav-list .nav-list-item .nav-list-link,
html[data-theme="dark"] .nav-list .nav-list-item > .nav-list .nav-list-item .nav-list-expander { color: var(--sf-muted) !important; }

/* ---- main content ---- */
html[data-theme="dark"] .main-content-wrap,
html[data-theme="dark"] .main,
html[data-theme="dark"] .main-header { background: transparent; }
/* drop the light-grey rule under the search bar in dark mode */
html[data-theme="dark"] .main-header { border-bottom: none; }
html[data-theme="dark"] .main-content { color: var(--sf-text); }
html[data-theme="dark"] .main-content h1,
html[data-theme="dark"] .main-content h2,
html[data-theme="dark"] .main-content h3,
html[data-theme="dark"] .main-content h4,
html[data-theme="dark"] .main-content h5,
html[data-theme="dark"] .main-content h6,
html[data-theme="dark"] h1, html[data-theme="dark"] h2, html[data-theme="dark"] h3,
html[data-theme="dark"] h4, html[data-theme="dark"] h5, html[data-theme="dark"] h6 { color: var(--sf-heading) !important; }
html[data-theme="dark"] .main-content p,
html[data-theme="dark"] .main-content li,
html[data-theme="dark"] .main-content dd,
html[data-theme="dark"] .main-content dt,
html[data-theme="dark"] .main-content span,
html[data-theme="dark"] .main-content strong,
html[data-theme="dark"] .main-content b { color: var(--sf-text); }
html[data-theme="dark"] .main-content a { color: var(--sf-primary-light) !important; }
html[data-theme="dark"] .main-content a:hover { color: #a9cbff !important; }
html[data-theme="dark"] hr,
html[data-theme="dark"] .main-content hr { background-color: var(--sf-border); }
html[data-theme="dark"] ::selection { background: rgba(47, 111, 214, 0.40); color: #fff; }

/* the "Play Labs …" call-to-action text */
html[data-theme="dark"] .play-button span { color: var(--sf-text) !important; }

/* ---- breadcrumbs ---- */
html[data-theme="dark"] .breadcrumb-nav-list-item a { color: var(--sf-primary-light) !important; }
html[data-theme="dark"] .breadcrumb-nav-list-item span { color: var(--sf-muted); }
html[data-theme="dark"] .breadcrumb-nav-list-item::after { color: var(--sf-muted-2); }

/* ---- search ---- */
html[data-theme="dark"] .search-input,
html[data-theme="dark"] .search-active .search-input {
  background-color: var(--sf-surface-2) !important;
  color: var(--sf-text) !important;
}
html[data-theme="dark"] .search-input::placeholder { color: var(--sf-muted-2); }
html[data-theme="dark"] .search-icon { color: var(--sf-muted); }
html[data-theme="dark"] .search-results {
  background-color: var(--sf-surface) !important;
  border: 1px solid var(--sf-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
html[data-theme="dark"] .search-result-title,
html[data-theme="dark"] .search-result { color: var(--sf-text) !important; }
html[data-theme="dark"] .search-result:hover,
html[data-theme="dark"] .search-result.active { background-color: var(--sf-surface-2) !important; }
html[data-theme="dark"] .search-result-rel-url { color: var(--sf-muted-2) !important; }
html[data-theme="dark"] .search-result-highlight { color: var(--sf-primary-light); }
html[data-theme="dark"] .search-overlay { background-color: rgba(0, 0, 0, 0.6); }

/* ---- tables ---- */
html[data-theme="dark"] .table-wrapper {
  box-shadow: none;
  border: 1px solid var(--sf-border);
}
html[data-theme="dark"] th,
html[data-theme="dark"] td {
  background-color: var(--sf-surface) !important;
  border-color: var(--sf-border) !important;
  color: var(--sf-text);
}
html[data-theme="dark"] thead th {
  background-color: var(--sf-surface-2) !important;
  color: var(--sf-heading);
}
html[data-theme="dark"] tbody tr:hover td { background-color: rgba(107, 164, 255, 0.08) !important; }

/* ---- inline code + code blocks ---- */
html[data-theme="dark"] code {
  background-color: var(--sf-surface-2) !important;
  border: 1px solid var(--sf-border) !important;
  color: #d6e2ff;
}
/* Only the OUTERMOST container gets the frame, so nested .highlight / pre.highlight
   don't draw a second (inner) border above the code. */
html[data-theme="dark"] div.highlighter-rouge,
html[data-theme="dark"] figure.highlight {
  background-color: #0c1120 !important;
  border: 1px solid var(--sf-border);
  border-radius: 8px;
}
html[data-theme="dark"] div.highlighter-rouge .highlight,
html[data-theme="dark"] div.highlighter-rouge pre.highlight,
html[data-theme="dark"] figure.highlight pre.highlight,
html[data-theme="dark"] .highlight pre,
html[data-theme="dark"] pre {
  background: transparent !important;
  border: 0 !important;
  color: #e5e6e8 !important;
}
html[data-theme="dark"] div.highlighter-rouge code,
html[data-theme="dark"] .highlight code {
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  color: inherit;
}
html[data-theme="dark"] .highlight .hll { background-color: rgba(255,255,255,0.08); }
html[data-theme="dark"] .highlight .c, html[data-theme="dark"] .highlight .ch, html[data-theme="dark"] .highlight .cm, html[data-theme="dark"] .highlight .c1, html[data-theme="dark"] .highlight .cs, html[data-theme="dark"] .highlight .cpf { color: #7f8b9e !important; font-style: italic; }
html[data-theme="dark"] .highlight .cp { color: #c8a24a !important; }
html[data-theme="dark"] .highlight .k, html[data-theme="dark"] .highlight .kc, html[data-theme="dark"] .highlight .kd, html[data-theme="dark"] .highlight .kn, html[data-theme="dark"] .highlight .kp, html[data-theme="dark"] .highlight .kr { color: #7aa2f7 !important; }
html[data-theme="dark"] .highlight .kt { color: #f7768e !important; }
html[data-theme="dark"] .highlight .o, html[data-theme="dark"] .highlight .ow { color: #89ddff !important; }
html[data-theme="dark"] .highlight .s, html[data-theme="dark"] .highlight .s1, html[data-theme="dark"] .highlight .s2, html[data-theme="dark"] .highlight .sb, html[data-theme="dark"] .highlight .sc, html[data-theme="dark"] .highlight .sd, html[data-theme="dark"] .highlight .se, html[data-theme="dark"] .highlight .sh, html[data-theme="dark"] .highlight .si, html[data-theme="dark"] .highlight .sx, html[data-theme="dark"] .highlight .sr, html[data-theme="dark"] .highlight .ss, html[data-theme="dark"] .highlight .sa, html[data-theme="dark"] .highlight .dl { color: #9ece6a !important; }
html[data-theme="dark"] .highlight .m, html[data-theme="dark"] .highlight .mf, html[data-theme="dark"] .highlight .mh, html[data-theme="dark"] .highlight .mi, html[data-theme="dark"] .highlight .mo, html[data-theme="dark"] .highlight .mb, html[data-theme="dark"] .highlight .il { color: #ff9e64 !important; }
html[data-theme="dark"] .highlight .na { color: #bb9af7 !important; }
html[data-theme="dark"] .highlight .nb, html[data-theme="dark"] .highlight .bp { color: #2ac3de !important; }
html[data-theme="dark"] .highlight .nc, html[data-theme="dark"] .highlight .nn { color: #7dcfff !important; }
html[data-theme="dark"] .highlight .no { color: #ff9e64 !important; }
html[data-theme="dark"] .highlight .nd, html[data-theme="dark"] .highlight .ni { color: #bb9af7 !important; }
html[data-theme="dark"] .highlight .ne, html[data-theme="dark"] .highlight .nf, html[data-theme="dark"] .highlight .fm { color: #7aa2f7 !important; }
html[data-theme="dark"] .highlight .nl, html[data-theme="dark"] .highlight .nt { color: #f7768e !important; }
html[data-theme="dark"] .highlight .nv, html[data-theme="dark"] .highlight .vc, html[data-theme="dark"] .highlight .vg, html[data-theme="dark"] .highlight .vi, html[data-theme="dark"] .highlight .vm { color: #c0caf5 !important; }
html[data-theme="dark"] .highlight .gd { color: #f7768e !important; }
html[data-theme="dark"] .highlight .gi { color: #9ece6a !important; }
html[data-theme="dark"] .highlight .gh, html[data-theme="dark"] .highlight .gp, html[data-theme="dark"] .highlight .gu { color: #7aa2f7 !important; }
html[data-theme="dark"] .highlight .gr, html[data-theme="dark"] .highlight .gt { color: #f7768e !important; }
html[data-theme="dark"] .highlight .w { color: #3b4261 !important; }
html[data-theme="dark"] .highlight .err { border: 1px solid #f7768e; }

/* ---- blockquotes ---- */
html[data-theme="dark"] blockquote,
html[data-theme="dark"] .main-content blockquote {
  border-left: 3px solid var(--sf-primary);
  background: var(--sf-surface-2);
  color: var(--sf-muted);
}

/* ---- images get a subtle border so they don't float on black ---- */
html[data-theme="dark"] .main-content img:not(.play-button img) { border: 1px solid var(--sf-border); border-radius: 6px; }

/* ---- labels / badges keep their accent colours; ensure readable text ---- */
html[data-theme="dark"] .label-yellow { color: #1a1b1c; }

/* ---- buttons rendered inside content ---- */
html[data-theme="dark"] .btn {
  background-color: var(--sf-surface-2);
  color: var(--sf-primary-light);
  box-shadow: none;
  border: 1px solid var(--sf-border);
}
html[data-theme="dark"] .btn:hover { background-color: var(--sf-panel); color: #fff; }

/* ---- cookie consent button ---- */
html[data-theme="dark"] #CookieConsent.ccb__edit {
  background: var(--sf-surface-2) !important;
  color: var(--sf-text) !important;
  border: 1px solid var(--sf-border) !important;
}
