/* Layout: content first. A translucent bar on top, one calm column of text, hierarchy from size and weight,
   hairlines instead of boxes. One accent (blue) marks what can be pressed and where you are. */
:root {
  color-scheme: light;
  --bg: #ffffff; --bg-2: #f5f5f7; --bg-3: #e8e8ed; --glass: rgba(255, 255, 255, .72); --veil: rgba(255, 255, 255, .6);
  --fg: #1d1d1f; --fg-2: #6e6e73; --fg-3: #86868b; --hair: rgba(0, 0, 0, .1); --hair-2: rgba(0, 0, 0, .06);
  --accent: #0071e3; --accent-fg: #ffffff; --link: #0066cc;
  --green: #34c759; --orange: #ff9500; --red: #ff3b30; --blue: #007aff; --purple: #af52de; --gray: #8e8e93;
  --lift: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 12px rgba(0, 0, 0, .05), 0 16px 40px rgba(0, 0, 0, .06);
  --float: 0 2px 6px rgba(0, 0, 0, .06), 0 12px 32px rgba(0, 0, 0, .12), 0 40px 80px rgba(0, 0, 0, .16);
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  --spring: cubic-bezier(.32, 1.28, .54, 1); --ease: cubic-bezier(.25, .1, .25, 1);
  --nav: 52px; --r-s: 10px; --r-m: 14px; --r-l: 20px; --r-xl: 28px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --bg-2: #161617; --bg-3: #2c2c2e; --glass: rgba(22, 22, 23, .72); --veil: rgba(0, 0, 0, .55);
    --fg: #f5f5f7; --fg-2: #a1a1a6; --fg-3: #86868b; --hair: rgba(255, 255, 255, .16); --hair-2: rgba(255, 255, 255, .09);
    --accent: #0a84ff; --accent-fg: #ffffff; --link: #2997ff;
    --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --blue: #0a84ff; --purple: #bf5af2; --gray: #8e8e93;
    --lift: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .5);
    --float: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 70px rgba(0, 0, 0, .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000; --bg-2: #161617; --bg-3: #2c2c2e; --glass: rgba(22, 22, 23, .72); --veil: rgba(0, 0, 0, .55);
  --fg: #f5f5f7; --fg-2: #a1a1a6; --fg-3: #86868b; --hair: rgba(255, 255, 255, .16); --hair-2: rgba(255, 255, 255, .09);
  --accent: #0a84ff; --accent-fg: #ffffff; --link: #2997ff;
  --green: #30d158; --orange: #ff9f0a; --red: #ff453a; --blue: #0a84ff; --purple: #bf5af2; --gray: #8e8e93;
  --lift: 0 0 0 1px rgba(255, 255, 255, .06), 0 12px 32px rgba(0, 0, 0, .5);
  --float: 0 0 0 1px rgba(255, 255, 255, .1), 0 24px 70px rgba(0, 0, 0, .7);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav) + 28px + env(safe-area-inset-top, 0px)); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.53 var(--sans); letter-spacing: -.011em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 70; background: var(--bg); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; }
button { font: inherit; color: inherit; letter-spacing: inherit; }

/* ---- navigation bar: glass over the content */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 60; background: var(--glass);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 1px 0 transparent; transition: box-shadow .3s var(--ease); }
.nav.scrolled, .menu-open .nav { box-shadow: 0 1px 0 var(--hair); }
.navin { height: var(--nav); max-width: 1120px; margin: 0 auto; display: flex; align-items: center; gap: 28px;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }
.brand { color: var(--fg); font-weight: 600; font-size: 19px; letter-spacing: -.02em; flex: 0 0 auto; white-space: nowrap; }
.brand span { color: var(--fg-3); font-weight: 400; margin-left: 6px; }
.brand:hover { text-decoration: none; }
.links { flex: 1 1 auto; display: flex; gap: 2px; min-width: 0; }
.links a { color: var(--fg); opacity: .72; font-size: 13px; letter-spacing: -.005em; padding: 6px 10px; border-radius: 980px; white-space: nowrap;
  transition: opacity .2s var(--ease), background-color .2s var(--ease); }
.links a:hover { opacity: 1; text-decoration: none; }
.links a.on { opacity: 1; font-weight: 600; background: var(--hair-2); }
.tools { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; margin-left: auto; }
.icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
  color: var(--fg); opacity: .8; cursor: pointer; transition: transform .35s var(--spring), opacity .2s, background-color .2s; }
.icon:hover { opacity: 1; background: var(--hair-2); }
.icon:active { transform: scale(.88); }
.lang { color: var(--fg); opacity: .8; font-size: 13px; padding: 6px 10px; border-radius: 980px; }
.lang:hover { opacity: 1; text-decoration: none; background: var(--hair-2); }
.menubtn { display: none; }
.menubtn path { transition: transform .4s var(--spring); transform-origin: 12px 12px; }
.menu-open .menubtn .m1 { transform: translateY(3.5px) rotate(45deg); }
.menu-open .menubtn .m2 { transform: translateY(-3.5px) rotate(-45deg); }

/* ---- menu sheet (narrow screens) */
.sheet { position: fixed; z-index: 55; inset: 0; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  padding: calc(var(--nav) + 20px + env(safe-area-inset-top, 0px)) max(28px, env(safe-area-inset-right, 0px)) 40px max(28px, env(safe-area-inset-left, 0px));
  overflow-y: auto; animation: fade .25s var(--ease); }
.sheet nav { display: flex; flex-direction: column; }
.sheet a { color: var(--fg); font-size: 26px; font-weight: 600; letter-spacing: -.02em; padding: 10px 0; border-bottom: 1px solid var(--hair-2);
  animation: rise .5s var(--spring) backwards; }
.sheet a.on { color: var(--accent); }
.sheet a:hover { text-decoration: none; }
.sheet a:nth-child(2) { animation-delay: .03s; } .sheet a:nth-child(3) { animation-delay: .06s; } .sheet a:nth-child(4) { animation-delay: .09s; }
.sheet a:nth-child(5) { animation-delay: .12s; } .sheet a:nth-child(6) { animation-delay: .15s; } .sheet a:nth-child(7) { animation-delay: .18s; }
.sheet a:nth-child(8) { animation-delay: .21s; } .sheet a:nth-child(9) { animation-delay: .24s; } .sheet a:nth-child(10) { animation-delay: .27s; }
.sheet a:nth-child(11) { animation-delay: .3s; }

/* ---- search panel */
.spot { position: fixed; z-index: 80; inset: 0; background: var(--veil); display: flex; justify-content: center; align-items: flex-start;
  padding: calc(11vh + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 24px max(16px, env(safe-area-inset-left, 0px)); animation: fade .2s var(--ease); }
.spotbox { width: min(640px, 100%); max-height: 74vh; display: flex; flex-direction: column; background: var(--glass); border-radius: var(--r-l);
  -webkit-backdrop-filter: saturate(180%) blur(40px); backdrop-filter: saturate(180%) blur(40px); box-shadow: var(--float); overflow: hidden; animation: pop .42s var(--spring); }
.spotin { display: flex; align-items: center; gap: 12px; padding: 0 20px; color: var(--fg-3); border-bottom: 1px solid var(--hair-2); flex: 0 0 auto; }
.spotin input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; color: var(--fg); font: 400 21px var(--sans); letter-spacing: -.015em; outline: none; }
.spotin input::placeholder { color: var(--fg-3); }
.spotin input::-webkit-search-cancel-button { display: none; }
.spotin kbd { font: 500 11px var(--sans); color: var(--fg-3); background: var(--hair-2); border-radius: 6px; padding: 3px 7px; }
.results { overflow-y: auto; padding: 8px; }
.results a { display: block; padding: 10px 12px; border-radius: var(--r-s); color: var(--fg); }
.results a:hover, .results a.sel { background: var(--accent); color: var(--accent-fg); text-decoration: none; }
.results b { display: block; font-weight: 600; font-size: 15px; letter-spacing: -.01em; }
.results small { display: block; font-size: 12px; opacity: .62; }
.results span { display: block; font-size: 13px; line-height: 1.45; opacity: .78; margin-top: 2px; overflow-wrap: anywhere; }
.results mark { background: none; color: inherit; font-weight: 700; opacity: 1; }
.results .hint { margin: 0; padding: 18px 12px; color: var(--fg-3); font-size: 14px; }

/* ---- page frames */
.page { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 0 64px; align-items: start;
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }
.page.notoc { grid-template-columns: minmax(0, 1fr); }
.page.notoc > main { max-width: 780px; margin: 0 auto; width: 100%; }
.page.wide > main, .page.home > main { max-width: 980px; }
.page.ref { max-width: 1320px; grid-template-columns: 216px minmax(0, 1fr) 200px; gap: 0 56px; }
.page.ref.notoc { grid-template-columns: 216px minmax(0, 1fr); }
.page.ref.notoc > main { max-width: none; margin: 0; }
main { min-width: 0; padding-block: 64px 40px; }

.intro { margin-bottom: 48px; }
.eyebrow { margin: 0 0 10px; color: var(--fg-2); font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
h1 { margin: 0; font-size: clamp(34px, 5vw, 48px); line-height: 1.08; font-weight: 700; letter-spacing: -.028em; text-wrap: balance; }
.lead { margin: 18px 0 0; color: var(--fg-2); font-size: clamp(19px, 2.1vw, 21px); line-height: 1.42; letter-spacing: -.017em; max-width: 34em; text-wrap: pretty; }
.source { margin: 18px 0 0; color: var(--fg-3); font-size: 13px; }

.hero { text-align: center; padding: 28px 0 8px; display: flex; flex-direction: column; align-items: center; }
.hero h1 { font-size: clamp(46px, 9vw, 88px); line-height: 1.02; letter-spacing: -.04em; animation: rise .8s var(--spring) backwards; }
.hero .eyebrow { font-size: 17px; animation: rise .8s var(--spring) backwards; }
.hero .lead { max-width: 30em; animation: rise .8s .06s var(--spring) backwards; }
.cta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 28px; margin: 30px 0 0; animation: rise .8s .12s var(--spring) backwards; }
.btn { display: inline-flex; align-items: center; background: var(--accent); color: var(--accent-fg); font-size: 17px; padding: 11px 22px; border-radius: 980px;
  transition: transform .4s var(--spring), filter .2s; }
.btn:hover { text-decoration: none; filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.more { display: inline-flex; align-items: center; gap: 7px; font-size: 17px; }
.more svg { transition: transform .4s var(--spring); }
.more:hover svg { transform: translateX(3px); }

/* ---- reference list (left) and "on this page" (right) */
.side, .toc { position: sticky; top: calc(var(--nav) + env(safe-area-inset-top, 0px)); max-height: calc(100vh - var(--nav) - env(safe-area-inset-top, 0px));
  overflow-y: auto; padding-block: 72px 40px; scrollbar-width: none; }
.side::-webkit-scrollbar, .toc::-webkit-scrollbar { display: none; }
.sgroup { display: flex; flex-direction: column; margin-bottom: 26px; }
.stitle, .toctitle { color: var(--fg-3); font-size: 12px; font-weight: 600; letter-spacing: .01em; margin-bottom: 8px; }
.side a { color: var(--fg-2); font-size: 14px; letter-spacing: -.006em; padding: 4px 0; overflow-wrap: anywhere; transition: color .15s; }
.side a:hover { color: var(--fg); text-decoration: none; }
.side a.on { color: var(--accent); font-weight: 600; }
.toc { display: flex; flex-direction: column; }
.toc a { color: var(--fg-2); font-size: 13px; line-height: 1.38; letter-spacing: -.003em; padding: 5px 0 5px 14px; border-left: 1px solid var(--hair); overflow-wrap: anywhere;
  transition: color .2s var(--ease), border-color .2s var(--ease); }
.toc a.l3 { padding-left: 26px; color: var(--fg-3); }
.toc a:hover { color: var(--fg); text-decoration: none; }
.toc a.on { color: var(--fg); font-weight: 600; border-left-color: var(--fg); }

/* ---- prose */
.prose { overflow-wrap: break-word; }
.prose h2 { margin: 72px 0 16px; font-size: clamp(26px, 3.4vw, 32px); line-height: 1.14; font-weight: 700; letter-spacing: -.024em; text-wrap: balance; }
.prose > h2:first-child { margin-top: 0; }
.prose h3 { margin: 44px 0 10px; font-size: 21px; line-height: 1.24; font-weight: 600; letter-spacing: -.018em; }
.prose h4 { margin: 28px 0 6px; font-size: 17px; font-weight: 600; }
.prose p { margin: 0 0 16px; max-width: 42em; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 1.3em; max-width: 42em; }
.prose li { margin: 6px 0; padding-left: 2px; }
.prose li::marker { color: var(--fg-3); }
.prose strong, .prose b { font-weight: 600; }
.prose hr { border: 0; border-top: 1px solid var(--hair); margin: 56px 0; }
.prose blockquote { margin: 0 0 20px; padding: 16px 20px; border-radius: var(--r-m); background: var(--bg-2); color: var(--fg-2); font-size: 15px; }
.prose blockquote p:last-child { margin-bottom: 0; }
.anchor { margin-left: .35em; color: var(--fg-3); opacity: 0; font-weight: 400; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor, .anchor:focus { opacity: 1; text-decoration: none; }
code { font: .86em var(--mono); letter-spacing: 0; background: var(--bg-2); border-radius: 6px; padding: 2px 6px; overflow-wrap: anywhere; }
a code { color: var(--link); }
pre { position: relative; margin: 0 0 20px; background: var(--bg-2); border-radius: var(--r-m); padding: 18px 20px; overflow-x: auto; font-size: 14px; line-height: 1.55; }
pre code { background: none; padding: 0; font-size: 14px; overflow-wrap: normal; white-space: pre; }
.copybtn { position: absolute; top: 10px; right: 10px; font: 500 12px var(--sans); padding: 5px 11px; border-radius: 980px; border: 0; background: var(--bg-3); color: var(--fg-2);
  cursor: pointer; opacity: 0; transition: opacity .2s, transform .35s var(--spring); }
pre:hover .copybtn, .copybtn:focus-visible { opacity: 1; }
.copybtn:active { transform: scale(.92); }

/* tables: lines, no boxes */
.tablewrap { overflow-x: auto; margin: 0 0 28px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.45; letter-spacing: -.008em; font-variant-numeric: tabular-nums; }
th, td { text-align: left; vertical-align: top; padding: 13px 20px 13px 0; border-bottom: 1px solid var(--hair-2); }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--fg-3); font-size: 12px; font-weight: 600; letter-spacing: .005em; white-space: nowrap; border-bottom-color: var(--hair); padding-bottom: 9px; }
td { color: var(--fg-2); }
td:first-child, td strong, td b { color: var(--fg); }
td.num, th.num { text-align: right; }
tfoot td { color: var(--fg); font-weight: 600; border-top: 1px solid var(--hair); border-bottom: 0; }
.refdoc table { font-size: 14px; }
.refdoc td { min-width: 96px; }
.wide3 table { min-width: 900px; }
.wide3 td:first-child { min-width: 148px; }
.wide3 td:last-child { white-space: nowrap; }

/* status marks: a coloured dot and plain words */
.badge { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 500; letter-spacing: -.003em; color: var(--fg-2); white-space: nowrap; margin-right: 10px; }
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; background: var(--dot, var(--gray)); box-shadow: inset 0 0 0 1.5px var(--dot, var(--gray)); }
.badge.verified { --dot: var(--green); }
.badge.done { --dot: var(--green); }
.badge.running { --dot: var(--blue); }
.badge.translated { --dot: var(--blue); }
.badge.ours { --dot: var(--purple); }
.badge.approx { --dot: var(--orange); }
.badge.unchecked { --dot: var(--orange); }
.badge.todo { --dot: var(--red); }
.badge.done::before, .badge.translated::before, .badge.unchecked::before, .badge.na::before { background: transparent; }
th .badge { font-size: 12px; font-weight: 600; margin-right: 0; }

/* ---- blocks */
.note { margin: 0 0 28px; padding: 18px 22px; border-radius: var(--r-m); background: var(--bg-2); color: var(--fg-2); font-size: 15px; line-height: 1.5; }
.note b { color: var(--fg); }
.statrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 36px 24px; margin: 72px 0; text-align: center; }
.stat { display: flex; flex-direction: column; gap: 6px; animation: rise .8s var(--spring) backwards; }
.stat b { font-size: clamp(40px, 5.4vw, 56px); line-height: 1; font-weight: 700; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.stat span { color: var(--fg-2); font-size: 14px; line-height: 1.35; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 0 0 24px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 24px 24px 26px; border-radius: var(--r-l); background: var(--bg-2); color: var(--fg-2);
  transition: transform .5s var(--spring), box-shadow .3s var(--ease), background-color .3s; animation: rise .7s var(--spring) backwards; }
.card:hover { text-decoration: none; transform: scale(1.018); box-shadow: var(--lift); }
.card:active { transform: scale(.985); }
.card b { color: var(--fg); font-size: 19px; font-weight: 600; letter-spacing: -.02em; }
.card span { font-size: 15px; line-height: 1.42; }
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 32px; }
.flow > div { background: var(--bg-2); border-radius: var(--r-l); padding: 22px; display: flex; flex-direction: column; gap: 6px; animation: rise .7s var(--spring) backwards; }
.flow b { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.flow span { font-size: 14px; color: var(--fg-2); line-height: 1.45; }
.statrow > :nth-child(2), .cards > :nth-child(2), .flow > :nth-child(2), .gallery > :nth-child(2) { animation-delay: .05s; }
.statrow > :nth-child(3), .cards > :nth-child(3), .flow > :nth-child(3), .gallery > :nth-child(3) { animation-delay: .1s; }
.statrow > :nth-child(4), .cards > :nth-child(4), .flow > :nth-child(4), .gallery > :nth-child(4) { animation-delay: .15s; }
.cards > :nth-child(5), .gallery > :nth-child(5) { animation-delay: .2s; }
.cards > :nth-child(6) { animation-delay: .25s; }
.meta { font-size: 13px; color: var(--fg-3); margin: 0 0 16px; max-width: none !important; }

.shot { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.shot img { display: block; width: 100%; border-radius: var(--r-m); background: #000; cursor: zoom-in; box-shadow: 0 0 0 1px var(--hair-2);
  transition: transform .5s var(--spring), box-shadow .3s var(--ease); }
.shot img:hover { transform: scale(1.015); box-shadow: 0 0 0 1px var(--hair-2), var(--lift); }
.shot figcaption { font-size: 13px; color: var(--fg-3); line-height: 1.4; }
.shot.wide { margin: 0 0 16px; animation: rise .9s .1s var(--spring) backwards; }
.shot.wide img { border-radius: var(--r-xl); }
.shot.wide figcaption { text-align: center; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 20px; margin: 0 0 12px; }
.gallery > * { animation: rise .7s var(--spring) backwards; }
.gallery.two { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.docimg { display: block; max-width: min(100%, 520px); border-radius: var(--r-m); cursor: zoom-in; }

/* one option = one grouped card, as a settings list */
.opt { background: var(--bg-2); border-radius: var(--r-l); padding: 26px 28px 12px; margin: 0 0 16px; }
.opt h3 { margin: 0 0 10px; font-size: 21px; display: flex; flex-direction: column-reverse; gap: 6px; }
.opt h3 code { align-self: flex-start; font-size: 12.5px; font-weight: 400; color: var(--fg-2); background: var(--hair-2); }
.opt h3 .anchor { display: none; }
.opt p { color: var(--fg-2); font-size: 16px; line-height: 1.47; }
.opt .tablewrap { margin-bottom: 14px; }
.opt td:first-child { white-space: nowrap; width: 1%; padding-right: 28px; }
.opt td:first-child b { font-weight: 600; }
.opt tr:last-child td { border-bottom: 0; }
.opt p.meta { border-top: 1px solid var(--hair-2); padding-top: 12px; font-size: 13px; color: var(--fg-3); }
.opt code { background: var(--hair-2); }

.fold { background: var(--bg-2); border-radius: var(--r-m); margin: 0 0 10px; overflow: hidden; }
.fold > summary { cursor: pointer; list-style: none; padding: 16px 22px; font-weight: 600; font-size: 17px; letter-spacing: -.015em; display: flex; gap: 10px; align-items: center; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--fg-3); border-bottom: 2px solid var(--fg-3); transform: rotate(45deg); margin: -4px 4px 0 auto;
  transition: transform .4s var(--spring); }
.fold[open] > summary::after { transform: rotate(225deg); margin-top: 4px; }
.fold .count { color: var(--fg-3); font-weight: 400; font-size: 14px; }
.fold .tablewrap { margin: 0; padding: 0 22px 10px; }
.fold code { background: var(--hair-2); }
.fold tr:last-child td { border-bottom: 0; }

.timeline { list-style: none; padding: 0 !important; margin: 0 0 24px; max-width: none !important; }
.timeline li { display: grid; grid-template-columns: 104px 72px minmax(0, 1fr); gap: 12px; align-items: baseline; padding: 11px 0; margin: 0; border-bottom: 1px solid var(--hair-2); font-size: 15px; }
.timeline time { font-size: 13px; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.timeline a { color: var(--fg); }
.timeline a:hover { color: var(--link); text-decoration: none; }
.chip { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip.ghost { color: var(--fg-3); }

.doclist { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0 40px; margin: 0 0 8px; }
.doclist a { display: flex; flex-direction: column; gap: 2px; padding: 14px 0; border-bottom: 1px solid var(--hair-2); color: var(--fg); transition: transform .4s var(--spring); }
.doclist a:hover { text-decoration: none; transform: translateX(4px); }
.doclist a:hover b { color: var(--link); }
.doclist b { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.doclist span { font-size: 14px; color: var(--fg-2); line-height: 1.4; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 96px 0 0; }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 20px 24px; border-radius: var(--r-l); background: var(--bg-2); color: var(--fg);
  transition: transform .5s var(--spring), box-shadow .3s var(--ease); min-width: 0; }
.pager a:hover { text-decoration: none; transform: scale(1.015); box-shadow: var(--lift); }
.pager a:active { transform: scale(.98); }
.pager .next { text-align: right; }
.pager small { color: var(--fg-3); font-size: 13px; }
.pager b { font-size: 19px; font-weight: 600; letter-spacing: -.02em; overflow-wrap: anywhere; }

.foot { margin-top: 80px; background: var(--bg-2); color: var(--fg-3); font-size: 12px; letter-spacing: 0; }
.foot div { max-width: 1120px; margin: 0 auto; padding-block: 22px calc(22px + env(safe-area-inset-bottom, 0px));
  padding-left: max(22px, env(safe-area-inset-left, 0px)); padding-right: max(22px, env(safe-area-inset-right, 0px)); }

.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0, 0, 0, .86); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; cursor: zoom-out; animation: fade .25s var(--ease);
  padding: calc(20px + env(safe-area-inset-top, 0px)) max(20px, env(safe-area-inset-right, 0px)) calc(20px + env(safe-area-inset-bottom, 0px)) max(20px, env(safe-area-inset-left, 0px)); }
.lightbox img { max-height: calc(100% - 60px); max-width: 100%; border-radius: var(--r-m); animation: pop .5s var(--spring); }
.lightbox p { color: #a1a1a6; font-size: 13px; margin: 0; text-align: center; }
.lightbox .icon { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: max(14px, env(safe-area-inset-right, 0px)); color: #f5f5f7; background: rgba(255, 255, 255, .12); }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } }
@keyframes pop { from { opacity: 0; transform: scale(.94); } }
@keyframes fade { from { opacity: 0; } }

/* ---- narrower screens */
@media (max-width: 1240px) {
  .page.ref { grid-template-columns: 216px minmax(0, 1fr); }
  .page.ref .toc { display: none; }
}
@media (max-width: 1000px) {
  .page, .page.ref, .page.ref.notoc { grid-template-columns: minmax(0, 1fr); }
  .toc, .side { display: none; }
  .page > main, .page.ref.notoc > main { max-width: 780px; margin: 0 auto; width: 100%; }
  .links, .tools .lang { display: none; }
  .menubtn { display: inline-flex; }
}
@media (max-width: 600px) {
  body { font-size: 16px; }
  main { padding-block: 40px 24px; }
  .intro { margin-bottom: 36px; }
  .prose h2 { margin-top: 56px; }
  .statrow { grid-template-columns: 1fr 1fr; margin: 48px 0; }
  .opt { padding: 22px 20px 8px; }
  .timeline li { grid-template-columns: 92px minmax(0, 1fr); }
  .timeline .chip { display: none; }
  .pager { margin-top: 64px; }
  .pager a { padding: 16px 18px; }
  .pager b { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
