/* docs.xosting.net — same palette as xosting.net / my.xosting.net. Every text colour meets WCAG AA
   (>= 4.5:1) on the surface it sits on, in both themes. */
:root {
  color-scheme: dark;
  --bg: #080b12;
  --surface: #0f1420;
  --raised: #141a28;
  --line: rgb(255 255 255 / 0.09);
  --line-strong: rgb(255 255 255 / 0.16);
  --fg: #f4f6fb;
  --fg-muted: #c9ced8;
  --fg-subtle: #a3abb9;
  --fg-faint: #8b93a3;
  --link: #7cb4ff;
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: rgb(59 130 246 / 0.14);
  --code-bg: #0b0f19;
  --code-fg: #e6e9f2;
  --inline-code-bg: rgb(255 255 255 / 0.07);
  --tip: #6ee7b7;
  --tip-bg: rgb(16 185 129 / 0.09);
  --tip-line: rgb(16 185 129 / 0.35);
  --note: #93c5fd;
  --note-bg: rgb(59 130 246 / 0.09);
  --note-line: rgb(59 130 246 / 0.35);
  --warn: #fcd34d;
  --warn-bg: rgb(245 158 11 / 0.09);
  --warn-line: rgb(245 158 11 / 0.38);
  --shadow: 0 24px 60px -20px rgb(0 0 0 / 0.7);
  --top: 64px;
  --radius: 14px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --raised: #ffffff;
  --line: rgb(9 9 11 / 0.1);
  --line-strong: rgb(9 9 11 / 0.18);
  --fg: #09090b;
  --fg-muted: #3f3f46;
  --fg-subtle: #52525b;
  --fg-faint: #63636c;
  --link: #1d4ed8;
  --primary-soft: rgb(37 99 235 / 0.09);
  --code-bg: #0f1420;
  --code-fg: #e6e9f2;
  --inline-code-bg: rgb(9 9 11 / 0.06);
  --tip: #04694b;
  --tip-bg: rgb(16 185 129 / 0.08);
  --tip-line: rgb(4 120 87 / 0.35);
  --note: #1d4ed8;
  --note-bg: rgb(37 99 235 / 0.06);
  --note-line: rgb(29 78 216 / 0.3);
  --warn: #9a4706;
  --warn-bg: rgb(245 158 11 / 0.1);
  --warn-line: rgb(180 83 9 / 0.35);
  --shadow: 0 24px 60px -24px rgb(9 9 11 / 0.25);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img, svg { display: block; max-width: 100%; }
a { color: var(--link); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; border-radius: 6px; }
.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; }
.icon { width: 18px; height: 18px; flex: none; }
kbd {
  font: 600 11px/1 var(--mono);
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 6px;
  color: var(--fg-subtle);
  background: var(--surface);
}
.skip {
  position: fixed; left: 12px; top: -60px; z-index: 100;
  padding: 10px 14px; border-radius: 10px; background: var(--primary); color: #fff; font-weight: 600;
}
.skip:focus { top: 12px; }

/* ------------------------------------------------------------ header */
.top {
  position: sticky; top: 0; z-index: 40;
  height: var(--top);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.top-inner {
  max-width: 1440px; height: 100%; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; border-radius: 8px; }
.brand img { height: 26px; width: auto; }
[data-theme="light"] .brand img, [data-theme="light"] .logo-invert { filter: invert(1) hue-rotate(180deg); }
.brand-tag {
  font-size: 13px; font-weight: 600; color: var(--fg-muted);
  padding: 3px 9px; border: 1px solid var(--line-strong); border-radius: 999px;
}
.search-btn {
  margin-left: 24px; flex: 1; max-width: 420px;
  display: flex; align-items: center; gap: 10px;
  height: 40px; padding: 0 10px 0 12px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: var(--surface); color: var(--fg-subtle);
  font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.search-btn span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.search-btn:hover { border-color: var(--link); color: var(--fg-muted); }
.top-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.top-links a {
  color: var(--fg-muted); text-decoration: none; font-size: 14px; font-weight: 500;
  padding: 8px 12px; border-radius: 10px;
}
.top-links a:hover { color: var(--fg); background: var(--primary-soft); }
.top-links .top-cta { background: var(--primary); color: #fff; }
.top-links .top-cta:hover { background: var(--primary-strong); color: #fff; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg-muted);
  cursor: pointer;
}
.icon-btn:hover { color: var(--fg); border-color: var(--link); }
.icon-btn .icon { width: 19px; height: 19px; }
.icon-btn .moon { display: none; }
[data-theme="light"] .icon-btn .sun { display: none; }
[data-theme="light"] .icon-btn .moon { display: block; }
.menu-btn, .icon-btn:has(.only-mobile) { display: none; }

/* ------------------------------------------------------------ layout */
.shell {
  max-width: 1440px; margin: 0 auto; padding: 0 20px;
  display: grid; grid-template-columns: 272px minmax(0, 1fr) 232px; gap: 40px;
}
.shell-home { grid-template-columns: minmax(0, 1fr); }
.shell-home .sidebar { display: none; }
.sidebar {
  position: sticky; top: var(--top); align-self: start;
  max-height: calc(100dvh - var(--top)); overflow-y: auto;
  padding: 28px 8px 40px 0;
  scrollbar-width: thin;
}
.nav-group + .nav-group { margin-top: 22px; }
.nav-title {
  display: flex; align-items: center; gap: 8px; margin: 0 0 6px;
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em; text-transform: uppercase; color: var(--fg-faint);
}
.nav-title .icon { width: 16px; height: 16px; }
.sidebar ul { list-style: none; margin: 0; padding: 0 0 0 8px; border-left: 1px solid var(--line); }
.sidebar li a {
  display: block; margin-left: -9px; padding: 6px 12px;
  border-left: 2px solid transparent;
  color: var(--fg-subtle); text-decoration: none; font-size: 14.5px; line-height: 1.4;
}
.sidebar li a:hover { color: var(--fg); border-left-color: var(--line-strong); }
.sidebar li a[aria-current="page"] {
  color: var(--link); font-weight: 600; border-left-color: var(--link);
  background: linear-gradient(90deg, var(--primary-soft), transparent);
}
main { min-width: 0; padding: 32px 0 64px; outline: none; }

/* ------------------------------------------------------------ article */
.doc { max-width: 780px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--fg-faint); }
.crumbs a { color: var(--fg-subtle); text-decoration: none; }
.crumbs a:hover { color: var(--link); }
.doc h1 { margin: 12px 0 10px; font-size: clamp(28px, 4vw, 38px); line-height: 1.15; letter-spacing: -0.025em; }
.lead { margin: 0; font-size: 18px; line-height: 1.6; color: var(--fg-muted); }
.prose { margin-top: 28px; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { position: relative; letter-spacing: -0.015em; line-height: 1.3; }
.prose h2 { margin: 44px 0 14px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 24px; }
.prose h3 { margin: 30px 0 10px; font-size: 19px; }
.prose .anchor {
  position: absolute; left: -24px; padding-right: 6px;
  color: var(--fg-faint); text-decoration: none; opacity: 0; transition: opacity 0.15s;
}
.prose h2 .anchor { top: 22px; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus-visible { opacity: 1; }
.prose p, .prose ul, .prose ol { margin: 0 0 16px; color: var(--fg-muted); }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--fg-faint); }
.prose strong { color: var(--fg); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.prose :not(pre) > code {
  font: 0.88em/1 var(--mono); padding: 3px 6px; border-radius: 6px;
  background: var(--inline-code-bg); color: var(--fg); word-break: break-word;
}
/* numbered steps */
.prose > ol { counter-reset: step; list-style: none; padding-left: 0; }
.prose > ol > li { counter-increment: step; position: relative; padding-left: 44px; margin: 14px 0; }
.prose > ol > li::before {
  content: counter(step);
  position: absolute; left: 0; top: -1px;
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 700; color: var(--link);
  background: var(--primary-soft); border: 1px solid var(--note-line);
}
/* code */
.code { margin: 18px 0 22px; border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; background: var(--code-bg); }
.code figcaption {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 6px 8px 6px 14px; border-bottom: 1px solid rgb(255 255 255 / 0.08);
  font-size: 12.5px; font-weight: 600; color: #a3abb9; background: rgb(255 255 255 / 0.03);
}
.copy {
  font: 600 12.5px/1 var(--font); color: #d1d5db; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; border: 1px solid rgb(255 255 255 / 0.14); background: rgb(255 255 255 / 0.04);
}
.copy:hover { color: #fff; border-color: #60a5fa; }
.copy.done { color: #6ee7b7; border-color: rgb(110 231 183 / 0.5); }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; }
.code code { font: 14px/1.65 var(--mono); color: var(--code-fg); white-space: pre; }
.code pre:focus-visible { outline-offset: -2px; }
/* tables */
.table-wrap { margin: 18px 0 24px; overflow-x: auto; border: 1px solid var(--line-strong); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--fg-muted); }
.prose th { color: var(--fg); background: var(--primary-soft); font-weight: 600; white-space: nowrap; }
.prose tr:last-child td { border-bottom: 0; }
.prose td:first-child { color: var(--fg); font-weight: 500; }
/* callouts */
.callout { margin: 20px 0; padding: 14px 18px; border-radius: var(--radius); border: 1px solid; }
.callout > :last-child { margin-bottom: 0; }
.callout p, .callout li { color: var(--fg-muted); }
.callout-title { margin: 0 0 6px !important; font-weight: 700; font-size: 15px; }
.callout-tip { background: var(--tip-bg); border-color: var(--tip-line); }
.callout-tip .callout-title { color: var(--tip); }
.callout-note { background: var(--note-bg); border-color: var(--note-line); }
.callout-note .callout-title { color: var(--note); }
.callout-warning { background: var(--warn-bg); border-color: var(--warn-line); }
.callout-warning .callout-title { color: var(--warn); }
.ext { font-size: 0.8em; margin-left: 2px; }
/* pager + help */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; }
.pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); text-decoration: none;
  background: var(--surface);
}
.pager a:hover { border-color: var(--link); }
.pager span { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--fg-faint); }
.pager span .icon { width: 14px; height: 14px; }
.pager strong { color: var(--fg); font-weight: 600; }
.pager .next { text-align: right; }
.pager .next span { justify-content: flex-end; }
.help-box {
  margin-top: 40px; padding: 24px; border-radius: 18px;
  border: 1px solid var(--note-line);
  background: linear-gradient(135deg, var(--primary-soft), transparent 70%), var(--surface);
}
.help-box h2 { margin: 0 0 6px; font-size: 20px; }
.help-box p { margin: 0 0 16px; color: var(--fg-muted); }
.help-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--fg); font: 600 14.5px/1.2 var(--font); text-decoration: none; cursor: pointer;
}
.btn:hover { border-color: var(--link); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); border-color: var(--primary-strong); }

/* ------------------------------------------------------------ toc */
.toc { position: sticky; top: var(--top); align-self: start; padding: 32px 0; max-height: calc(100dvh - var(--top)); overflow-y: auto; }
.toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; color: var(--fg-faint); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc a { display: block; margin-left: -1px; padding: 5px 0 5px 14px; border-left: 2px solid transparent; font-size: 13.5px; line-height: 1.4; color: var(--fg-subtle); text-decoration: none; }
.toc .d3 a { padding-left: 26px; font-size: 13px; }
.toc a:hover { color: var(--fg); }
.toc a[aria-current] { color: var(--link); border-left-color: var(--link); }

/* ------------------------------------------------------------ home */
.home { max-width: 1120px; margin: 0 auto; }
.hero {
  position: relative; text-align: center; padding: 56px 20px 48px; margin-bottom: 16px;
  border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  background:
    radial-gradient(ellipse 60% 80% at 50% 0%, rgb(37 99 235 / 0.22), transparent 70%),
    radial-gradient(ellipse 40% 60% at 85% 100%, rgb(34 211 238 / 0.1), transparent 70%),
    var(--surface);
}
.eyebrow { margin: 0 0 12px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
.hero h1 { margin: 0 0 12px; font-size: clamp(30px, 5vw, 48px); line-height: 1.1; letter-spacing: -0.03em; }
.hero .lead { max-width: 640px; margin: 0 auto; }
.hero-search {
  margin: 28px auto 0; width: 100%; max-width: 620px;
  display: flex; align-items: center; gap: 12px; padding: 0 14px 0 18px; height: 58px;
  border-radius: 16px; border: 1px solid var(--line-strong); background: var(--bg);
  color: var(--fg-subtle); font: inherit; font-size: 16px; cursor: pointer; text-align: left;
  box-shadow: var(--shadow);
}
.hero-search span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hero-search:hover { border-color: var(--link); }
.hero-search .icon { width: 20px; height: 20px; color: var(--link); }
.home-h2 { margin: 40px 0 16px; font-size: 22px; letter-spacing: -0.015em; }
.popular { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.popular a {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 16px 18px;
  border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); text-decoration: none;
}
.popular a:hover { border-color: var(--link); }
.popular strong { color: var(--fg); }
.popular span { color: var(--fg-subtle); font-size: 14px; line-height: 1.5; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card { padding: 20px 22px; border: 1px solid var(--line-strong); border-radius: 18px; background: var(--surface); }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-icon { width: 38px; height: 38px; padding: 9px; border-radius: 11px; color: var(--link); background: var(--primary-soft); }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 10px 0 12px; color: var(--fg-subtle); font-size: 14.5px; }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li a { display: block; padding: 5px 0; font-size: 15px; text-decoration: none; }
.card li a:hover { text-decoration: underline; }
.notfound { text-align: center; padding: 80px 0; }
.notfound .big { margin: 0; font-size: 96px; font-weight: 700; letter-spacing: -0.05em; color: var(--link); }
.notfound h1 { margin: 0 0 10px; }
.notfound .help-actions { justify-content: center; margin-top: 24px; }

/* ------------------------------------------------------------ footer */
.foot { border-top: 1px solid var(--line); }
.foot-inner { max-width: 1440px; margin: 0 auto; padding: 22px 20px 30px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 14px; color: var(--fg-faint); }
.foot p { margin: 0; }
.foot a { color: var(--fg-subtle); }

/* ------------------------------------------------------------ search dialog */
.search-dialog { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; background: rgb(3 5 10 / 0.6); backdrop-filter: blur(4px); }
.search-dialog[hidden] { display: none; }
body.search-open { overflow: hidden; }
.search-panel { width: 100%; max-width: 640px; border-radius: 18px; border: 1px solid var(--line-strong); background: var(--raised); box-shadow: var(--shadow); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 12px 0 16px; border-bottom: 1px solid var(--line); }
.search-field .icon { color: var(--link); }
.search-field input { flex: 1; height: 58px; border: 0; background: transparent; color: var(--fg); font: inherit; font-size: 17px; outline: none; }
.search-field input::placeholder { color: var(--fg-faint); }
.search-field input::-webkit-search-cancel-button { display: none; }
.esc { font: 600 12px/1 var(--font); color: var(--fg-subtle); padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 8px; background: transparent; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 8px; max-height: min(60vh, 520px); overflow-y: auto; }
.search-results:empty { display: none; }
.search-results a { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; border-radius: 12px; text-decoration: none; }
.search-results [aria-selected="true"] a { background: var(--primary-soft); outline: 1px solid var(--note-line); }
.sr-section { font-size: 12.5px; color: var(--fg-faint); }
.search-results strong { color: var(--fg); }
.sr-text { font-size: 14px; color: var(--fg-subtle); line-height: 1.5; }
.search-empty { margin: 0; padding: 18px; color: var(--fg-subtle); }
.search-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--fg-faint); }

/* ------------------------------------------------------------ responsive */
@media (max-width: 1180px) {
  .shell { grid-template-columns: 250px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .menu-btn { display: inline-flex; }
  .search-btn { display: none; }
  .icon-btn:has(.only-mobile) { display: inline-flex; margin-left: auto; }
  .top-links { display: none; }
  .top-inner { padding: 0 12px; gap: 8px; }
  .brand-tag { display: none; }
  .sidebar {
    position: fixed; top: var(--top); left: 0; right: 0; height: calc(100dvh - var(--top)); z-index: 30; display: none;
    max-height: none; padding: 20px 20px 40px; background: var(--bg);
  }
  .shell-home .sidebar { display: none; }
  body.menu-open { overflow: hidden; }
  body.menu-open .sidebar { display: block; }
  .sidebar li a { padding: 9px 12px; font-size: 16px; }
  main { padding-top: 22px; }
  .prose .anchor { display: none; }
  .pager { grid-template-columns: 1fr; }
  .hero { padding: 40px 18px 32px; border-radius: 20px; }
  .cards { grid-template-columns: 1fr; }
}
@media print {
  .top, .sidebar, .toc, .pager, .help-box, .foot, .copy { display: none !important; }
  .shell { display: block; }
}

.is-home .menu-btn { display: none !important; }
a.nav-title { text-decoration: none; border-radius: 6px; }
a.nav-title:hover, a.nav-title[aria-current="page"] { color: var(--link); }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { color: var(--link); }
.section-list { margin-top: 28px; grid-template-columns: 1fr; }
