:root {
  color-scheme: light;
  --ink: #101828;
  --text: #344054;
  --muted: #667085;
  --line: #e4e7ec;
  --soft: #f8fafc;
  --green: #12b76a;
  --green-dark: #087443;
  --green-soft: #ecfdf3;
  --red: #f04438;
  --red-dark: #b42318;
  --red-soft: #fef3f2;
  --amber: #f79009;
  --amber-dark: #b54708;
  --amber-soft: #fffaeb;
  --purple: #7f56d9;
  --purple-dark: #6941c6;
  --blue: #185adb;
  --blue-soft: #eff4ff;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #fff; color: var(--text); font: 14px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; }
a { color: inherit; }
.docs-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.docs-header { position: sticky; z-index: 10; top: 0; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .94); backdrop-filter: blur(10px); }
.docs-topbar { display: flex; min-height: 68px; justify-content: space-between; gap: 20px; align-items: center; }
.docs-brand { display: flex; gap: 11px; align-items: center; text-decoration: none; }
.docs-brand-mark { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 9px; background: #111827; color: #fff; font-size: 15px; font-weight: 900; }
.docs-brand strong, .docs-brand small { display: block; }
.docs-brand strong { color: var(--ink); font-size: 14px; line-height: 1.3; }
.docs-brand small { color: var(--muted); font-size: 10px; }
.docs-nav { display: flex; gap: 7px; }
.docs-nav a { border: 1px solid #d0d5dd; border-radius: 8px; padding: 6px 10px; color: #344054; font-size: 12px; font-weight: 700; text-decoration: none; }
.docs-nav a:hover { border-color: #98a2b3; background: var(--soft); }
.docs-hero { max-width: 820px; padding: 60px 0 44px; }
.eyebrow { margin: 0 0 8px; color: var(--green-dark); font-size: 10px; font-weight: 900; letter-spacing: .14em; }
.docs-hero h1 { margin: 0 0 14px; color: var(--ink); font-size: clamp(34px, 6vw, 54px); line-height: 1.05; letter-spacing: -.05em; }
.hero-copy { max-width: 740px; margin: 0; color: var(--muted); font-size: 16px; }
.hero-note { display: inline-flex; gap: 8px; align-items: center; margin-top: 22px; border-radius: 8px; background: var(--blue-soft); color: #344f8c; padding: 8px 11px; font-size: 12px; }
.hero-note span { display: grid; width: 17px; height: 17px; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; font-weight: 900; }
.docs-layout { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 54px; align-items: start; padding-bottom: 70px; }
.docs-toc { position: sticky; top: 92px; padding: 15px 0; border-top: 1px solid var(--line); }
.docs-toc strong { display: block; margin-bottom: 8px; color: var(--ink); font-size: 12px; }
.docs-toc nav { display: grid; }
.docs-toc a { border-left: 2px solid transparent; padding: 5px 10px; color: var(--muted); font-size: 12px; text-decoration: none; }
.docs-toc a:hover { border-color: var(--green); color: var(--ink); }
.docs-content { min-width: 0; }
.doc-section { position: relative; scroll-margin-top: 92px; padding: 34px 0 46px; border-top: 1px solid var(--line); }
.section-number { display: block; margin-bottom: 7px; color: var(--green-dark); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.doc-section h2 { margin: 0 0 10px; color: var(--ink); font-size: clamp(24px, 4vw, 31px); line-height: 1.2; letter-spacing: -.035em; }
.doc-section > p { max-width: 780px; margin: 0 0 22px; color: var(--muted); }
.fact-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px; overflow: hidden; margin: 24px 0; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.fact { min-width: 0; padding: 15px 13px; background: #fff; }
.fact strong { display: block; color: var(--ink); font-size: 19px; letter-spacing: -.025em; }
.fact span { display: block; margin-top: 2px; color: var(--muted); font-size: 10px; }
.pipeline { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; counter-reset: none; }
.pipeline li { position: relative; display: flex; min-width: 0; gap: 9px; align-items: flex-start; padding: 13px; border-radius: 9px; background: var(--soft); }
.pipeline li:not(:last-child)::after { position: absolute; z-index: 2; right: -10px; top: 20px; color: #98a2b3; content: "→"; }
.pipeline li > span { display: grid; flex: 0 0 auto; width: 21px; height: 21px; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 10px; font-weight: 900; }
.pipeline strong, .pipeline small { display: block; }
.pipeline strong { color: var(--ink); font-size: 12px; }
.pipeline small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.table-scroll { overflow-x: auto; margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; }
table { width: 100%; border-collapse: collapse; background: #fff; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--soft); color: var(--muted); font-size: 11px; white-space: nowrap; }
td { min-width: 130px; }
tbody tr:last-child td { border-bottom: 0; }
.state-chip { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 800; white-space: nowrap; }
.state-chip i { width: 7px; height: 7px; border-radius: 50%; background: #98a2b3; }
.state-chip.operational { color: var(--green-dark); }
.state-chip.operational i { background: var(--green); }
.state-chip.outage { color: var(--red-dark); }
.state-chip.outage i { background: var(--red); }
.state-chip.css-outage { color: var(--purple-dark); }
.state-chip.css-outage i { background: var(--purple); }
.state-chip.blocked, .state-chip.checking, .state-chip.unknown, .state-chip.pending { color: var(--amber-dark); }
.state-chip.blocked i, .state-chip.checking i, .state-chip.unknown i, .state-chip.pending i { background: var(--amber); }
.state-chip.paused { color: var(--muted); }
.callout { margin-top: 18px; border: 1px solid #b2ddff; border-left: 4px solid #2e90fa; border-radius: 9px; background: #f5fbff; padding: 13px 15px; }
.callout.amber { border-color: #fedf89; border-left-color: var(--amber); background: var(--amber-soft); }
.callout strong { display: block; color: var(--ink); }
.callout p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.flow-group { display: grid; gap: 12px; margin-top: 24px; }
.flow-row { display: grid; grid-template-columns: 82px minmax(0, 1fr) 20px minmax(0, 1fr) 20px minmax(0, 1fr); gap: 7px; align-items: center; }
.flow-label { color: var(--muted); font-size: 11px; font-weight: 800; }
.flow-step { min-height: 70px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.flow-step strong, .flow-step span { display: block; }
.flow-step strong { color: var(--ink); font-size: 12px; }
.flow-step span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.flow-step.checking { border-color: #fedf89; background: var(--amber-soft); }
.flow-step.outage { border-color: #fecdca; background: var(--red-soft); }
.flow-step.operational { border-color: #abefc6; background: var(--green-soft); }
.flow-arrow { color: #98a2b3; text-align: center; }
.fine-print { margin-top: 16px !important; font-size: 12px; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-top: 22px; }
.check-card { position: relative; min-height: 126px; padding: 18px 18px 16px 54px; border: 1px solid var(--line); border-radius: 10px; }
.check-card > span { position: absolute; left: 17px; top: 18px; display: grid; width: 25px; height: 25px; place-items: center; border-radius: 6px; background: var(--soft); color: var(--muted); font-size: 9px; font-weight: 900; }
.check-card strong { display: block; color: var(--ink); }
.check-card p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.metric-list { display: grid; gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--line); }
.metric-list > div { display: grid; grid-template-columns: 145px 1fr; gap: 18px; padding: 15px 17px; background: #fff; }
.metric-list strong { color: var(--ink); }
.metric-list p { margin: 0; color: var(--muted); font-size: 12px; }
.example-box { margin-top: 14px; border-radius: 9px; background: var(--soft); padding: 13px 15px; }
.example-box strong { color: var(--ink); font-size: 12px; }
.example-box p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.detail-list, .limit-list { display: grid; gap: 0; margin: 22px 0 0; padding: 0; list-style: none; }
.detail-list li { display: grid; grid-template-columns: 120px 1fr; gap: 18px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.detail-list li:first-child { border-top: 1px solid var(--line); }
.detail-list strong { color: var(--ink); }
.detail-list span { color: var(--muted); }
.limit-list { gap: 9px; }
.limit-list li { position: relative; padding-left: 20px; color: var(--muted); }
.limit-list li::before { position: absolute; left: 2px; top: .7em; width: 6px; height: 6px; border-radius: 50%; background: #98a2b3; content: ""; }
.doc-footer { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 4px; border-radius: 11px; background: #111827; color: #fff; padding: 20px 22px; }
.doc-footer div { display: flex; gap: 8px; }
.doc-footer a { border: 1px solid #475467; border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 800; text-decoration: none; }
.doc-footer a:hover { background: #344054; }
.doc-footer .primary-link { border-color: #fff; background: #fff; color: #111827; }
.doc-footer .primary-link:hover { background: #f2f4f7; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; }
  .docs-toc { position: static; padding: 13px 0 25px; }
  .docs-toc nav { display: flex; flex-wrap: wrap; gap: 5px; }
  .docs-toc a { border: 1px solid var(--line); border-radius: 999px; padding: 4px 9px; }
  .docs-toc a:hover { border-color: #98a2b3; }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pipeline li::after { display: none; }
}

@media (max-width: 680px) {
  .docs-shell { width: min(100% - 24px, 1120px); }
  .docs-topbar { min-height: 60px; }
  .docs-brand-mark { width: 30px; height: 30px; }
  .docs-brand small { display: none; }
  .docs-nav a { padding: 5px 8px; font-size: 11px; }
  .docs-hero { padding: 40px 0 32px; }
  .hero-copy { font-size: 14px; }
  .fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact:last-child { grid-column: span 2; }
  .pipeline { grid-template-columns: 1fr; gap: 7px; }
  .flow-row { grid-template-columns: 1fr; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
  .flow-label { margin-bottom: 2px; color: var(--ink); }
  .flow-arrow { transform: rotate(90deg); }
  .flow-step { min-height: 0; }
  .check-grid { grid-template-columns: 1fr; }
  .metric-list > div, .detail-list li { grid-template-columns: 1fr; gap: 4px; }
  .doc-footer { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 400px) {
  .docs-brand strong { font-size: 13px; }
  .docs-nav { gap: 5px; }
  .docs-nav a { padding-inline: 7px; }
  .hero-note { align-items: flex-start; }
  .doc-footer div { width: 100%; display: grid; grid-template-columns: 1fr 1fr; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
