:root {
    color-scheme: dark;
    --accent: #ffc300;
    --accent-2: #ffda55;
    --bg: #070707;
    --surface: #0d0d0e;
    --surface-2: #141416;
    --surface-3: #1a1a1d;
    --line: #26262a;
    --line-strong: #34343a;
    --text: #f5f5f7;
    --muted: #9b9ba5;
    --muted-2: #6f7079;
    --header-h: 72px;
    --sidebar-w: 292px;
    --toc-w: 240px;
    --shadow: 0 20px 70px rgba(0, 0, 0, .32);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f8fa;
    --surface: #ffffff;
    --surface-2: #f1f2f5;
    --surface-3: #e8eaee;
    --line: #e0e2e7;
    --line-strong: #cdd0d8;
    --text: #17181b;
    --muted: #626671;
    --muted-2: #858a95;
    --shadow: 0 20px 70px rgba(20, 23, 31, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--text); background: var(--bg); font-size: 15px; line-height: 1.68; }
body.nav-open { overflow: hidden; }
button, input { font: inherit; }
a { color: inherit; }
code, kbd { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; }

body::before {
    position: fixed; inset: 0; z-index: -2; content: ""; pointer-events: none;
    background:
        radial-gradient(circle at 50% -18%, rgba(255, 195, 0, .09), transparent 36%),
        linear-gradient(rgba(255,255,255,.016) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.016) 1px, transparent 1px);
    background-size: auto, 52px 52px, 52px 52px;
}

.topbar {
    position: sticky; top: 0; z-index: 50; height: var(--header-h); padding: 0 26px;
    display: grid; grid-template-columns: var(--sidebar-w) minmax(280px, 640px) 1fr;
    align-items: center; gap: 22px; border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px);
}

.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; color: var(--text); text-decoration: none; font-weight: 900; font-size: 20px; letter-spacing: -.03em; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid rgba(255,195,0,.35); border-radius: 10px; color: #080808; background: var(--accent); box-shadow: 0 0 30px rgba(255,195,0,.16); font-size: 17px; }
.brand em { padding: 3px 6px; border-radius: 5px; color: var(--accent); background: rgba(255,195,0,.10); font-style: normal; font-size: 9px; letter-spacing: .14em; }

.search-trigger { height: 44px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); cursor: pointer; text-align: left; transition: border-color .18s, background .18s; }
.search-trigger:hover { border-color: rgba(255,195,0,.45); background: var(--surface-2); }
.search-trigger > span:first-child { color: var(--accent); font-size: 23px; line-height: 1; }
.search-trigger kbd { padding: 3px 7px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--muted-2); background: var(--surface-2); font-size: 10px; }

.top-actions { justify-self: end; display: flex; align-items: center; gap: 9px; }
.top-actions a { min-height: 40px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: var(--surface); text-decoration: none; font-weight: 750; font-size: 13px; }
.top-actions .top-shop { border-color: var(--accent); color: #080808; background: var(--accent); }
.top-actions a:hover { color: var(--text); border-color: var(--line-strong); }
.top-actions .top-shop:hover { color: #080808; background: var(--accent-2); }

.wiki-shell { min-height: calc(100vh - var(--header-h)); display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w); gap: 0; max-width: 1600px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow: hidden auto; padding: 22px 16px 18px; border-right: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar-mobile-head { display: none; }
.nav-group { display: grid; gap: 4px; }
.nav-group__title { width: 100%; padding: 12px 11px 7px; display: flex; justify-content: space-between; align-items: center; border: 0; color: var(--muted); background: transparent; cursor: pointer; text-transform: uppercase; letter-spacing: .09em; font-size: 10px; font-weight: 900; text-align: left; }
.nav-group__title i { font-style: normal; transition: transform .2s; }
.nav-group.is-collapsed .nav-group__title i { transform: rotate(-90deg); }
.nav-group__items { display: grid; gap: 2px; overflow: hidden; }
.nav-group.is-collapsed .nav-group__items { display: none; }
.nav-group__items a { min-height: 42px; padding: 8px 10px; display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; color: var(--muted); text-decoration: none; transition: color .16s, background .16s, border-color .16s; }
.nav-group__items a span { width: 24px; display: grid; place-items: center; filter: saturate(.8); }
.nav-group__items a b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; }
.nav-group__items a:hover { color: var(--text); background: var(--surface-2); }
.nav-group__items a.is-active { color: var(--text); border-color: rgba(255,195,0,.18); background: rgba(255,195,0,.08); box-shadow: inset 3px 0 0 var(--accent); }
.nav-group__items a.is-active span { filter: none; }
.powered { margin-top: 18px; min-height: 50px; padding: 10px 12px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: var(--surface); text-decoration: none; }
.powered span { color: var(--accent); }
.powered b { font-size: 12px; }

.article-wrap { min-width: 0; padding: 56px clamp(32px, 5vw, 84px) 100px; }
.article { max-width: 820px; margin: 0 auto; }
.article-kicker { margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.article-kicker > span { color: var(--accent); text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 900; }
.article-kicker button { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface); cursor: pointer; font-size: 11px; }
.article-kicker button:hover { color: var(--text); border-color: var(--line-strong); }
.article h1 { margin: 0; display: flex; align-items: flex-start; gap: 14px; color: var(--text); font-size: clamp(36px, 5vw, 56px); line-height: 1.05; letter-spacing: -.055em; }
.article-icon { flex: 0 0 auto; font-size: .76em; filter: drop-shadow(0 8px 22px rgba(255,195,0,.18)); }
.article-lead { max-width: 680px; margin: 20px 0 48px; color: var(--muted); font-size: 18px; line-height: 1.65; }
.article-section { scroll-margin-top: calc(var(--header-h) + 28px); margin-top: 48px; }
.article-section h2 { margin: 0 0 20px; padding-bottom: 11px; display: flex; align-items: center; gap: 9px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 27px; line-height: 1.25; letter-spacing: -.035em; }
.article-section h2 a { opacity: 0; color: var(--accent); text-decoration: none; font-weight: 500; transition: opacity .15s; }
.article-section h2:hover a { opacity: 1; }
.article-section p { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.article-section p a { color: var(--accent); text-underline-offset: 3px; }
.article-section code { padding: 2px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--accent-2); background: var(--surface-2); font-size: .9em; }

.callout { margin: 22px 0; padding: 17px 18px; display: grid; grid-template-columns: 28px minmax(0,1fr); gap: 2px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.callout::before { grid-row: span 2; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; font-weight: 900; }
.callout b { font-size: 13px; }
.callout span { grid-column: 2; color: var(--muted); font-size: 13px; line-height: 1.55; }
.callout--info { border-color: rgba(255,195,0,.24); background: rgba(255,195,0,.055); }
.callout--info::before { content: "i"; color: #090909; background: var(--accent); }
.callout--warning { border-color: rgba(255,151,39,.28); background: rgba(255,151,39,.06); }
.callout--warning::before { content: "!"; color: #14100a; background: #ff9c2b; }
.callout--danger { border-color: rgba(255,76,76,.26); background: rgba(255,76,76,.055); }
.callout--danger::before { content: "!"; color: #fff; background: #e84444; }

.facts { margin: 22px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.facts > div { min-height: 58px; padding: 13px 16px; display: grid; grid-template-columns: minmax(130px, .8fr) 1.3fr; align-items: center; gap: 20px; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts span { color: var(--muted); font-size: 12px; }
.facts code, .facts strong { justify-self: start; }

.steps { margin: 22px 0; padding: 0; counter-reset: step; display: grid; gap: 13px; list-style: none; }
.steps li { position: relative; min-height: 58px; padding: 8px 0 8px 58px; display: grid; align-content: center; }
.steps li::before { position: absolute; left: 0; top: 7px; width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(255,195,0,.25); border-radius: 11px; color: #080808; background: var(--accent); content: counter(step); counter-increment: step; font-weight: 900; }
.steps li::after { position: absolute; left: 19px; top: 49px; bottom: -13px; width: 1px; content: ""; background: var(--line); }
.steps li:last-child::after { display: none; }
.steps li b { font-size: 14px; }
.steps li span { color: var(--muted); font-size: 13px; }

.card-grid { margin: 22px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.mini-card { min-height: 104px; padding: 17px; display: grid; align-content: center; gap: 5px; border: 1px solid var(--line); border-radius: 12px; color: var(--text); background: var(--surface); text-decoration: none; transition: transform .16s, border-color .16s, background .16s; }
a.mini-card:hover { transform: translateY(-2px); border-color: rgba(255,195,0,.35); background: var(--surface-2); }
.mini-card b { font-size: 14px; }
.mini-card span { color: var(--muted); font-size: 12px; line-height: 1.45; }

.link-list, .check-list { margin: 20px 0; padding: 0; display: grid; gap: 8px; list-style: none; }
.link-list li { padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.link-list a { color: var(--text); font-weight: 750; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.link-list span { color: var(--muted); font-size: 12px; text-align: right; }
.check-list li { position: relative; padding: 8px 0 8px 28px; color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.check-list li::before { position: absolute; left: 0; top: 9px; content: "✓"; color: var(--accent); font-weight: 900; }
.check-list--bad li::before { content: "×"; color: #ff5959; }

.command-list { margin: 20px 0; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.command-list > div { min-height: 56px; padding: 11px 15px; display: grid; grid-template-columns: minmax(170px, .7fr) 1fr; align-items: center; gap: 18px; border-bottom: 1px solid var(--line); }
.command-list > div:last-child { border-bottom: 0; }
.command-list span { color: var(--muted); font-size: 13px; }

details { margin: 10px 0; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
details summary { padding: 15px 17px; cursor: pointer; color: var(--text); font-weight: 750; }
details p { margin: 0; padding: 0 17px 17px; }

.rank-line { margin: 22px 0; padding: 18px; display: flex; align-items: center; gap: 8px; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rank-line span { flex: 0 0 auto; padding: 7px 9px; border-radius: 7px; color: #070707; background: var(--accent); font-size: 10px; font-weight: 950; }
.rank-line i { flex: 1 0 12px; height: 1px; background: rgba(255,195,0,.32); }

.feedback { margin-top: 70px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.feedback > div:first-child { display: grid; }
.feedback strong { font-size: 13px; }
.feedback span { color: var(--muted); font-size: 11px; }
.feedback > div:last-child { display: flex; gap: 7px; }
.feedback button { min-width: 42px; height: 36px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-2); cursor: pointer; font-size: 11px; }
.feedback button:hover { color: #080808; border-color: var(--accent); background: var(--accent); }

.article-pager { margin-top: 20px; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.article-pager a { min-height: 86px; padding: 16px; display: grid; align-content: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; }
.article-pager a:last-child { text-align: right; }
.article-pager a:hover { border-color: rgba(255,195,0,.38); }
.article-pager span { color: var(--muted); font-size: 10px; }
.article-pager b { font-size: 13px; }
.updated { margin-top: 24px; color: var(--muted-2) !important; font-size: 11px; text-align: center; }

.article--empty { min-height: 65vh; display: grid; place-content: center; justify-items: center; text-align: center; }
.article--empty h1 { margin-top: 12px; font-size: 42px; }
.article--empty p { color: var(--muted); }
.empty-actions { display: flex; gap: 10px; }
.empty-actions a, .empty-actions button { min-height: 42px; padding: 0 16px; display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 9px; color: var(--text); background: var(--surface); text-decoration: none; cursor: pointer; }
.empty-actions .primary-link { color: #090909; border-color: var(--accent); background: var(--accent); }

.toc { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); padding: 48px 24px; border-left: 1px solid var(--line); }
.toc > strong { display: block; margin-bottom: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.toc nav { display: grid; gap: 4px; }
.toc a { padding: 6px 8px; border-left: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 12px; line-height: 1.4; }
.toc a:hover, .toc a.is-active { color: var(--text); border-left-color: var(--accent); }
.toc-divider { height: 1px; margin: 20px 0; background: var(--line); }
.toc > a { padding-left: 0; border: 0; color: var(--accent); font-weight: 700; }
.theme-switcher { position: absolute; left: 24px; bottom: 22px; padding: 4px; display: flex; gap: 3px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.theme-switcher button { width: 32px; height: 30px; border: 0; border-radius: 7px; color: var(--muted); background: transparent; cursor: pointer; }
.theme-switcher button.is-active { color: #080808; background: var(--accent); }

.search-dialog { width: min(680px, calc(100vw - 28px)); max-height: min(720px, calc(100vh - 40px)); padding: 0; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.search-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(7px); }
.search-box { display: grid; }
.search-input-wrap { height: 64px; padding: 0 14px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.search-input-wrap > span { color: var(--accent); font-size: 26px; }
.search-input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; color: var(--text); background: transparent; font-size: 16px; }
.search-input-wrap button { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); background: var(--surface-2); cursor: pointer; }
.search-hint { padding: 11px 15px; color: var(--muted-2); font-size: 10px; }
.search-results { max-height: 490px; padding: 0 8px 8px; overflow-y: auto; }
.search-result { width: 100%; min-height: 70px; padding: 11px 12px; display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; color: var(--text); background: transparent; text-decoration: none; }
.search-result:hover, .search-result.is-selected { border-color: rgba(255,195,0,.25); background: rgba(255,195,0,.07); }
.search-result > span { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); }
.search-result div { min-width: 0; display: grid; }
.search-result b { font-size: 13px; }
.search-result small { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.search-empty { padding: 46px 20px; color: var(--muted); text-align: center; }
.search-footer { min-height: 42px; padding: 8px 14px; display: flex; gap: 18px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 9px; }
.search-footer kbd { margin-right: 3px; padding: 2px 4px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface-2); }

.icon-button { border: 0; color: var(--text); background: transparent; cursor: pointer; }
.mobile-nav-open { display: none; }
.overlay { display: none; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 100; padding: 10px 15px; border: 1px solid rgba(255,195,0,.36); border-radius: 10px; color: var(--text); background: var(--surface-2); box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .2s, transform .2s; font-size: 12px; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1180px) {
    :root { --toc-w: 0px; }
    .wiki-shell { grid-template-columns: var(--sidebar-w) minmax(0,1fr); }
    .toc { display: none; }
    .topbar { grid-template-columns: var(--sidebar-w) minmax(260px, 1fr) auto; }
}

@media (max-width: 820px) {
    :root { --header-h: 64px; --sidebar-w: 0px; }
    .topbar { padding: 0 14px; grid-template-columns: 36px 1fr auto; gap: 9px; }
    .mobile-nav-open { display: block; width: 34px; height: 34px; font-size: 20px; }
    .brand { font-size: 17px; }
    .brand-mark { width: 31px; height: 31px; }
    .brand em { display: none; }
    .search-trigger { width: 40px; padding: 0; display: grid; place-items: center; justify-self: end; }
    .search-trigger > span:first-child { display: block; }
    .search-trigger > span:nth-child(2), .search-trigger kbd { display: none; }
    .top-actions a:first-child { display: none; }
    .top-actions a { min-height: 38px; padding: 0 12px; }
    .wiki-shell { display: block; }
    .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(330px, 88vw); height: 100vh; padding-top: 12px; border-right: 1px solid var(--line-strong); background: var(--bg); transform: translateX(-104%); transition: transform .22s ease; }
    body.nav-open .sidebar { transform: translateX(0); }
    .sidebar-mobile-head { min-height: 46px; margin-bottom: 8px; padding: 0 8px 0 12px; display: flex; align-items: center; justify-content: space-between; }
    .sidebar-mobile-head strong { font-size: 13px; }
    .sidebar-mobile-head button { width: 34px; height: 34px; font-size: 22px; }
    .overlay { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.68); backdrop-filter: blur(4px); }
    body.nav-open .overlay { display: block; }
    .article-wrap { padding: 38px 20px 76px; }
    .article h1 { font-size: clamp(34px, 11vw, 48px); }
    .article-lead { margin-bottom: 36px; font-size: 16px; }
    .article-section { margin-top: 40px; }
    .article-section h2 { font-size: 23px; }
    .feedback { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
    .top-actions .top-shop { font-size: 0; }
    .top-actions .top-shop::after { content: "Shop"; font-size: 11px; }
    .article-wrap { padding-inline: 16px; }
    .article-kicker button { font-size: 0; }
    .article-kicker button::before { content: "⧉"; font-size: 16px; }
    .article h1 { gap: 9px; }
    .article-lead { margin-top: 14px; }
    .facts > div, .command-list > div { grid-template-columns: 1fr; gap: 4px; }
    .card-grid { grid-template-columns: 1fr; }
    .link-list li { align-items: flex-start; flex-direction: column; gap: 4px; }
    .link-list span { text-align: left; }
    .article-pager { grid-template-columns: 1fr; }
    .article-pager a:last-child { text-align: left; }
    .search-footer { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
