/* NEVARO Docs – gemeinsames Stylesheet aller Seiten (Help Center, 2026-10-23).
 *
 * Eine Datei statt eines <style>-Blocks pro Seite: vorher wurde derselbe
 * Block dreifach gepflegt. Erzeugt/kopiert von build_helpcenter_*.py; die
 * Seiten binden sie mit ?v=<hash> ein, damit Cloudflare keine alte Fassung
 * ausliefert.
 *
 * Grundsatz: NEVARO App = benutzen, NEVARO Docs = verstehen – ruhiger als die
 * App, Hierarchie über Typografie und Weißraum, Karten nur für echte Gruppen.
 */

:root {
  --bg: #f6f7f6;
  --surface: #ffffff;
  --surface-2: #f0f2f1;
  --text: #15191c;
  --text-2: #4c575d;
  --muted: #6a767c;
  --border: #e3e7e5;
  --border-strong: #cdd4d1;
  --accent: #0d9268;          /* NEVARO-Grün der bisherigen Doku */
  --accent-strong: #0a7a57;
  --accent-soft: #e5f4ee;
  --accent-ink: #ffffff;
  --info: #2563a8;
  --info-soft: #eaf1fa;
  --warn: #9a5b06;
  --warn-soft: #fdf4e3;
  --warn-border: #f0d9a8;
  --danger: #b8321f;
  --danger-soft: #fcedea;
  --code-bg: #12171b;
  --code-head: #1a2126;
  --code-text: #e1e7e5;
  --code-dim: #8b989e;
  --code-accent: #6ad8ab;
  --focus: #0d9268;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --topbar-h: 60px;
  --sidebar-w: 268px;
  --toc-w: 220px;
  --measure: 46rem;         /* ~736px Lesebreite */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d1013;
    --surface: #14191d;
    --surface-2: #1a2025;
    --text: #e6ebea;
    --text-2: #b4bec1;
    --muted: #8e9a9f;
    --border: #232b31;
    --border-strong: #354047;
    --accent: #34d399;
    --accent-strong: #5ee0ae;
    --accent-soft: #11261f;
    --accent-ink: #06120d;
    --info: #7fb2ec;
    --info-soft: #132030;
    --warn: #e7b062;
    --warn-soft: #251d11;
    --warn-border: #4a3a1c;
    --danger: #f0907e;
    --danger-soft: #2a1715;
    --code-bg: #0a0d10;
    --code-head: #11161a;
    --focus: #34d399;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--topbar-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-strong); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

img { max-width: 100%; height: auto; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.08em 0.36em;
  overflow-wrap: anywhere;
}

kbd {
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 5px;
  color: var(--muted);
  background: var(--surface);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  font-weight: 600;
  text-decoration: none;
}
.skip:focus { top: 10px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------------------------------------------------------------- Topbar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.01em;
  min-height: 44px;
  flex: none;
}
.brand:hover { color: var(--text); }
.brand-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--accent); display: grid; place-items: center; }
img.brand-mark { background: none; object-fit: cover; }
.brand-mark svg { width: 16px; height: 16px; stroke: var(--accent-ink); fill: none; stroke-width: 2.4; stroke-linecap: round; }
.brand-sep { color: var(--border-strong); font-weight: 400; }
.brand-docs { color: var(--muted); font-weight: 500; }

.search-trigger {
  flex: 0 1 420px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface-2);
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  text-align: left;
}
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-2); }
.search-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 4px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  flex: none;
}
.topbar-link:hover { color: var(--accent-strong); }

.icon-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--r-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg.i { width: 22px; height: 22px; }

/* --------------------------------------------------------------- Layout */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  max-width: 1480px;
  margin: 0 auto;
}

.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  height: calc(100dvh - var(--topbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 24px 14px 40px 20px;
  border-right: 1px solid var(--border);
}

.sidebar-head { display: none; }

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-group + .nav-group, .nav-list + .nav-group { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }

.nav-title {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 10px;
  border-radius: var(--r-sm);
  color: var(--text-2);
  font-size: 15px;
  line-height: 1.35;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-list a:hover { background: var(--surface-2); color: var(--text); }
.nav-list a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 600;
  border-left-color: var(--accent);
}

.scrim { display: none; }

.main { min-width: 0; padding: 0 40px; }

.page-grid {
  display: grid;
  grid-template-columns: minmax(0, var(--measure)) var(--toc-w);
  gap: 56px;
  justify-content: center;
}
.page-grid.no-toc { grid-template-columns: minmax(0, var(--measure)); }
.page-grid.wide { grid-template-columns: minmax(0, 60rem); }

.article { padding: 36px 0 24px; min-width: 0; }

/* ------------------------------------------------------- Article header */

.crumbs { margin: 0 0 18px; font-size: 14px; color: var(--muted); }
.article .crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 0; padding: 0; }
.crumbs li { display: inline-flex; align-items: center; gap: 6px; }
.crumbs li + li::before { content: "›"; color: var(--border-strong); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-strong); text-decoration: underline; }
.crumbs [aria-current] { color: var(--text-2); }

.eyebrow {
  display: block;
  margin: 0 0 8px;
  font-size: 12.5px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

h1, h2, h3 { color: var(--text); letter-spacing: -0.015em; line-height: 1.2; }
h1 { font-size: 42px; font-weight: 700; margin: 0; letter-spacing: -0.025em; }
h2 { font-size: 27px; font-weight: 650; margin: 0 0 12px; }
h3 { font-size: 19px; font-weight: 650; margin: 0 0 6px; }

.lede { margin: 14px 0 0; font-size: 19px; line-height: 1.5; color: var(--text-2); max-width: 40rem; }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  font-size: 13px;
  color: var(--muted);
}
.badge b { color: var(--text-2); font-weight: 600; }
.badge.warn { border-color: var(--warn-border); background: var(--warn-soft); color: var(--warn); }
.badge.warn b { color: var(--warn); }

.article-head { margin-bottom: 36px; }

/* -------------------------------------------------------- Article body */

.article section { margin-top: 44px; }
.article section:first-of-type { margin-top: 0; }
.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 1.3em; }
.article li { margin: 4px 0; }
.article li::marker { color: var(--muted); }
.article strong { font-weight: 650; }
.article em { font-style: normal; font-weight: 550; color: var(--text); }
.article > section > :last-child { margin-bottom: 0; }

.step-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.step-head h2 { margin: 0; }
.step-num {
  width: 30px; height: 30px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 15px;
  font-weight: 700;
}

.sub { margin-top: 26px; }
.sub h3 { margin-bottom: 8px; }

/* Definitions (Funktionen, Variablen) – ruhige Liste statt Tabelle. */
.deflist { margin: 0 0 16px; border-top: 1px solid var(--border); }
.deflist > div { padding: 14px 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 4px 20px; }
.deflist dt { font-weight: 600; color: var(--text); }
.deflist dd { margin: 0; color: var(--text-2); }
.deflist.vars dt code { font-size: 0.86em; }

/* Plattform-Schritte (App installieren). */
.platforms { display: grid; gap: 12px; margin: 0 0 18px; }
.platform { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); padding: 18px 20px; }
.platform h3 { display: flex; align-items: center; gap: 10px; }
.platform p:last-child, .platform ol:last-child { margin-bottom: 0; }

/* Voraussetzungen */
.reqs { list-style: none; padding: 0 !important; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: 10px; }
.reqs li { margin: 0 !important; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); font-size: 15px; line-height: 1.45; }
.reqs li svg.i { color: var(--accent); margin-top: 2px; }
.reqs b { display: block; font-weight: 600; color: var(--text); }
.reqs span { color: var(--muted); }

/* -------------------------------------------------------------- Callout */

.callout {
  display: flex;
  gap: 12px;
  margin: 0 0 18px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  background: var(--surface);
  font-size: 15.5px;
  line-height: 1.55;
}
.callout > svg.i { margin-top: 2px; color: var(--accent); }
.callout-body { min-width: 0; }
.callout-body > :last-child { margin-bottom: 0 !important; }
.callout-title { display: block; font-weight: 650; margin-bottom: 2px; color: var(--text); }
.callout.info { border-left-color: var(--info); background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 22%, var(--border)); }
.callout.info > svg.i { color: var(--info); }
.callout.tip { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, var(--border)); }
.callout.warning { border-left-color: var(--warn); background: var(--warn-soft); border-color: var(--warn-border); }
.callout.warning > svg.i { color: var(--warn); }
.callout.error { border-left-color: var(--danger); background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 25%, var(--border)); }
.callout.error > svg.i { color: var(--danger); }
.callout.success > svg.i { color: var(--accent); }

/* ------------------------------------------------------------ Codeblock */

.code {
  margin: 0 0 18px;
  border-radius: var(--r-md);
  background: var(--code-bg);
  border: 1px solid #000;
  overflow: hidden;
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 38px;
  padding: 0 6px 0 14px;
  background: var(--code-head);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: var(--code-dim);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  min-width: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--code-dim);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  position: relative;
}
.copy-btn::after { content: ""; position: absolute; inset: -6px 0; }  /* 44px Trefferfläche */
.copy-btn svg.i { width: 15px; height: 15px; }
.copy-btn:hover { color: var(--code-text); background: rgba(255, 255, 255, 0.07); }
.copy-btn.done { color: var(--code-accent); }
.code pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  font-family: var(--mono);
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--code-text);
  tab-size: 2;
}
.code pre code { all: unset; font: inherit; white-space: pre; }
.code .p { color: var(--code-accent); user-select: none; -webkit-user-select: none; }
.code .c { color: var(--code-dim); }

/* ------------------------------------------------------------ Accordion */

details.acc {
  margin: 0 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
details.acc > summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 600;
  border-radius: var(--r-md);
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary svg.i { margin-left: auto; color: var(--muted); transition: transform 0.15s ease; }
details.acc[open] > summary svg.i { transform: rotate(180deg); }
details.acc > summary:hover { background: var(--surface-2); }
.acc-body { padding: 4px 16px 16px; }
.acc-body > :last-child { margin-bottom: 0; }

/* ------------------------------------------------------------- Figures */

.shot { margin: 0 0 20px; border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { padding: 9px 14px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 14px; margin-bottom: 20px; }
.shots .shot { margin: 0; }

/* -------------------------------------------------------------- Cards */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); gap: 12px; margin: 0 0 8px; }
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); color: var(--text); }
.card-icon { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); margin-bottom: 8px; }
.card-icon svg.i { width: 18px; height: 18px; }
.card-title { font-weight: 650; font-size: 16.5px; }
.card-text { color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.card-cta { margin-top: auto; padding-top: 10px; color: var(--accent-strong); font-size: 14.5px; font-weight: 600; }
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

/* Themenliste (Handbuch-Überblick): Zeilen statt Karten. */
.topics { list-style: none; padding: 0 !important; margin: 0 0 16px; border-top: 1px solid var(--border); }
.topics li { margin: 0 !important; border-bottom: 1px solid var(--border); }
.topics a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 4px; text-decoration: none; color: var(--text); }
.topics a:hover .topic-title { color: var(--accent-strong); }
.topics .card-icon { margin: 0; }
.topic-title { display: block; font-weight: 650; }
.topic-text { display: block; color: var(--muted); font-size: 14.5px; line-height: 1.45; }
.topics .chev { color: var(--muted); }

/* ------------------------------------------------------- Landing (Hero) */

.hero { padding: 64px 0 36px; text-align: center; }
.hero h1 { font-size: 46px; }
.hero .lede { margin: 14px auto 0; }
.hero-search { position: relative; max-width: 620px; margin: 30px auto 0; text-align: left; }
.hero-search label { display: block; }
.hero-search .field { position: relative; }
.hero-search svg.i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; pointer-events: none; }
.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 16px 0 48px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 17px;
  box-shadow: 0 1px 2px rgba(16, 24, 20, 0.04);
}
.hero-search input::placeholder { color: var(--muted); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.hero-search .results-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0; right: 0;
  max-height: min(60vh, 28rem);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(16, 24, 20, 0.12);
}
.hero-search .results-pop:empty { display: none; }

.landing-section { margin-top: 44px; }
.landing-section > h2 { font-size: 13px; font-weight: 650; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }

.quicklinks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); gap: 0 28px; }
.quicklinks li { border-bottom: 1px solid var(--border); }
.quicklinks a { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 48px; padding: 8px 2px; color: var(--text-2); text-decoration: none; font-size: 15.5px; }
.quicklinks a:hover { color: var(--accent-strong); }
.quicklinks small { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.install-strip { margin-top: 44px; padding: 22px 24px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.install-strip h2 { font-size: 20px; margin-bottom: 4px; }
.install-strip p { color: var(--text-2); margin: 0 0 14px; }
.install-strip .code { margin-bottom: 10px; }

/* ------------------------------------------------------ Troubleshooting */

.ts-tools { margin: 0 0 28px; }
.ts-search { position: relative; margin-bottom: 14px; }
.ts-search svg.i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ts-search input {
  width: 100%;
  height: 50px;
  padding: 0 14px 0 44px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.ts-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 14.5px;
  cursor: pointer;
  position: relative;
}
.chip::after { content: ""; position: absolute; inset: -4px 0; }
.chip:hover { border-color: var(--border-strong); }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); color: var(--accent-strong); font-weight: 600; }
.chip .count { color: var(--muted); font-weight: 400; margin-left: 4px; }
.ts-status { margin: 12px 0 0; font-size: 14px; color: var(--muted); min-height: 1.4em; }

.ts-group { margin-top: 36px; }
.ts-group:first-of-type { margin-top: 0; }
.ts-group > h2 { font-size: 22px; }
.ts-list { display: grid; gap: 10px; }
.ts-item { padding: 18px 20px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.ts-item:target { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.ts-item h3 { font-size: 17.5px; margin: 0; }
.ts-item h3 code { font-size: 0.85em; }
.ts-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.ts-cause { margin: 6px 0 0 !important; color: var(--muted); font-size: 15px; }
.ts-fix { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 15.5px; }
.ts-fix-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-strong); margin-bottom: 4px; }
.ts-fix-label svg.i { width: 15px; height: 15px; }
.ts-fix p { margin: 0 0 8px !important; }
.ts-fix > :last-child { margin-bottom: 0 !important; }
.ts-fix .code { margin: 8px 0 0; }
.ts-empty { padding: 28px; text-align: center; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); color: var(--muted); }

/* ------------------------------------------------------- Prev / Next */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); text-decoration: none; color: var(--text); min-width: 0; }
.pager a:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.pager .dir { font-size: 13px; color: var(--muted); }
.pager .ttl { font-weight: 650; color: var(--accent-strong); overflow-wrap: anywhere; }
.pager .next { grid-column: 2; text-align: right; }

/* ---------------------------------------------------------------- TOC */

.toc { padding-top: 40px; }
.toc-inner { position: sticky; top: calc(var(--topbar-h) + 28px); max-height: calc(100vh - var(--topbar-h) - 56px); overflow-y: auto; }
.toc-title { margin: 0 0 10px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.toc a { display: block; padding: 5px 0 5px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); font-size: 14px; line-height: 1.4; text-decoration: none; }
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent-strong); border-left-color: var(--accent); font-weight: 600; }

/* -------------------------------------------------------------- Footer */

.site-footer { margin: 64px 0 0; padding: 32px 0 40px; border-top: 1px solid var(--border); }
.page-grid > .site-footer { grid-column: 1 / -1; }
.site-footer h2 { font-size: 19px; margin: 0 0 4px; }
.site-footer p { margin: 0 0 14px; color: var(--text-2); }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
}
.btn:hover { border-color: var(--accent); color: var(--accent-strong); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-strong); color: var(--accent-ink); }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 26px; font-size: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; min-height: 32px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-meta { margin-top: 10px; font-size: 13px; color: var(--muted); }

/* -------------------------------------------------------------- Search */

.search-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(78vh, 640px);
  margin: 10vh auto auto;
  padding: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 60px rgba(10, 16, 14, 0.22);
  overflow: hidden;
}
.search-dialog[open] { display: flex; flex-direction: column; }
.search-dialog::backdrop { background: rgba(12, 18, 16, 0.38); }
.search-bar { display: flex; align-items: center; gap: 10px; padding: 0 8px 0 16px; border-bottom: 1px solid var(--border); flex: none; }
.search-bar svg.i { color: var(--muted); width: 20px; height: 20px; }
.search-bar input { flex: 1; min-width: 0; height: 58px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 17px; }
.search-bar input:focus { outline: none; }
.search-bar input::-webkit-search-cancel-button { display: none; }
.search-close { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; cursor: pointer; border-radius: var(--r-sm); }
.search-close:hover { background: var(--surface-2); color: var(--text); }
.search-results { overflow-y: auto; overscroll-behavior: contain; padding: 6px; }
.search-foot { flex: none; display: flex; gap: 14px; padding: 9px 16px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }

.sr-list { list-style: none; margin: 0; padding: 0; }
.sr-item a { display: block; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); text-decoration: none; }
.sr-item a:hover, .sr-item a[aria-selected="true"] { background: var(--accent-soft); }
.sr-area { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.03em; color: var(--accent-strong); }
.sr-title { display: block; font-weight: 600; font-size: 15.5px; margin: 1px 0; }
.sr-snip { display: block; font-size: 13.5px; line-height: 1.45; color: var(--muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sr-item mark { background: color-mix(in srgb, var(--accent) 24%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
.sr-note { padding: 18px 14px; color: var(--muted); font-size: 14.5px; }
.sr-heading { padding: 10px 12px 4px; font-size: 11.5px; font-weight: 650; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted); }

/* ---------------------------------------------------------- Responsive */

@media (max-width: 1279px) {
  .page-grid { grid-template-columns: minmax(0, var(--measure)); }
  .toc { display: none; }
  .main { padding: 0 32px; }
}

@media (max-width: 1023px) {
  :root { --topbar-h: 56px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  .icon-btn { display: inline-flex; }
  .topbar { padding: 0 8px; gap: 4px; }
  .brand { margin-right: auto; }
  .search-trigger, .topbar-link { display: none; }

  /* Drawer */
  .sidebar {
    position: fixed;
    z-index: 60;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(320px, 86vw);
    height: auto;
    padding: 0 12px 32px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    transform: translateX(-102%);
    visibility: hidden;
    transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .sidebar[data-open="true"] { transform: none; visibility: visible; transition: transform 0.22s ease; box-shadow: 0 0 40px rgba(0, 0, 0, 0.18); }
  .sidebar-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--topbar-h);
    margin: 0 -12px 12px;
    padding: 0 6px 0 18px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    font-weight: 650;
  }
  .sidebar-head .icon-btn { display: inline-flex; }
  .nav-list a { min-height: 44px; font-size: 16px; }
  .scrim { position: fixed; inset: 0; z-index: 55; background: rgba(12, 18, 16, 0.38); }
  .scrim[data-open="true"] { display: block; }

  .no-js .sidebar { position: static; transform: none; visibility: visible; width: auto; border-right: 0; border-top: 1px solid var(--border); padding: 16px 16px 32px; }
  .no-js .sidebar-head, .no-js .icon-btn { display: none; }

  .main { padding: 0 24px; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .main { padding: 0 16px; }
  .article { padding-top: 22px; }
  h1, .hero h1 { font-size: 33px; }
  h2 { font-size: 24px; }
  h3 { font-size: 18px; }
  .lede { font-size: 17px; }
  .article-head { margin-bottom: 28px; }
  .article section { margin-top: 36px; }
  .hero { padding: 36px 0 20px; text-align: left; }
  .hero .lede { margin-left: 0; }
  .hero-search { margin-top: 22px; }
  .hero-search input { height: 52px; }
  .deflist > div { grid-template-columns: minmax(0, 1fr); }
  .code pre { font-size: 14px; padding: 12px 14px 14px; }
  .pager { gap: 8px; }
  .pager a { padding: 12px; }
  .ts-item { padding: 16px; }
  .install-strip { padding: 18px 16px; }
  .landing-section { margin-top: 36px; }
  .site-footer { margin-top: 48px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .search-dialog { width: 100vw; max-width: 100vw; height: 100%; max-height: 100%; margin: 0; border-radius: 0; border: 0; }
  .search-foot { display: none; }
}

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

@media (prefers-contrast: more) {
  :root { --border: var(--border-strong); --muted: var(--text-2); }
}

@media print {
  .topbar, .sidebar, .toc, .pager, .copy-btn, .site-footer .btn, .scrim { display: none !important; }
  .layout { display: block; }
  .main { padding: 0; }
}
