/* Smooth Docs — the "Cheerful Aurora Glass" look of smooth.family, tuned for reading.
   Performance on phones: no backdrop-filter except the sticky top bar fallback, no fixed backgrounds,
   no infinite animations, one static aurora wash painted once. */
:root {
  --bg: #F5FAFF; --bg-2: #EAF2FD; --surface: #FFFFFF; --raised: #F7FAFF;
  --line: #E1E9F6; --line-2: #CCD8EC;
  --ink: #101638; --soft: #536180; --faint: #8A95B0;
  --signal: #287CFA; --signal-ink: #1C5FD0; --signal-wash: rgba(40,124,250,.09);
  --aurora: linear-gradient(100deg, #42B7FF 0%, #B89BFF 38%, #FF91C8 72%, #FFB989 100%);
  --code-bg: #0F1536; --code-ink: #E6ECFF; --code-dim: #8B97C9; --code-line: rgba(170,190,255,.14);
  --tip: #12A76E; --tip-wash: #E9FBF3; --warn: #C26A00; --warn-wash: #FFF4E5; --note: #287CFA; --note-wash: #EEF5FF; --safe: #7C4DFF; --safe-wash: #F3EEFF;
  --shadow: 0 1px 2px rgba(30,50,110,.05), 0 0 0 1px var(--line);
  --shadow-2: 0 18px 40px -26px rgba(40,70,160,.4), 0 0 0 1px var(--line);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --top: 64px; --side: 268px; --toc: 220px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A0F2C; --bg-2: #121A42; --surface: #121A45; --raised: #18214F;
    --line: rgba(170,190,255,.13); --line-2: rgba(170,190,255,.24);
    --ink: #F2F5FF; --soft: #A9B4DA; --faint: #6F7AA6;
    --signal: #6FB2FF; --signal-ink: #8FC3FF; --signal-wash: rgba(111,178,255,.12);
    --code-bg: #070B22; --code-line: rgba(170,190,255,.12);
    --tip: #5FE0B0; --tip-wash: rgba(95,224,176,.08); --warn: #FFB86B; --warn-wash: rgba(255,184,107,.08); --note: #6FB2FF; --note-wash: rgba(111,178,255,.08); --safe: #B89BFF; --safe-wash: rgba(184,155,255,.09);
    --shadow: 0 0 0 1px var(--line); --shadow-2: 0 20px 50px -28px rgba(0,0,0,.7), 0 0 0 1px var(--line);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; color: var(--ink); font: 400 16px/1.7 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  background: var(--bg);
}
/* the aurora wash: painted once at the top of the page, scrolls away with it (no fixed layer to repaint) */
body::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 560px; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 70% at 10% 0%, rgba(66,183,255,.16), transparent 70%), radial-gradient(45% 60% at 92% 0%, rgba(184,155,255,.18), transparent 70%);
}
a { color: var(--signal-ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 8px 14px; background: var(--surface); border-radius: 10px; box-shadow: var(--shadow-2); }
.skip:focus { left: 12px; }
kbd { font: 600 11px/1 var(--mono); padding: 3px 6px; border-radius: 6px; color: var(--soft); background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-2); }

/* ---------- top bar */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--top); display: flex; align-items: center; gap: 14px; padding: 0 20px;
  background: var(--bg); border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 17px; letter-spacing: -.02em; flex: none; }
.logo em { font-style: normal; font-weight: 700; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; color: #fff; background: var(--aurora); letter-spacing: 0; }
.search-btn {
  display: flex; align-items: center; gap: 10px; flex: 0 1 300px; margin-left: 18px; height: 38px; padding: 0 10px 0 12px; border: 0; border-radius: 12px; cursor: pointer;
  color: var(--faint); background: var(--surface); box-shadow: var(--shadow); font: 500 14px var(--font); text-align: left;
}
.search-btn span { flex: 1; }
.search-btn:hover { box-shadow: 0 0 0 1px var(--line-2); color: var(--soft); }
.top-links { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.top-links a { white-space: nowrap; color: var(--soft); text-decoration: none; font-weight: 600; font-size: 14px; padding: 7px 10px; border-radius: 10px; display: inline-flex; align-items: center; gap: 6px; }
.top-links a:hover { color: var(--ink); background: var(--signal-wash); }
.lang { font: 700 12.5px var(--font); color: var(--soft); text-decoration: none; padding: 7px 10px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line-2); }
.lang:hover { color: var(--ink); }
.btn-cta {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border-radius: 999px; flex: none;
  color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; white-space: nowrap;
  background: linear-gradient(180deg, #4A93FF 0%, #287CFA 55%, #1C68E3 100%); box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 1px 2px rgba(0,0,0,.18);
}
.btn-cta:hover { text-decoration: none; filter: brightness(1.05); }
.icon-btn { display: none; width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer; align-items: center; justify-content: center; }
.icon-btn:hover { background: var(--signal-wash); }

/* ---------- three columns */
.shell { display: grid; grid-template-columns: var(--side) minmax(0, 1fr) var(--toc); gap: 40px; max-width: 1400px; margin: 0 auto; padding: 0 24px; }
.side { position: sticky; isolation: isolate; top: var(--top); align-self: start; height: calc(100vh - var(--top)); height: calc(100dvh - var(--top)); overflow-y: auto; overscroll-behavior: contain; padding: 22px 6px 40px 0; scrollbar-width: thin; }
.side-group + .side-group { margin-top: 18px; }
.side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.side-title .i3d { width: 22px; height: 22px; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 6px 12px; margin: 1px 0; border-radius: 10px; color: var(--soft); text-decoration: none; font-size: 14.5px; font-weight: 550; line-height: 1.4; }
.side a:hover { color: var(--ink); background: var(--signal-wash); }
.side a[aria-current="page"] { color: var(--signal-ink); background: var(--signal-wash); font-weight: 700; box-shadow: inset 2px 0 0 var(--signal); }

.content { min-width: 0; padding: 28px 0 60px; }
.toc { position: sticky; top: var(--top); align-self: start; max-height: calc(100vh - var(--top)); overflow-y: auto; padding: 30px 0 30px; font-size: 13.5px; scrollbar-width: thin; }
.toc-title { margin: 0 0 8px; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 4px 0 4px 12px; margin-left: -1px; color: var(--soft); text-decoration: none; line-height: 1.4; border-left: 2px solid transparent; }
.toc li.l3 a { padding-left: 24px; font-size: 13px; }
.toc li a:hover { color: var(--ink); }
.toc li a.on { color: var(--signal-ink); border-left-color: var(--signal); font-weight: 650; }
.toc-top { display: inline-block; margin-top: 14px; color: var(--faint); text-decoration: none; font-size: 13px; }

/* ---------- article */
.crumbs { margin: 0 0 18px; font-size: 13.5px; color: var(--faint); display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { color: var(--faint); text-decoration: none; }
.crumbs a:hover { color: var(--signal-ink); }
.doc { max-width: 780px; }
.page-head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.page-head .i3d { width: 72px; height: 72px; flex: none; margin-top: 2px; }
.doc h1 { margin: 0; font-size: clamp(30px, 4.2vw, 42px); line-height: 1.12; letter-spacing: -.035em; font-weight: 800; }
.lede { margin: 12px 0 0; font-size: 18.5px; line-height: 1.6; color: var(--soft); }
.doc h2 { margin: 48px 0 12px; font-size: 26px; line-height: 1.25; letter-spacing: -.025em; font-weight: 800; padding-top: 6px; }
.doc h3 { margin: 32px 0 8px; font-size: 19.5px; line-height: 1.35; letter-spacing: -.015em; font-weight: 750; }
.doc h4 { margin: 24px 0 6px; font-size: 16.5px; font-weight: 750; }
.doc h2, .doc h3, .doc h4 { position: relative; }
.anchor { position: absolute; left: -22px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 600; }
.doc h2:hover .anchor, .doc h3:hover .anchor { opacity: 1; }
.doc p, .doc li { color: color-mix(in srgb, var(--ink) 88%, var(--soft)); }
.doc p { margin: 0 0 16px; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 22px; }
.doc li { margin: 6px 0; padding-left: 4px; }
.doc li::marker { color: var(--signal); }
.doc strong { color: var(--ink); font-weight: 750; }
.doc :not(pre) > code { font: 500 .88em/1 var(--mono); padding: .2em .45em; border-radius: 7px; background: var(--signal-wash); color: var(--ink); overflow-wrap: anywhere; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.ext { font-size: .8em; margin-left: 2px; }
blockquote { margin: 0 0 18px; padding: 4px 0 4px 18px; border-left: 3px solid var(--line-2); color: var(--soft); }

/* code */
.code { margin: 0 0 20px; border-radius: 16px; overflow: hidden; background: var(--code-bg); box-shadow: 0 0 0 1px var(--code-line); }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 7px 8px 7px 16px; border-bottom: 1px solid var(--code-line); }
.code-lang, .code-title { font: 600 12px var(--mono); color: var(--code-dim); text-transform: lowercase; }
.code-title { text-transform: none; }
.copy { border: 0; cursor: pointer; font: 600 12px var(--font); color: var(--code-dim); background: rgba(255,255,255,.06); padding: 5px 10px; border-radius: 8px; }
.copy:hover { color: #fff; background: rgba(255,255,255,.12); }
.copy.done { color: #7CFFC4; }
.code pre { margin: 0; padding: 14px 16px 16px; overflow-x: auto; font: 450 13.8px/1.65 var(--mono); color: var(--code-ink); tab-size: 2; scrollbar-width: thin; }
.code .c { color: var(--code-dim); font-style: italic; }

/* tables */
.table { margin: 0 0 22px; overflow-x: auto; border-radius: 16px; box-shadow: var(--shadow); background: var(--surface); -webkit-overflow-scrolling: touch; }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.table th, .table td { padding: 11px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table thead th { font-size: 12.5px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: var(--soft); background: var(--raised); white-space: nowrap; }
.table tbody th { font-weight: 700; color: var(--ink); min-width: 130px; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table td.center, .table th.center { text-align: center; }
.table td.right, .table th.right { text-align: right; }

/* callouts */
.callout { display: flex; gap: 12px; margin: 0 0 20px; padding: 14px 16px; border-radius: 16px; background: var(--note-wash); box-shadow: inset 3px 0 0 var(--note); }
.callout > div:last-child > :last-child { margin-bottom: 0; }
.callout-ic { flex: none; font-size: 17px; line-height: 1.6; }
.callout-title { font-weight: 750; margin-bottom: 4px !important; color: var(--ink) !important; }
.callout.tip { background: var(--tip-wash); box-shadow: inset 3px 0 0 var(--tip); }
.callout.warn { background: var(--warn-wash); box-shadow: inset 3px 0 0 var(--warn); }
.callout.safe { background: var(--safe-wash); box-shadow: inset 3px 0 0 var(--safe); }

/* cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 4px 0 24px; }
.card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 20px; text-decoration: none; color: var(--ink); background: var(--surface); box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s; }
.card:hover { text-decoration: none; box-shadow: var(--shadow-2); transform: translateY(-2px); }
.card .i3d { width: 52px; height: 52px; flex: none; }
.card span { display: grid; gap: 2px; min-width: 0; }
.card b { font-size: 15.5px; font-weight: 750; }
.card small { color: var(--soft); font-size: 13.5px; line-height: 1.45; }
.card i { margin-left: auto; font-style: normal; color: var(--faint); transition: transform .2s; }
.card:hover i { transform: translateX(3px); color: var(--signal); }

/* steps */
.steps { list-style: none; counter-reset: step; padding: 0 !important; margin: 8px 0 24px; }
.steps > li { counter-increment: step; position: relative; padding: 0 0 8px 50px !important; margin: 0 !important; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font: 800 14px var(--font); color: #fff; background: var(--aurora);
}
.steps > li::after { content: ""; position: absolute; left: 15.5px; top: 38px; bottom: 6px; width: 1px; background: var(--line-2); }
.steps > li:last-child::after { display: none; }
.step-title { margin: 3px 0 8px !important; font-size: 17.5px !important; }

/* verdict (compare pages) */
.verdict { margin: 0 0 26px; padding: 20px 22px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.verdict::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--aurora); }
.verdict-title { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint) !important; margin-bottom: 6px !important; }
.verdict > :last-child { margin-bottom: 0; }

/* plans */
.plan-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 6px 0 24px; }
.plan { padding: 18px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow); display: grid; align-content: start; gap: 6px; }
.plan.featured { box-shadow: 0 0 0 2px #B89BFF, 0 20px 40px -26px rgba(124,92,255,.45); }
.plan h3 { margin: 0 !important; font-size: 17px !important; }
.plan .price { margin: 0 !important; font-size: 28px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); line-height: 1.2; }
.plan .price s { font-size: 16px; color: var(--faint); font-weight: 600; }
.plan .tag { font-size: 13.5px; color: var(--soft) !important; margin: 0 !important; line-height: 1.45; }
.plan ul { padding-left: 18px !important; margin: 6px 0 0 !important; font-size: 13.5px; }
.plan li { margin: 4px 0 !important; line-height: 1.45; }

.updated { margin-top: 40px !important; font-size: 13.5px; color: var(--faint) !important; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 780px; margin-top: 28px; }
.pager a { display: grid; gap: 2px; padding: 14px 16px; border-radius: 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); background: var(--surface); }
.pager a:hover { box-shadow: 0 0 0 1px var(--signal); }
.pager small { color: var(--faint); font-size: 12.5px; font-weight: 600; }
.pager b { font-size: 15px; }
.pager .next { text-align: right; }
.doc-foot { max-width: 780px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13.5px; color: var(--faint); }
.doc-foot a { color: var(--faint); }
.notfound { text-align: center; margin: 40px auto; }
.notfound img { margin: 0 auto 10px; }

/* ---------- search */
.search { position: fixed; inset: 0; z-index: 60; background: rgba(10,15,44,.42); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search[hidden] { display: none; }
.search-box { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); box-shadow: 0 30px 80px -20px rgba(10,15,44,.55), 0 0 0 1px var(--line); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--line); color: var(--faint); }
.search-field input { flex: 1; min-width: 0; height: 56px; border: 0; outline: 0; background: transparent; color: var(--ink); font: 500 17px var(--font); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-hits { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.search-hits:empty { display: none; }
.search-hits a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; text-decoration: none; color: var(--ink); }
.search-hits a small { color: var(--faint); font-size: 12.5px; font-weight: 650; }
.search-hits a span { color: var(--soft); font-size: 13.5px; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-hits a mark { background: rgba(255,214,0,.35); color: inherit; border-radius: 3px; }
.search-hits a.on, .search-hits a:hover { background: var(--signal-wash); }
.search-hits .empty { padding: 18px; color: var(--faint); text-align: center; }

/* ---------- responsive */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--side) minmax(0, 1fr); }
  .toc { display: none; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .top-links a:not(.gh) { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 58px; }
  .top { padding: 0 10px 0 6px; gap: 6px; }
  .icon-btn { display: inline-flex; }
  .search-btn { margin-left: auto; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; box-shadow: none; color: var(--ink); }
  .search-btn span, .search-btn kbd { display: none; }
  .top-links { margin-left: 0; }
  .top-links .gh span { display: none; }
  .btn-cta { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); padding: 0 16px; gap: 0; }
  .side {
    position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: min(310px, 86vw); height: auto; padding: 18px 12px 40px;
    background: var(--bg); box-shadow: 20px 0 60px -20px rgba(10,15,44,.45); transform: translateX(-105%); transition: transform .25s cubic-bezier(.2,.8,.2,1); visibility: hidden;
  }
  .side.open { transform: none; visibility: visible; }
  .scrim { position: fixed; inset: 0; z-index: 45; background: rgba(10,15,44,.4); }
  .content { padding-top: 18px; }
  .anchor { display: none; }
  .cards, .pager { grid-template-columns: 1fr; }
  .pager .next { text-align: left; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .page-head { flex-direction: column; gap: 10px; }
  .page-head .i3d { width: 56px; height: 56px; }
  .lede { font-size: 17px; }
  .doc h2 { font-size: 23px; margin-top: 40px; }
  .plan-grid { grid-template-columns: 1fr; }
  .logo span { display: none; }
  .search { padding-top: 12px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
