:root {
  color-scheme: light;
  --bg: #ffffff;
  --surface: #fafafa;
  --surface-2: #f4f4f5;
  --border: #e4e4e7;
  --text: #09090b;
  --text-2: #3f3f46;
  --muted: #71717a;
  --brand: #5b5bd6;
  --brand-ink: #4a4ac4;
  --brand-soft: #eef0ff;
  --code-bg: #f6f6f7;
  --code-ink: #18181b;
  --warn-soft: #fff7e6;
  --warn-ink: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090b;
    --surface: #0f0f12;
    --surface-2: #18181b;
    --border: #27272a;
    --text: #fafafa;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --brand: #8b8bf0;
    --brand-ink: #a5a5f5;
    --brand-soft: #1c1c33;
    --code-bg: #121215;
    --code-ink: #e4e4e7;
    --warn-soft: #2a2110;
    --warn-ink: #f5c86a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090b;
  --surface: #0f0f12;
  --surface-2: #18181b;
  --border: #27272a;
  --text: #fafafa;
  --text-2: #d4d4d8;
  --muted: #a1a1aa;
  --brand: #8b8bf0;
  --brand-ink: #a5a5f5;
  --brand-soft: #1c1c33;
  --code-bg: #121215;
  --code-ink: #e4e4e7;
  --warn-soft: #2a2110;
  --warn-ink: #f5c86a;
}
* { box-sizing: border-box; }
html { scroll-padding-top: 76px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15.5px/1.7 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-ink); text-underline-offset: 3px; }
code, pre { font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; }

.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 60px; padding: 0 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 650; letter-spacing: -0.015em; }
.brand em { font-style: normal; font-weight: 500; color: var(--muted); }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 18px; font-size: 14px; }
.top-links a { color: var(--text-2); text-decoration: none; }
.top-links a:hover { color: var(--text); }
.theme, .menu { border: 1px solid var(--border); background: var(--bg); color: var(--text-2); border-radius: 8px; height: 32px; min-width: 32px; cursor: pointer; font-size: 15px; }
.menu { display: none; }

.wrap { display: grid; grid-template-columns: 250px minmax(0, 1fr) 220px; max-width: 1360px; margin: 0 auto; }
.side { position: sticky; top: 60px; height: calc(100vh - 60px); overflow-y: auto; padding: 28px 16px 40px 24px; border-right: 1px solid var(--border); }
.nav-group { display: flex; flex-direction: column; margin-bottom: 22px; }
.nav-group span { font-size: 12px; font-weight: 600; color: var(--muted); margin: 0 10px 6px; letter-spacing: 0.02em; text-transform: uppercase; }
.nav-group a { padding: 5px 10px; border-radius: 7px; color: var(--text-2); text-decoration: none; font-size: 14px; }
.nav-group a:hover { background: var(--surface-2); color: var(--text); }
.nav-group a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }

main { min-width: 0; padding: 44px 56px 64px; }
article { max-width: 760px; }
article h1 { font-size: 36px; line-height: 1.2; letter-spacing: -0.025em; margin: 0 0 16px; font-weight: 700; }
article h2 { font-size: 23px; letter-spacing: -0.015em; margin: 48px 0 12px; padding-top: 8px; font-weight: 650; }
article h3 { font-size: 17.5px; margin: 32px 0 8px; font-weight: 650; }
article h1 + p { font-size: 18px; color: var(--text-2); }
article p, article li { color: var(--text-2); }
article strong { color: var(--text); font-weight: 600; }
.anchor { position: absolute; margin-left: -1em; padding-right: 0.3em; color: var(--muted); text-decoration: none; opacity: 0; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
article :not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 0.08em 0.36em; font-size: 0.86em; color: var(--text); word-break: break-word; }
.code { position: relative; margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; background: var(--code-bg); }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.65; color: var(--code-ink); }
.code .lang { position: absolute; top: 8px; right: 66px; font-size: 11px; color: var(--muted); }
.code .copy { position: absolute; top: 6px; right: 6px; font: 500 12px/1 Inter, system-ui, sans-serif; padding: 6px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--bg); color: var(--text-2); cursor: pointer; opacity: 0; transition: opacity 0.15s; }
.code:hover .copy, .code .copy:focus-visible { opacity: 1; }
@media (hover: none) { .code .copy { opacity: 1; } }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 1px solid var(--border); border-radius: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { background: var(--surface); font-weight: 600; color: var(--text); }
tr:last-child td { border-bottom: 0; }
td { color: var(--text-2); }
blockquote { margin: 20px 0; padding: 12px 16px; border-radius: 10px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent); }
blockquote p { margin: 0; color: var(--text); }
hr { border: 0; border-top: 1px solid var(--border); margin: 40px 0; }

.pager { display: flex; justify-content: space-between; gap: 16px; max-width: 760px; margin-top: 56px; }
.pager a { flex: 1; max-width: 50%; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--text); font-weight: 600; }
.pager a:hover { border-color: var(--brand); }
.pager a span { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); }
.pager .next { text-align: right; margin-left: auto; }
footer { max-width: 760px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 13.5px; }
footer a { color: var(--muted); }

.toc { position: sticky; top: 60px; align-self: start; padding: 44px 24px 24px 8px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; max-height: calc(100vh - 60px); overflow-y: auto; }
.toc span { font-weight: 600; color: var(--text); margin-bottom: 6px; }
.toc a { color: var(--muted); text-decoration: none; padding: 3px 0; }
.toc a.d3 { padding-left: 12px; }
.toc a:hover, .toc a[aria-current] { color: var(--brand-ink); }

@media (max-width: 1180px) { .wrap { grid-template-columns: 240px minmax(0, 1fr); } .toc { display: none; } }
@media (max-width: 820px) {
  .wrap { display: block; }
  .menu { display: inline-block; }
  .top { padding: 0 16px; }
  .top-links a { display: none; }
  .side { display: none; position: fixed; inset: 60px 0 0 0; z-index: 15; background: var(--bg); border: 0; padding: 20px 16px; height: auto; }
  body.nav-open .side { display: block; }
  main { padding: 28px 16px 48px; }
  article h1 { font-size: 29px; }
  .pager a { max-width: none; }
}

/* ---------------- status page ---------------- */
:root { --st-good: #0ca30c; --st-warn: #fab219; --st-bad: #d03b3b; --st-none: #e4e4e7; --st-good-ink: #08700a; --st-warn-ink: #8a5a00; --st-bad-ink: #b42828; }
/* Same reserved status steps as the dashboard: fills stay, inks and the empty step change in dark. */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --st-none: #232327; --st-good-ink: #4cc24c; --st-warn-ink: #f5c04d; --st-bad-ink: #ef7b7b; } }
:root[data-theme="dark"] { --st-none: #232327; --st-good-ink: #4cc24c; --st-warn-ink: #f5c04d; --st-bad-ink: #ef7b7b; }
#status-root { margin: 28px 0; display: flex; flex-direction: column; gap: 14px; }
.st-loading { color: var(--muted); }
.st-overall { display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); }
.st-overall strong { display: block; font-size: 17px; color: var(--text); }
.st-overall div > span { color: var(--muted); font-size: 13.5px; }
.st-overall .st-icon { color: #fff; }
.st-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 700; flex: none; }
.st-overall.st-operational .st-icon { background: var(--st-good); }
.st-overall.st-degraded .st-icon { background: var(--st-warn); color: #1a1200; }
.st-overall.st-outage .st-icon { background: var(--st-bad); }
.st-overall.st-unknown .st-icon { background: var(--muted); }
.st-comp { padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; }
.st-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.st-head strong { color: var(--text); }
.st-meta { margin-left: auto; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.st-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border); }
.st-pill.st-operational { color: var(--st-good-ink); }
.st-pill.st-degraded { color: var(--st-warn-ink); }
.st-pill.st-outage { color: var(--st-bad-ink); }
.st-pill.st-unknown { color: var(--muted); }
.st-bars { display: grid; grid-template-columns: repeat(90, minmax(0, 1fr)); gap: 2px; height: 34px; }
.st-bar { border-radius: 2px; background: var(--st-none); outline-offset: 2px; }
.st-bar.st-good, .st-legend i.st-good { background: var(--st-good); }
.st-bar.st-warn, .st-legend i.st-warn { background: var(--st-warn); }
.st-bar.st-bad, .st-legend i.st-bad { background: var(--st-bad); }
.st-legend i.st-none { background: var(--st-none); }
.st-bar:hover, .st-bar:focus-visible { filter: brightness(0.85); }
.st-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 12px; color: var(--muted); }
.st-legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12.5px; color: var(--muted); }
.st-legend span { display: inline-flex; align-items: center; gap: 6px; }
.st-legend i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.st-tip { position: absolute; z-index: 30; padding: 6px 9px; border-radius: 8px; background: var(--text); color: var(--bg); font-size: 12.5px; pointer-events: none; white-space: nowrap; }
@media (max-width: 820px) { .st-bars { gap: 1px; height: 30px; } .st-meta { margin-left: 0; width: 100%; } }
