/* CoreCode docs. Tokens follow the console theme (corecode-app
 * web/src/styles/corecode-brand.css): cream canvas, white cards, warm
 * hairlines, one clay accent, serif titles, sans body. The status page
 * (site/status/) reuses this file and reads --bg, --fg, --muted, --line,
 * --card and --code, so keep those names. prefs.js puts the resolved light or
 * dark class on <html> from the console's theme setting; dark tokens key on
 * that class, not on prefers-color-scheme, so the header's switch wins. */

@font-face {
  font-family: "Lora";
  src: url("/docs/fonts/lora-latin.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #faf9f5; --fg: #141413; --muted: #5e5d59; --faint: #8a8780;
  --line: rgb(31 30 29 / 0.12); --line-soft: rgb(31 30 29 / 0.07);
  --card: #ffffff; --code: #f5f4ed; --code-head: #efede4; --hover: rgb(31 30 29 / 0.05); --pill: #f0eee6;
  --accent: #b5532f; --accent-ring: #c96442;
  --accent-soft: color-mix(in oklab, #c96442 11%, var(--bg));
  --tip: #4d7a3a; --tip-soft: color-mix(in oklab, #4d7a3a 10%, var(--bg));
  --warn: #8a5a12; --warn-soft: color-mix(in oklab, #c58a1c 13%, var(--bg));
  --shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 14px rgb(0 0 0 / 0.06);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.06), 0 16px 40px -4px rgb(0 0 0 / 0.14);
  --serif: "Lora", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --header-h: 60px;
  color-scheme: light;
}
:root.dark {
  --bg: #262624; --fg: #faf9f5; --muted: #a6a39b; --faint: #85827b;
  --line: rgb(250 249 245 / 0.1); --line-soft: rgb(250 249 245 / 0.06);
  --card: #30302e; --code: #1f1e1d; --code-head: #2a2927; --hover: rgb(250 249 245 / 0.06); --pill: #2d2c2a;
  --accent: #e08264; --accent-ring: #d97757;
  --accent-soft: color-mix(in oklab, #d97757 16%, var(--bg));
  --tip: #8fb07a; --tip-soft: color-mix(in oklab, #8fb07a 13%, var(--bg));
  --warn: #e0a44a; --warn-soft: color-mix(in oklab, #e0a44a 13%, var(--bg));
  --shadow: 0 1px 2px rgb(0 0 0 / 0.2), 0 4px 14px rgb(0 0 0 / 0.25);
  --shadow-lg: 0 4px 8px rgb(0 0 0 / 0.3), 0 16px 40px -4px rgb(0 0 0 / 0.45);
  color-scheme: dark;
}
.dark body { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 20px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 15.5px/1.8 var(--sans); overflow-x: hidden; }
::selection { background: color-mix(in oklab, var(--accent) 24%, transparent); }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent-ring); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }

/* ---------- header ---------- */
header { position: sticky; top: 0; z-index: 30; height: var(--header-h); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line-soft); }
.bar { max-width: 1320px; height: 100%; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); font: 600 17px/1 var(--serif); letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.brand b { color: var(--accent); font-weight: 600; }
.brand .tag { font: 500 12px/1 var(--sans); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 4px 8px; margin-left: 2px; letter-spacing: 0; }
.bar nav { margin-left: auto; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.bar nav a { color: var(--muted); padding: 6px 10px; border-radius: 8px; }
.bar nav a:hover { color: var(--fg); background: var(--hover); text-decoration: none; }
.bar nav a[aria-current="page"] { color: var(--fg); }
.bar nav a.cta { color: #fff; background: var(--accent); margin-left: 6px; font-weight: 550; }
.bar nav a.cta:hover { background: color-mix(in oklab, var(--accent) 88%, black); color: #fff; }
.dark .bar nav a.cta, .dark .bar nav a.cta:hover { color: #141413; }
.bar nav .sep { width: 1px; height: 16px; margin: 0 6px; background: var(--line); }

/* Language menu (scripts/site-seo.mjs writes it), the status page's EN / 中文 pill, and the theme menu */
details.lang { position: relative; flex: none; }
details.lang summary { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; color: var(--muted); font-size: 14px; white-space: nowrap; list-style: none; cursor: pointer; }
details.lang summary::-webkit-details-marker { display: none; }
details.lang summary:hover, details.lang[open] summary { color: var(--fg); background: var(--hover); }
details.lang summary svg { width: 16px; height: 16px; }
.lang-list { position: absolute; z-index: 50; top: calc(100% + 6px); right: 0; min-width: 140px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow-lg); }
.lang-list > * { display: block; padding: 6px 10px; border-radius: 6px; font-size: 14px; line-height: 1.4; white-space: nowrap; }
.bar nav .lang-list a { color: var(--fg); }
.bar nav .lang-list a:hover { background: var(--hover); }
.lang-list [aria-current] { color: var(--accent); font-weight: 550; }
div.lang { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 2px; border-radius: 999px; background: var(--pill); }
div.lang > * { display: inline-flex; align-items: center; height: 100%; padding: 0 12px; border-radius: 999px; font-size: 14px; line-height: 1; white-space: nowrap; }
.bar nav div.lang a { color: var(--muted); }
.bar nav div.lang a:hover { color: var(--fg); background: none; }
div.lang [aria-current] { color: var(--fg); background: var(--bg); font-weight: 550; box-shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 2px 8px rgb(0 0 0 / 0.08); }
.theme { flex: none; position: relative; display: inline-grid; place-items: center; width: 36px; height: 36px; margin-left: 2px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); cursor: pointer; }
.theme:hover, .theme[aria-expanded="true"] { background: var(--hover); }
.theme svg { grid-area: 1 / 1; width: 19px; height: 19px; transition: transform 300ms, opacity 300ms; }
.theme .moon, .dark .theme .sun { opacity: 0; transform: rotate(90deg) scale(0); }
.dark .theme .moon { opacity: 1; transform: none; }
.theme-menu { position: fixed; z-index: 50; min-width: 128px; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); box-shadow: var(--shadow-lg); }
.theme-menu button { display: flex; align-items: center; gap: 16px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; color: var(--fg); font: 14px/1.4 var(--sans); text-align: left; cursor: pointer; }
.theme-menu button:hover, .theme-menu button:focus-visible { background: var(--hover); outline: none; }
.theme-menu svg { width: 14px; height: 14px; margin-left: auto; }
.theme-menu [aria-checked="false"] svg { visibility: hidden; }
.menu-btn { display: none; align-items: center; justify-content: center; width: 36px; height: 36px; margin-left: -6px; border: 0; border-radius: 8px; background: transparent; color: var(--fg); cursor: pointer; }
.menu-btn:hover { background: var(--hover); }
.menu-btn svg { width: 20px; height: 20px; }

/* ---------- layout ---------- */
.layout { max-width: 1320px; margin: 0 auto; padding: 0 24px; display: grid; grid-template-columns: 236px minmax(0, 1fr) 208px; gap: 56px; }
.layout.solo { grid-template-columns: minmax(0, 1fr); max-width: 820px; padding-top: 40px; padding-bottom: 96px; }
main { min-width: 0; max-width: 780px; padding: 44px 0 96px; }
.layout.solo main { padding: 0; }
/* blog: a post is the article and its toc; the index is one column of posts */
.layout.post { grid-template-columns: minmax(0, 1fr) 208px; max-width: 1080px; }
.post-list { list-style: none; margin: 28px 0 0; padding: 0; }
.post-list li { margin: 0; }
.post-list li + li { border-top: 1px solid var(--line-soft); }
.post-list a { display: grid; gap: 6px; padding: 22px 0; color: inherit; }
.post-list a:hover { text-decoration: none; }
.post-list a:hover b { color: var(--accent); }
.post-list time, .post-list small { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.post-list b { font-family: var(--serif); font-size: 21px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; transition: color 150ms; }
.post-list span { color: var(--muted); font-size: 15px; line-height: 1.6; }

/* icons from /docs/img/icons: an <img> keeps its colors, a span.ni is a mask in the text color */
span.ni { display: inline-block; background: currentColor; -webkit-mask: var(--ni) center / contain no-repeat; mask: var(--ni) center / contain no-repeat; }
.ni-inline { display: inline-flex; align-items: center; gap: 8px; }
.ni-inline .ni { flex: none; width: 16px; height: 16px; }
td.codes code { display: inline-block; margin: 2px 4px 2px 0; white-space: nowrap; }

/* sidebar */
.sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 36px 8px 40px 0; font-size: 14px; scrollbar-width: thin; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-group > p { margin: 0 0 6px; padding: 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--faint); }
.nav-group a { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--muted); line-height: 1.45; }
.nav-group a:hover { color: var(--fg); background: var(--hover); text-decoration: none; }
.nav-group a[aria-current="page"] { color: var(--fg); background: var(--card); box-shadow: 0 0 0 1px var(--line-soft), var(--shadow); font-weight: 550; }
.nav-group a .ni { flex: none; width: 16px; height: 16px; }
.nav-group a span.ni { opacity: 0.85; }
.nav-group a .ext { margin-left: auto; width: 12px; height: 12px; opacity: 0.6; }
.nav-sub { margin: 4px 0 6px 14px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-sub a { padding: 4px 10px; font-size: 13px; }
.nav-sub a.active { color: var(--accent); }
@media (min-width: 1181px) { .nav-sub { display: none; } }

/* on-page toc */
.toc { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 44px 0 40px; font-size: 13px; }
.toc p { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--faint); }
.toc a { display: block; padding: 4px 0 4px 12px; border-left: 2px solid var(--line-soft); color: var(--muted); line-height: 1.5; }
.toc a.sub { padding-left: 24px; font-size: 12.5px; }
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 236px minmax(0, 1fr); gap: 48px; }
  .layout.post { grid-template-columns: minmax(0, 1fr); max-width: 820px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 18px; }
  .menu-btn { display: inline-flex; }
  .bar { padding: 0 16px; gap: 10px; }
  .bar nav > a:not(.cta), .bar nav .sep { display: none; }
  .sidebar { position: fixed; z-index: 40; top: 0; left: 0; bottom: 0; width: min(300px, 84vw); max-height: none; padding: 20px 14px 40px; background: var(--bg); border-right: 1px solid var(--line); box-shadow: var(--shadow-lg); transform: translateX(-102%); transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1); }
  body.nav-open .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 35; background: rgb(0 0 0 / 0.32); opacity: 0; pointer-events: none; transition: opacity 200ms; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .sidebar .drawer-head { display: flex; }
  main { padding-top: 28px; }
}
@media (max-width: 480px) {
  .bar { gap: 6px; }
  .brand .tag { display: none; }
  div.lang > * { padding: 0 9px; }
  details.lang summary span { display: none; }
  .bar nav a.cta { margin-left: 0; }
}
@media (max-width: 380px) { header .brand span { display: none; } }
.drawer-head { display: none; align-items: center; justify-content: space-between; margin: 0 0 18px; padding: 0 4px 0 10px; }

/* ---------- typography ---------- */
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: 0.02em; }
h1, h2, h3 { color: var(--fg); scroll-margin-top: calc(var(--header-h) + 20px); }
h1 { font: 500 36px/1.2 var(--serif); letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
h2 { font: 500 25px/1.3 var(--serif); letter-spacing: -0.012em; margin: 60px 0 14px; padding-top: 4px; }
h3 { font: 600 17px/1.5 var(--sans); margin: 34px 0 10px; }
h2 + h3 { margin-top: 18px; }
h4 { font-size: 15px; margin: 22px 0 6px; }
main h2, main h3 { position: relative; }
.anchor { position: absolute; left: -22px; top: 0; padding-right: 6px; color: var(--faint); opacity: 0; font: 400 18px/inherit var(--sans); }
h2 .anchor { line-height: 1.6; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
p, li { color: var(--fg); }
p { margin: 0 0 14px; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.75; margin: 0 0 28px; text-wrap: pretty; }
.meta { color: var(--faint); font-size: 13px; margin: 0 0 18px; }
strong { font-weight: 600; }
ol, ul { padding-left: 22px; margin: 0 0 16px; }
li { margin: 5px 0; }
li::marker { color: var(--faint); }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
kbd { font: 12px/1 var(--mono); padding: 3px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--card); }

code { font: 0.86em/1.5 var(--mono); background: var(--code); border: 1px solid var(--line-soft); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
a code { color: inherit; }

/* ---------- code blocks ---------- */
.code { position: relative; margin: 12px 0 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--code); overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 8px 0 14px; background: var(--code-head); border-bottom: 1px solid var(--line-soft); font: 12px/1 var(--mono); color: var(--muted); }
.code-head .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-head .tabs { display: flex; gap: 2px; margin: 0 0 0 -6px; height: 40px; align-items: stretch; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.code-head .tabs::-webkit-scrollbar { display: none; }
.code-head .tabs button { flex: none; white-space: nowrap; font: 500 12.5px/1 var(--sans); padding: 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); cursor: pointer; }
.code-head .tabs button:hover { color: var(--fg); }
.code-head .tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--accent); }
.copy { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; font: 500 12px/1 var(--sans); color: var(--muted); background: transparent; border: 0; border-radius: 6px; padding: 6px 8px; cursor: pointer; }
.copy:hover { color: var(--fg); background: var(--hover); }
.copy svg { width: 14px; height: 14px; }
.copy { flex: none; }
@media (max-width: 560px) { .copy span { display: none; } .copy { padding: 7px; } }
.copy.done { color: var(--tip); }
pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13px/1.65 var(--mono); tab-size: 2; }
pre code { background: none; border: 0; padding: 0; font: inherit; overflow-wrap: normal; }
pre[hidden] { display: none; }
/* a pre that docs.js has not wrapped (no JS) */
main > pre { background: var(--code); border: 1px solid var(--line); border-radius: 12px; margin: 12px 0 20px; }

/* ---------- per-OS steps: a card whose header switches the system ---------- */
.panes { margin: 14px 0 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; }
.panes > .tabs { display: flex; gap: 4px; padding: 6px; background: var(--code-head); border-bottom: 1px solid var(--line-soft); }
.panes > .tabs button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 14px; font: 500 14px/1 var(--sans); color: var(--muted); background: none; border: 1px solid transparent; border-radius: 9px; cursor: pointer; transition: color .15s, background-color .15s; }
.panes > .tabs button:hover { color: var(--fg); background: var(--hover); }
.panes > .tabs button[aria-selected="true"] { color: var(--fg); font-weight: 600; background: var(--card); border-color: var(--line); box-shadow: var(--shadow); }
.panes > .tabs button:is([data-tab="win"], [data-tab="mac"])::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--os) center / contain no-repeat; mask: var(--os) center / contain no-repeat; }
.panes > .tabs button[aria-selected="true"]::before { color: var(--accent); }
.panes > .tabs [data-tab="win"] { --os: url(/docs/img/icons/windows.svg); }
.panes > .tabs [data-tab="mac"] { --os: url(/docs/img/icons/apple.svg); }
.panes > [data-panel] { padding: 18px 20px 4px; }
.panes > [data-panel] > :first-child { margin-top: 0; }
.panes > [data-panel] > img { margin: 0 0 16px; }
@media (max-width: 560px) { .panes > [data-panel] { padding: 16px 14px 2px; } }

/* ---------- callouts ---------- */
.note, .callout { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; margin: 18px 0 22px; padding: 14px 16px; border-radius: 12px; background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 22%, transparent); font-size: 14.5px; line-height: 1.75; }
.note > svg, .callout > svg { width: 18px; height: 18px; margin-top: 4px; color: var(--accent); }
.note > div > strong:first-child, .callout > div > strong:first-child { display: block; color: var(--fg); margin-bottom: 2px; }
.note p:last-child, .callout p:last-child { margin-bottom: 0; }
.callout.tip { background: var(--tip-soft); border-color: color-mix(in oklab, var(--tip) 24%, transparent); }
.callout.tip > svg { color: var(--tip); }
.callout.warn { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 26%, transparent); }
.callout.warn > svg { color: var(--warn); }

/* ---------- tables ---------- */
.table { margin: 12px 0 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.65; }
th, td { text-align: left; padding: 11px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; }
tr:first-child > th, tr:first-child > td { border-top: 0; }
th { color: var(--muted); font-weight: 550; font-size: 13px; background: color-mix(in oklab, var(--code) 60%, var(--card)); }
td:first-child { white-space: nowrap; }
td:first-child code { white-space: nowrap; }
.table.wrap td:first-child { white-space: normal; }
table.trace th, table.trace td { white-space: nowrap; }
main > table { border: 1px solid var(--line); border-radius: 12px; border-collapse: separate; border-spacing: 0; overflow: hidden; background: var(--card); margin: 12px 0 22px; }

/* key-value summary */
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); margin: 8px 0 28px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; font-size: 14.5px; }
.kv > div { padding: 12px 16px; border-top: 1px solid var(--line-soft); }
.kv > div:nth-child(-n+2) { border-top: 0; }
.kv > div:nth-child(odd) { color: var(--muted); }

/* ---------- steps ---------- */
ol.steps { list-style: none; padding: 0; margin: 20px 0 28px; counter-reset: step; }
ol.steps > li { position: relative; margin: 0; padding: 0 0 28px 48px; counter-increment: step; }
ol.steps > li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 600 14px/1 var(--sans); color: var(--accent); background: var(--accent-soft); border: 1px solid color-mix(in oklab, var(--accent) 28%, transparent); }
ol.steps > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--line); }
ol.steps > li:last-child { padding-bottom: 4px; }
ol.steps > li:last-child::after { display: none; }
ol.steps > li > h3 { margin: 2px 0 8px; }

/* ---------- cards ---------- */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 16px 0 28px; }
.card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); box-shadow: var(--shadow); transition: border-color 160ms, transform 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms; }
.card:hover { text-decoration: none; border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow-lg); }
.card .card-title { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15.5px; }
.card .card-title svg { width: 20px; height: 20px; color: var(--accent); flex: none; }
.card .card-title .badge { margin-left: auto; }
.card .card-title .ni { flex: none; width: 22px; height: 22px; }
.card .card-title span.ni { color: var(--fg); }
.card .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card .chips code { font-size: 12px; }
.card span.desc { color: var(--muted); font-size: 13.5px; line-height: 1.6; }
.badge { display: inline-block; font: 600 11px/1 var(--sans); padding: 4px 7px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); letter-spacing: 0.02em; }
@media (max-width: 640px) { .cards { grid-template-columns: minmax(0, 1fr); } }

/* ---------- hero (docs home) ---------- */
.hero { margin: 0 0 8px; }
.hero h1 { font-size: 42px; }
.hero .lead { font-size: 17.5px; max-width: 640px; }

/* ---------- figures ---------- */
figure { margin: 14px 0 24px; }
main img { display: block; max-width: min(100%, 560px); height: auto; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); background: var(--card); }
main img.wide { max-width: 100%; }
main img[data-zoom] { cursor: zoom-in; }
figcaption { color: var(--faint); font-size: 13px; margin-top: 8px; }
li > img { margin: 12px 0 8px; }

.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgb(20 20 19 / 0.78); cursor: zoom-out; opacity: 0; transition: opacity 180ms; }
.lightbox.open { opacity: 1; }
.lightbox img { max-width: min(96vw, 1600px); max-height: 92vh; width: auto; height: auto; border: 0; border-radius: 10px; box-shadow: var(--shadow-lg); cursor: zoom-out; }

/* ---------- faq ---------- */
details.qa { border: 1px solid var(--line); border-radius: 12px; background: var(--card); margin: 8px 0; transition: border-color 160ms; }
details.qa[open] { border-color: color-mix(in oklab, var(--accent) 30%, var(--line)); }
details.qa summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 13px 16px; cursor: pointer; font-weight: 550; font-size: 15px; line-height: 1.5; }
details.qa summary::-webkit-details-marker { display: none; }
details.qa summary::after { content: ""; flex: none; margin-left: auto; width: 8px; height: 8px; border-right: 1.5px solid var(--faint); border-bottom: 1.5px solid var(--faint); transform: rotate(45deg) translate(-2px, -2px); transition: transform 160ms; }
details.qa[open] summary::after { transform: rotate(225deg) translate(-2px, -2px); }
details.qa summary:hover { color: var(--accent); }
details.qa > div { padding: 0 16px 14px; color: var(--fg); font-size: 14.5px; }
details.qa > div p:last-child { margin-bottom: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #fff; border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 550; box-shadow: var(--shadow); }
.btn:hover { text-decoration: none; background: color-mix(in oklab, var(--accent) 88%, black); }
.dark .btn, .dark .btn:hover { color: #141413; }

/* ---------- pager ---------- */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 3px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; color: var(--fg); font-weight: 550; background: var(--card); transition: border-color 160ms; }
.pager a.next { grid-column: 2; text-align: right; }
.pager a span { color: var(--faint); font-size: 12.5px; font-weight: 400; }
.pager a:hover { border-color: var(--accent); text-decoration: none; }
@media (max-width: 560px) { .pager { grid-template-columns: 1fr; } .pager a.next { grid-column: 1; } }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 13px; }
footer .bar { height: auto; min-height: 64px; padding-top: 16px; padding-bottom: 16px; justify-content: space-between; flex-wrap: wrap; }
footer .bar span:last-child { display: flex; flex-wrap: wrap; gap: 4px 16px; }
footer a { color: var(--muted); }
footer a:hover { color: var(--fg); }

/* in-place navigation: a thin progress bar while the next page loads, and a
 * short crossfade where the browser supports view transitions */
html.loading::before { content: ""; position: fixed; z-index: 70; top: 0; left: 0; height: 2px; width: 100%; background: var(--accent); transform-origin: left; animation: docs-load 1.2s cubic-bezier(0.16, 1, 0.3, 1) 120ms both; }
@keyframes docs-load { from { transform: scaleX(0); } to { transform: scaleX(0.85); } }
main h1:focus { outline: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 140ms; }
