/* Tenant Administrator User Guide — Multi-Tenant AI Assistant Portal
   Offline stylesheet: no web fonts, no external requests. */

:root {
  --brand: #0f766e;
  --brand-strong: #0b5f58;
  --brand-soft: #e6f4f2;
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --bg-3: #f1f5f9;
  --side-bg: #0b1220;
  --side-ink: #cbd5e1;
  --side-ink-2: #94a3b8;
  --side-active: #13223a;
  --info: #2563eb;       --info-bg: #eff6ff;    --info-line: #bfdbfe;
  --warn: #b45309;       --warn-bg: #fffbeb;    --warn-line: #fde68a;
  --tip: #7c3aed;        --tip-bg: #f5f3ff;     --tip-line: #ddd6fe;
  --best: #047857;       --best-bg: #ecfdf5;    --best-line: #a7f3d0;
  --danger: #b91c1c;     --danger-bg: #fef2f2;  --danger-line: #fecaca;
  --shadow: 0 1px 2px rgb(15 23 42 / 6%), 0 4px 16px rgb(15 23 42 / 6%);
  --radius: 12px;
  --side-w: 290px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #2dd4bf; --brand-strong: #5eead4; --brand-soft: #0d2b29;
    --ink: #e2e8f0; --ink-2: #cbd5e1; --ink-3: #94a3b8;
    --line: #1e293b; --line-2: #334155;
    --bg: #0b1220; --bg-2: #0f172a; --bg-3: #111c30;
    --side-bg: #070d18; --side-active: #13223a;
    --info: #93c5fd; --info-bg: #0c1a33; --info-line: #1e3a8a;
    --warn: #fcd34d; --warn-bg: #2a1f06; --warn-line: #78350f;
    --tip: #c4b5fd; --tip-bg: #1d1535; --tip-line: #4c1d95;
    --best: #6ee7b7; --best-bg: #062a1f; --best-line: #065f46;
    --danger: #fca5a5; --danger-bg: #2a0d0d; --danger-line: #7f1d1d;
    --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #2dd4bf; --brand-strong: #5eead4; --brand-soft: #0d2b29;
  --ink: #e2e8f0; --ink-2: #cbd5e1; --ink-3: #94a3b8;
  --line: #1e293b; --line-2: #334155;
  --bg: #0b1220; --bg-2: #0f172a; --bg-3: #111c30;
  --side-bg: #070d18; --side-active: #13223a;
  --info: #93c5fd; --info-bg: #0c1a33; --info-line: #1e3a8a;
  --warn: #fcd34d; --warn-bg: #2a1f06; --warn-line: #78350f;
  --tip: #c4b5fd; --tip-bg: #1d1535; --tip-line: #4c1d95;
  --best: #6ee7b7; --best-bg: #062a1f; --best-line: #065f46;
  --danger: #fca5a5; --danger-bg: #2a0d0d; --danger-line: #7f1d1d;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 4px 16px rgb(0 0 0 / 30%);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--font); overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
kbd {
  font: 600 0.82em var(--mono); background: var(--bg-3); border: 1px solid var(--line-2);
  border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px;
}
code { font: 0.9em var(--mono); background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
/* Labels wrap rather than run off a small phone (a 320px screen scrolled sideways
   on "Copy instructions for your web developer"); `clone` keeps each wrapped
   line looking like a label. */
.ui { font-weight: 600; color: var(--ink); background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; padding: 0 6px; overflow-wrap: anywhere; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ---------- layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--side-w); background: var(--side-bg);
  color: var(--side-ink); display: flex; flex-direction: column; z-index: 40;
  border-right: 1px solid #0f1b30;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 20px 20px 14px; text-decoration: none; color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #14b8a6, #0f766e); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 18%);
}
.brand-text { line-height: 1.25; }
.brand-text strong { display: block; font-size: 14px; color: #fff; }
.brand-text span { font-size: 12px; color: var(--side-ink-2); }
.search-wrap { padding: 4px 16px 12px; position: relative; }
.search {
  width: 100%; background: #111a2b; border: 1px solid #1f2b40; color: #e2e8f0; border-radius: 10px;
  padding: 9px 12px 9px 36px; font: 14px var(--font);
}
.search::placeholder { color: #7c8aa3; }
.search-icon { position: absolute; left: 28px; top: 14px; color: #7c8aa3; pointer-events: none; }
.search-results {
  position: absolute; left: 16px; right: 16px; top: 52px; background: var(--bg); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); max-height: 60vh;
  overflow: auto; z-index: 60; display: none; padding: 6px;
}
.search-results.open { display: block; }
.search-results a { display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); }
.search-results a:hover, .search-results a.active { background: var(--brand-soft); }
.search-results .r-title { font-weight: 600; font-size: 14px; }
.search-results .r-path { font-size: 12px; color: var(--ink-3); }
.search-results .r-snip { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.search-results mark { background: color-mix(in srgb, var(--brand) 25%, transparent); color: inherit; border-radius: 3px; }
.search-empty { padding: 10px; font-size: 13px; color: var(--ink-3); }

.nav { overflow-y: auto; padding: 4px 10px 24px; flex: 1; scrollbar-width: thin; }
.nav-group { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #6b7a93; padding: 14px 10px 6px; }
.nav a {
  display: flex; gap: 10px; align-items: baseline; color: var(--side-ink); text-decoration: none;
  padding: 6px 10px; border-radius: 8px; font-size: 14px; line-height: 1.35;
}
.nav a .num { color: #6b7a93; font-variant-numeric: tabular-nums; font-size: 12px; min-width: 18px; }
.nav a:hover { background: #111c2f; color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #2dd4bf; }
.nav .sub { margin: 2px 0 6px 28px; border-left: 1px solid #1c283d; padding-left: 8px; display: none; }
.nav .sub a { font-size: 13px; padding: 4px 8px; color: var(--side-ink-2); }
.nav li.open > .sub { display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; }
.side-foot { padding: 12px 20px 16px; border-top: 1px solid #16223a; font-size: 12px; color: #6b7a93; display: flex; justify-content: space-between; align-items: center; }
.theme-btn {
  background: #111a2b; border: 1px solid #1f2b40; color: var(--side-ink); border-radius: 8px;
  padding: 5px 10px; font: 12px var(--font); cursor: pointer;
}

.topbar {
  position: sticky; top: 0; z-index: 30; display: none; align-items: center; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.menu-btn { background: var(--bg-3); border: 1px solid var(--line); color: var(--ink); border-radius: 8px; padding: 7px 12px; min-height: 44px; font: 600 14px var(--font); cursor: pointer; }
.topbar-title { font-weight: 600; font-size: 15px; }

.main { margin-left: var(--side-w); min-width: 0; }
.content { max-width: 920px; margin: 0 auto; padding: 32px 40px 80px; }
.progress { position: fixed; top: 0; left: var(--side-w); right: 0; height: 3px; z-index: 50; background: transparent; }
.progress span { display: block; height: 100%; width: 0; background: var(--brand); transition: width 0.1s linear; }

/* ---------- cover ---------- */
.cover {
  position: relative; overflow: hidden; border-radius: 20px; padding: 56px 48px 44px; margin: 8px 0 48px;
  color: #ecfeff; background:
    radial-gradient(900px 300px at 90% -20%, rgb(45 212 191 / 35%), transparent 60%),
    radial-gradient(700px 300px at -10% 120%, rgb(59 130 246 / 25%), transparent 60%),
    linear-gradient(135deg, #0b1220 0%, #0f2a33 55%, #0f766e 130%);
  box-shadow: var(--shadow);
}
.cover::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgb(255 255 255 / 5%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 5%) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: linear-gradient(180deg, #000, transparent 85%);
}
.cover > * { position: relative; z-index: 1; }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: #99f6e4; font-weight: 700; }
.cover h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 12px 0 10px; letter-spacing: -0.02em; color: #fff; }
.cover .subtitle { font-size: clamp(18px, 2.4vw, 22px); color: #ccfbf1; margin: 0 0 24px; }
.cover-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 5px 12px; border-radius: 999px; background: rgb(255 255 255 / 10%); border: 1px solid rgb(255 255 255 / 18%); color: #e0f2f1; }
.cover-shot { margin-top: 8px; border-radius: 14px; overflow: hidden; border: 1px solid rgb(255 255 255 / 18%); box-shadow: 0 20px 60px rgb(0 0 0 / 45%); }
.cover-shot img { display: block; width: 100%; }
.cover-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 28px; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-primary { background: #14b8a6; color: #042f2e; }
.btn-primary:hover { background: #2dd4bf; color: #042f2e; }
.btn-ghost { background: rgb(255 255 255 / 8%); color: #ecfeff; border-color: rgb(255 255 255 / 22%); }
.btn-ghost:hover { background: rgb(255 255 255 / 14%); color: #fff; }

/* ---------- sections ---------- */
section.chapter { padding-top: 12px; margin-bottom: 64px; }
.chapter-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.chapter-num {
  flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); font-weight: 800; font-size: 18px;
}
h2 { font-size: clamp(24px, 3vw, 30px); line-height: 1.2; margin: 2px 0 6px; letter-spacing: -0.015em; }
h3 { font-size: 20px; margin: 40px 0 10px; letter-spacing: -0.01em; line-height: 1.3; }
h4 { font-size: 16px; margin: 24px 0 8px; }
.lead { font-size: 17.5px; color: var(--ink-2); margin: 0 0 20px; }
p, li { color: var(--ink-2); }
strong { color: var(--ink); }
.muted { color: var(--ink-3); }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.page-card {
  display: grid; grid-template-columns: 120px 1fr; gap: 6px 16px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 16px 0 20px; font-size: 14.5px;
}
.page-card dt { color: var(--ink-3); font-weight: 600; }
.page-card dd { margin: 0; color: var(--ink); }

/* ---------- screenshots ---------- */
figure.shot { margin: 20px 0 28px; }
figure.shot .frame {
  border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--bg-3);
  box-shadow: var(--shadow); cursor: zoom-in; position: relative;
}
figure.shot .frame::before {
  content: ""; display: block; height: 26px; background: var(--bg-3); border-bottom: 1px solid var(--line);
  background-image: radial-gradient(circle at 16px 13px, #f87171 5px, transparent 6px), radial-gradient(circle at 34px 13px, #fbbf24 5px, transparent 6px), radial-gradient(circle at 52px 13px, #34d399 5px, transparent 6px);
}
figure.shot.bare .frame::before { display: none; }
figure.shot img { display: block; width: 100%; height: auto; }
figure.shot .zoom-hint {
  position: absolute; right: 10px; bottom: 10px; font-size: 12px; background: rgb(15 23 42 / 75%); color: #fff;
  padding: 3px 9px; border-radius: 999px; opacity: 0; transition: opacity 0.15s;
}
figure.shot .frame:hover .zoom-hint, figure.shot .frame:focus-visible .zoom-hint { opacity: 1; }
figure.shot figcaption { font-size: 13.5px; color: var(--ink-3); margin-top: 10px; overflow-wrap: anywhere; }
figure.shot figcaption b { color: var(--ink-2); white-space: nowrap; margin-right: 6px; }
.shot-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.shot-pair figure.shot { margin: 12px 0; }
figure.shot.narrow { max-width: 620px; }

/* ---------- steps ---------- */
ol.steps { list-style: none; counter-reset: step; padding: 0; margin: 14px 0 22px; }
ol.steps > li {
  counter-increment: step; position: relative; padding: 2px 0 14px 48px; margin: 0;
  border-left: 2px solid var(--line); margin-left: 15px; padding-left: 32px;
}
ol.steps > li:last-child { border-left-color: transparent; padding-bottom: 0; }
ol.steps > li::before {
  content: counter(step); position: absolute; left: -16px; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--brand); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 0 0 4px var(--bg);
}
ol.steps > li > strong:first-child { display: block; color: var(--ink); margin-bottom: 2px; }

/* ---------- callouts ---------- */
.callout {
  display: grid; grid-template-columns: 24px 1fr; gap: 12px; border: 1px solid; border-left-width: 4px;
  border-radius: 10px; padding: 14px 16px; margin: 18px 0; font-size: 15px;
}
.callout p { margin: 0; color: var(--ink-2); }
.callout p + p, .callout ul { margin-top: 6px; }
.callout ul { padding-left: 18px; margin-bottom: 0; }
.callout .c-title { font-weight: 700; margin-bottom: 2px; }
.callout svg { width: 22px; height: 22px; }
.callout.info { background: var(--info-bg); border-color: var(--info-line); border-left-color: var(--info); }
.callout.info .c-title, .callout.info svg { color: var(--info); }
.callout.warning { background: var(--warn-bg); border-color: var(--warn-line); border-left-color: var(--warn); }
.callout.warning .c-title, .callout.warning svg { color: var(--warn); }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-line); border-left-color: var(--tip); }
.callout.tip .c-title, .callout.tip svg { color: var(--tip); }
.callout.best { background: var(--best-bg); border-color: var(--best-line); border-left-color: var(--best); }
.callout.best .c-title, .callout.best svg { color: var(--best); }
.callout.danger { background: var(--danger-bg); border-color: var(--danger-line); border-left-color: var(--danger); }
.callout.danger .c-title, .callout.danger svg { color: var(--danger); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 16px 0 24px; border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { background: var(--bg-2); font-size: 12.5px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); font-weight: 700; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 600; color: var(--ink); min-width: 160px; }
td { color: var(--ink-2); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 14px; margin: 16px 0 24px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; background: var(--bg); }
.card h4 { margin: 0 0 4px; font-size: 15.5px; }
.card p { margin: 0; font-size: 14.5px; }
.card .k { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--brand); margin-bottom: 4px; }
.card.link { text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.card.link:hover { border-color: var(--brand); transform: translateY(-1px); }
.icon-dot { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); margin-bottom: 10px; }
.icon-dot svg { width: 18px; height: 18px; }

/* ---------- collapsible ---------- */
details.fold { border: 1px solid var(--line); border-radius: var(--radius); margin: 10px 0; background: var(--bg); }
details.fold > summary {
  list-style: none; cursor: pointer; padding: 14px 44px 14px 18px; font-weight: 650; color: var(--ink); position: relative;
}
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 9px; height: 9px; margin-top: -6px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform 0.15s;
}
details.fold[open] > summary::after { transform: rotate(-135deg); margin-top: -2px; }
details.fold > summary:hover { background: var(--bg-2); border-radius: var(--radius); }
details.fold > .fold-body { padding: 0 18px 16px; border-top: 1px solid var(--line); }
details.fold .tag { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; background: var(--bg-3); color: var(--ink-3); margin-right: 8px; vertical-align: 2px; }
.fold-tools { display: flex; gap: 8px; justify-content: flex-end; margin: 8px 0; }
.link-btn { background: none; border: 1px solid var(--line); color: var(--ink-2); font: 600 13px var(--font); padding: 5px 10px; border-radius: 8px; cursor: pointer; }
.link-btn:hover { border-color: var(--brand); color: var(--brand); }
.trouble h5 { font-size: 13px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-3); margin: 14px 0 4px; }

/* ---------- checklists ---------- */
.checklist { list-style: none; padding: 0; margin: 8px 0 18px; }
.checklist li { margin: 0; }
.checklist label { display: flex; gap: 12px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; cursor: pointer; color: var(--ink-2); }
.checklist label:hover { background: var(--bg-2); }
.checklist input { appearance: none; flex: none; width: 20px; height: 20px; margin-top: 3px; border: 2px solid var(--line-2); border-radius: 6px; display: grid; place-items: center; cursor: pointer; background: var(--bg); }
.checklist input:checked { background: var(--brand); border-color: var(--brand); }
.checklist input:checked::after { content: ""; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.checklist input:checked + span { color: var(--ink-3); text-decoration: line-through; }
.checklist .sub { display: block; font-size: 13px; color: var(--ink-3); }
.check-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 8px 4px; margin: 14px 0; }
.check-card h4 { margin: 10px 12px 2px; display: flex; justify-content: space-between; align-items: center; }
.check-count { font-size: 12px; font-weight: 600; color: var(--ink-3); background: var(--bg-3); padding: 2px 8px; border-radius: 999px; }
.static-check { list-style: none; padding: 0; }
.static-check li { padding: 5px 0 5px 30px; position: relative; }
.static-check li::before { content: "✓"; position: absolute; left: 4px; top: 5px; color: var(--best); font-weight: 800; }

/* ---------- glossary ---------- */
dl.glossary { display: grid; grid-template-columns: 200px 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
dl.glossary dt, dl.glossary dd { margin: 0; padding: 13px 16px; border-bottom: 1px solid var(--line); }
dl.glossary dt { font-weight: 700; background: var(--bg-2); color: var(--ink); }
dl.glossary dd { color: var(--ink-2); }
dl.glossary dt:last-of-type, dl.glossary dd:last-of-type { border-bottom: 0; }

/* ---------- gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin: 16px 0; }
.gallery button {
  all: unset; cursor: zoom-in; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg-2);
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.gallery button:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); }
.gallery img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; display: block; }
.gallery span { font-size: 13px; padding: 8px 10px; color: var(--ink-2); }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgb(2 6 23 / 95%); display: none; z-index: 90; padding: 56px 24px 24px; }
.lightbox.open { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox .lb-stage { max-width: 100%; display: flex; justify-content: center; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); border-radius: 10px; box-shadow: 0 30px 80px rgb(0 0 0 / 60%); background: #fff; }
/* On a phone a whole console screen is too small to read even enlarged, so a
   tap shows it at reading size and lets it be panned. */
.lightbox.zoomed .lb-stage { overflow: auto; width: 100%; max-height: calc(100vh - 140px); justify-content: flex-start; -webkit-overflow-scrolling: touch; }
.lightbox.zoomed img { max-width: none; max-height: none; width: 260%; border-radius: 0; cursor: zoom-out; }
/* While panning a zoomed screenshot the arrows would sit on top of it. */
.lightbox.zoomed .lb-prev, .lightbox.zoomed .lb-next { display: none; }
.lightbox .lb-tip { color: #cbd5e1; font-size: 13px; margin-top: 6px; display: none; }
@media (max-width: 900px) { .lightbox .lb-tip { display: block; } .lightbox img { cursor: zoom-in; } }
.lightbox .lb-cap { color: #e2e8f0; margin-top: 14px; font-size: 14px; text-align: center; max-width: 900px; }
.lightbox .lb-btn { position: absolute; background: rgb(255 255 255 / 10%); color: #fff; border: 1px solid rgb(255 255 255 / 25%); border-radius: 10px; width: 44px; height: 44px; font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.lightbox .lb-close { top: 12px; right: 16px; }
.lightbox .lb-prev { left: 16px; top: 50%; }
.lightbox .lb-next { right: 16px; top: 50%; }

.to-top { position: fixed; right: 20px; bottom: 20px; z-index: 35; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; opacity: 0; pointer-events: none; transition: opacity 0.2s; font-size: 18px; }
.to-top.show { opacity: 1; pointer-events: auto; }
.search-hit { background: color-mix(in srgb, var(--brand) 22%, transparent); border-radius: 4px; transition: background 1.2s; }
footer.doc-foot { border-top: 1px solid var(--line); margin-top: 60px; padding-top: 20px; font-size: 13px; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.backdrop { position: fixed; inset: 0; background: rgb(2 6 23 / 55%); z-index: 39; display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .content { padding: 28px 28px 72px; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.2s ease; visibility: hidden; }
  body.nav-open .sidebar { transform: none; visibility: visible; box-shadow: 0 0 40px rgb(0 0 0 / 40%); }
  body.nav-open .backdrop { display: block; }
  .main { margin-left: 0; }
  .topbar { display: flex; }
  .progress { left: 0; }
  .shot-pair, .grid.two, .grid.three { grid-template-columns: 1fr; }
  .cover { padding: 36px 24px 28px; }
}
@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .content { padding: 20px 16px 64px; }
  .page-card { grid-template-columns: 1fr; gap: 2px; }
  .page-card dd { margin-bottom: 8px; }
  dl.glossary { grid-template-columns: 1fr; }
  dl.glossary dt { border-bottom: 0; padding-bottom: 2px; }
  .chapter-head { gap: 12px; }
  .chapter-num { width: 38px; height: 38px; font-size: 16px; }
  ol.steps > li { padding-left: 26px; }
  td:first-child { min-width: 120px; }
}

/* ---------- print ---------- */
/* People who have asked their device for less motion get none: no smooth
   scrolling, no sliding menu, no fades. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

@media print {
  .sidebar, .topbar, .to-top, .progress, .lightbox, .fold-tools, .backdrop, .cover-actions { display: none !important; }
  .main { margin: 0; }
  .content { max-width: none; padding: 0; }
  details.fold { break-inside: avoid; }
  details.fold > .fold-body { display: block; }
  section.chapter { break-before: page; }
  .cover { break-after: page; color: #000; }
  figure.shot { break-inside: avoid; }
  a { color: inherit; }
}
