/* ============================================================
   Binder Docs — styles.css
   Professional documentation layout
   ============================================================ */

/* --- Design tokens --- */
:root {
  --ember: #ff4500;
  --ember-light: rgba(255, 69, 0, 0.07);
  --ember-mid: rgba(255, 69, 0, 0.14);
  --brown: #402220;
  --cream: #fffaf5;
  --sidebar-bg: #f7f3ef;
  --paper: #ffffff;
  --hover: rgba(64, 34, 32, 0.05);
  --active: rgba(255, 69, 0, 0.08);
  --ink: #402220;
  --ink-soft: rgba(64, 34, 32, 0.68);
  --ink-muted: rgba(64, 34, 32, 0.48);
  --ink-faint: rgba(64, 34, 32, 0.32);
  --line: rgba(64, 34, 32, 0.09);
  --line-mid: rgba(64, 34, 32, 0.14);
  --shadow-sm: 0 1px 3px rgba(64, 34, 32, 0.06), 0 4px 12px rgba(64, 34, 32, 0.03);
  --shadow-md: 0 4px 16px rgba(64, 34, 32, 0.08), 0 1px 4px rgba(64, 34, 32, 0.05);
  --shadow-lg: 0 24px 64px rgba(64, 34, 32, 0.16), 0 4px 16px rgba(64, 34, 32, 0.08);
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: Fraunces, Georgia, serif;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --sidebar-w: 256px;
  --toc-w: 216px;
  --topbar-h: 54px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: inherit; }
[hidden] { display: none !important; }
button { cursor: pointer; font: inherit; border: 0; padding: 0; background: none; }
figure { margin: 0; }

/* ============================================================
   LAYOUT
   ============================================================ */

.docs-app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */

.docs-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--line-mid) transparent;
  z-index: 100;
}

/* Brand */
.docs-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 1rem 1rem 0.875rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.docs-brand:hover { opacity: 0.75; }
.brand-logo-img {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.docs-brand strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.docs-brand em {
  display: block;
  font-style: normal;
  color: var(--ink-muted);
  font-size: 0.7rem;
  line-height: 1.3;
  margin-top: 0.05rem;
}

/* Search trigger button */
.sidebar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0.75rem 0;
  padding: 0.4375rem 0.625rem;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.65);
  color: var(--ink-muted);
  text-align: left;
  font-size: 0.8125rem;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  width: calc(100% - 1.5rem);
}
.sidebar-search-btn:hover {
  border-color: rgba(255, 69, 0, 0.4);
  background: #fff;
  color: var(--ink-soft);
}
.sidebar-search-btn svg { flex-shrink: 0; }
.sidebar-search-btn span { flex: 1; }
.sidebar-search-btn kbd {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  background: var(--paper);
  color: var(--ink-faint);
  font-family: inherit;
  font-size: 0.6875rem;
  line-height: 1.5;
  flex-shrink: 0;
}

/* Nav */
.sidebar-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  padding: 0.5rem 0.625rem;
  overflow-y: auto;
}
.sidebar-label {
  padding: 0.75rem 0.375rem 0.25rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  transition: background 0.1s ease, color 0.1s ease;
  position: relative;
  flex-shrink: 0;
}
.sidebar-link:hover {
  background: var(--hover);
  color: var(--ink);
}
.sidebar-link.active {
  background: var(--active);
  color: var(--brown);
  font-weight: 600;
}
.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 25%;
  bottom: 25%;
  width: 2.5px;
  background: var(--ember);
  border-radius: 0 2px 2px 0;
}
.sidebar-link span:first-child {
  width: 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  flex-shrink: 0;
  line-height: 1;
}

/* Footer */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}
.open-binder {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--brown);
  color: var(--cream);
  text-align: center;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: opacity 0.15s ease;
}
.open-binder:hover { opacity: 0.82; }

/* ============================================================
   TOPBAR
   ============================================================ */

.docs-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: var(--topbar-h);
  padding: 0 1.5rem;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  flex-shrink: 0;
}
.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
  flex-shrink: 0;
  transition: background 0.1s ease, color 0.1s ease;
}
.mobile-menu-btn:hover { background: var(--hover); color: var(--ink); }
.breadcrumbs {
  flex: 1;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.breadcrumbs a {
  color: var(--ink-muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumb-sep { margin: 0 0.35rem; opacity: 0.5; }
.mobile-menu-note { display: none; }

/* Topbar search trigger (small) */
.topbar-search-btn {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.3125rem 0.5rem;
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-muted);
  font-size: 0.8125rem;
  transition: border-color 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}
.topbar-search-btn:hover { border-color: var(--ember); color: var(--ink); }
.topbar-search-btn kbd {
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--ink-faint);
}

/* ============================================================
   TABLE OF CONTENTS (right panel, injected by JS)
   ============================================================ */

/* When TOC is present, docs-content becomes a grid */
.docs-content.has-toc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--toc-w);
  align-items: start;
}
.docs-content.has-toc .docs-topbar {
  grid-column: 1 / -1;
}

.docs-toc {
  padding: 1.5rem 1rem 2rem 1.25rem;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  scrollbar-width: thin;
  border-left: 1px solid var(--line);
  align-self: start;
}
.toc-label {
  margin: 0 0 0.5rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.docs-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.docs-toc li { margin: 0; }
.toc-link {
  display: block;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  border-left: 2px solid transparent;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 0.8125rem;
  line-height: 1.45;
  transition: color 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}
.toc-link:hover { color: var(--ink); background: var(--hover); }
.toc-link.active {
  color: var(--ember);
  border-left-color: var(--ember);
  background: var(--ember-light);
}

/* ============================================================
   PAGE CONTENT
   ============================================================ */

.docs-page {
  max-width: 740px;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 5rem;
}
/* Center the page when there's no TOC */
.docs-content:not(.has-toc) .docs-page {
  margin: 0 auto;
}

/* ============================================================
   TYPOGRAPHY
   ============================================================ */

.kicker {
  margin: 0 0 0.5rem;
  color: var(--ember);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
h1 {
  margin: 0;
  color: var(--brown);
  font-family: var(--display);
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.035em;
}
h2 {
  margin: 0;
  color: var(--brown);
  font-size: 1.3125rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
}
h3 {
  margin: 0 0 0.375rem;
  color: var(--brown);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
p { margin: 0; }
.lede, .wide-text, .help-subtitle {
  margin: 0.875rem 0 0;
  color: var(--ink-soft);
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
  line-height: 1.75;
  max-width: 46rem;
}
ul {
  margin: 0.625rem 0 0;
  padding-left: 1.125rem;
}
li {
  color: var(--ink-soft);
  margin-bottom: 0.2rem;
  line-height: 1.65;
}

/* Hero sections */
.hero, .page-hero, .help-hero {
  padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.75rem, 4vw, 2.75rem);
  border-bottom: 1px solid var(--line);
}

/* Content sections */
.section, .help-section {
  padding: clamp(1.75rem, 4vw, 3rem) 0;
  border-bottom: 1px solid var(--line);
}
.section:last-child, .help-section:last-child { border-bottom: 0; }
.section h2, .help-section h2 { margin-bottom: 0.5rem; }
.section > p, .help-section > p,
.section > .wide-text, .help-section > .wide-text {
  margin-top: 0.625rem;
  color: var(--ink-soft);
}
.section-heading-row { margin-bottom: 1rem; }

/* ============================================================
   CARDS & GRIDS
   ============================================================ */

.steps, .card-grid, .method-grid, .shot-grid, .category-grid {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.25rem;
}
.steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.two, .method-grid, .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Card base (articles inside grids) */
.card-grid > article,
.method-grid > article,
.steps > article {
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.card-grid > article h3,
.method-grid > article h3,
.steps > article h3 {
  margin-bottom: 0.375rem;
}
.card-grid > article p,
.method-grid > article p,
.steps > article p {
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* Step numbers */
.steps > article { position: relative; }
.steps span {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  margin-bottom: 0.625rem;
  border-radius: 50%;
  background: var(--ember-light);
  color: var(--ember);
  font-size: 0.8125rem;
  font-weight: 800;
}

/* Method icons */
.method-grid > article { padding-top: 1.125rem; }
.method-grid span {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.625rem;
  border-radius: 8px;
  background: var(--ember-light);
  font-size: 1.05rem;
}

/* Category cards */
.category-card {
  display: block;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--brown);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
}
.category-card:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 69, 0, 0.28);
  box-shadow: 0 6px 20px rgba(255, 69, 0, 0.07), var(--shadow-sm);
}
.category-icon {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.625rem;
  border-radius: 8px;
  background: var(--ember-light);
  font-size: 1.05rem;
}
.category-card strong { display: block; margin-bottom: 0.25rem; font-size: 0.9375rem; font-weight: 600; }
.category-card p { margin: 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.6; }
.category-card em {
  display: block;
  margin-top: 0.625rem;
  color: var(--ink-muted);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 600;
}

/* Article list */
.article-list {
  display: grid;
  gap: 0.625rem;
  margin-top: 1rem;
}
.article-list a {
  display: block;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--brown);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.12s ease;
}
.article-list a:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 69, 0, 0.28);
}
.article-list a > span {  /* category tag */
  display: inline-block;
  margin-bottom: 0.3rem;
  padding: 0.125rem 0.4rem;
  border-radius: 4px;
  background: var(--ember-light);
  color: var(--ember);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}
.article-list a strong { display: block; margin-bottom: 0.2rem; font-size: 0.9375rem; font-weight: 600; }
.article-list a p { margin: 0; color: var(--ink-soft); font-size: 0.875rem; line-height: 1.6; }

/* Two-column layout */
.two-column-help {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 1.5rem;
  align-items: start;
}
.support-card {
  position: sticky;
  top: calc(var(--topbar-h) + 1rem);
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.support-card img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
  margin-bottom: 0.75rem;
}
.support-card h3 { margin-bottom: 0.375rem; }
.support-card p { color: var(--ink-soft); font-size: 0.875rem; line-height: 1.65; }
.support-card a { color: var(--ember); font-weight: 600; text-decoration: none; }
.support-card a:hover { text-decoration: underline; }

/* Method strip */
.method-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.125rem;
}
.method-strip a {
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--line-mid);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: border-color 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.method-strip a:hover {
  border-color: rgba(255, 69, 0, 0.35);
  color: var(--brown);
  background: var(--ember-light);
}

/* Callout (dark inverted block) */
.callout {
  background: var(--brown);
  color: var(--cream);
  border-radius: var(--radius-lg);
}
/* When callout is a section itself */
section.callout {
  padding: 1.5rem;
  border: none;
  border-bottom: 0;
  border-radius: 0;
  margin: 0;
}
section.callout:last-child { border-bottom: 0; }
/* When callout is a div inside a section */
.section > .callout, .help-section > .callout {
  padding: 1.25rem 1.375rem;
  border: 1px solid rgba(64, 34, 32, 0.2);
  box-shadow: var(--shadow-sm);
}
.callout h2 { color: var(--cream); margin-bottom: 0.5rem; font-size: 1.0625rem; }
.callout p {
  color: rgba(255, 250, 245, 0.78);
  font-size: 0.9375rem;
  line-height: 1.7;
  max-width: none;
}

/* Checklist */
.checklist {
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding: 1rem 1.125rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
}
.checklist label {
  display: flex;
  gap: 0.625rem;
  align-items: flex-start;
  color: var(--ink-soft);
  line-height: 1.55;
  font-size: 0.9rem;
}
.checklist input { margin-top: 0.25rem; accent-color: var(--ember); flex-shrink: 0; }

/* Screenshot grid */
.shot-grid figure {
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}
.shot-grid img {
  width: 100%;
  display: block;
  border-radius: var(--radius-md);
}
figcaption {
  padding: 0.625rem 0.125rem 0;
  color: var(--ink-muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Empty / misc */
.empty-state { color: var(--ink-soft); padding: 0.5rem 0; }

/* Buttons */
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; margin-top: 1.5rem; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
.button:hover { opacity: 0.88; transform: translateY(-1px); }
.primary { background: var(--ember); color: #fff; box-shadow: 0 4px 16px rgba(255, 69, 0, 0.22); }
.secondary { background: var(--paper); color: var(--brown); border: 1px solid var(--line-mid); }

/* ============================================================
   PREV / NEXT NAVIGATION (injected by JS)
   ============================================================ */

.docs-page-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}
.page-nav-link {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.page-nav-link:hover {
  border-color: rgba(255, 69, 0, 0.3);
  background: var(--ember-light);
}
.page-nav-link.next { text-align: right; }
.page-nav-dir {
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.page-nav-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ember);
}

/* ============================================================
   SEARCH MODAL (injected by JS)
   ============================================================ */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(3rem, 12vh, 6rem);
}
.search-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(32, 20, 18, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.search-dialog {
  position: relative;
  width: min(620px, calc(100vw - 2rem));
  max-height: calc(100vh - 8rem);
  background: var(--paper);
  border: 1px solid var(--line-mid);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: searchIn 0.15s ease;
}
@keyframes searchIn {
  from { opacity: 0; transform: scale(0.97) translateY(-8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.search-input-row {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0 1rem;
  border-bottom: 1px solid var(--line);
  height: 3.25rem;
  flex-shrink: 0;
}
.search-icon { color: var(--ink-muted); flex-shrink: 0; }
.search-modal-input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.search-modal-input::placeholder { color: var(--ink-faint); }
.search-esc {
  padding: 0.2rem 0.45rem;
  border: 1px solid var(--line-mid);
  border-radius: 4px;
  background: var(--sidebar-bg);
  color: var(--ink-muted);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.1s ease;
}
.search-esc:hover { background: var(--hover); }

.search-results-wrap {
  overflow-y: auto;
  max-height: calc(100vh - 18rem);
}
.search-section-label {
  padding: 0.5rem 1rem 0.25rem;
  color: var(--ink-faint);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.search-results {
  padding: 0.25rem 0.375rem 0.375rem;
}
.search-result {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: var(--radius-md);
  color: var(--ink);
  text-decoration: none;
  transition: background 0.1s ease;
}
.search-result:hover, .search-result.selected {
  background: var(--ember-light);
}
.search-result.selected .search-result-title { color: var(--ember); }
.search-result-icon {
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 6px;
  background: var(--sidebar-bg);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.search-result-body { flex: 1; min-width: 0; }
.search-result-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--brown);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-result-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
  font-weight: 500;
  margin-bottom: 0.2rem;
}
.search-result-excerpt {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-empty {
  padding: 2rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.search-footer {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  padding: 0.5625rem 0.875rem;
  border-top: 1px solid var(--line);
  background: var(--sidebar-bg);
  flex-shrink: 0;
}
.search-footer span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}
.search-footer kbd {
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line-mid);
  border-radius: 3px;
  background: var(--paper);
  font-family: inherit;
  font-size: 0.7rem;
  color: var(--ink-muted);
}

/* ============================================================
   MOBILE SIDEBAR DRAWER
   ============================================================ */

.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32, 20, 18, 0.38);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.sidebar-backdrop.visible { display: block; }
body.sidebar-open { overflow: hidden; }
body.search-open { overflow: hidden; }

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Hide TOC on medium screens */
@media (max-width: 1260px) {
  .docs-content.has-toc {
    grid-template-columns: minmax(0, 1fr);
  }
  .docs-content.has-toc .docs-toc { display: none; }
  .docs-content.has-toc .docs-topbar { grid-column: 1; }
}

/* Mobile: sidebar becomes an off-canvas drawer */
@media (max-width: 980px) {
  .docs-app { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: none;
  }
  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }
  .mobile-menu-btn { display: flex; }
  .two-column-help { grid-template-columns: 1fr; }
  .support-card { position: static; }
  .steps, .card-grid.two, .card-grid.three, .method-grid, .category-grid, .shot-grid {
    grid-template-columns: 1fr;
  }
  .docs-topbar { padding: 0 1rem; }
}

@media (max-width: 640px) {
  :root { --topbar-h: 50px; }
  .docs-page { padding-left: 1.125rem; padding-right: 1.125rem; }
  h1 { font-size: clamp(1.875rem, 11vw, 2.625rem); }
  .docs-page-nav { grid-template-columns: 1fr; }
  .two-column-help { grid-template-columns: 1fr; }
  .search-footer { gap: 0.75rem; }
}
