:root {
  color-scheme: dark;
  --bg: #070b10;
  --surface: #0c121a;
  --surface-2: #111925;
  --surface-3: #172131;
  --line: #223247;
  --line-bright: #31506c;
  --text: #eef7ff;
  --muted: #91a4b8;
  --cyan: #26aef2;
  --cyan-soft: #0b7fb9;
  --green: #54d39a;
  --amber: #f4b861;
  --sidebar: 280px;
  --topbar: 76px;
  --radius: 12px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 24px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
button, input { font: inherit; }
a { color: inherit; }
code, pre, kbd { font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace; }
code { color: #9edcff; font-size: .92em; }
kbd { display: inline-flex; min-width: 2rem; justify-content: center; padding: .16rem .46rem; border: 1px solid #466078; border-bottom-width: 2px; border-radius: 5px; background: #162131; color: #dff4ff; font-size: .78rem; line-height: 1.3; }

.skip-link { position: fixed; z-index: 100; top: 10px; left: 10px; padding: 10px 14px; background: var(--cyan); color: #041019; transform: translateY(-160%); border-radius: 6px; font-weight: 800; }
.skip-link:focus { transform: none; }
.topbar { position: fixed; z-index: 20; inset: 0 0 auto; height: var(--topbar); display: flex; align-items: center; justify-content: space-between; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(7, 11, 16, .94); backdrop-filter: blur(16px); }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.08; letter-spacing: .06em; }
.brand strong { display: block; font-size: .88rem; }
.brand small { display: block; margin-top: 5px; color: var(--cyan); font-size: .65rem; font-weight: 800; letter-spacing: .16em; }
.brand-mark { width: 34px; height: 34px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 4px; border: 1px solid var(--cyan-soft); background: #071520; }
.brand-mark i { display: block; background: var(--cyan); }
.topbar-actions { display: flex; align-items: center; gap: 18px; }
.language-switch { display: inline-flex; overflow: hidden; border: 1px solid var(--line-bright); border-radius: 6px; font-size: .72rem; font-weight: 900; }
.language-switch a, .language-switch span { padding: 5px 8px; text-decoration: none; }
.language-switch span { background: var(--cyan); color: #05121b; }
.language-switch a { color: var(--muted); }
.language-switch a:hover { color: var(--text); background: var(--surface-2); }
.status { color: var(--muted); font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.status span { display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); }
.menu-button { display: none; border: 1px solid var(--line-bright); border-radius: 6px; background: var(--surface-2); color: var(--text); padding: 7px 11px; }

.sidebar { position: fixed; z-index: 15; left: 0; top: var(--topbar); bottom: 0; width: var(--sidebar); overflow-y: auto; padding: 26px 20px 40px; border-right: 1px solid var(--line); background: #090e15; }
.search { position: relative; display: block; }
.search > span { display: block; margin-bottom: 7px; color: var(--muted); font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 7px; outline: 0; background: var(--surface); color: var(--text); padding: 10px 38px 10px 11px; }
.search input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(38, 174, 242, .12); }
.search kbd { position: absolute; right: 8px; bottom: 9px; min-width: 24px; color: var(--muted); }
.search-result { min-height: 20px; margin: 7px 0 10px; color: var(--cyan); font-size: .76rem; }
.sidebar nav { display: grid; gap: 2px; }
.sidebar nav a { padding: 8px 11px; border-left: 2px solid transparent; color: #aebdca; text-decoration: none; font-size: .9rem; }
.sidebar nav a:hover { color: var(--text); background: var(--surface); }
.sidebar nav a.active { border-color: var(--cyan); background: linear-gradient(90deg, rgba(38,174,242,.12), transparent); color: #dff5ff; }
.sidebar nav a.search-hidden { display: none; }
.nav-label { margin: 20px 10px 5px; color: #566a7d; font-size: .68rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }

main { margin-left: var(--sidebar); padding-top: var(--topbar); }
.doc-section { max-width: 1160px; margin: 0 auto; padding: 88px 54px; border-bottom: 1px solid var(--line); }
.doc-section.search-miss { display: none; }
.hero { min-height: calc(100vh - var(--topbar)); display: grid; grid-template-columns: 1.05fr .95fr; align-items: center; gap: 52px; max-width: none; padding-right: max(54px, calc((100vw - var(--sidebar) - 1260px) / 2)); padding-left: max(54px, calc((100vw - var(--sidebar) - 1260px) / 2)); background: radial-gradient(circle at 58% 34%, rgba(24,111,160,.14), transparent 36%), linear-gradient(135deg, #080d13, #0b121a 60%, #071018); }
.eyebrow, .kicker { margin: 0 0 12px; color: var(--cyan); font-size: .73rem; font-weight: 900; letter-spacing: .17em; }
.hero h1 { max-width: 760px; margin: 0; font-size: clamp(2.5rem, 4.8vw, 5.6rem); line-height: .98; letter-spacing: -.055em; }
.hero-copy > p { max-width: 680px; margin: 25px 0 0; color: #b2c1ce; font-size: 1.08rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line-bright); border-radius: 7px; text-decoration: none; font-weight: 800; font-size: .88rem; }
.button.primary { border-color: var(--cyan); background: var(--cyan); color: #05121b; }
.button.secondary:hover { border-color: var(--cyan); color: #ccefff; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 35px 0 0; border: 1px solid var(--line); background: var(--line); }
.facts div { padding: 13px 15px; background: var(--surface); }
.facts dt { color: #60758a; font-size: .66rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.facts dd { margin: 3px 0 0; color: #d9e7f2; font-size: .84rem; font-weight: 700; }

.image-card { margin: 0; border: 1px solid var(--line-bright); background: #05080c; box-shadow: 0 24px 70px rgba(0,0,0,.34); }
.image-open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.image-open img { display: block; width: 100%; height: auto; }
.image-card figcaption { display: flex; gap: 12px; padding: 12px 15px; color: var(--muted); font-size: .76rem; line-height: 1.45; }
.image-card figcaption span { color: var(--cyan); font-weight: 900; }
.hero-shot { transform: perspective(1200px) rotateY(-2deg); }
.wide-image { margin-top: 32px; }
.wide-image img { max-height: 610px; object-fit: cover; object-position: center; }

.section-heading { display: flex; align-items: flex-start; gap: 18px; margin-bottom: 34px; }
.section-number { color: #37556d; font: 800 1rem/1 "Cascadia Code", monospace; padding-top: 8px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.05; letter-spacing: -.04em; }
.section-heading .kicker { margin-bottom: 8px; }
.lead { max-width: 820px; color: #b7c7d4; font-size: 1.08rem; }
h3 { margin-top: 1.8em; line-height: 1.2; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.steps article, .property-grid article, .module-grid article, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, var(--surface-2), var(--surface)); padding: 22px; }
.steps article > span { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--cyan-soft); color: var(--cyan); font: 800 .8rem "Cascadia Code", monospace; }
.steps h3, .property-grid h3, .module-grid h3 { margin: 18px 0 8px; }
.steps p, .module-grid p { margin: 0; color: var(--muted); }
.key-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 24px; border: 1px solid var(--line); background: var(--line); }
.key-grid div { display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 11px 14px; background: var(--surface); }
.key-grid span { color: #b6c5d1; font-size: .85rem; }
.callout { margin-top: 24px; padding: 17px 20px; border-left: 3px solid var(--cyan); background: rgba(38,174,242,.08); color: #bed0dd; }
.callout strong { color: var(--text); }
.callout.warning { border-color: var(--amber); background: rgba(244,184,97,.07); }

.split-card { display: grid; grid-template-columns: 1fr .85fr; gap: 1px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); }
.split-card > div { padding: 28px; background: var(--surface); }
.split-card h3 { margin: 12px 0 15px; font-size: 1.6rem; }
.recommended { display: inline-flex; padding: 4px 8px; border: 1px solid rgba(84,211,154,.35); border-radius: 4px; color: var(--green); background: rgba(84,211,154,.07); font-size: .66rem; font-weight: 900; letter-spacing: .12em; }
.manual-box { background: var(--surface-2) !important; }
ol, ul { padding-left: 1.3rem; }
li + li { margin-top: .55rem; }
.check-list li::marker { color: var(--cyan); font-weight: 900; }
.check-list.compact { margin-bottom: 0; }

.path { display: flex; align-items: center; gap: 16px; margin: 25px 0; padding: 14px 17px; border: 1px dashed var(--line-bright); background: #0b121a; }
.path span { flex: 0 0 auto; color: var(--cyan); font-size: .7rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.path strong { font-family: "Cascadia Code", monospace; font-size: .85rem; overflow-wrap: anywhere; }
.property-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.property-grid h3 { color: #dff5ff; }
.property-grid dl { margin: 0; }
.property-grid dt { margin-top: 12px; color: var(--cyan); font: 700 .82rem "Cascadia Code", monospace; }
.property-grid dd { margin: 3px 0 0; color: var(--muted); font-size: .86rem; }
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.panel h3 { margin-top: 0; }
.panel li { color: #acbdca; }
.action-table { border: 1px solid var(--line); }
.action-table > div { display: grid; grid-template-columns: 180px 1fr; gap: 18px; padding: 14px 16px; border-top: 1px solid var(--line); }
.action-table > div:first-child { border: 0; }
.action-table span { color: var(--muted); }

.media-layout { display: grid; grid-template-columns: 1.15fr .85fr; gap: 20px; align-items: start; }
.feature-list { display: grid; gap: 1px; border: 1px solid var(--line); background: var(--line); }
.feature-list article { display: grid; grid-template-columns: 42px 1fr; gap: 12px; padding: 16px; background: var(--surface); }
.feature-list article > span { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line-bright); color: var(--cyan); font-weight: 900; }
.feature-list h3 { margin: 1px 0 4px; font-size: .96rem; }
.feature-list p { margin: 0; color: var(--muted); font-size: .84rem; }

.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.module-grid article { min-width: 0; }
.module-grid article > code { display: block; margin-top: 16px; overflow-wrap: anywhere; }
.module-icon { display: inline-grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--cyan-soft); color: var(--cyan); font: 900 .75rem "Cascadia Code", monospace; }

.mode-table { border: 1px solid var(--line); margin: 24px 0; }
.mode-table > div { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 16px; padding: 13px 16px; border-top: 1px solid var(--line); }
.mode-table > div:first-child { border: 0; }
.mode-table .table-head { background: var(--surface-3); color: var(--muted); font-size: .7rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.mode-table > div:not(.table-head) span { color: var(--muted); font-size: .88rem; }
pre { position: relative; overflow-x: auto; margin: 20px 0; padding: 21px; border: 1px solid var(--line); border-radius: 8px; background: #05090e; color: #b9e5ff; font-size: .84rem; line-height: 1.7; tab-size: 4; }
pre code { color: inherit; }
.copy-code { position: absolute; top: 10px; right: 10px; padding: 5px 9px; border: 1px solid var(--line-bright); border-radius: 5px; background: var(--surface-2); color: var(--muted); cursor: pointer; font: 700 .68rem Inter, sans-serif; }
.copy-code:hover { color: var(--text); border-color: var(--cyan); }

.api-group + .api-group { margin-top: 34px; }
.api-table { display: grid; grid-template-columns: minmax(260px, .9fr) 1.3fr; border: 1px solid var(--line); }
.api-table > * { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.api-table > *:nth-last-child(-n+2) { border-bottom: 0; }
.api-table code { background: var(--surface); overflow-wrap: anywhere; }
.api-table span { color: var(--muted); background: #0a1017; }

.troubleshooting { display: grid; gap: 8px; }
details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
summary { cursor: pointer; padding: 15px 18px; color: #dcecf7; font-weight: 800; }
details p { margin: 0; padding: 0 18px 17px; color: var(--muted); }
details[open] { border-color: var(--line-bright); }
details[open] summary { color: var(--cyan); }
.deep-guides { display: grid; gap: 8px; margin-top: 28px; }
.details-body { padding: 0 20px 20px; color: var(--muted); }
.details-body p:last-child, .details-body ol:last-child, .details-body ul:last-child { margin-bottom: 0; }
.component-reference { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.component-reference article { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 22px; }
.component-reference h3 { margin: 0; }
.component-path { margin: 7px 0 16px; color: var(--cyan); font: 700 .72rem/1.5 "Cascadia Code", monospace; }
.component-reference dl { margin: 0; }
.component-reference dt { margin-top: 11px; color: #dcecf7; font-weight: 800; }
.component-reference dd { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.recipe-grid article { position: relative; min-height: 215px; padding: 22px; border: 1px solid var(--line); background: linear-gradient(150deg, var(--surface-2), #0a1017); }
.recipe-grid article > span { color: #3a5870; font: 900 .74rem "Cascadia Code", monospace; }
.recipe-grid h3 { margin: 24px 0 8px; font-size: 1.02rem; }
.recipe-grid p { margin: 0; color: var(--muted); font-size: .88rem; }
.safe-change-table { margin-top: 20px; border: 1px solid var(--line); }
.safe-change-table > div { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 14px 16px; border-top: 1px solid var(--line); }
.safe-change-table > div:first-child { border: 0; }
.safe-change-table strong { color: var(--cyan); }
.safe-change-table span { color: var(--muted); }
.save-scenarios { grid-template-columns: 1fr 1fr; }
.folder-tree { display: grid; grid-template-columns: 1fr 1fr; margin-top: 24px; border: 1px solid var(--line); }
.folder-tree > div { display: grid; grid-template-columns: 150px 1fr; gap: 12px; padding: 13px 15px; border-bottom: 1px solid var(--line); background: var(--surface); }
.folder-tree > div:nth-child(odd) { border-right: 1px solid var(--line); }
.folder-tree > div:nth-last-child(-n+2) { border-bottom: 0; }
.folder-tree strong { color: var(--cyan); font: 700 .78rem/1.5 "Cascadia Code", monospace; }
.folder-tree span { color: var(--muted); font-size: .86rem; }
.release-checklist { columns: 2; column-gap: 36px; }
.release-checklist li { break-inside: avoid; color: #b7c7d4; }
.release-checklist li::marker { color: var(--green); }

footer { max-width: 1160px; margin: 0 auto; padding: 45px 54px 70px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 25px; color: var(--muted); font-size: .8rem; }
.footer-brand { transform: scale(.9); transform-origin: left center; }
footer p { margin: 0; }
footer > a { color: var(--cyan); text-decoration: none; font-weight: 800; }

.lightbox { width: min(94vw, 1500px); max-height: 92vh; padding: 0; border: 1px solid var(--line-bright); background: #05080c; color: var(--text); }
.lightbox::backdrop { background: rgba(0,0,0,.88); backdrop-filter: blur(4px); }
.lightbox img { display: block; width: 100%; max-height: 82vh; object-fit: contain; }
.lightbox p { margin: 0; padding: 12px 16px; color: var(--muted); }
.lightbox-close { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border: 1px solid #5d7285; border-radius: 50%; background: rgba(5,8,12,.88); color: white; cursor: pointer; font-size: 1.4rem; }

@media (max-width: 1120px) {
  .hero { grid-template-columns: 1fr; padding-top: 70px; padding-bottom: 70px; }
  .hero h1 { font-size: clamp(2.7rem, 7vw, 5rem); }
  .hero-shot { transform: none; max-width: 820px; }
  .module-grid { grid-template-columns: repeat(2, 1fr); }
  .media-layout { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  :root { --topbar: 64px; }
  .topbar { padding: 0 16px; }
  .status { display: none; }
  .menu-button { display: block; }
  .sidebar { width: min(88vw, 320px); transform: translateX(-105%); transition: transform .2s ease; box-shadow: 20px 0 60px rgba(0,0,0,.6); }
  .sidebar.open { transform: none; }
  main { margin-left: 0; }
  .doc-section, .hero { padding: 65px 20px; }
  .hero { min-height: auto; }
  .hero h1 { font-size: clamp(2.35rem, 12vw, 4rem); }
  .facts, .steps, .key-grid, .property-grid, .two-columns, .split-card, .module-grid { grid-template-columns: 1fr; }
  .component-reference, .recipe-grid, .save-scenarios { grid-template-columns: 1fr; }
  .facts { gap: 1px; }
  .key-grid { grid-template-columns: 1fr 1fr; }
  .mode-table .table-head { display: none; }
  .mode-table > div { grid-template-columns: 1fr; gap: 3px; }
  .api-table { grid-template-columns: 1fr; }
  .api-table > * { border-bottom: 0; }
  .api-table span { padding-top: 0; border-bottom: 1px solid var(--line); }
  .api-table > *:last-child { border-bottom: 0; }
  .safe-change-table > div { grid-template-columns: 1fr; gap: 4px; }
  .action-table > div, .folder-tree, .folder-tree > div { grid-template-columns: 1fr; }
  .folder-tree > div:nth-child(odd) { border-right: 0; }
  .folder-tree > div:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .release-checklist { columns: 1; }
  footer { grid-template-columns: 1fr; padding: 40px 20px 60px; }
}

@media (max-width: 470px) {
  .brand strong { font-size: .74rem; }
  .brand small { font-size: .56rem; }
  .brand-mark { width: 30px; height: 30px; }
  .hero-actions { display: grid; }
  .button { justify-content: center; }
  .key-grid { grid-template-columns: 1fr; }
  .section-heading { gap: 10px; }
  .section-number { display: none; }
}

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