* { box-sizing: border-box }
:root {
  color-scheme: dark;
  --bg: light-dark(#fcfbf8,#101110);
  --surface: light-dark(#fff,#191a18);
  --field: var(--surface);
  --ink: light-dark(#20211e,#f1f0e9);
  --muted: light-dark(#575c54,#a9aaa3);
  --line: light-dark(#ddded7,#333630);
  --accent: light-dark(#97430e,#ffab74);
  --wash: light-dark(#f8ede2,#2b211a);
  --sans: Inter,system-ui,sans-serif;
  --mono: ui-monospace,Consolas,monospace;
  background: var(--bg); color: var(--ink);
  font: 15px/1.6 var(--sans);
  scrollbar-gutter: stable;
}
:root:has(meta[name="color-scheme"][content="light"]) { color-scheme: light }
@media(prefers-color-scheme:light) { :root:has(meta[name="color-scheme"][content="light dark"]) { color-scheme: light } }
body, h1, h2, p, dl, dd, pre { margin: 0 }
a { color: inherit; text-decoration: none }
button,select,input { font: inherit; color: inherit }
button,summary,select { cursor: pointer }
a,button { -webkit-tap-highlight-color: transparent }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px }
.skip,.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%) }
.skip:focus { width: auto; height: auto; clip-path: none; z-index: 20; background: var(--surface); padding: 10px 20px }
.bar { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line) }
.bar-inner,.reading-layout { width: min(100% - 64px,1376px); margin-inline: auto }
.bar-inner { height: 70px; display: flex; align-items: center; justify-content: space-between; gap: 24px }
.identity,.identity a,.bar-actions,.panel-link { display: flex; align-items: center; gap: 10px }
.identity a:first-child { font-weight: 650; font-size: 21px; letter-spacing: -.055em }
.identity > span { margin-inline: 4px; color: var(--muted); opacity: .65 }
.identity .doc-home { font-size: 15px; font-weight: 500 }
.bar .site-search-open { display: flex; align-items: center; gap: 10px; width: min(330px,32vw); height: 37px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; background: var(--surface); color: var(--muted); font-size: 13px }
kbd { margin-left: auto; font: 11px var(--sans); border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; white-space: nowrap }
#theme { border: 0; background: transparent; padding: 4px 8px; font-size: 21px }
.panel-link { padding: 6px 13px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; border-radius: 7px }
.reading-layout { display: grid; grid-template-columns: minmax(180px,220px) minmax(0,750px) minmax(140px,178px); column-gap: clamp(30px,4vw,88px); justify-content: space-between }
.sidebar,.toc { position: sticky; top: 70px; max-height: calc(100dvh - 70px); overflow-y: auto; align-self: start }
.sidebar { padding: 38px 16px 40px 0; border-right: 1px solid var(--line); min-height: calc(100dvh - 70px) }
.sidebar h2,.mobile-menu h2,.toc h2 { font-size: 13px; font-weight: 600; margin: 0 0 7px }
.sidebar h2,.mobile-menu h2 { padding: 0 11px }
.sidebar > div + div,.mobile-menu nav > div + div { margin-top: 23px }
.sidebar a,.mobile-menu nav a { display: flex; align-items: center; justify-content: space-between; padding: 6px 11px; border-radius: 5px; font-size: 14px; color: var(--muted) }
.sidebar a:hover,.mobile-menu nav a:hover,.toc a:hover { color: var(--ink); background: var(--surface) }
.sidebar a[aria-current],.mobile-menu a[aria-current] { background: var(--wash); color: var(--accent); font-weight: 600 }
.resources small { font-size: 12px }
.mobile-menu { display: none }
main { min-width: 0; padding-block: 46px 64px }
.group-label { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 6px }
h1 { font-size: clamp(38px,4vw,54px); line-height: 1.12; letter-spacing: -.055em; font-weight: 600 }
.lead { color: var(--muted); font-size: clamp(16px,1.3vw,19px); margin: 14px 0 32px; max-width: 62ch }
main section { margin-top: 30px }
main [id],main { scroll-margin-top: 90px }
main h2 { font-size: 23px; line-height: 1.3; letter-spacing: -.035em; font-weight: 600; margin-bottom: 13px }
main p,main li { line-height: 1.7 }
main p + p { margin-top: 10px }
code,pre { font-family: var(--mono); font-size: .9em }
p code,li code { background: var(--surface); padding: .1em .26em; border-radius: 3px; overflow-wrap: anywhere }
.code-box,main section > div:not(.code-box) > pre { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin: 12px 0 }
.code-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--muted) }
.code-tools button,.code-tools select { border: 1px solid var(--line); background: var(--surface); border-radius: 5px; padding: 3px 8px }
main pre { padding: 16px; overflow-x: auto; line-height: 1.65 }
main pre code { font-size: inherit }
.code-box [role=status]:not(:empty) { display: block; padding: 0 16px 10px; color: var(--accent); font-size: 13px }
.guide-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.guide-card { position: relative; display: grid; align-content: start; gap: 3px; border: 1px solid var(--line); padding: 17px; border-radius: 10px; background: var(--surface) }
.guide-card:hover,.pager a:hover { border-color: var(--accent) }
.card-symbol { font: 600 18px var(--mono); color: var(--accent); margin-bottom: 12px }
.guide-card > span:last-of-type,.pager small { font-size: 13px; color: var(--muted); line-height: 1.5 }
.guide-card i { position: absolute; right: 14px; top: 12px; font-style: normal; color: var(--muted) }
.inline { display: inline-block; color: var(--accent); margin: 6px 0; text-decoration: underline; text-underline-offset: 3px }
.toc { padding-top: 46px }
.toc a { display: block; color: var(--muted); font-size: 13px; padding: 5px 12px; border-left: 1px solid var(--line) }
.toc a[aria-current] { border-color: var(--accent); color: var(--accent) }
.routes { border-block: 1px solid var(--line) }
.routes div { padding: 15px 0 }
.routes div + div,.sample + .sample { border-top: 1px solid var(--line) }
.routes dt { display: flex; align-items: baseline; gap: 12px; overflow-wrap: anywhere }
.routes dd { color: var(--muted); font-size: 14px; margin-top: 4px }
.routes dt a:hover, main p a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px }
.param-scroll { overflow: auto; max-height: 60vh; border: 1px solid var(--line); border-radius: 8px }
.param-scroll table { width: 100%; border-spacing: 0; font-size: 14px }
.param-scroll th,.param-scroll td { text-align: start; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line) }
.param-scroll thead th { position: sticky; top: 0; background: var(--surface); z-index: 1 }
.param-scroll tbody th { position: sticky; left: 0; background: var(--bg); font-weight: 500 }
.param-scroll td { min-width: 16ch }
.verb { font: 600 11px var(--mono); color: var(--accent); background: var(--wash); border-radius: 4px; padding: 4px 6px }
.doc-grid label:not(.code-tools label) { display: grid; grid-template-columns: minmax(0,1fr); gap: 4px; margin-block: 12px; font-weight: 500 }
.doc-grid select { max-width: 100%; padding: 7px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px }
.sample summary { padding: 10px 0; font-weight: 500 }
.sample summary span { float: right }
.sample p { padding-bottom: 12px; color: var(--muted) }
.pager { display: flex; gap: 12px; margin-top: 40px; border-top: 1px solid var(--line); padding-top: 20px }
.pager a { display: grid; border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; min-width: 0 }
.pager .next { text-align: right; margin-left: auto }
.pager b { font-size: 14px }
@media(max-width:1050px) {
  .reading-layout { grid-template-columns: 180px minmax(0,1fr) }
  .reading-layout aside { display: none }
}
@media(max-width:720px) {
  .sidebar { display: none }
  .mobile-menu { display: block; border-bottom: 1px solid var(--line) }
  .mobile-menu summary { padding: 10px 20px; color: var(--muted); font-size: 14px }
  .mobile-menu nav { padding: 0 10px 20px }
  .reading-layout { display: block }
  .reading-layout,.bar-inner { width: calc(100% - 36px) }
  .bar-inner { height: 58px; gap: 8px }
  .bar-actions,.identity { gap: 4px }
  .bar .site-search-open { width: 35px; height: 35px; padding: 7px; margin-left: auto }
  .site-search-open span,.site-search-open kbd { display: none }
  main { padding-block: 28px 40px }
  .guide-cards { grid-template-columns: 1fr }
  main [id],main { scroll-margin-top: 68px }
}
@media(max-width:375px) {
  .identity a:first-child { font-size: 18px; gap: 5px }
  .identity img { width: 25px; height: 25px }
  .panel-link { padding: 5px 8px; gap: 4px; white-space: nowrap }
  .identity > span { margin-inline: 1px }
  .bar-inner { gap: 4px }
  #theme { padding-inline: 3px }
}
