:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --bg: #1c1d1f;
  --sidebar: #1b1c1e;
  --text: #e4e6e3;
  --muted: #a4a8a4;
  --subtle: #7d837e;
  --line: rgba(255,255,255,.09);
  --accent: #c1d6c9;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--bg); -webkit-font-smoothing: antialiased; }
body { margin: 0; color: var(--text); background: var(--bg); font: 14px/1.68 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: rgba(193,214,201,.25); }
.skip-link { position: fixed; z-index: 30; left: 12px; top: -60px; padding: 8px 12px; background: var(--text); color: var(--bg); border-radius: 6px; }
.skip-link:focus { top: 9px; }
.site-header { position: sticky; z-index: 20; top: 0; display: flex; align-items: center; gap: 30px; height: 52px; padding: 0 24px; background: rgba(28,29,31,.97); box-shadow: 0 1px var(--line); backdrop-filter: blur(16px); }
.site-brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 680; font-size: 13px; white-space: nowrap; }
.brand-mark { display: inline-block; width: 18px; height: 18px; background: currentColor; mask: url("assets/KairosLogo.svg") center / contain no-repeat; }
.top-nav { display: flex; align-items: stretch; gap: 20px; align-self: stretch; }
.top-nav a { display: inline-flex; align-items: center; border-bottom: 2px solid transparent; padding: 2px 1px 0; color: var(--muted); font-size: 12px; white-space: nowrap; }
.top-nav a:hover, .top-nav a[aria-current] { color: var(--text); }
.top-nav a[aria-current] { border-bottom-color: var(--accent); }
.search-trigger { display: inline-flex; align-items: center; gap: 9px; width: 245px; height: 31px; margin-left: auto; padding: 0 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--muted); background: #242628; text-align: left; font-size: 12px; }
.search-trigger:hover { background: #2b2e2c; color: var(--text); }
.search-trigger svg, .search-dialog-header svg { width: 16px; height: 16px; flex: none; }
.search-trigger kbd { margin-left: auto; padding: 1px 4px; border-radius: 3px; background: #303331; color: var(--subtle); font: 10px var(--mono); }
.header-app-link { font-size: 11px; color: var(--muted); white-space: nowrap; }
.header-app-link:hover { color: var(--text); }
.header-app-link span { margin-left: 3px; }
.menu-toggle { display: none; }
.docs-layout { display: grid; grid-template-columns: 268px minmax(0,1fr) 224px; min-height: calc(100vh - 52px); }
.sidebar { background: var(--sidebar); box-shadow: 1px 0 var(--line); }
.sidebar nav { position: sticky; top: 52px; overflow-y: auto; height: calc(100vh - 52px); padding: 27px 24px 45px; scrollbar-width: thin; }
.nav-group { display: grid; align-content: start; gap: 2px; margin-bottom: 27px; }
.nav-heading { margin-bottom: 8px; color: var(--subtle); font-size: 11px; font-weight: 600; }
.nav-group a { min-height: 25px; padding: 1px 0; color: #b4b8b4; font-size: 12px; line-height: 1.55; }
.nav-group a:hover { color: var(--text); }
.nav-group a[aria-current="page"], .nav-group a[aria-current="location"] { color: var(--accent); }
.article-column { width: min(100%, 842px); min-width: 0; padding: 35px 54px 70px; margin: 0 auto; }
.article-meta { margin-bottom: 7px; color: var(--subtle); font-size: 11px; }
.doc-article { max-width: 734px; }
.doc-article h1 { margin: 0 0 24px; font-size: 34px; line-height: 1.18; font-weight: 640; letter-spacing: -.045em; text-wrap: balance; }
.doc-article .intro { max-width: 680px; margin: 0; color: #c2c6c2; font-size: 15px; line-height: 1.62; }
.intro-section { padding-bottom: 10px; }
.doc-section { margin-top: 48px; scroll-margin-top: 78px; }
.doc-section h2 { display: flex; align-items: baseline; gap: 7px; margin: 0 0 15px; font-size: 23px; line-height: 1.3; font-weight: 620; letter-spacing: -.035em; text-wrap: balance; }
.doc-section h3 { margin: 25px 0 8px; font-size: 16px; line-height: 1.4; font-weight: 600; letter-spacing: -.02em; }
.doc-section p, .doc-section li { color: #bec2be; line-height: 1.72; text-wrap: pretty; }
.doc-section p { margin: 0 0 15px; }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section ol, .doc-section ul { margin: 0 0 16px; padding-left: 22px; }
.doc-section li { padding-left: 3px; margin: 4px 0; }
.doc-section a:not(.heading-link) { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(193,214,201,.45); text-underline-offset: 3px; }
.doc-section a:not(.heading-link):hover { text-decoration-color: var(--accent); }
.heading-link { color: #79877d; opacity: 0; font-size: 15px; text-decoration: none; transition: opacity 120ms ease; }
.doc-section h2:hover .heading-link, .heading-link:focus-visible { opacity: 1; }
.doc-section code { padding: 2px 4px; border-radius: 4px; color: #d6dfd7; background: #303430; font: 12px var(--mono); }
.table-scroll { overflow-x: auto; margin: 20px 0; }
table { width: 100%; min-width: 520px; border-collapse: collapse; text-align: left; font-size: 12px; }
th, td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--text); font-weight: 600; }
td { color: #b8bdb8; }
td:first-child { white-space: nowrap; color: var(--text); }
.article-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 67px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--subtle); font-size: 11px; }
.article-footer a { color: var(--accent); }
.toc { position: sticky; top: 52px; height: calc(100vh - 52px); padding: 35px 23px 22px 0; overflow-y: auto; color: var(--muted); font-size: 11px; }
.toc-title { margin-bottom: 13px; color: var(--text); font-weight: 600; }
.toc nav { display: grid; gap: 9px; }
.toc a { display: block; color: #9fa49f; line-height: 1.35; }
.toc a:hover, .toc a[aria-current="location"] { color: var(--text); }
.copy-page { width: 100%; margin-top: 22px; padding: 16px 0 0; border: 0; border-top: 1px solid var(--line); color: var(--muted); background: none; text-align: left; font-size: 11px; }
.copy-page:hover { color: var(--text); }
.feature-group { margin-top: 51px; scroll-margin-top: 76px; }
.feature-group > h2 { margin: 0 0 19px; font-size: 23px; font-weight: 620; letter-spacing: -.03em; }
.feature-item { padding: 0 0 21px; margin: 0 0 21px; border-bottom: 1px solid var(--line); scroll-margin-top: 77px; }
.feature-item:last-child { margin-bottom: 0; }
.feature-item h3 { margin: 0 0 6px; font-size: 16px; font-weight: 610; letter-spacing: -.02em; }
.feature-item p { margin: 0; color: #b9beb9; line-height: 1.65; text-wrap: pretty; }
.search-dialog { width: min(620px, calc(100vw - 28px)); max-height: min(590px, calc(100vh - 70px)); padding: 0; border: 1px solid rgba(255,255,255,.17); border-radius: 12px; color: var(--text); background: #252729; box-shadow: 0 24px 85px #0009; overflow: hidden; }
.search-dialog::backdrop { background: #0009; backdrop-filter: blur(2px); }
.search-dialog-header { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-dialog-header input { flex: 1; min-width: 0; padding: 0; border: 0; outline: 0; background: none; color: var(--text); font-size: 14px; }
.search-dialog-header input::placeholder { color: var(--subtle); }
.search-dialog-header button { padding: 3px 7px; border: 1px solid var(--line); border-radius: 4px; background: none; color: var(--muted); font-size: 10px; }
.search-results { max-height: 490px; overflow-y: auto; padding: 8px; }
.search-results a { display: block; padding: 9px 11px; border-radius: 6px; }
.search-results a:hover, .search-results a:focus-visible { background: #353836; }
.search-results strong { display: block; font-size: 12px; font-weight: 590; }
.search-results small { display: block; margin-top: 1px; color: var(--muted); font-size: 10px; }
.search-results p { margin: 10px; color: var(--muted); font-size: 12px; }
@media (max-width: 1130px) { .docs-layout { grid-template-columns: 235px minmax(0,1fr) 180px; } .article-column { padding-inline: 38px; } .toc { padding-right: 18px; } }
@media (max-width: 900px) { .docs-layout { grid-template-columns: 230px minmax(0,1fr); } .toc { display: none; } .article-column { padding-inline: 44px; } }
@media (max-width: 650px) {
  .site-header { height: 52px; padding: 0 16px; gap: 15px; }
  .top-nav { gap: 14px; }
  .search-trigger { width: 32px; justify-content: center; padding: 0; margin-left: auto; }
  .search-trigger span, .search-trigger kbd, .header-app-link { display: none; }
  .menu-toggle { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 6px; background: #262829; }
  .menu-toggle span { width: 15px; height: 1.5px; border-radius: 2px; background: var(--text); }
  .docs-layout { display: block; }
  .sidebar { position: fixed; z-index: 18; inset: 52px auto 0 0; width: min(280px, 85vw); transform: translateX(-103%); transition: transform 160ms ease; box-shadow: 14px 0 40px #0006; }
  body[data-nav-open="true"] .sidebar { transform: translateX(0); }
  .sidebar nav { height: calc(100vh - 52px); }
  .article-column { padding: 28px 22px 55px; }
  .doc-article h1 { font-size: 29px; }
  .doc-article .intro { font-size: 14px; }
  .doc-section, .feature-group { margin-top: 39px; }
  .doc-section h2, .feature-group > h2 { font-size: 21px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .sidebar, .heading-link { transition: none; } }
