:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-muted: #eef3f8;
  --border: #dfe7f0;
  --border-strong: #c9d5e4;
  --text: #172033;
  --muted: #64748b;
  --faint: #94a3b8;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #e8f0ff;
  --navy: #172554;
  --green: #059669;
  --green-soft: #e8f8f2;
  --amber: #b45309;
  --amber-soft: #fff7e6;
  --violet: #7c3aed;
  --violet-soft: #f2ebff;
  --danger: #be123c;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 14px 34px rgba(30, 41, 59, .09);
  --sidebar-width: 292px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1120;
  --surface: #111827;
  --surface-soft: #172033;
  --surface-muted: #1e293b;
  --border: #263348;
  --border-strong: #38465c;
  --text: #e7eef9;
  --muted: #9aa9be;
  --faint: #718097;
  --primary: #60a5fa;
  --primary-strong: #3b82f6;
  --primary-soft: #172f52;
  --navy: #dbeafe;
  --green: #34d399;
  --green-soft: #12352f;
  --amber: #fbbf24;
  --amber-soft: #3b2d13;
  --violet: #a78bfa;
  --violet-soft: #2c2346;
  --danger: #fb7185;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow: 0 18px 42px rgba(0, 0, 0, .25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.65 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  transition: background .2s ease, color .2s ease;
}
button, input { font: inherit; }
a { color: var(--primary); }
code, kbd {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
code {
  padding: .15rem .38rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--violet);
  background: var(--surface-muted);
  font-size: .9em;
}

.sr-only {
  position: absolute;
  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;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-150%);
  padding: 9px 13px;
  border-radius: 8px;
  color: #fff;
  background: var(--primary-strong);
  text-decoration: none;
}
.skip-link:focus { transform: none; }

.wiki-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  border-right: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(16px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #60a5fa);
  box-shadow: 0 8px 18px rgba(37, 99, 235, .25);
  font-weight: 900;
  letter-spacing: -.04em;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; letter-spacing: -.01em; }
.brand small { color: var(--muted); font-size: 12px; }

.sidebar-search {
  position: relative;
  margin: 16px 15px 8px;
}
.sidebar-search svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 17px;
  height: 17px;
  transform: translateY(-50%);
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.8;
  stroke-linecap: round;
}
.sidebar-search input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  outline: none;
  color: var(--text);
  background: var(--surface-soft);
}
.sidebar-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 15%, transparent);
}
.sidebar-search kbd {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  padding: 1px 6px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  color: var(--faint);
  background: var(--surface);
  font-size: 11px;
}
.search-results {
  position: absolute;
  z-index: 60;
  top: 134px;
  left: 15px;
  right: 15px;
  max-height: 360px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.search-result {
  display: block;
  padding: 10px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
}
.search-result:hover, .search-result:focus { background: var(--primary-soft); }
.search-result strong { display: block; font-size: 13px; }
.search-result span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.search-empty { padding: 14px; color: var(--muted); text-align: center; }

.wiki-nav {
  flex: 1;
  overflow: auto;
  padding: 4px 11px 22px;
  scrollbar-width: thin;
}
.nav-group-title {
  margin: 18px 11px 7px;
  color: var(--faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.wiki-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 39px;
  padding: 7px 10px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: .15s ease;
}
.wiki-nav a:hover { color: var(--text); background: var(--surface-muted); }
.wiki-nav a.active { color: var(--primary); background: var(--primary-soft); }
.nav-icon {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  color: currentColor;
  font-size: 15px;
  font-weight: 800;
}
.sidebar-footer {
  display: flex;
  flex-direction: column;
  padding: 14px 20px 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
}
.sidebar-footer small { color: var(--faint); }

.workspace {
  grid-column: 2;
  min-width: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px);
}
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
}
.breadcrumbs b { color: var(--faint); font-weight: 400; }
.breadcrumbs strong {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar-actions { display: flex; gap: 7px; margin-left: auto; }
.icon-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}
.icon-button:hover { color: var(--primary); border-color: var(--primary); }
.menu-button { display: none; }

.content {
  width: min(1120px, calc(100% - 56px));
  min-height: calc(100vh - 132px);
  margin: 0 auto;
  padding: 54px 0 80px;
  outline: none;
}
.wiki-page { display: none; animation: page-in .24s ease; }
.wiki-page.active { display: block; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

.article-header {
  max-width: 820px;
  margin-bottom: 46px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}
.eyebrow {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .12em;
  text-transform: uppercase;
}
h1, h2, h3 { color: var(--text); line-height: 1.2; letter-spacing: -.025em; }
h1 { margin: 0 0 13px; font-size: clamp(34px, 5vw, 50px); }
h2 { margin: 0 0 17px; font-size: 25px; }
h3 { margin: 0 0 8px; font-size: 17px; }
p { margin: 0 0 15px; color: var(--muted); }
.lead { max-width: 740px; font-size: 18px; line-height: 1.65; }
.wiki-page > section { margin-top: 44px; }
.wiki-page > section:first-of-type { margin-top: 0; }

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 42px;
  overflow: hidden;
  padding: 48px;
  border: 1px solid var(--border);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 5%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 35%),
    linear-gradient(135deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -100px;
  width: 260px;
  height: 260px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-radius: 50%;
}
.hero h1 { font-size: clamp(40px, 6vw, 66px); }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  background: var(--surface);
  font-weight: 750;
  text-decoration: none;
}
.button.primary { border-color: var(--primary-strong); color: #fff; background: var(--primary-strong); }
.button.ghost:hover { border-color: var(--primary); color: var(--primary); }
.hero-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  align-content: center;
  gap: 15px 12px;
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 75%, transparent);
}
.hero-panel strong { color: var(--primary); font-size: 24px; }
.hero-panel span { align-self: center; color: var(--muted); font-size: 12px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}
.feature-grid.small { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feature-card {
  position: relative;
  min-height: 168px;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  color: var(--text);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
a.feature-card:hover { transform: translateY(-2px); border-color: var(--primary); box-shadow: var(--shadow); }
.feature-card p { margin: 0; font-size: 14px; }
.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-size: 18px;
  font-weight: 850;
}
.accent-violet .feature-icon { color: var(--violet); background: var(--violet-soft); }
.accent-green .feature-icon { color: var(--green); background: var(--green-soft); }
.accent-amber .feature-icon { color: var(--amber); background: var(--amber-soft); }

.callout {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 26%, var(--border));
  border-left: 4px solid var(--primary);
  border-radius: 12px;
  background: var(--primary-soft);
}
.callout.warning { border-color: color-mix(in srgb, var(--amber) 35%, var(--border)); border-left-color: var(--amber); background: var(--amber-soft); }
.callout.tip { border-color: color-mix(in srgb, var(--green) 35%, var(--border)); border-left-color: var(--green); background: var(--green-soft); }
.callout-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: var(--primary);
  font-weight: 900;
}
.callout.warning .callout-icon { background: var(--amber); }
.callout.tip .callout-icon { background: var(--green); }
.callout h3 { margin-top: 2px; }
.callout p { margin: 0; }

.step-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}
.step-list.compact { grid-template-columns: 1fr; }
.step-list li {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  gap: 13px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.step-list li > span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--primary);
  background: var(--primary-soft);
  font-weight: 900;
}
.step-list strong { display: block; margin: 2px 0 3px; }
.step-list p { margin: 0; font-size: 14px; }

.chip-list { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-list span {
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface);
  font-size: 13px;
  font-weight: 650;
}
.check-list { display: grid; gap: 9px; padding: 0; list-style: none; }
.check-list li { position: relative; padding-left: 28px; color: var(--muted); }
.check-list li::before {
  content: "✓";
  position: absolute;
  top: 1px;
  left: 0;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 900;
}
.check-list strong { color: var(--text); }

.stat-doc-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.stat-doc-grid > div {
  padding: 19px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
.stat-doc-grid strong { display: block; margin-bottom: 5px; color: var(--primary); }
.stat-doc-grid p { margin: 0; font-size: 13px; }

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
th { color: var(--text); background: var(--surface-soft); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
td { color: var(--muted); font-size: 14px; }
td:first-child { color: var(--text); font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }

.faq-list { display: grid; gap: 10px; }
.faq-list details {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--surface);
}
.faq-list summary {
  position: relative;
  padding: 17px 48px 17px 18px;
  color: var(--text);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  color: var(--primary);
  font-size: 22px;
  font-weight: 400;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list details[open] summary { border-bottom: 1px solid var(--border); }
.faq-list details p { padding: 15px 18px 17px; margin: 0; }

.empty-search { padding: 80px 20px; text-align: center; }
.empty-search > span { display: block; color: var(--faint); font-size: 46px; }
.empty-search h2 { margin: 12px 0 7px; }
.page-footer {
  display: flex;
  justify-content: space-between;
  width: min(1120px, calc(100% - 56px));
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid var(--border);
  color: var(--faint);
  font-size: 12px;
}
.sidebar-overlay { display: none; }

@media (max-width: 1050px) {
  .feature-grid.small { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .wiki-shell { display: block; }
  .sidebar {
    transform: translateX(-103%);
    box-shadow: var(--shadow);
    transition: transform .22s ease;
  }
  body.menu-open .sidebar { transform: none; }
  .workspace { grid-column: 1; }
  .menu-button { display: grid; }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: block;
    visibility: hidden;
    border: 0;
    opacity: 0;
    background: rgba(2, 6, 23, .55);
    transition: .2s ease;
  }
  body.menu-open .sidebar-overlay { visibility: visible; opacity: 1; }
  .content, .page-footer { width: min(100% - 36px, 760px); }
  .topbar { padding: 0 18px; }
  .hero { grid-template-columns: 1fr; padding: 34px; }
  .hero-panel { grid-template-columns: 70px 1fr; }
}

@media (max-width: 620px) {
  .content { width: calc(100% - 28px); padding-top: 34px; }
  .page-footer { width: calc(100% - 28px); flex-direction: column; gap: 3px; }
  .hero { padding: 26px 21px; border-radius: 18px; }
  .hero h1 { font-size: 39px; }
  .lead { font-size: 16px; }
  .feature-grid, .feature-grid.small, .step-list, .stat-doc-grid { grid-template-columns: 1fr; }
  .feature-card { min-height: 0; }
  .article-header { margin-bottom: 34px; }
  h1 { font-size: 36px; }
  h2 { font-size: 22px; }
  .wiki-page > section { margin-top: 36px; }
  .breadcrumbs span, .breadcrumbs b { display: none; }
  .callout { grid-template-columns: 32px minmax(0, 1fr); padding: 15px; }
}

@media print {
  :root, [data-theme="dark"] { color-scheme: light; --bg: #fff; --surface: #fff; --surface-soft: #f7f7f7; --border: #d6d6d6; --text: #111; --muted: #444; --primary: #174ea6; }
  body { background: #fff; font-size: 11pt; }
  .sidebar, .topbar, .page-footer, .sidebar-overlay, .hero-actions { display: none !important; }
  .wiki-shell, .workspace { display: block; }
  .content { width: 100%; margin: 0; padding: 0; }
  .wiki-page { display: none !important; }
  .wiki-page.active { display: block !important; }
  .hero, .feature-card, .step-list li, .stat-doc-grid > div, .table-scroll, .faq-list details { box-shadow: none; break-inside: avoid; }
  .hero { grid-template-columns: 1fr; padding: 22px; }
  .hero-panel { display: none; }
  .wiki-page > section { margin-top: 28px; }
  a { color: inherit; text-decoration: none; }
  table { font-size: 9pt; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; }
}
