:root {
  color-scheme: light;
  --paper: #fff;
  --chrome: #faf9f7;
  --surface: #f6f5f3;
  --hover: #f1efec;
  --text: #21211f;
  --muted: #5f5d57;
  --border: #e5e2dc;
  --strong-border: #d6d2ca;
  --accent: #a63d1b;
  --accent-hover: #822d13;
  --accent-line: #d5582d;
  --accent-wash: #fff1e9;
  --code: #20201e;
  --code-bar: #292825;
  --code-border: #3c3a35;
  --code-text: #f5f1ea;
  --code-muted: #c6c1b7;
  --shadow: 0 16px 60px #24170918, 0 3px 14px #24170910;
  --header-height: 62px;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #181817;
  --chrome: #1c1b19;
  --surface: #23221f;
  --hover: #292823;
  --text: #f3f0eb;
  --muted: #bbb6ad;
  --border: #383631;
  --strong-border: #4e4b45;
  --accent: #ffac86;
  --accent-hover: #ffccb5;
  --accent-line: #f58a5e;
  --accent-wash: #34231c;
  --code: #111110;
  --code-bar: #201e1b;
  --code-border: #38352f;
  --shadow: 0 16px 60px #0007;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font: 16px/1.65 var(--sans);
}

a { color: var(--accent); text-underline-offset: .2em; }
a:hover { color: var(--accent-hover); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent-line); outline-offset: 3px; }
::selection { background: var(--accent-wash); color: var(--text); }

.sr-only, .skip-link:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link:focus {
  position: fixed;
  z-index: 15;
  top: .5rem;
  left: .8rem;
  background: var(--paper);
  padding: .55rem .85rem;
  border: 1px solid var(--strong-border);
  border-radius: .4rem;
}

.site-header {
  position: sticky;
  z-index: 10;
  top: 0;
  background: var(--paper);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  min-height: var(--header-height);
  max-width: 1740px;
  margin: 0 auto;
  padding: 0 1.45rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--text);
  text-decoration: none;
  font-size: .96rem;
  white-space: nowrap;
}

.brand:hover { color: var(--text); }
.brand strong { font-size: 1.1rem; letter-spacing: -.035em; }
.brand > span:last-child { color: var(--muted); }
.brand-divider { height: 21px; width: 1px; background: var(--border); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: #c94e27;
  color: #fff;
  font: 760 1rem/1 var(--mono);
}

.search-button {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: clamp(165px, 24vw, 325px);
  height: 36px;
  margin-left: 1.05rem;
  padding: 0 .65rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  background: var(--chrome);
  color: var(--muted);
  font-size: .85rem;
  text-align: left;
}

.search-button:hover { border-color: var(--strong-border); background: var(--surface); }
.search-icon {
  position: relative;
  display: inline-block;
  width: .72rem;
  height: .72rem;
  flex: 0 0 auto;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  margin: 0 2px 2px 1px;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: .32rem;
  height: 1.5px;
  bottom: -2px;
  right: -4px;
  background: currentColor;
  transform: rotate(48deg);
}

kbd {
  border: 1px solid var(--border);
  border-radius: .3rem;
  padding: .04rem .32rem;
  background: var(--paper);
  font: .72rem/1.45 var(--mono);
  white-space: nowrap;
}

.search-button kbd { margin-left: auto; }

.top-links, .sidebar-links { display: flex; gap: 1.3rem; align-items: center; }
.top-links { margin-left: auto; }
.top-links a, .sidebar-links a {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 540;
  white-space: nowrap;
  text-decoration: none;
}

.top-links a:hover, .sidebar-links a:hover { color: var(--accent); text-decoration: underline; }
.theme-button, .menu-button, .search-dialog-header button {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .25rem .6rem;
  color: var(--muted);
  font-size: .8rem;
}

.theme-button { min-width: 3.4rem; }
.theme-button:hover, .menu-button:hover, .search-dialog-header button:hover { background: var(--hover); }
.menu-button { display: none; }

.site-layout {
  max-width: 1540px;
  min-height: calc(100vh - var(--header-height));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 233px minmax(0, 1fr) 215px;
}

.sidebar, .outline {
  position: sticky;
  top: calc(var(--header-height) + 1px);
  max-height: calc(100vh - var(--header-height) - 1px);
  align-self: start;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--strong-border) transparent;
}

.sidebar { padding: 1.4rem 1rem 2.5rem; border-right: 1px solid var(--border); }
.sidebar-top { display: none; margin: .05rem .3rem 1.5rem; }
.has-interactions .sidebar-top { display: block; }
.sidebar-top input, .catalogue-controls input, .catalogue-controls select, #doc-query {
  background: var(--chrome);
  border: 1px solid var(--border);
  border-radius: .42rem;
  padding: .4rem .65rem;
  min-height: 34px;
  font-size: .81rem;
}

.sidebar-top input { width: 100%; }
input::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus { border-color: var(--accent-line); }

.nav-group + .nav-group { margin-top: 1.3rem; }
.nav-group p, .outline nav > p {
  margin: 0 0 .38rem;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.3;
}

.nav-group p { padding: 0 .6rem; }
.nav-group ul, .outline ul, #search-results { list-style: none; margin: 0; padding: 0; }

.nav-group a {
  display: block;
  color: var(--muted);
  font-size: .86rem;
  padding: .32rem .6rem;
  border-radius: .37rem;
  line-height: 1.45;
  text-decoration: none;
}

.nav-group a:hover { background: var(--surface); color: var(--text); }
.nav-group a[aria-current="page"] {
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 670;
  box-shadow: inset 2px 0 var(--accent-line);
}

.sidebar-empty { font-size: .85rem; color: var(--muted); }
.sidebar-links { display: none; }

.article {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem clamp(1.85rem, 4.4vw, 4.4rem) 4rem;
  overflow-wrap: anywhere;
}

.article-header { margin-bottom: 1.75rem; }
.article-header h1 {
  font-size: clamp(2.05rem, 4.65vw, 3.15rem);
  font-weight: 740;
  letter-spacing: -.052em;
  line-height: 1.05;
  margin: 0 0 .75rem;
  text-wrap: balance;
}

.article-header p {
  color: var(--muted);
  font-size: clamp(1rem, 1.65vw, 1.14rem);
  max-width: 49rem;
  margin: 0;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .55rem;
  margin-bottom: 1.2rem;
  color: var(--muted);
  font-size: .82rem;
}

.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumbs span[aria-hidden] { opacity: .64; }

.article h2, .article h3, .article h4, [data-code-panel] {
  scroll-margin-top: calc(var(--header-height) + 1rem);
}
.article h2 {
  margin: 2.4rem 0 .8rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.52rem;
  font-weight: 715;
  letter-spacing: -.026em;
  line-height: 1.3;
}

.article h3 {
  margin: 1.7rem 0 .55rem;
  font-size: 1.14rem;
  font-weight: 690;
  line-height: 1.35;
}

.article h4 { margin: 1.35rem 0 .4rem; font-size: 1rem; }
.article p { margin: .7rem 0 1rem; }
.article-header p { margin: 0; }
.article ul, .article ol { margin: .65rem 0 1rem; padding-left: 1.5rem; }
.article li { padding-left: .15rem; }
.article li + li { margin-top: .32rem; }

.article blockquote, .notice {
  margin: 1rem 0;
  border-inline-start: 3px solid var(--accent-line);
  background: var(--accent-wash);
  padding: .65rem .9rem;
  border-radius: 0 .35rem .35rem 0;
}

.article blockquote p { margin: .15rem 0; }

.outline {
  padding: 2.85rem 1.3rem 2rem .5rem;
  color: var(--muted);
}

.outline nav > p { color: var(--text); }
.outline nav li + li { margin-top: .12rem; }
.outline nav a {
  display: block;
  border-inline-start: 1px solid var(--border);
  padding: .27rem .62rem;
  font-size: .81rem;
  line-height: 1.38;
  color: var(--muted);
  text-decoration: none;
}

.outline nav a:hover { color: var(--accent); }
.outline nav a[aria-current="location"] { border-color: var(--accent-line); color: var(--accent); font-weight: 640; }
.markdown-link { display: inline-block; margin-top: .9rem; font-size: .78rem; }

code, pre { font-family: var(--mono); }
.article :not(pre) > code {
  background: var(--surface);
  border-radius: .24rem;
  padding: .12em .32em;
  font-size: .85em;
}

.base-url {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .75rem .85rem;
  margin: 0 0 1rem;
  border: 1px solid var(--border);
  border-radius: .55rem;
  background: var(--chrome);
}

.base-url > div { min-width: 0; display: grid; gap: .07rem; }
.base-url span { color: var(--muted); font-size: .74rem; font-weight: 700; }
.article .base-url code { padding: 0; background: transparent; color: var(--text); font-size: .88rem; }
.overview-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .65rem; }
.overview-links a {
  display: flex;
  flex-direction: column;
  gap: .25rem;
  padding: .7rem .82rem;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: .53rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}

.overview-links a strong { display: flex; align-items: baseline; justify-content: space-between; gap: .4rem; font-size: .91rem; }
.overview-links a strong::after { content: "→"; color: var(--accent); }
.overview-links a span { color: var(--muted); font-size: .83rem; }
.overview-links a:hover { border-color: var(--accent-line); background: var(--accent-wash); }

.code-block {
  margin: 1rem 0 1.3rem;
  color-scheme: dark;
  color: var(--code-text);
  background: var(--code);
  border: 1px solid var(--code-border);
  border-radius: .6rem;
  overflow: hidden;
}

.code-block figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--code-border);
  padding: .42rem .8rem .42rem .95rem;
  color: var(--code-muted);
  background: var(--code-bar);
  font-size: .79rem;
  font-weight: 610;
}

.copy-button {
  min-width: 4.35rem;
  padding: .12rem .52rem;
  border: 1px solid var(--strong-border);
  border-radius: .35rem;
  background: var(--paper);
  font-size: .76rem;
  line-height: 1.7;
}

.copy-button:hover { background: var(--hover); }
.code-block .copy-button { border-color: var(--code-border); background: var(--code); color: var(--code-text); }
.code-block .copy-button:hover { background: var(--code-bar); border-color: var(--code-muted); }

pre {
  margin: 0;
  padding: 1rem;
  overflow-x: auto;
  white-space: pre;
  tab-size: 2;
  font-size: .8rem;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: var(--code-border) var(--code);
}

pre code { font-family: inherit; }

.code-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
  border-bottom: 1px solid var(--border);
  padding: 0 0 .36rem;
  margin-bottom: .7rem;
}

.code-tab-list button {
  border: 1px solid transparent;
  border-radius: .34rem;
  background: none;
  color: var(--muted);
  padding: .28rem .51rem;
  font-size: .84rem;
  font-weight: 575;
}

.code-tab-list button:hover { color: var(--text); background: var(--surface); }
.code-tab-list button[aria-selected="true"] { color: var(--accent); background: var(--accent-wash); border-color: var(--border); }
.code-tabs .code-block { margin-top: .6rem; }
.article .code-setup { color: var(--muted); font-size: .88rem; margin: .55rem 0 .7rem; }

.table-wrap {
  overflow-x: auto;
  margin: .9rem 0 1.3rem;
  border: 1px solid var(--border);
  border-radius: .5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--strong-border) transparent;
}

.table-wrap table { width: 100%; border-collapse: collapse; font-size: .88rem; line-height: 1.5; }
.table-wrap th, .table-wrap td { text-align: left; padding: .55rem .75rem; vertical-align: top; }
.table-wrap thead th { background: var(--surface); font-weight: 690; }
.table-wrap tbody th { font-weight: 560; }
.table-wrap tbody tr { border-top: 1px solid var(--border); }
.table-wrap tbody tr:nth-of-type(even) { background: var(--chrome); }
.table-wrap :not(pre) > code { white-space: nowrap; }
.catalogue .table-wrap table { min-width: 620px; }
.catalogue-controls { display: flex; flex-wrap: wrap; gap: .6rem; }
.catalogue-controls input { width: min(100%, 245px); }

.pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem;
  padding-top: 1.15rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--border);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: .18rem;
  text-decoration: none;
  font-size: .9rem;
  line-height: 1.4;
  border: 1px solid var(--border);
  border-radius: .5rem;
  padding: .65rem .85rem;
}

.pager a span { color: var(--muted); font-size: .75rem; }
.pager a:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-wash); }
.pager-next { grid-column: 2; text-align: right; }

.search-dialog {
  width: min(650px, calc(100% - 2rem));
  max-height: min(72vh, 660px);
  margin: max(2rem, 10vh) auto 0;
  padding: .95rem;
  color: var(--text);
  background: var(--paper);
  border: 1px solid var(--strong-border);
  border-radius: .7rem;
  box-shadow: var(--shadow);
}

.search-dialog::backdrop { background: #211b1680; }
.search-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.search-dialog-header h2 { margin: 0; font-size: 1.06rem; letter-spacing: -.01em; }
#doc-query { width: 100%; margin-top: .75rem; font-size: .95rem; }
.search-message { margin: .5rem 0 .25rem; color: var(--muted); font-size: .79rem; line-height: 1.35; }
#search-results { display: grid; gap: .17rem; }
#search-results a {
  display: block;
  padding: .4rem .55rem;
  border-radius: .4rem;
  color: var(--text);
  line-height: 1.35;
  text-decoration: none;
}

#search-results a:hover, #search-results a:focus { background: var(--accent-wash); }
#search-results strong { display: block; font-size: .87rem; }
#search-results span { display: block; color: var(--muted); font-size: .77rem; }

@media (max-width: 1120px) {
  .site-layout { grid-template-columns: 208px minmax(0, 1fr) 153px; }
  .article { padding-inline: clamp(1.4rem, 3vw, 3rem); }
  .outline { padding-right: .65rem; }
}

@media (max-width: 920px) {
  .site-layout { grid-template-columns: 195px minmax(0, 1fr); }
  .outline { grid-column: 2; position: static; max-height: none; padding: 0 1.4rem 1.8rem; }
  .outline nav, .outline:empty { display: none; }
  .outline .markdown-link { margin-top: 0; }
  .article { padding-bottom: 2rem; }
  .top-links { gap: .9rem; }
  .header-inner { gap: .9rem; }
  .search-button { margin-left: 0; }
}

@media (max-width: 720px) {
  :root { --header-height: 54px; }
  .header-inner { gap: .65rem; padding-inline: .8rem; }
  .brand { gap: .43rem; }
  .brand-mark { width: 26px; height: 26px; border-radius: 7px; }
  .top-links { display: none; }
  .menu-button { display: inline-block; order: -1; }
  .search-button { width: auto; margin-left: auto; }
  .search-button kbd, .search-button > span:nth-child(2) { display: none; }
  .search-button .search-icon { margin-right: 3px; }
  .site-layout { display: block; }
  .sidebar {
    position: static;
    max-height: none;
    padding: .85rem .75rem 1.2rem;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--paper);
  }
  .has-interactions .sidebar { display: none; }
  .has-interactions .sidebar.is-open { display: block; }
  .sidebar-links {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin: .95rem .3rem 0;
    padding-top: .8rem;
    border-top: 1px solid var(--border);
  }
  .article { padding: 1.6rem 1rem 2rem; }
  .outline { padding-inline: 1rem; }
}

@media (max-width: 510px) {
  .overview-links { grid-template-columns: 1fr; }
  .brand-divider, .brand > span:last-child { display: none; }
  .article h2 { font-size: 1.35rem; }
  .pager a { padding-inline: .55rem; }
}
