:root {
    --brand: #1d49c3;
    --brand-dark: #163aa0;
    --brand-soft: #edf2ff;
    --navy: #0f144e;
    --ink: #171a2b;
    --muted: #5f6678;
    --subtle: #8b91a0;
    --line: #e2e5ec;
    --surface: #f7f8fb;
    --surface-blue: #f7f9ff;
    --code: #101426;
    --white: #fff;
    --header-height: 76px;
    --sidebar-width: 286px;
    --content-width: 820px;
    --toc-width: 210px;
    --shadow: 0 12px 38px rgba(15, 20, 78, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 24px); }
body { margin: 0; color: var(--ink); background: var(--white); font-family: Poppins, ui-sans-serif, system-ui, sans-serif; font-size: 15px; line-height: 1.75; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
button, input { font: inherit; }
img, svg { display: block; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 16px; color: #fff; background: var(--navy); transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { position: sticky; z-index: 100; top: 0; height: var(--header-height); border-bottom: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); }
.header-inner { display: flex; align-items: center; gap: 28px; width: min(1480px, 100%); height: 100%; margin: 0 auto; padding: 0 32px; }
.logo { display: flex; flex: 0 0 auto; align-items: center; gap: 18px; color: var(--navy); text-decoration: none; }
.logo img { width: 171px; height: 45px; }
.logo span { padding-left: 18px; border-left: 1px solid var(--line); font-size: 13px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.header-search { display: flex; align-items: center; width: min(430px, 34vw); height: 42px; margin-left: auto; padding: 0 11px; border: 1px solid #d9dce5; border-radius: 7px; background: var(--surface); transition: border-color .2s, box-shadow .2s, background .2s; }
.header-search:focus-within { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 3px rgba(29,73,195,.12); }
.header-search svg, .mobile-search-toggle svg { width: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
.header-search svg { color: var(--muted); }
.header-search input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; padding: 0 10px; color: var(--ink); }
.header-search input::placeholder { color: #858b98; }
kbd { min-width: 24px; padding: 1px 7px; border: 1px solid #d2d5dd; border-bottom-width: 2px; border-radius: 5px; color: #737988; background: #fff; font: 12px/20px Poppins, sans-serif; text-align: center; }
.header-links { display: flex; align-items: center; gap: 18px; white-space: nowrap; }
.header-links a { color: var(--navy); font-size: 13px; font-weight: 500; text-decoration: none; }
.header-links a:hover { color: var(--brand); }
.version-pill { padding: 4px 10px; border-radius: 999px; color: var(--brand); background: var(--brand-soft); font-size: 11px; font-weight: 700; letter-spacing: .04em; }
.icon-button { display: none; border: 0; background: transparent; color: var(--navy); cursor: pointer; }
.menu-toggle { display: grid; width: 38px; height: 38px; padding: 9px; gap: 4px; place-items: center; border-radius: 7px; }
.menu-toggle:hover, .menu-toggle:focus-visible { color: var(--brand); background: var(--brand-soft); }
.menu-toggle span { width: 20px; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.mobile-search-panel { display: none; }

.docs-shell { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); width: min(1480px, 100%); min-height: calc(100vh - var(--header-height)); margin: 0 auto; transition: grid-template-columns .22s ease; }
.docs-sidebar { position: sticky; top: var(--header-height); align-self: start; height: calc(100vh - var(--header-height)); overflow: auto; border-right: 1px solid var(--line); padding: 34px 26px 80px 24px; scrollbar-width: thin; scrollbar-color: #cdd1db transparent; transition: transform .22s ease, opacity .16s ease, visibility .22s; }
.nav-group + .nav-group { margin-top: 28px; }
.nav-group h2 { margin: 0 0 8px; }
.nav-group-toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px 7px 12px; border: 0; border-radius: 6px; color: var(--navy); background: transparent; font: 700 12px/1.35 Poppins, sans-serif; letter-spacing: .045em; text-align: left; text-transform: uppercase; cursor: pointer; }
.nav-group-toggle:hover, .nav-group-toggle:focus-visible { color: var(--brand); background: var(--surface-blue); }
.nav-group-toggle svg { width: 12px; height: 12px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; transition: transform .18s ease; }
.nav-group.collapsed .nav-group-toggle svg { transform: rotate(-90deg); }
.nav-group.collapsed ul { display: none; }
.nav-group ul { margin: 0; padding: 0; list-style: none; }
.nav-group li + li { margin-top: 1px; }
.nav-group a { position: relative; display: block; padding: 7px 12px; border-radius: 6px; color: #555d70; font-size: 13px; font-weight: 400; line-height: 1.45; text-decoration: none; transition: color .15s, background .15s; }
.nav-group a:hover { color: var(--brand); background: var(--surface-blue); }
.nav-group a.active { color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.nav-group a.active::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); content: ''; }

@media (min-width: 821px) {
    .sidebar-collapsed .docs-shell { grid-template-columns: 0 minmax(0, 1fr); }
    .sidebar-collapsed .docs-sidebar { visibility: hidden; opacity: 0; transform: translateX(-100%); pointer-events: none; }
}

.docs-main { min-width: 0; padding: 28px 44px 100px; }
.breadcrumbs { display: flex; overflow: hidden; align-items: center; gap: 8px; max-width: 1100px; margin: 0 auto 52px; color: var(--subtle); font-size: 12px; white-space: nowrap; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs span:last-child { overflow: hidden; text-overflow: ellipsis; }
.article-grid { display: grid; grid-template-columns: minmax(0, var(--content-width)) var(--toc-width); justify-content: center; gap: 72px; }
.article-content { min-width: 0; }
.article-header { margin-bottom: 58px; padding-bottom: 38px; border-bottom: 1px solid var(--line); }
.article-kicker { margin: 0 0 13px !important; color: var(--brand) !important; font-size: 12px !important; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.article-header h1 { margin: 0 0 22px; color: var(--navy); font-size: clamp(38px, 5vw, 54px); font-weight: 700; letter-spacing: -.045em; line-height: 1.08; }
.article-header > p:last-child { max-width: 740px; margin: 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.doc-section { margin: 0 0 62px; }
.doc-section h2 { margin: 0 0 22px; color: var(--navy); font-size: 26px; font-weight: 600; letter-spacing: -.025em; line-height: 1.28; }
.doc-section h2 a { display: inline-block; width: 24px; margin-left: -24px; color: transparent; font-weight: 400; text-decoration: none; }
.doc-section h2:hover a, .doc-section h2 a:focus { color: var(--brand); }
.doc-section h3 { margin: 30px 0 12px; color: var(--navy); font-size: 18px; }
.doc-section p { margin: 0 0 20px; }
.doc-section ul, .doc-section ol { margin: 0 0 24px; padding-left: 24px; }
.doc-section li { margin: 8px 0; padding-left: 4px; }
.doc-section code:not(pre code), .article-toc code { padding: 2px 6px; border: 1px solid #e4e7ef; border-radius: 4px; color: #243779; background: #f5f7fc; font: 13px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; overflow-wrap: anywhere; }

.article-toc { position: sticky; top: calc(var(--header-height) + 32px); align-self: start; max-height: calc(100vh - var(--header-height) - 64px); overflow: auto; padding-left: 20px; border-left: 1px solid var(--line); }
.article-toc h2 { margin: 0 0 14px; color: var(--navy); font-size: 12px; font-weight: 700; letter-spacing: .045em; text-transform: uppercase; }
.article-toc ol { margin: 0; padding: 0; list-style: none; }
.article-toc li + li { margin-top: 9px; }
.article-toc a { display: block; color: var(--muted); font-size: 12px; line-height: 1.5; text-decoration: none; }
.article-toc a:hover, .article-toc a.current { color: var(--brand); }
.article-toc a.current { font-weight: 600; }
.article-toc .back-top { margin-top: 24px; color: var(--brand); }

.code-block { overflow: hidden; margin: 24px 0 28px; border: 1px solid #222943; border-radius: 9px; background: var(--code); box-shadow: 0 8px 22px rgba(15,20,78,.08); }
.code-toolbar { display: flex; align-items: center; justify-content: space-between; height: 39px; padding: 0 12px 0 18px; border-bottom: 1px solid #282e49; color: #8e98bb; font-size: 10px; font-weight: 600; letter-spacing: .08em; }
.copy-code { padding: 4px 9px; border: 1px solid #3a4262; border-radius: 4px; color: #cdd5f0; background: #1b2139; font-size: 10px; cursor: pointer; }
.copy-code:hover { border-color: #6172ac; color: #fff; }
.code-block pre { overflow: auto; margin: 0; padding: 22px 24px 25px; color: #e7eaf5; font: 13px/1.75 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 4; }
.code-block code { font: inherit; }

.table-wrap { overflow-x: auto; margin: 24px 0 30px; border: 1px solid var(--line); border-radius: 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { color: var(--navy); background: var(--surface); font-weight: 600; text-align: left; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; }
.callout { position: relative; margin: 28px 0; padding: 20px 22px 21px; border: 1px solid #cfd9f7; border-left: 4px solid var(--brand); border-radius: 8px; background: var(--surface-blue); box-shadow: 0 5px 18px rgba(29,73,195,.04); }
.callout strong { display: block; margin-bottom: 7px; color: var(--navy); font-size: 13px; font-weight: 700; line-height: 1.45; }
.callout div { color: #4f586d; font-size: 13px; line-height: 1.7; }
.callout div > :first-child { margin-top: 0; }
.callout div > :last-child { margin-bottom: 0; }
.callout--warning { border-color: #efd6a6; border-left-color: #c77700; background: #fffaf0; }
.callout--warning strong { color: #764800; }
.callout--tip { border-color: #bfe5d4; border-left-color: #16865b; background: #f3fcf8; }

.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 28px 0; }
.feature-grid article { padding: 22px 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.feature-grid article > span { color: var(--brand); font-size: 11px; font-weight: 700; }
.feature-grid h3 { margin: 12px 0 8px; font-size: 16px; }
.feature-grid p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
.steps { display: grid; gap: 11px; margin-top: 26px !important; padding: 0 !important; counter-reset: steps; list-style: none; }
.steps li { display: grid; grid-template-columns: 34px minmax(170px,.7fr) minmax(0,1.8fr); gap: 16px; align-items: center; margin: 0 !important; padding: 17px 20px !important; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 4px 15px rgba(15,20,78,.035); counter-increment: steps; }
.steps li::before { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; color: #fff; background: var(--brand); content: counter(steps); font-size: 11px; font-weight: 700; }
.steps li b { color: var(--navy); font-size: 14px; line-height: 1.45; }
.steps li span { color: var(--muted); font-size: 14px; line-height: 1.6; }
.field-index { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 26px 0; }
.field-index a { display: flex; flex-direction: column; padding: 14px 16px; border: 1px solid var(--line); border-radius: 7px; color: var(--navy); text-decoration: none; transition: transform .15s, border-color .15s, box-shadow .15s; }
.field-index a:hover { border-color: #b9c8f1; box-shadow: 0 7px 20px rgba(29,73,195,.08); transform: translateY(-1px); }
.field-index span { font-size: 13px; font-weight: 600; }
.field-index code { margin-top: 5px; color: var(--subtle) !important; background: none !important; border: 0 !important; padding: 0 !important; font-size: 10px !important; }
.external::after { content: ' ↗'; }

.article-footer { display: flex; gap: 36px; margin-top: 80px; padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.article-footer div { display: flex; flex-direction: column; gap: 4px; }
.article-footer span { color: var(--subtle); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.article-footer strong { color: var(--navy); font-size: 12px; }
.pagination { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 34px; }
.pagination a { display: flex; flex-direction: column; padding: 18px 20px; border: 1px solid var(--line); border-radius: 8px; color: var(--navy); text-decoration: none; }
.pagination a:hover { border-color: #b8c7ed; box-shadow: 0 8px 22px rgba(29,73,195,.07); }
.pagination span { margin-bottom: 4px; color: var(--brand); font-size: 10px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pagination strong { font-size: 13px; }
.pagination .next { text-align: right; }

.search-page-form { display: flex; max-width: 720px; height: 52px; margin: -25px 0 28px; }
.search-page-form input { flex: 1; min-width: 0; padding: 0 17px; border: 1px solid var(--line); border-right: 0; border-radius: 7px 0 0 7px; outline: 0; }
.search-page-form input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.search-page-form button, .mobile-search-panel button { padding: 0 23px; border: 0; border-radius: 0 7px 7px 0; color: #fff; background: var(--brand); font-weight: 600; cursor: pointer; }
.result-count { color: var(--muted); font-size: 13px; }
.search-results { display: grid; max-width: 820px; gap: 12px; }
.search-results > a { padding: 22px 24px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); text-decoration: none; }
.search-results > a:hover { border-color: #b8c7ed; box-shadow: var(--shadow); }
.search-results span { color: var(--brand); font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; }
.search-results h2 { margin: 6px 0; color: var(--navy); font-size: 19px; }
.search-results p { margin: 0; color: var(--muted); font-size: 13px; }
.empty-state { padding: 42px; border: 1px dashed #ccd1dc; border-radius: 8px; text-align: center; }
.empty-state h2 { color: var(--navy); }

@media (max-width: 1180px) {
    :root { --sidebar-width: 250px; }
    .header-inner { gap: 18px; padding: 0 22px; }
    .logo span, .header-links a { display: none; }
    .docs-main { padding-right: 28px; padding-left: 28px; }
    .article-grid { grid-template-columns: minmax(0, 760px); }
    .article-toc { display: none; }
}

@media (max-width: 820px) {
    :root { --header-height: 66px; }
    .header-inner { padding: 0 15px; }
    .logo img { width: 144px; height: auto; }
    .header-search, .header-links { display: none; }
    .logo { margin-right: auto; }
    .icon-button { display: grid; width: 38px; height: 38px; padding: 9px; place-items: center; }
    .mobile-search-toggle svg { width: 21px; }
    .mobile-search-panel.open { display: block; position: fixed; z-index: 99; top: var(--header-height); right: 0; left: 0; padding: 12px 15px; border-bottom: 1px solid var(--line); background: #fff; box-shadow: var(--shadow); }
    .mobile-search-panel form { display: flex; height: 43px; }
    .mobile-search-panel input { min-width: 0; flex: 1; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px 0 0 6px; }
    .docs-shell { display: block; }
    .docs-sidebar { position: fixed; z-index: 102; top: var(--header-height); bottom: auto; left: 0; width: min(320px, 86vw); height: calc(100dvh - var(--header-height)); max-height: calc(100dvh - var(--header-height)); background: #fff; box-shadow: 18px 0 45px rgba(15,20,78,.14); transform: translateX(-105%); transition: transform .22s ease; }
    .nav-open .docs-sidebar { transform: none; }
    .sidebar-backdrop { position: fixed; z-index: 101; inset: var(--header-height) 0 0; background: rgba(15,20,40,.45); }
    .nav-open { overflow: hidden; }
    .docs-main { padding: 22px 22px 70px; }
    .breadcrumbs { margin-bottom: 38px; }
    .article-header { margin-bottom: 45px; padding-bottom: 28px; }
    .article-header h1 { font-size: 39px; }
    .article-header > p:last-child { font-size: 16px; }
    .feature-grid, .field-index { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 540px) {
    .docs-main { padding-right: 17px; padding-left: 17px; }
    .breadcrumbs span:nth-last-child(2) { display: none; }
    .article-header h1 { font-size: 34px; }
    .doc-section { margin-bottom: 48px; }
    .doc-section h2 { font-size: 23px; }
    .doc-section h2 a { width: 0; margin: 0; }
    .feature-grid, .field-index { grid-template-columns: 1fr; }
    .steps { gap: 9px; }
    .steps li { grid-template-columns: 32px minmax(0,1fr); gap: 4px 13px; align-items: start; padding: 16px !important; }
    .steps li::before { grid-row: 1 / span 2; width: 28px; height: 28px; }
    .steps li b { grid-column: 2; }
    .steps li span { grid-column: 2; }
    .callout { padding: 18px 19px; }
    .code-block pre { padding: 18px; font-size: 12px; }
    td:first-child { white-space: normal; }
    .article-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
    .pagination { grid-template-columns: 1fr; }
    .pagination .next { text-align: left; }
}

@media print {
    .site-header, .docs-sidebar, .article-toc, .pagination, .copy-code { display: none !important; }
    .docs-shell, .article-grid { display: block; }
    .docs-main { padding: 0; }
    .code-block { break-inside: avoid; }
}
