:root,
html[data-theme="light"],
html[data-theme="dark"],
html:not([data-theme="dark"]):not([data-theme="light"]) {
  --shell-bg: #050508;
  --shell-surface: #111118;
  --shell-surface-hover: #171720;
  --shell-line: rgba(255, 255, 255, 0.1);
  --shell-text: #f8fafc;
  --shell-muted: #a1a1aa;
  --shell-blue: #2563eb;
  --shell-blue-hover: #1d4ed8;
  --bg-base: #050508;
  --bg-elevated: #0a0a0f;
  --bg-surface: #111118;
  --bg-surface-hover: #171720;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-default: rgba(255, 255, 255, 0.12);
  --brand-primary: #3b82f6;
  --brand-primary-light: #60a5fa;
  --brand-primary-dark: #2563eb;
  --text-primary: #f8fafc;
  --text-secondary: #c4c4cc;
  --text-tertiary: #a1a1aa;
  --text-muted: #71717a;
}

/* The marketing site has one deliberate theme. Older pages still load a
   theme manager and define light tokens inline, so lock the compatibility
   tokens here to prevent a visitor's OS preference or stale localStorage
   value from producing dark surfaces with dark text. */
html {
  color-scheme: dark;
  --bg-base: #050508 !important;
  --bg-elevated: #0a0a0f !important;
  --bg-surface: #111118 !important;
  --bg-surface-hover: #171720 !important;
  --text-primary: #f8fafc !important;
  --text-secondary: #c4c4cc !important;
  --text-tertiary: #a1a1aa !important;
  --text-muted: #8b8b95 !important;
  --border-subtle: rgba(255, 255, 255, 0.08) !important;
  --border-default: rgba(255, 255, 255, 0.12) !important;
  --brand-primary: #3b82f6 !important;
  --brand-primary-light: #60a5fa !important;
  --brand-primary-dark: #2563eb !important;
  --dw-bg-base: #050508 !important;
  --dw-bg-elevated: #0a0a0f !important;
  --dw-bg-surface: #111118 !important;
  --dw-bg-surface-hi: #171720 !important;
  --dw-text-primary: #f8fafc !important;
  --dw-text-secondary: #cbd5e1 !important;
  --dw-text-tertiary: #a1a1aa !important;
  --dw-text-muted: #8b8b95 !important;
  --dw-border-subtle: rgba(255, 255, 255, 0.08) !important;
  --dw-border-default: rgba(255, 255, 255, 0.12) !important;
}

body {
  margin: 0;
  display: block !important;
  min-height: 100vh;
  padding: 0 !important;
  text-align: left !important;
  background: var(--shell-bg) !important;
  color: var(--shell-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  -webkit-font-smoothing: antialiased;
}

html, body { max-width: 100%; overflow-x: hidden; }
img { max-width: 100%; }
main, article, section, .doc, .layout { min-width: 0; }
pre { max-width: 100%; }

h1, h2, h3, h4, .font-display {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif !important;
}

.site-nav {
  position: sticky !important;
  inset: 0 0 auto 0;
  z-index: 1000;
  width: 100%;
  border: 0 !important;
  border-bottom: 1px solid var(--shell-line) !important;
  background: rgba(5, 5, 8, 0.9) !important;
  backdrop-filter: blur(18px);
}

.site-nav-inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-brand { display: inline-flex; align-items: center; flex: 0 0 auto; }
.site-brand img { display: block; width: 178px; max-width: 178px; height: auto !important; }

.site-nav-links,
.site-nav-actions {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-nav-links { margin-left: auto; }

.site-nav a {
  color: var(--shell-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible { color: var(--shell-text); }

.site-nav .site-nav-scan,
.site-nav .site-nav-scan:hover {
  min-height: 40px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--shell-blue);
  border-radius: 10px;
  background: var(--shell-blue);
  color: #fff;
  font-weight: 750;
  box-shadow: none;
}

.site-nav .site-nav-scan:hover { background: var(--shell-blue-hover); border-color: var(--shell-blue-hover); }

.site-mobile-menu { display: none; position: relative; }
.dw-theme-toggle-slot { display: none !important; }
.site-mobile-menu summary {
  list-style: none;
  cursor: pointer;
  color: var(--shell-text);
  font-size: 14px;
  font-weight: 700;
}
.site-mobile-menu summary::-webkit-details-marker { display: none; }
.site-mobile-panel {
  position: absolute;
  top: 34px;
  right: 0;
  width: 210px;
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: #101017;
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
}
.site-mobile-panel a { padding: 11px 12px; border-radius: 8px; }
.site-mobile-panel a:hover { background: var(--shell-surface-hover); }

.site-footer {
  margin-top: 72px;
  padding: 48px 0 30px !important;
  border: 0 !important;
  border-top: 1px solid var(--shell-line) !important;
  background: #07070b !important;
  color: var(--shell-muted);
}

.site-footer-inner { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 42px; padding-bottom: 34px; }
.site-footer-brand img { width: 178px; max-width: 100%; height: auto; margin-bottom: 15px; }
.site-footer-brand p { max-width: 420px; margin: 0; color: var(--shell-muted); font-size: 14px; line-height: 1.65; }
.site-footer h2 { margin: 0 0 14px; color: var(--shell-text); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.site-footer-links { display: grid; gap: 10px; }
.site-footer a { color: var(--shell-muted); text-decoration: none; font-size: 14px; }
.site-footer a:hover { color: var(--shell-text); }
.site-footer-bottom { padding-top: 24px; border-top: 1px solid var(--shell-line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: 13px; }

.card,
.blog-post-card,
.stat-highlight,
.related-post {
  border-color: var(--shell-line) !important;
  border-radius: 16px !important;
  background: var(--shell-surface) !important;
  color: var(--shell-text) !important;
}

.article-content { color: var(--text-secondary) !important; }
.article-content h2,
.article-content h3,
.article-content h4,
.article-content strong { color: var(--text-primary) !important; }

.form-input {
  border-color: var(--border-default) !important;
  background: var(--bg-elevated) !important;
  color: var(--text-primary) !important;
}

#scanBtn { background: var(--shell-blue) !important; color: #fff !important; }
#scanBtn:hover { background: var(--shell-blue-hover) !important; }

/* Accessible accent text and controls across the older article templates. */
main a:not(.btn):not(.btn-primary):not(.site-nav-scan),
.article-content a,
.err-action .arr,
.err-foot a { color: #93c5fd !important; }
.category-tag { color: #bfdbfe !important; }
.use-case-number { background: var(--shell-blue) !important; }
.copy-btn { color: #f8fafc !important; }
.btn-primary,
.btn.primary,
a.btn-primary,
button.btn-primary,
[class~="bg-[var(--brand-primary)]"],
[class~="bg-[var(--accent-green)]"] {
  background: var(--shell-blue) !important;
  border-color: var(--shell-blue) !important;
  color: #fff !important;
}
.btn-primary:hover,
.btn.primary:hover,
a.btn-primary:hover,
button.btn-primary:hover { background: var(--shell-blue-hover) !important; }
.row span:first-child { color: #a1a1aa !important; }

@media (max-width: 860px) {
  .site-nav-links, .site-nav-signin { display: none !important; }
  .site-mobile-menu { display: block; }
  .site-nav-actions { margin-left: auto; gap: 16px; }
  .site-footer-top { grid-template-columns: 1fr 1fr; }
  .site-footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .site-nav-inner, .site-footer-inner { width: min(100% - 28px, 1180px); }
  .site-nav .site-nav-scan { min-height: 38px; padding: 0 13px; font-size: 13px; }
  .site-brand img { width: 140px; max-width: 140px; height: auto !important; }
  .site-nav-actions { gap: 12px; }
  .site-footer-top { grid-template-columns: 1fr; gap: 28px; }
  .site-footer-brand { grid-column: auto; }
}

@media (max-width: 760px) {
  .doc .params { display: block; max-width: 100%; overflow-x: auto; }
  .doc pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .container { width: 100%; max-width: 100%; }
}
