:root {
  color-scheme: light;
  --brand: #8b2433;
  --brand-dark: #681724;
  --accent: #075985;
  --accent-soft: #e8f4fa;
  --ink: #17212b;
  --muted: #586879;
  --subtle: #f5f7f9;
  --paper: #fff;
  --line: #d8e0e7;
  --code: #101b26;
  --code-ink: #edf7ff;
  --focus: #f2a900;
  --shadow: 0 14px 42px rgb(20 35 50 / 12%);
  --header-height: 4.25rem;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --brand: #e78694;
  --brand-dark: #f0a8b2;
  --accent: #75c7ed;
  --accent-soft: #173544;
  --ink: #eef3f7;
  --muted: #b6c2cd;
  --subtle: #15202a;
  --paper: #0f1821;
  --line: #354451;
  --code: #071019;
  --code-ink: #eaf7ff;
  --focus: #ffd166;
  --shadow: 0 14px 42px rgb(0 0 0 / 32%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 1.5rem); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.68 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: var(--accent); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:hover { text-decoration-thickness: .13em; }
button, input { font: inherit; }
button, a, input, summary { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: .2rem; }
.sr-only { position: absolute!important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 100000; left: 1rem; top: -5rem; background: var(--ink); color: var(--paper); padding: .65rem 1rem; border-radius: .35rem; }
.skip-link:focus { top: .65rem; }

.site-header { position: sticky; z-index: 1000; top: 0; height: var(--header-height); display: flex; align-items: center; gap: 1.25rem; padding: 0 clamp(1rem,4vw,4rem); background: color-mix(in srgb, var(--paper) 94%, transparent); border-bottom: 1px solid var(--line); backdrop-filter: blur(12px); }
.brand { display: flex; align-items: center; gap: .65rem; min-width: 10rem; color: var(--ink); font-weight: 750; text-decoration: none; letter-spacing: -.01em; }
.brand img { width: 6.25rem; height: auto; }
.brand span { padding-left: .65rem; border-left: 1px solid var(--line); }
.header-search { position: relative; flex: 1; max-width: 38rem; margin-inline: auto; }
.header-search > span { position: absolute; left: .85rem; top: .47rem; color: var(--muted); font-size: 1.25rem; }
.header-search input, .search-form input { width: 100%; min-height: 2.65rem; padding: .55rem .85rem .55rem 2.35rem; color: var(--ink); background: var(--subtle); border: 1px solid var(--line); border-radius: .5rem; }
.header-search input:focus, .search-form input:focus { background: var(--paper); border-color: var(--accent); }
.theme-toggle, .icon-button { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .6rem; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: .4rem; cursor: pointer; }
.theme-toggle:hover, .icon-button:hover { color: var(--ink); background: var(--subtle); }
.portal-link { white-space: nowrap; padding: .55rem .8rem; color: #fff; background: #8b2433; border-radius: .4rem; font-weight: 700; text-decoration: none; }
.portal-link:hover { background: #681724; text-decoration: none; }
.nav-toggle { display: none; font-size: 1.2rem; }

.docs-layout { display: grid; grid-template-columns: minmax(13rem, 16rem) minmax(0, 49rem) minmax(10rem, 13rem); gap: clamp(2rem,4vw,4.5rem); width: min(100% - 2rem, 91rem); margin: 0 auto; }
.docs-sidebar, .page-toc { position: sticky; top: calc(var(--header-height) + 2rem); align-self: start; max-height: calc(100vh - var(--header-height) - 4rem); overflow: auto; padding-block: 2.4rem; scrollbar-width: thin; }
.sidebar-heading, .page-toc > p { margin: 0 0 .8rem; color: var(--ink); font-size: .76rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.docs-nav { margin: 0; padding: 0; list-style: none; }
.docs-nav .docs-nav { margin: .2rem 0 .6rem .75rem; padding-left: .8rem; border-left: 1px solid var(--line); }
.docs-nav a { display: block; padding: .35rem .55rem; color: var(--muted); border-radius: .35rem; font-size: .92rem; line-height: 1.35; text-decoration: none; }
.docs-nav > li > a { margin-top: .25rem; color: var(--ink); font-weight: 680; }
.docs-nav a:hover { color: var(--ink); background: var(--subtle); }
.docs-nav .is-current > a { color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, transparent); font-weight: 760; }
.editor-link { display: block; margin: 1.25rem .55rem 0; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .86rem; }

.docs-main { min-width: 0; min-height: calc(100vh - var(--header-height)); padding: 2.35rem 0 1.5rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 2rem; padding: 0; color: var(--muted); list-style: none; font-size: .83rem; }
.breadcrumbs li:not(:last-child)::after { margin-left: .4rem; content: "/"; color: var(--line); }
.breadcrumbs a { color: inherit; text-decoration: none; }
.eyebrow { margin: 0 0 .35rem; color: var(--brand); font-size: .76rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
.article-header { padding-bottom: 1.75rem; border-bottom: 1px solid var(--line); }
h1, h2, h3, h4 { line-height: 1.22; letter-spacing: -.025em; text-wrap: balance; }
h1 { max-width: 18ch; margin: 0; font-size: clamp(2.15rem,5vw,3.3rem); }
h2 { margin: 2.6rem 0 .8rem; font-size: clamp(1.55rem,3vw,2rem); }
h3 { margin: 2rem 0 .65rem; font-size: 1.32rem; }
h4 { margin: 1.5rem 0 .5rem; font-size: 1.08rem; }
.article-summary { max-width: 64ch; margin: .85rem 0 0; color: var(--muted); font-size: 1.13rem; }
.article-body { overflow-wrap: anywhere; }
.article-body > :first-child { margin-top: 1.8rem; }
.article-body p, .article-body li { max-width: 72ch; }
.article-body img, .article-body video { max-width: 100%; height: auto; border-radius: .45rem; }

.page-toc { font-size: .84rem; }
#article-toc { display: grid; gap: .2rem; border-left: 1px solid var(--line); }
#article-toc a, .toc-empty { display: block; padding: .3rem 0 .3rem .8rem; color: var(--muted); line-height: 1.35; text-decoration: none; }
#article-toc a:hover { color: var(--ink); border-left: 2px solid var(--brand); margin-left: -1px; }
#article-toc .toc-subsection { padding-left: 1.5rem; font-size: .8rem; }

.callout { margin: 1.6rem 0; padding: 1rem 1.15rem; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); border-left: 4px solid var(--accent); border-radius: .25rem .45rem .45rem .25rem; }
.callout > strong { display: block; margin-bottom: .25rem; }
.callout p:last-child { margin-bottom: 0; }
.callout-tip { border-left-color: #237a46; background: color-mix(in srgb, #237a46 11%, var(--paper)); }
.callout-warning { border-left-color: #a05b00; background: color-mix(in srgb, #d88a00 13%, var(--paper)); }
.callout-important { border-left-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--paper)); }
.code-sample { margin: 1.6rem 0; overflow: hidden; background: var(--code); border: 1px solid var(--line); border-radius: .5rem; }
.code-toolbar { display: flex; justify-content: space-between; align-items: center; min-height: 2.5rem; padding: .35rem .75rem; color: #b8c7d4; border-bottom: 1px solid #304050; font: .76rem/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; }
.code-toolbar button { color: #fff; background: #263746; border: 1px solid #415466; border-radius: .3rem; cursor: pointer; }
.code-block { margin: 0; padding: 1rem; overflow: auto; color: var(--code-ink); background: transparent; font: .9rem/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; white-space: pre; }
.docs-figure { margin: 1.75rem 0; }
.figure-button { display: block; width: 100%; padding: 0; background: transparent; border: 0; cursor: zoom-in; }
.docs-figure img { display: block; width: 100%; border: 1px solid var(--line); box-shadow: var(--shadow); }
figcaption { margin-top: .6rem; color: var(--muted); font-size: .88rem; }
.procedure { margin: 2rem 0; }
.procedure ol { padding: 0; list-style: none; counter-reset: procedure; }
.procedure li { position: relative; min-height: 2.4rem; margin: 1rem 0; padding: 0 0 1rem 3.25rem; border-bottom: 1px solid var(--line); counter-increment: procedure; }
.procedure li::before { position: absolute; left: 0; top: -.2rem; display: grid; place-items: center; width: 2.15rem; height: 2.15rem; color: #fff; background: #8b2433; border-radius: 50%; content: counter(procedure); font-weight: 800; }
.procedure li > strong { display: block; font-size: 1.03rem; }
.accordion-group { margin: 2rem 0; }
details { margin: .7rem 0; border: 1px solid var(--line); border-radius: .4rem; background: var(--subtle); }
summary { padding: .8rem 1rem; cursor: pointer; font-weight: 700; }
.accordion-body { padding: 0 1rem 1rem; }
.docs-columns { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.docs-column { padding: 1rem; border: 1px solid var(--line); border-radius: .45rem; }
.docs-button { display: inline-block; padding: .58rem .88rem; color: #fff; background: #8b2433; border-radius: .4rem; font-weight: 750; text-decoration: none; }
.docs-button:hover { background: #681724; text-decoration: none; }
.embed { position: relative; padding-top: 56.25%; margin: 1.5rem 0; overflow: hidden; border-radius: .5rem; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.uploaded-video { width: 100%; margin: 1.5rem 0; background: #000; }
.docs-divider { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--line); }
.related { margin-top: 2.5rem; padding: 1.2rem; background: var(--subtle); border-radius: .5rem; }
.related h2 { margin-top: 0; font-size: 1.2rem; }

.article-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 3.5rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.article-pager a { display: flex; flex-direction: column; padding: .8rem; color: var(--ink); border: 1px solid var(--line); border-radius: .45rem; text-decoration: none; }
.article-pager a:hover { border-color: var(--accent); background: var(--subtle); }
.article-pager span { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.pager-next { text-align: right; }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; margin-top: 4rem; padding-top: 1.25rem; color: var(--muted); border-top: 1px solid var(--line); font-size: .8rem; }

.search-page h1 { margin-bottom: 1.8rem; }
.search-form { padding: 1.2rem; background: var(--subtle); border: 1px solid var(--line); border-radius: .5rem; }
.search-form label { display: block; margin-bottom: .45rem; font-weight: 700; }
.search-form > div { display: flex; gap: .5rem; }
.search-form input { padding-left: .8rem; }
.search-form button { padding: .55rem 1rem; color: #fff; background: #8b2433; border: 0; border-radius: .4rem; font-weight: 750; cursor: pointer; }
.search-count { margin-top: 2rem; color: var(--muted); }
.search-results { margin: 0; padding: 0; list-style: none; }
.search-results > li { padding: 1.25rem 0; border-bottom: 1px solid var(--line); }
.search-results > li > a { font-size: 1.17rem; font-weight: 760; }
.search-results p { margin: .35rem 0; color: var(--muted); }
.search-results span { color: var(--brand); font-size: .78rem; }
.search-message { margin-top: 2rem; padding: 2rem; text-align: center; background: var(--subtle); border: 1px dashed var(--line); border-radius: .5rem; }
.search-message h2 { margin-top: 0; font-size: 1.25rem; }
.search-error { border-color: var(--brand); }
.error-page { max-width: 42rem; margin: 10vh auto 0; text-align: center; }
.error-code { margin: 0; color: var(--brand); font-size: 1rem; font-weight: 850; letter-spacing: .15em; }
.error-page h1 { max-width: none; }
.error-page > p { color: var(--muted); font-size: 1.08rem; }
.error-page > div { display: flex; justify-content: center; align-items: center; gap: 1.2rem; margin-top: 1.5rem; }

.nav-scrim { display: none; }
.image-lightbox { max-width: min(92vw,75rem); max-height: 92vh; padding: 2.5rem 1rem 1rem; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: .6rem; box-shadow: var(--shadow); }
.image-lightbox::backdrop { background: rgb(3 10 18 / 84%); }
.image-lightbox img { display: block; max-width: 100%; max-height: 76vh; margin: auto; }
.image-lightbox p { margin: .65rem 0 0; text-align: center; color: var(--muted); }
.lightbox-close { position: absolute; top: .35rem; right: .5rem; color: var(--ink); background: transparent; border: 0; font-size: 1.75rem; cursor: pointer; }

@media (max-width: 68rem) {
  .docs-layout { grid-template-columns: minmax(12rem,15rem) minmax(0,49rem); }
  .page-toc { display: none; }
}

@media (max-width: 50rem) {
  .site-header { gap: .65rem; padding-inline: 1rem; }
  .nav-toggle { display: inline-flex; }
  .brand { min-width: auto; }
  .brand img { width: 5.25rem; }
  .brand span, .theme-label, .portal-label { display: none; }
  .portal-link { padding-inline: .7rem; }
  .header-search { order: 2; }
  .docs-layout { display: block; width: min(100% - 2rem,49rem); }
  .docs-sidebar { position: fixed; z-index: 1100; inset: var(--header-height) auto 0 0; width: min(19rem,86vw); max-height: none; padding: 1.5rem 1rem; background: var(--paper); border-right: 1px solid var(--line); box-shadow: var(--shadow); transform: translateX(-105%); transition: transform .2s ease; }
  .nav-scrim { position: fixed; z-index: 1050; inset: var(--header-height) 0 0; width: 100%; height: calc(100vh - var(--header-height)); padding: 0; background: rgb(3 10 18 / 48%); border: 0; }
  .nav-open .docs-sidebar { transform: translateX(0); }
  .nav-open .nav-scrim { display: block; }
  .docs-main { padding-top: 1.4rem; }
  .docs-columns { grid-template-columns: 1fr; }
}

@media (max-width: 34rem) {
  :root { --header-height: 7.35rem; }
  .site-header { flex-wrap: wrap; height: var(--header-height); padding-block: .6rem; }
  .header-search { flex-basis: 100%; max-width: none; order: 5; }
  .article-pager { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

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