:root {
  --bg: #121417; --bg-soft: #191c20; --bg-mute: #20242a; --bg-hover: #262b32;
  --line: #2c3139; --line-soft: #23272e;
  --text: #e4e7eb; --text-2: #aab1bb; --text-3: #7f8792;
  --accent: #f0a63c; --accent-soft: rgba(240,166,60,.14); --accent-text: #ffc06a;
  --link: #79b8ff; --sig: #c39bff; --met: #6fd6a8; --prop: #f0a63c;
  --warn-bg: #2a2212; --warn-line: #5b4517; --warn-text: #f3d39a;
  --code-bg: #0d0f12; --code-text: #d7dce2;
  --tok-k: #ff7b72; --tok-s: #a5d6ff; --tok-c: #7f8792; --tok-n: #79c0ff; --tok-f: #d2a8ff;
  --mark: rgba(240,166,60,.28);
  --shadow: 0 10px 40px rgba(0,0,0,.5);
  --mono: ui-monospace, "Cascadia Code", "JetBrains Mono", Consolas, Menlo, monospace;
  --sans: Inter, "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --top: 56px; --side: 290px; color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #ffffff; --bg-soft: #f6f7f9; --bg-mute: #eceef1; --bg-hover: #e4e7eb;
  --line: #dcdfe4; --line-soft: #e8eaee;
  --text: #1d2127; --text-2: #4a525d; --text-3: #6b7380;
  --accent: #b86a00; --accent-soft: rgba(184,106,0,.10); --accent-text: #8f5200;
  --link: #0b5fbd; --sig: #7240c9; --met: #137a4d; --prop: #a35d00;
  --warn-bg: #fff6e5; --warn-line: #f0c674; --warn-text: #6b4300;
  --code-bg: #f5f6f8; --code-text: #1d2127;
  --tok-k: #cf222e; --tok-s: #0a3069; --tok-c: #6e7781; --tok-n: #0550ae; --tok-f: #8250df;
  --mark: rgba(255,190,60,.35);
  --shadow: 0 10px 40px rgba(0,0,0,.15); color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #ffffff; --bg-soft: #f6f7f9; --bg-mute: #eceef1; --bg-hover: #e4e7eb;
    --line: #dcdfe4; --line-soft: #e8eaee;
    --text: #1d2127; --text-2: #4a525d; --text-3: #6b7380;
    --accent: #b86a00; --accent-soft: rgba(184,106,0,.10); --accent-text: #8f5200;
    --link: #0b5fbd; --sig: #7240c9; --met: #137a4d; --prop: #a35d00;
    --warn-bg: #fff6e5; --warn-line: #f0c674; --warn-text: #6b4300;
    --code-bg: #f5f6f8; --code-text: #1d2127;
    --tok-k: #cf222e; --tok-s: #0a3069; --tok-c: #6e7781; --tok-n: #0550ae; --tok-f: #8250df;
    --mark: rgba(255,190,60,.35);
    --shadow: 0 10px 40px rgba(0,0,0,.15); color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 16px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--sans); -webkit-text-size-adjust: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font-family: var(--mono); font-size: .88em; background: var(--bg-mute); padding: .1em .38em; border-radius: 4px; overflow-wrap: anywhere; }
a code { color: inherit; }
button { font: inherit; color: inherit; }
kbd { font: 11px var(--mono); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--text-3); background: var(--bg-soft); }
.top { position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 12px; padding: 0 16px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: baseline; gap: 8px; color: var(--text); font-weight: 650; white-space: nowrap; min-width: 0; }
.brand:hover { text-decoration: none; }
.brand .dot { color: var(--accent); }
.brand small { font-weight: 450; color: var(--text-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; }
.top .grow { flex: 1; }
.searchbtn { display: flex; align-items: center; gap: 10px; min-width: 240px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); color: var(--text-3); cursor: pointer; }
.searchbtn:hover { border-color: var(--accent); }
.disc { position: relative; }
.discbtn[aria-expanded="true"] { background: var(--bg-mute); color: var(--text); }
.discpop { position: absolute; right: 0; top: calc(100% + 8px); z-index: 45; width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - var(--top) - 24px); overflow-y: auto; padding: 16px 18px 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); font-size: 13px; line-height: 1.55; color: var(--text-2); }
.discpop::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }
.discclose { position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border: 0; border-radius: 8px; background: none; color: var(--text-3); font-size: 20px; line-height: 1; cursor: pointer; }
.discclose:hover { background: var(--bg-mute); color: var(--text); }
.discpop h2 { margin: 0 0 8px; padding: 0; border: 0; font-size: 15px; color: var(--text); }
.discpop p { margin: 0 0 10px; }
.discpop h3 { margin: 12px 0 4px; font-size: 13px; color: var(--text); }
.discpop ul { margin: 0 0 10px; padding-left: 18px; }
.discpop li { margin: 0 0 4px; }
.aibtn { padding: 6px 8px; }
.aibtn img { display: block; width: 24px; height: 24px; }
.searchbtn span { flex: 1; text-align: left; }
.iconbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text-2); }
.iconbtn:hover { background: var(--bg-mute); color: var(--text); }
.menubtn { display: none; }
.layout { display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--bg-soft); }
.side-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 12px 20px; overscroll-behavior: contain; }
.side-actions { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.sidebox { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); padding: 8px 10px; text-align: center; }
.sidebox.version b { font-size: 16px; font-weight: 600; line-height: 1.3; }
.sidebox.version span { font-size: 15px; color: var(--text-2); line-height: 1.3; }
.sidebox.brandcard { gap: 6px; padding: 8px 10px 12px; color: var(--link); text-decoration: none; }
.sidebox.brandcard:hover { border-color: var(--accent); text-decoration: none; }
.sidebox.brandcard .site { font-size: 18px; letter-spacing: .01em; }
.sidebox.brandcard:hover .site { text-decoration: underline; }
.sidebox.brandcard img { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
@media (max-height: 860px) { .sidebox.brandcard img { display: none; } }
@media (max-height: 640px) { .sidebox.version { display: none; } }
.actbtn { display: block; padding: 9px 14px; border-radius: 10px; text-align: center; font-weight: 600; font-size: 14px; color: #fff !important; text-decoration: none !important; }
.actbtn.submit { background: #23863a; }
.actbtn.submit:hover { background: #2ea043; }
.actbtn.report { background: #c4302b; }
.actbtn.report:hover { background: #da3633; }
.actbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.side nav.pages a { display: flex; justify-content: space-between; padding: 5px 10px; border-radius: 6px; color: var(--text-2); font-size: 14px; }
.side nav.pages a:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.side a.active { background: var(--accent-soft) !important; color: var(--accent-text) !important; font-weight: 600; }
.side h4 { margin: 18px 10px 6px; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); font-weight: 650; }
.filter { width: 100%; padding: 7px 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.side details { margin: 2px 0; }
.side summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; border-radius: 6px; font-weight: 600; font-size: 14px; color: var(--text); user-select: none; }
.side summary::-webkit-details-marker { display: none; }
.side summary::before { content: "›"; display: inline-block; width: 14px; color: var(--text-3); transition: transform .15s; }
.side details[open] > summary::before { transform: rotate(90deg); }
.side summary .lbl { flex: 1; }
.side summary:hover { background: var(--bg-hover); }
.side .cl { display: flex; justify-content: space-between; gap: 8px; padding: 3px 10px 3px 26px; border-radius: 6px; color: var(--text-2); font-size: 13.5px; font-family: var(--mono); }
.side .cl:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.side .cl .n { overflow: hidden; text-overflow: ellipsis; }
.cnt { color: var(--text-3); font: 12px var(--sans); font-variant-numeric: tabular-nums; }
.side .empty { padding: 6px 10px; color: var(--text-3); font-size: 13px; }
main { min-width: 0; padding: 28px clamp(16px, 4vw, 48px) 80px; }
.page { max-width: 1180px; }
.page.withtoc { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 40px; max-width: 1300px; }
.toc { position: sticky; top: calc(var(--top) + 20px); align-self: start; max-height: calc(100vh - var(--top) - 40px); overflow-y: auto; font-size: 13px; border-left: 1px solid var(--line); padding-left: 14px; }
.toc b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--text-2); }
.toc a { display: block; padding: 2px 0; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc a.l3 { padding-left: 12px; }
.toc a:hover { color: var(--text); text-decoration: none; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 6px; letter-spacing: -.01em; overflow-wrap: anywhere; }
h1 code { font-size: .9em; background: none; padding: 0; }
h2 { font-size: 21px; margin: 38px 0 12px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
h3 { font-size: 17px; margin: 26px 0 8px; }
h1 .anchor { display: none; }
h2 .anchor, h3 .anchor, h4 .anchor { margin-left: 8px; color: var(--text-3); opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.lead { color: var(--text-2); margin: 0 0 18px; }
.crumbs { font-size: 13px; color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-3); }
.chip { display: inline-block; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg-soft); font-size: 12.5px; color: var(--text-2); }
.chip.grp { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a.chip { font-family: var(--mono); color: var(--link); }
.chips a.chip:hover { border-color: var(--link); text-decoration: none; }
.chips .chip.missing { color: var(--text-3); font-family: var(--mono); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin: 18px 0; }
.fact { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; background: var(--bg-soft); min-width: 0; }
a.fact { color: var(--text); }
a.fact:hover { border-color: var(--accent); text-decoration: none; }
.chip.ver { font-size: 13px; vertical-align: middle; font-weight: 500; }
.fact .k { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; }
.fact .v { font-size: 22px; font-weight: 650; font-variant-numeric: tabular-nums; }
.fact .v.small { font-size: 13.5px; font-weight: 450; font-family: var(--mono); overflow-wrap: anywhere; }
dl.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 18px; margin: 14px 0; }
dl.kv dt { color: var(--text-3); font-size: 13.5px; padding-top: 2px; }
dl.kv dd { margin: 0; min-width: 0; }
.tabletools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 10px; }
.tabletools .filter { max-width: 320px; }
.tabletools .cnt { font-size: 13px; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; margin: 10px 0 18px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line-soft); }
th { position: sticky; top: 0; background: var(--bg-mute); font-weight: 600; font-size: 13px; color: var(--text-2); white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; }
th.sort:hover { color: var(--text); }
th.sort[data-dir="asc"]::after { content: " ▲"; font-size: 10px; }
th.sort[data-dir="desc"]::after { content: " ▼"; font-size: 10px; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: var(--bg-soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.name { font-family: var(--mono); font-size: 13.5px; white-space: nowrap; }
td.file { font-family: var(--mono); font-size: 12.5px; color: var(--text-2); overflow-wrap: anywhere; min-width: 180px; }
td.note { color: var(--text-2); font-size: 13px; min-width: 140px; }
td.vals { min-width: 220px; }
td.vals .v { display: inline-block; margin: 1px 4px 3px 0; padding: 0 6px; border-radius: 4px; background: var(--bg-mute); font: 12.5px/1.6 var(--mono); overflow-wrap: anywhere; max-width: 100%; }
td.code { font: 12.5px var(--mono); overflow-wrap: anywhere; min-width: 22ch; }
tr.hit td { background: var(--mark) !important; }
tr.hit td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.t-type { font: 12px var(--mono); color: var(--text-2); white-space: nowrap; }
.src { font-size: 12px; white-space: nowrap; padding: 0 7px; border-radius: 999px; border: 1px solid var(--line); }
.src.lua { color: var(--met); border-color: color-mix(in srgb, var(--met) 45%, transparent); }
.src.both { color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.none { color: var(--text-3); font-style: italic; }
.xl.sig, a.sig { color: var(--sig); }
.xl.met, a.met { color: var(--met); }
.md p, .md li { max-width: 80ch; }
.md ul, .md ol { padding-left: 22px; }
.md li { margin: 3px 0; }
.md li.nested { margin-left: 22px; list-style: circle; }
.md .tablewrap table { font-size: 13.5px; }
.md .tablewrap td { overflow-wrap: break-word; }
.md td code { overflow-wrap: normal; white-space: nowrap; }
pre.code { background: var(--code-bg); color: var(--code-text); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; font: 13px/1.55 var(--mono); tab-size: 4; }
pre.code code { background: none; padding: 0; font-size: inherit; }
.tk-k { color: var(--tok-k); } .tk-s { color: var(--tok-s); } .tk-c { color: var(--tok-c); font-style: italic; } .tk-n { color: var(--tok-n); } .tk-f { color: var(--tok-f); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 16px 0 26px; }
.card { display: block; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; background: var(--bg-soft); color: var(--text); }
.card:hover { border-color: var(--accent); text-decoration: none; }
.card b { display: block; }
.card span { display: block; margin-top: 4px; }
.card span { color: var(--text-2); font-size: 13.5px; }
.toplist { columns: 3 220px; column-gap: 24px; padding: 0; list-style: none; }
.toplist li { break-inside: avoid; display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border-bottom: 1px dashed var(--line-soft); font-family: var(--mono); font-size: 13.5px; }
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.5); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 14px 14px; }
.modal[hidden] { display: none; }
.sbox { width: min(760px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.sbox .row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.sbox input { flex: 1; border: 0; background: none; color: var(--text); font: 17px var(--sans); outline: none; min-width: 0; }
.sbox .kinds { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); }
.sbox .kinds button { border: 1px solid var(--line); background: var(--bg-soft); border-radius: 999px; padding: 1px 10px; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.sbox .kinds button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.results { overflow-y: auto; padding: 6px; }
.results .hint { padding: 16px; color: var(--text-3); font-size: 14px; }
.res { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 2px 10px; align-items: baseline; padding: 8px 10px; border-radius: 8px; color: var(--text); }
.res:hover, .res.sel { background: var(--bg-hover); text-decoration: none; }
.res.sel { outline: 1px solid var(--accent); }
.res .kind { grid-row: span 2; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding-top: 3px; }
.res .kind.k-class { color: var(--link); } .res .kind.k-prop { color: var(--prop); } .res .kind.k-signal { color: var(--sig); } .res .kind.k-method { color: var(--met); }
.res .t { font-family: var(--mono); font-size: 14px; overflow-wrap: anywhere; }
.res .t .on { color: var(--text-3); font-family: var(--sans); font-size: 13px; }
.res .d { font-size: 12.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res mark { background: var(--mark); color: inherit; border-radius: 2px; }
.sfoot { display: flex; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.brand { min-width: 0; flex-shrink: 1; }
.brand > span { overflow: hidden; text-overflow: ellipsis; }
.searchbtn { flex-shrink: 0; }
@media (max-width: 480px) {
  .top { gap: 6px; padding: 0 10px; }
  .brand { font-size: 14px; }
  .brand .dot { display: none; }
  .searchbtn { min-width: 76px; padding: 6px 8px; }
  .iconbtn { padding: 6px 8px; }
}
@media (max-width: 1100px) { .page.withtoc { display: block; } .toc { display: none; } }
@media (max-width: 860px) {
  :root { --top: 52px; }
  .menubtn { display: inline-flex; }
  .brand small { display: none; }
  .searchbtn { flex: 1 1 auto; min-width: 76px; }
  .searchbtn kbd { display: none; }
  .top .grow { display: none; }
  .disclbl { display: none; }
  .disc { position: static; }
  .discpop { position: fixed; right: 12px; top: calc(var(--top) + 6px); }
  .layout { display: block; }
  .side { position: fixed; z-index: 40; top: var(--top); left: 0; width: min(320px, 88vw); transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: var(--top) 0 0 0; background: rgba(0,0,0,.45); z-index: 35; }
  main { padding-top: 20px; }
  .fact { padding: 8px 12px; }
  .fact .v { font-size: 19px; }
  h1 { font-size: 25px; }
}
.stack { container-type: inline-size; }
@container (max-width: 860px) {
table, thead, tbody, tr, td { display: block; width: 100%; }
thead { display: none; }
tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
td { display: flex; gap: 12px; border: 0; padding: 3px 10px; text-align: left !important; white-space: normal; min-width: 0 !important; }
td:has(> .cv:empty) { display: none; }
td::before { content: attr(data-l); flex: 0 0 112px; color: var(--text-3); font: 11.5px/1.7 var(--sans); text-transform: uppercase; letter-spacing: .05em; }
td > .cv { flex: 1; min-width: 0; }
td.name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
td.name::before { display: none; }
.tablewrap { overflow: visible; }
}
@container (max-width: 420px) {
td { display: block; }
td::before { display: block; }
}
@media print { .top, .side { display: none; } .layout { display: block; } }
