:root {
  --orange: #ff7900;
  --orange-soft: #fff1e5;
  --orange-dark: #a94a00;
  --bg: #f5f6f8;
  --surface: #fff;
  --surface-alt: #f9fafb;
  --control: #fff;
  --code-bg: #0f172a;
  --code-ink: #e2e8f0;
  --line: #d8dee8;
  --line-strong: #aeb7c5;
  --ink: #101828;
  --muted: #667085;
  --nav-link: #344054;
  --nav: #ffffff;
  --nav-muted: #667085;
  --link: #344054;
  --crumb: #98a2b3;
  --panel-shadow: 0 4px 14px rgba(16, 24, 40, 0.05);
  --focus-ring: rgba(255, 121, 0, 0.15);
  --hover-ring: rgba(255, 121, 0, 0.12);
  --radius: 8px;
  --shadow: 0 16px 34px rgba(16, 24, 40, 0.08);
  --font-ui: Aptos, Inter, "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --orange-soft: rgba(255, 121, 0, 0.16);
  --orange-dark: #ffb15c;
  --bg: #0b1018;
  --surface: #121a26;
  --surface-alt: #172231;
  --control: #0f1722;
  --code-bg: #070b12;
  --code-ink: #d9e2ef;
  --line: #263449;
  --line-strong: #3a4b63;
  --ink: #eef4ff;
  --muted: #9aa9bc;
  --nav-link: #d7e0ec;
  --nav: #0e1622;
  --nav-muted: #8f9db0;
  --link: #d7e0ec;
  --crumb: #6f7f94;
  --panel-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
  --focus-ring: rgba(255, 121, 0, 0.26);
  --hover-ring: rgba(255, 121, 0, 0.2);
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

:root[data-theme="light"] {
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-family: var(--font-ui); }
body { margin: 0; min-height: 100vh; font-size: 15px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
code, pre { font-family: var(--font-mono); }

.app-shell { display: grid; grid-template-columns: 320px 1fr; min-height: 100vh; }
.side-nav { position: sticky; top: 0; height: 100vh; overflow: auto; padding: 18px; border-right: 1px solid var(--line); background: var(--nav); color: var(--ink); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding: 6px 4px; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border-radius: 8px; background: #fff; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }
.brand strong, .brand small { display: block; }
.brand small { color: var(--nav-muted); }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; margin-bottom: 18px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); color: var(--ink); font: inherit; font-weight: 750; cursor: pointer; }
.theme-toggle:hover { border-color: var(--orange); box-shadow: 0 0 0 3px var(--hover-ring); }
.theme-toggle-text { display: grid; gap: 1px; text-align: left; }
.theme-toggle-text small { color: var(--muted); font-size: 0.76rem; font-weight: 650; }
.theme-switch { position: relative; flex: 0 0 auto; width: 42px; height: 24px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--control); }
.theme-switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--muted); transition: transform 160ms ease, background 160ms ease; }
:root[data-theme="dark"] .theme-switch::after { transform: translateX(18px); background: var(--orange); }
.sidebar-search { position: relative; margin-bottom: 18px; }
.doc-nav { display: grid; gap: 6px; }
.doc-link, .doc-summary, .doc-child { border-radius: 6px; color: var(--nav-link); }
.doc-link { display: flex; padding: 9px 10px; font-weight: 750; }
.doc-group { border-top: 1px solid var(--line); padding-top: 6px; }
.doc-group:first-of-type { border-top: 0; }
.doc-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; cursor: pointer; font-weight: 800; list-style: none; }
.doc-summary::-webkit-details-marker { display: none; }
.doc-summary::before { content: "›"; color: var(--muted); transition: transform 160ms ease; }
.doc-group[open] > .doc-summary::before { transform: rotate(90deg); }
.doc-summary span { flex: 1; }
.doc-summary small, .doc-child small { color: var(--muted); font-size: 0.74rem; font-weight: 750; }
.doc-children { display: grid; gap: 2px; padding: 2px 0 8px 19px; }
.doc-child { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; font-size: 0.9rem; }
.doc-link:hover, .doc-summary:hover, .doc-child:hover, .doc-link.active, .doc-summary.active, .doc-child.active { background: var(--orange-soft); color: var(--orange-dark); }

.content-shell { min-width: 0; }
main { width: min(100%, 1380px); margin: 0 auto; padding: 28px; display: grid; gap: 18px; }

.search-wrap, .sidebar-search { position: relative; }
.site-search-input, input { width: 100%; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--control); color: var(--ink); padding: 11px 13px; font: inherit; outline: none; }
.site-search-input:focus, input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--focus-ring); }
.site-search-results { display: none; position: absolute; top: calc(100% + 8px); left: 0; right: 0; max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.site-search-results.active { display: block; }
.search-result { display: grid; gap: 3px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.search-result:hover { background: var(--orange-soft); }
.search-result strong { color: var(--ink); }
.search-result span { color: var(--muted); font-size: 0.86rem; }

.hero, .page-hero, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--panel-shadow); }
.hero, .page-hero { padding: 28px; border-left: 4px solid var(--orange); }
.panel { padding: 20px; }
.eyebrow { margin: 0 0 8px; color: var(--orange-dark); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 3vw, 3.3rem); line-height: 1.05; letter-spacing: 0; }
h2 { font-size: 1.15rem; }
.lede { max-width: 900px; margin-top: 10px; color: var(--link); font-size: 1.02rem; }
.muted, .label { color: var(--muted); }
.label { display: block; font-size: 0.75rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }

.stats-grid, .details-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 18px; }
.stats-grid div, .details-grid div { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); }
.stats-grid strong { display: block; font-size: 1.45rem; }
.stats-grid span { color: var(--muted); }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.pack-card, .category-card, .policy-row { border: 1px solid var(--line); border-radius: 8px; background: var(--surface-alt); padding: 14px; }
.pack-card, .category-card { display: grid; gap: 8px; min-height: 96px; }
.pack-card:hover, .category-card:hover, .policy-row:hover { border-color: var(--orange); box-shadow: 0 0 0 3px var(--hover-ring); }
.pack-title { font-weight: 800; }
.list-grid { display: grid; gap: 8px; }
.policy-row { display: block; }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 0.88rem; }
.breadcrumbs a { color: var(--link); font-weight: 650; }
.breadcrumbs a:hover { color: var(--orange-dark); }
.crumb-sep { color: var(--crumb); }

.policy-title-block { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; }
.policy-badge { display: inline-flex; border-radius: 999px; border: 1px solid rgba(255, 121, 0, 0.35); background: var(--orange-soft); color: var(--orange-dark); padding: 5px 10px; font-size: 0.78rem; font-weight: 800; }
.registry-copy-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.copy-button { border: 1px solid var(--line-strong); border-radius: 7px; background: var(--control); color: var(--ink); padding: 9px 12px; font: inherit; font-weight: 750; cursor: pointer; }
.copy-button:hover { border-color: var(--orange); color: var(--orange-dark); box-shadow: 0 0 0 3px var(--hover-ring); }
.registry-text-list { display: grid; gap: 10px; margin-top: 14px; }
pre { overflow: auto; margin: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--code-bg); color: var(--code-ink); padding: 14px; font-size: 0.84rem; }

.toast-host { position: fixed; right: 22px; bottom: 22px; z-index: 80; }
.toast { border-radius: 8px; background: var(--ink); color: #fff; padding: 10px 14px; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .side-nav { position: static; height: auto; max-height: none; }
  .doc-nav { max-height: 360px; overflow: auto; }
  main { padding: 16px 14px 48px; }
  .hero, .page-hero, .panel { padding: 16px; }
  .policy-title-block { display: grid; }
}
