/* ============================================================
   SeeUsPlay Docs — Stripe/Linear-style minimal
   ============================================================ */

:root {
  --bg: #F5F5F5;
  --surface: #FFFFFF;
  --surface-2: #EFEFEF;
  --surface-3: #E5E5E5;
  --text: #1A1A1A;
  --text-muted: #5A5A5A;
  --text-faint: #909090;
  --border: #E2E2E2;
  --border-strong: #CECECE;
  --accent: oklch(0.66 0.18 45);          /* SeeUsPlay orange */
  --accent-hover: oklch(0.60 0.19 45);
  --accent-faint: oklch(0.96 0.04 45);
  --accent-border: oklch(0.85 0.10 45);
  --accent-2: oklch(0.78 0.18 155);       /* SeeUsPlay mint green */
  --topbar-bg: #0A0A0A;
  --topbar-text: #FFFFFF;
  --topbar-muted: #B8B8B8;
  --topbar-border: #1F1F1F;
  --code-bg: #F0F0F0;
  --code-text: #1A1A1A;
  --kbd-bg: #FFFFFF;
  --kbd-border: #CECECE;
  --callout-info-bg: oklch(0.97 0.03 45);
  --callout-info-border: oklch(0.85 0.12 45);
  --callout-warn-bg: oklch(0.97 0.04 65);
  --callout-warn-border: oklch(0.82 0.14 65);
  --callout-tip-bg: oklch(0.97 0.04 155);
  --callout-tip-border: oklch(0.82 0.12 155);
  --shadow-sm: 0 1px 2px rgba(15, 15, 15, 0.04);
  --shadow-md: 0 4px 14px rgba(15, 15, 15, 0.06), 0 1px 3px rgba(15, 15, 15, 0.04);
  --shadow-lg: 0 24px 60px rgba(15, 15, 15, 0.12), 0 6px 16px rgba(15, 15, 15, 0.06);

  --topbar-h: 56px;
  --sidebar-w: 272px;
  --toc-w: 220px;
  --content-max: 740px;

  --font-sans: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-2: #1B1B1B;
  --surface-3: #242424;
  --text: #F4F4F4;
  --text-muted: #A8A8A8;
  --text-faint: #6E6E6E;
  --border: #232323;
  --border-strong: #333333;
  --accent: oklch(0.74 0.18 50);
  --accent-hover: oklch(0.80 0.18 50);
  --accent-faint: oklch(0.28 0.10 50);
  --accent-border: oklch(0.45 0.14 50);
  --accent-2: oklch(0.80 0.18 155);
  --topbar-bg: #050505;
  --topbar-text: #FFFFFF;
  --topbar-muted: #A0A0A0;
  --topbar-border: #1A1A1A;
  --code-bg: #1A1A1A;
  --code-text: #E4E4E4;
  --kbd-bg: #1E1E1E;
  --kbd-border: #303030;
  --callout-info-bg: oklch(0.24 0.06 50);
  --callout-info-border: oklch(0.45 0.12 50);
  --callout-warn-bg: oklch(0.24 0.06 65);
  --callout-warn-border: oklch(0.45 0.12 65);
  --callout-tip-bg: oklch(0.24 0.06 155);
  --callout-tip-border: oklch(0.45 0.12 155);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 14px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6), 0 6px 16px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

html {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body { background: var(--bg); color: var(--text); }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 2px; }

::selection { background: var(--accent-faint); color: var(--text); }

/* ============================================================
   Top bar
   ============================================================ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 0 20px 0 0;
  background: var(--topbar-bg);
  color: var(--topbar-text);
  border-bottom: 1px solid var(--topbar-border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 20px 0 22px;
  color: var(--topbar-text);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.brand:hover { text-decoration: none; color: var(--topbar-text); }
.brand-logo {
  height: 26px;
  width: auto;
  display: block;
  flex-shrink: 0;
}
.brand-sub  {
  color: var(--topbar-muted);
  font-weight: 400;
  font-size: 13px;
  padding-left: 12px;
  border-left: 1px solid rgba(255,255,255,0.15);
  letter-spacing: 0.01em;
}

.search-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: 460px;
  height: 36px;
  padding: 0 10px 0 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 8px;
  color: var(--topbar-muted);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.search-trigger:hover { border-color: rgba(255,255,255,0.20); background: rgba(255,255,255,0.10); color: #fff; }
.search-trigger svg { width: 16px; height: 16px; opacity: .8; flex-shrink: 0; }
.search-trigger .search-trigger-label { flex: 1; text-align: left; }
.search-trigger kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--topbar-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--topbar-muted);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.icon-btn:hover { background: rgba(255,255,255,0.08); color: #fff; }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .moon { display: none; }
[data-theme="dark"] .icon-btn .sun { display: none; }
[data-theme="dark"] .icon-btn .moon { display: inline; }

.ext-link {
  font-size: 13px;
  color: var(--topbar-muted);
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.ext-link:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
.ext-link.store {
  background: var(--accent-2);
  color: #06180D;
  font-weight: 600;
  padding: 7px 14px;
}
.ext-link.store:hover { background: oklch(0.84 0.18 155); color: #06180D; }

.mobile-menu { display: none; }

/* ============================================================
   Layout
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: calc(100vh - var(--topbar-h));
}

/* ============================================================
   Sidebar
   ============================================================ */
.sidebar {
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 28px 20px 60px 24px;
  background: var(--bg);
}
.sidebar-section {
  margin-bottom: 28px;
}
.sidebar-section-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 10px 8px;
}
.sidebar-group {
  margin-bottom: 18px;
}
.sidebar-group-title {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px 8px;
  letter-spacing: -0.005em;
}
.sidebar nav ul { list-style: none; padding: 0; margin: 0; }
.sidebar nav li { margin: 0; }
.sidebar nav a {
  display: block;
  padding: 5px 8px;
  font-size: 13.5px;
  color: var(--text-muted);
  border-radius: 6px;
  line-height: 1.45;
  text-decoration: none;
  border-left: 2px solid transparent;
  margin-left: 0;
}
.sidebar nav a:hover { color: var(--text); background: var(--surface-2); }
.sidebar nav a.active {
  color: var(--accent);
  background: var(--accent-faint);
  font-weight: 600;
}
[data-theme="dark"] .sidebar nav a.active {
  color: var(--accent);
  background: var(--accent-faint);
}

/* ============================================================
   Content
   ============================================================ */
.content {
  display: flex;
  justify-content: center;
  padding: 0 48px 80px;
}
.content-inner {
  width: 100%;
  max-width: var(--content-max);
  padding-top: 36px;
  position: relative;
}

/* On-page TOC right rail */
.with-toc .content-inner { display: grid; grid-template-columns: 1fr; }
@media (min-width: 1280px) {
  .with-toc .content-inner {
    grid-template-columns: 1fr var(--toc-w);
    gap: 56px;
    max-width: calc(var(--content-max) + var(--toc-w) + 56px);
  }
  .with-toc .article { min-width: 0; }
  .with-toc .toc { display: block; }
}
.toc {
  display: none;
  position: sticky;
  top: calc(var(--topbar-h) + 36px);
  align-self: start;
  font-size: 13px;
  max-height: calc(100vh - var(--topbar-h) - 60px);
  overflow-y: auto;
}
.toc-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin: 0 0 10px;
}
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a {
  display: block;
  padding: 4px 12px;
  margin-left: -1px;
  border-left: 1px solid transparent;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
}
.toc a:hover { color: var(--text); }
.toc a.active { color: var(--accent); border-left-color: var(--accent); }
.toc .toc-h3 { padding-left: 24px; font-size: 12.5px; }

/* ============================================================
   Article styling
   ============================================================ */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.breadcrumbs a, .breadcrumbs .current { white-space: nowrap; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--text); text-decoration: none; }
.breadcrumbs .sep { color: var(--text-faint); }
.breadcrumbs .current { color: var(--text); }

.article {
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--text);
}
.article > *:first-child { margin-top: 0; }
.article .page-header {
  margin-bottom: 36px;
}
.article .page-header h1 {
  font-size: 40px;
  line-height: 1.08;
  letter-spacing: -0.028em;
  font-weight: 600;
  margin: 0 0 14px;
  color: var(--text);
}
.article .page-header .lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
  font-weight: 400;
  max-width: 560px;
}
.article h1 {
  font-size: 36px;
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text);
}
.article h1.section-divider {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 64px 0 4px;
  padding: 0;
  border: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
.article h1.section-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}
.article > h1.section-divider:first-of-type { margin-top: 32px; }
.article .lede {
  font-size: 17px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0 0 36px;
  font-weight: 400;
}
.article h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 600;
  margin: 48px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article > h2:first-of-type { border-top: none; padding-top: 0; margin-top: 32px; }
.article h3 {
  font-size: 18px;
  line-height: 1.35;
  letter-spacing: -0.012em;
  font-weight: 600;
  margin: 36px 0 12px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 28px 0 8px;
  scroll-margin-top: calc(var(--topbar-h) + 16px);
}
.article h2, .article h3, .article h4 { position: relative; }
.heading-anchor {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  opacity: 0;
  transition: opacity .15s, color .15s;
  text-decoration: none;
  border-radius: 4px;
}
.heading-anchor:hover { color: var(--accent); background: var(--surface-2); text-decoration: none; }
.article h2:hover .heading-anchor,
.article h3:hover .heading-anchor,
.article h4:hover .heading-anchor { opacity: 1; }
.heading-anchor.copied { opacity: 1; color: var(--accent); }
.heading-anchor svg { width: 14px; height: 14px; }

.article p { margin: 12px 0; }
.article strong { font-weight: 600; color: var(--text); }
.article ul, .article ol { padding-left: 24px; margin: 12px 0; }
.article li { margin: 6px 0; }
.article li > p { margin: 4px 0; }

.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

.article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
/* Left-align all images, even when width hint is set */
.article img[width="300"], .article img[width="400"] {
  margin: 20px 0;
}

.article code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--border);
}

.article pre {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  overflow-x: auto;
  margin: 16px 0;
}
.article pre code { background: none; border: none; padding: 0; color: var(--code-text); }

/* Tables */
.article table {
  width: -moz-fit-content;
  width: fit-content;
  max-width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  margin-right: auto;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}
.article thead { background: var(--surface-2); }
.article th, .article td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
}
.article th:last-child, .article td:last-child { border-right: none; }
.article tbody tr:last-child td { border-bottom: none; }
.article th { font-weight: 600; color: var(--text); font-size: 13px; }

/* Images inside table cells: don't get an extra block-margin treatment */
.article td img, .article th img {
  margin: 0;
  display: inline-block;
  border: none;
  border-radius: 4px;
  background: transparent;
}
/* Center any image that sits alone in its table cell — keeps the small
   Hero10/9 product shots visually aligned with the larger Hero11/12/13 shots. */
.article td:has(> img:only-child) {
  text-align: center;
}

/* Blockquote -> callouts (parser converts known prefixes) */
.article blockquote {
  margin: 16px 0;
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.6;
}
.article blockquote p { margin: 6px 0; }
.article blockquote p:first-child { margin-top: 0; }
.article blockquote p:last-child  { margin-bottom: 0; }
.article blockquote ul, .article blockquote ol { margin: 6px 0; padding-left: 22px; }

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid;
  display: flex;
  gap: 12px;
  font-size: 14.5px;
  line-height: 1.55;
}
.callout-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}
.callout-body { flex: 1; min-width: 0; }
.callout-body > *:first-child { margin-top: 0; }
.callout-body > *:last-child { margin-bottom: 0; }
.callout-label {
  font-weight: 600;
  letter-spacing: -0.005em;
  display: block;
  margin-bottom: 2px;
}
.callout.info     { background: var(--callout-info-bg);  border-color: var(--callout-info-border); }
.callout.info .callout-icon, .callout.info .callout-label { color: oklch(0.50 0.18 260); }
.callout.warning  { background: var(--callout-warn-bg);  border-color: var(--callout-warn-border); }
.callout.warning .callout-icon, .callout.warning .callout-label { color: oklch(0.50 0.18 60); }
.callout.tip      { background: var(--callout-tip-bg);   border-color: var(--callout-tip-border); }
.callout.tip .callout-icon, .callout.tip .callout-label { color: oklch(0.45 0.15 155); }
[data-theme="dark"] .callout.info .callout-icon, [data-theme="dark"] .callout.info .callout-label { color: oklch(0.80 0.15 260); }
[data-theme="dark"] .callout.warning .callout-icon, [data-theme="dark"] .callout.warning .callout-label { color: oklch(0.80 0.15 60); }
[data-theme="dark"] .callout.tip .callout-icon, [data-theme="dark"] .callout.tip .callout-label { color: oklch(0.78 0.14 155); }

/* Prev/Next nav */
.prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.prev-next a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s;
  background: var(--surface);
}
.prev-next a:hover { border-color: var(--accent-border); background: var(--surface-2); text-decoration: none; }
.prev-next .pn-label {
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  align-items: center;
  gap: 4px;
}
.prev-next .pn-title { font-weight: 600; font-size: 14.5px; }
.prev-next .pn-next { text-align: right; align-items: flex-end; }
.prev-next .pn-next .pn-label { justify-content: flex-end; }
.prev-next .empty { visibility: hidden; }

/* ============================================================
   Home page
   ============================================================ */
.home {
  max-width: 980px;
  margin: 0 auto;
  padding: 64px 24px 80px;
}
.hero {
  text-align: left;
  padding: 24px 0 48px;
}
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 20px;
}
.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: oklch(0.65 0.18 145);
}
.hero h1 {
  font-size: 56px;
  line-height: 1.05;
  letter-spacing: -0.03em;
  font-weight: 600;
  margin: 0 0 16px;
  max-width: 720px;
}
.hero p.lede {
  font-size: 20px;
  line-height: 1.45;
  color: var(--text-muted);
  margin: 0 0 32px;
  max-width: 620px;
}
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14.5px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s, color .15s;
  border: 1px solid transparent;
}
.btn-primary { background: var(--text); color: var(--bg); }
.btn-primary:hover { background: color-mix(in srgb, var(--text) 88%, transparent); color: var(--bg); text-decoration: none; }
.btn-secondary { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--border-strong); background: var(--surface-2); color: var(--text); text-decoration: none; }
.btn svg { width: 16px; height: 16px; }

/* Home cards */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
@media (max-width: 1100px) {
  .guide-cards { grid-template-columns: 1fr 1fr; }
}
.guide-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.guide-card:hover {
  border-color: var(--accent-border);
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-md);
}
.guide-card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  margin-bottom: 16px;
}
.guide-card-icon svg { width: 20px; height: 20px; }
.guide-card-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.012em; }
.guide-card-desc { font-size: 14.5px; color: var(--text-muted); margin: 0 0 18px; line-height: 1.5; flex: 1; }
.guide-card-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.guide-card-chips span {
  font-size: 12px;
  color: var(--text-muted);
  padding: 3px 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.guide-card-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
}
.guide-card-cta svg { width: 14px; height: 14px; transition: transform .2s; }
.guide-card:hover .guide-card-cta svg { transform: translateX(3px); }

/* Quick links */
.section-eyebrow {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 64px 0 16px;
}
.quick-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.quick-link {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color .15s, background .15s;
}
.quick-link:hover { border-color: var(--accent-border); background: var(--surface-2); text-decoration: none; color: var(--text); }
.quick-link-mark {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-faint);
  padding-top: 2px;
  flex-shrink: 0;
  width: 24px;
}
.quick-link-body { flex: 1; min-width: 0; }
.quick-link-title { font-size: 14.5px; font-weight: 500; margin: 0; }
.quick-link-meta { font-size: 12px; color: var(--text-muted); margin: 2px 0 0; }

.home-footer {
  margin-top: 80px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
}
.home-footer a { color: var(--text-muted); }
.home-footer a:hover { color: var(--text); }

/* ============================================================
   Search modal
   ============================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 88px;
}
.search-modal[hidden] { display: none; }
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
[data-theme="dark"] .search-backdrop { background: rgba(0, 0, 0, 0.62); }
.search-box {
  position: relative;
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 160px);
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.search-input-row svg { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }
.search-input-row input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  padding: 4px 0;
}
.search-input-row input::placeholder { color: var(--text-faint); }
.search-input-row kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-faint);
}

.search-results {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}
.search-empty, .search-hint {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-faint);
  font-size: 14px;
}
.search-group {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.search-result {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
.search-result:hover, .search-result.active {
  background: var(--accent-faint);
  text-decoration: none;
  color: var(--text);
}
[data-theme="dark"] .search-result:hover, [data-theme="dark"] .search-result.active { background: var(--surface-2); }
.search-result-title {
  font-size: 14.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}
.search-result-crumbs {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}
.search-result-crumbs .sep { color: var(--text-faint); }
.search-result-snippet {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-result mark {
  background: oklch(0.92 0.10 90);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}
[data-theme="dark"] .search-result mark { background: oklch(0.50 0.15 90); color: var(--text); }

.search-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 11.5px;
  color: var(--text-faint);
}
.search-footer .keys { display: flex; gap: 12px; }
.search-footer kbd {
  font-family: var(--font-mono);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 3px;
}

/* ============================================================
   Toast
   ============================================================ */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--text);
  color: var(--bg);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 200;
  box-shadow: var(--shadow-md);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   Loading state
   ============================================================ */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--text-faint);
  font-size: 14px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 960px) {
  :root { --sidebar-w: 240px; }
  .content { padding: 0 28px 60px; }
  .hero h1 { font-size: 42px; }
  .guide-cards { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
    padding: 0 14px;
    gap: 10px;
  }
  .brand { padding: 0; }
  .brand-sub { display: none; }
  .search-trigger { max-width: none; height: 34px; }
  .search-trigger kbd, .search-trigger .search-trigger-label { display: none; }
  .search-trigger { justify-content: center; padding: 0 10px; }
  .ext-link { display: none; }
  .mobile-menu { display: inline-flex; }

  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--topbar-h));
    background: var(--bg);
    z-index: 25;
    transform: translateX(-100%);
    transition: transform .25s ease;
    border-right: 1px solid var(--border);
  }
  body.menu-open .sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
  body.menu-open::after {
    content: "";
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.35);
    z-index: 20;
  }
  .content { padding: 0 20px 50px; }
  .article h1 { font-size: 30px; }
  .hero h1 { font-size: 36px; }
  .hero p.lede { font-size: 17px; }
  .quick-links { grid-template-columns: 1fr; }
  .prev-next { grid-template-columns: 1fr; }
  .home { padding: 32px 20px 60px; }
  .search-modal { padding-top: 60px; }
  .search-box { max-width: calc(100vw - 24px); margin: 0 12px; }
}
