/* padcode.dev: PadCode's docs. Laid out like docs.flutter.dev (top bar, sidebar, content, "On this page"), in
   PadCode's colours, light and dark. */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f5fc;
  --surface: #ffffff;
  --surface-2: #f3f0fa;
  --text: #1c1530;
  --text-2: #423a58;
  --muted: #635c7a;
  --line: #e7e2f3;
  --line-strong: #d6cfe8;
  --accent: #6d28d9;
  --accent-soft: #f1eafe;
  --accent-text: #5b21b6;
  --pink: #db2777;
  --grad: linear-gradient(90deg, #7c3aed, #db2777);
  --code-bg: #f3f0fa;
  --code-text: #3b2a6b;
  --note-bg: #eef4ff;
  --note-line: #2563eb;
  --note-text: #1e3a8a;
  --tip-bg: #ecfbf1;
  --tip-line: #16a34a;
  --tip-text: #14532d;
  --warn-bg: #fff7eb;
  --warn-line: #d97706;
  --warn-text: #78350f;
  --shadow: 0 1px 2px rgba(28, 21, 48, 0.06), 0 8px 24px rgba(28, 21, 48, 0.06);
  --shadow-lg: 0 24px 64px rgba(28, 21, 48, 0.18);
  --topbar: 64px;
  --sidebar: 288px;
  --toc: 240px;
  --radius: 12px;
  --font: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --display: "Plus Jakarta Sans", var(--font);
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0a14;
    --bg-soft: #110f1c;
    --surface: #15131f;
    --surface-2: #1c1929;
    --text: #f2effa;
    --text-2: #d3cce6;
    --muted: #a8a1bd;
    --line: #262238;
    --line-strong: #353048;
    --accent: #b49bfc;
    --accent-soft: #241c3d;
    --accent-text: #c9b8ff;
    --pink: #f472b6;
    --grad: linear-gradient(90deg, #a78bfa, #f472b6);
    --code-bg: #1d1a2c;
    --code-text: #dccfff;
    --note-bg: #111c33;
    --note-line: #60a5fa;
    --note-text: #c7dcff;
    --tip-bg: #0f241a;
    --tip-line: #4ade80;
    --tip-text: #c3f3d4;
    --warn-bg: #2a1d0b;
    --warn-line: #fbbf24;
    --warn-text: #fde7b8;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0a14;
  --bg-soft: #110f1c;
  --surface: #15131f;
  --surface-2: #1c1929;
  --text: #f2effa;
  --text-2: #d3cce6;
  --muted: #a8a1bd;
  --line: #262238;
  --line-strong: #353048;
  --accent: #b49bfc;
  --accent-soft: #241c3d;
  --accent-text: #c9b8ff;
  --pink: #f472b6;
  --grad: linear-gradient(90deg, #a78bfa, #f472b6);
  --code-bg: #1d1a2c;
  --code-text: #dccfff;
  --note-bg: #111c33;
  --note-line: #60a5fa;
  --note-text: #c7dcff;
  --tip-bg: #0f241a;
  --tip-line: #4ade80;
  --tip-text: #c3f3d4;
  --warn-bg: #2a1d0b;
  --warn-line: #fbbf24;
  --warn-text: #fde7b8;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--topbar) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--font); text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--pink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; height: auto; }
kbd { font: 500 12px/1 var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; padding: 3px 6px; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); color: var(--muted); }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip:focus { top: 12px; }

/* MARK: Top bar */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar); display: flex; align-items: center; gap: 12px; padding: 0 20px;
  background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: 12px; }
.brand img { border-radius: 9px; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06); }
.brand-name { font: 800 20px/1 var(--display); letter-spacing: -0.02em; }
.brand-tag { font: 600 12px/1 var(--font); color: var(--accent-text); background: var(--accent-soft); padding: 5px 8px; border-radius: 999px; }
.topnav { display: flex; gap: 2px; flex: 1; min-width: 0; overflow: hidden; }
.topnav a { color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 15px; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.topnav a:hover { background: var(--surface-2); color: var(--text); }
.topnav a[aria-current="true"] { color: var(--accent-text); background: var(--accent-soft); }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--text-2); cursor: pointer; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.menu-btn { display: none; }
.search-btn { display: flex; align-items: center; gap: 10px; height: 40px; min-width: 220px; padding: 0 10px 0 12px; border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--bg-soft); color: var(--muted); font: 400 15px var(--font); cursor: pointer; margin-left: auto; }
.search-btn span { flex: 1; text-align: left; }
.search-btn:hover { border-color: var(--accent); color: var(--text-2); }
.theme-btn .icon:last-child { display: none; }
:root[data-theme="dark"] .theme-btn .icon:first-child { display: none; }
:root[data-theme="dark"] .theme-btn .icon:last-child { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .icon:first-child { display: none; }
  :root:not([data-theme="light"]) .theme-btn .icon:last-child { display: block; }
}

/* MARK: Shell: sidebar, content, On this page */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr) var(--toc); max-width: 1480px; margin: 0 auto; }
.sidebar { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 20px 12px 40px; border-right: 1px solid var(--line); overscroll-behavior: contain; scrollbar-width: thin; }
.nav-root, .nav-root ul { list-style: none; margin: 0; padding: 0; }
.nav-root summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; border-radius: 8px; user-select: none; }
.nav-root summary::-webkit-details-marker { display: none; }
.group > details > summary { padding: 9px 10px; font-weight: 600; font-size: 15px; color: var(--text); }
.group > details > summary .icon { color: var(--accent); flex: none; }
.group > details > summary span { flex: 1; }
.nav-root summary:hover { background: var(--surface-2); }
.nav-root .chev { color: var(--muted); transition: transform 0.2s ease; flex: none; }
.nav-root details[open] > summary .chev { transform: rotate(90deg); }
.group > details > ul { margin: 2px 0 10px 19px; padding-left: 10px; border-left: 1px solid var(--line); }
.nav-root li a { display: block; padding: 6px 10px; border-radius: 8px; color: var(--text-2); text-decoration: none; font-size: 14.5px; line-height: 1.4; }
.nav-root li a:hover { background: var(--surface-2); color: var(--text); }
.nav-root li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-text); font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.sub > details > summary { padding: 6px 10px; font-size: 14px; font-weight: 600; color: var(--muted); }
.sub > details > ul { margin: 0 0 4px 8px; }
.scrim { display: none; }

.main { min-width: 0; padding: 32px 48px 72px; }
.doc { max-width: 780px; margin: 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.doc h1 { font: 800 clamp(30px, 4vw, 42px)/1.15 var(--display); letter-spacing: -0.03em; margin: 0 0 12px; }
.lede { font-size: 19px; line-height: 1.55; color: var(--text-2); margin: 0 0 28px; }

/* MARK: Content */
.content { font-size: 16.5px; }
.content > :first-child { margin-top: 0; }
.content h2, .content h3, .content h4 { font-family: var(--display); letter-spacing: -0.015em; position: relative; scroll-margin-top: calc(var(--topbar) + 16px); }
.content h2 { font-size: 26px; line-height: 1.25; margin: 48px 0 14px; padding-top: 8px; font-weight: 700; }
.content h3 { font-size: 20px; line-height: 1.3; margin: 32px 0 10px; font-weight: 700; }
.content h4 { font-size: 17px; margin: 24px 0 8px; font-weight: 700; }
.content .anchor { position: absolute; left: -1.1em; width: 1em; text-align: center; color: var(--muted); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.content h2:hover .anchor, .content h3:hover .anchor, .content h4:hover .anchor, .content .anchor:focus { opacity: 1; }
.content p { margin: 0 0 16px; color: var(--text); }
.content ul, .content ol { margin: 0 0 18px; padding-left: 26px; }
.content li { margin: 6px 0; }
.content li > ul, .content li > ol { margin: 6px 0; }
.content li::marker { color: var(--muted); }
.content ol > li::marker { color: var(--accent-text); font-weight: 600; }
.content strong { font-weight: 600; color: var(--text); }
.content code { font: 500 0.88em/1.4 var(--mono); font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; background: var(--code-bg); color: var(--code-text); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.content blockquote { margin: 0 0 18px; padding: 4px 18px; border-left: 3px solid var(--line-strong); color: var(--text-2); }

.table-wrap { overflow-x: auto; margin: 0 0 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.content table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.5; }
.content th { text-align: left; font-weight: 600; background: var(--bg-soft); color: var(--text); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.content td { padding: 11px 14px; border-top: 1px solid var(--line); vertical-align: top; color: var(--text-2); }
.content tr:first-child td { border-top: 0; }
.content td:first-child { color: var(--text); min-width: 8.5em; }
.content td a { font-weight: 500; }

.badge { display: inline-block; font: 700 11.5px/1 var(--font); letter-spacing: 0.06em; text-transform: uppercase; padding: 5px 8px; border-radius: 999px; white-space: nowrap; }
.badge-pro { color: #fff; background: var(--grad); }
.badge-free { color: var(--tip-line); background: var(--tip-bg); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tip-line) 35%, transparent); }

figure { margin: 8px 0 28px; }
figure .zoom { display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); cursor: zoom-in; box-shadow: var(--shadow); }
figure img { display: block; width: 100%; }
figcaption { font-size: 14px; color: var(--muted); margin-top: 10px; line-height: 1.5; text-align: center; padding: 0 12px; }

.callout { margin: 0 0 22px; padding: 14px 18px 4px; border-radius: var(--radius); border-left: 4px solid; }
.callout-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.callout-body > :last-child { margin-bottom: 10px; }
.callout-body p { color: inherit; }
.callout-note { background: var(--note-bg); border-color: var(--note-line); color: var(--note-text); }
.callout-note .callout-title { color: var(--note-line); }
.callout-tip { background: var(--tip-bg); border-color: var(--tip-line); color: var(--tip-text); }
.callout-tip .callout-title { color: var(--tip-line); }
.callout-important, .callout-warning, .callout-caution { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn-text); }
.callout-important .callout-title, .callout-warning .callout-title, .callout-caution .callout-title { color: var(--warn-line); }
.callout code { background: color-mix(in srgb, currentColor 10%, transparent); color: inherit; }
.callout a { color: inherit; font-weight: 600; }

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.pager a { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color 0.2s, box-shadow 0.2s; }
.pager a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.pager-title { font-weight: 600; color: var(--accent-text); }

.toc-col { position: sticky; top: var(--topbar); height: calc(100vh - var(--topbar)); overflow-y: auto; padding: 36px 20px 40px 8px; }
.toc-title { font: 700 13px/1 var(--font); text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 12px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted); text-decoration: none; font-size: 14px; line-height: 1.4; }
.toc li.l3 a { padding-left: 24px; font-size: 13.5px; }
.toc li a:hover { color: var(--text); }
.toc li a.active { color: var(--accent-text); border-left-color: var(--accent); font-weight: 600; }

/* MARK: Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--text); font: 600 15.5px var(--font); text-decoration: none; cursor: pointer; transition: transform 0.15s, box-shadow 0.2s, border-color 0.2s; }
.btn:hover { border-color: var(--accent); color: var(--text); box-shadow: var(--shadow); }
.btn-primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 8px 24px rgba(124, 58, 237, 0.32); }
.btn-primary:hover { color: #fff; transform: translateY(-1px); }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* MARK: Home */
.main-home { padding: 0; }
.hero { max-width: 1280px; margin: 0 auto; padding: 64px 32px 40px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 56px; align-items: center; }
.hero-icon { border-radius: 22px; box-shadow: 0 18px 44px rgba(124, 58, 237, 0.35); margin-bottom: 22px; }
.hero h1 { font: 800 clamp(40px, 5.4vw, 64px)/1.04 var(--display); letter-spacing: -0.035em; margin: 0 0 18px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-style: italic; padding-right: 0.08em; }
.hero-sub { font-size: 19px; line-height: 1.6; color: var(--text-2); margin: 0 0 26px; max-width: 34em; }
.hero-search { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 520px; height: 56px; padding: 0 16px; margin-bottom: 20px; border: 1px solid var(--line-strong);
  border-radius: 14px; background: var(--surface); color: var(--muted); font: 400 17px var(--font); cursor: pointer; box-shadow: var(--shadow); }
.hero-search span { flex: 1; text-align: left; }
.hero-search:hover { border-color: var(--accent); }
.hero-shot { margin: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow-lg); background: #0b0a14; }
.hero-shot img { display: block; }
.start, .cards-section { max-width: 1280px; margin: 0 auto; padding: 24px 32px; }
.start h2, .cards-section h2 { font: 700 28px/1.2 var(--display); letter-spacing: -0.02em; margin: 0 0 20px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.steps a { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; padding: 20px; border-radius: 16px; background: var(--bg-soft); border: 1px solid var(--line); text-decoration: none; height: 100%; transition: border-color 0.2s, box-shadow 0.2s; }
.steps a:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.step-n { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--grad); color: #fff; font: 800 18px var(--display); }
.step-t { font-weight: 700; color: var(--text); font-size: 17px; }
.step-d { color: var(--muted); font-size: 15px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; padding-bottom: 56px; }
.card { display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s; }
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.card-title { font: 700 18px/1.3 var(--display); color: var(--text); }
.card-text { font-size: 15px; color: var(--text-2); line-height: 1.55; }
.card-meta { margin-top: auto; padding-top: 6px; font: 600 13px var(--font); color: var(--accent-text); }

/* MARK: Plain pages: legal, 404 */
.main-plain { padding: 40px 24px 72px; }
.doc-plain { max-width: 760px; }
/* PadLauncher, on the home page: its icon, what it does, and the way to it. */
.iphone-band { max-width: 1216px; margin: 8px auto 24px; padding: 24px; display: flex; gap: 20px; align-items: flex-start; border-radius: 20px; background: var(--bg-soft); border: 1px solid var(--line); }
.iphone-band img { border-radius: 18px; flex: none; box-shadow: var(--shadow); }
.iphone-band h2 { font: 700 24px/1.25 var(--display); letter-spacing: -0.02em; margin: 0 0 6px; }
.iphone-band p { color: var(--text-2); margin: 0 0 16px; max-width: 720px; }
.btn.is-disabled { opacity: 0.6; pointer-events: none; }
.app-legal { margin: 28px 0 0; color: var(--text-2); font-size: 15px; }
.notfound { text-align: center; max-width: 520px; margin: 48px auto; }
.notfound img { border-radius: 22px; }
.notfound h1 { font: 800 36px/1.2 var(--display); margin: 20px 0 10px; }
.notfound p { color: var(--text-2); margin: 0 0 24px; }
.notfound .cta-row { justify-content: center; }

/* MARK: Footer */
.footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 36px 24px 28px; }
.footer-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; }
.footer-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.footer-brand img { border-radius: 11px; }
.footer-brand strong { display: block; font: 800 18px/1.1 var(--display); }
.footer-brand em { display: block; font-size: 14px; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 22px; flex: 1; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: 15px; padding: 6px 0; }
.footer-links a:hover { color: var(--accent-text); text-decoration: underline; }
.powered { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.powered span { font: 700 11px/1 var(--font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.powered:hover { border-color: var(--accent); }
.fn-dark { display: none; }
:root[data-theme="dark"] .fn-light { display: none; }
:root[data-theme="dark"] .fn-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .fn-light { display: none; }
  :root:not([data-theme="light"]) .fn-dark { display: block; }
}
.fineprint { max-width: 1280px; margin: 22px auto 0; font-size: 13px; color: var(--muted); }

/* MARK: Search */
.search { width: min(680px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 80px)); margin: 72px auto auto; padding: 0; border: 1px solid var(--line-strong); border-radius: 16px;
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden; }
.search::backdrop { background: rgba(11, 10, 20, 0.45); backdrop-filter: blur(3px); }
.search-box { display: flex; flex-direction: column; max-height: inherit; }
.search-field { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 18px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; height: 48px; border: 0; outline: 0; background: transparent; color: var(--text); font: 400 18px var(--font); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-results { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.search-results li a { display: block; padding: 11px 14px; border-radius: 10px; text-decoration: none; color: var(--text); }
.search-results li a[aria-selected="true"], .search-results li a:hover { background: var(--accent-soft); }
.result-title { display: block; font-weight: 600; }
.result-group { font-size: 12px; font-weight: 600; color: var(--accent-text); text-transform: uppercase; letter-spacing: 0.06em; }
.result-text { display: block; font-size: 14px; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.search-results mark { background: color-mix(in srgb, var(--pink) 22%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.search-empty { padding: 22px 16px; color: var(--muted); }
.search-empty a { font-weight: 600; }
.search-hint { margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); background: var(--bg-soft); }

/* MARK: Lightbox */
.lightbox { max-width: 96vw; max-height: 94vh; padding: 0; border: 0; border-radius: 14px; background: #000; box-shadow: var(--shadow-lg); overflow: visible; }
.lightbox::backdrop { background: rgba(5, 4, 10, 0.82); }
.lightbox img { display: block; max-width: 96vw; max-height: 94vh; border-radius: 14px; }
.lightbox-close { position: absolute; top: -52px; right: 0; color: #fff; background: rgba(255, 255, 255, 0.12); }

/* MARK: Narrower screens */
@media (max-width: 1240px) {
  .shell { grid-template-columns: var(--sidebar) minmax(0, 1fr); }
  .toc-col { display: none; }
  .topnav a:nth-child(n + 5) { display: none; }
}
@media (max-width: 980px) {
  .menu-btn { display: inline-grid; }
  .topnav { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; height: 100vh; width: min(320px, 86vw); background: var(--bg); transform: translateX(-102%);
    transition: transform 0.25s ease; box-shadow: var(--shadow-lg); padding-top: 24px; }
  body.nav-open .sidebar { transform: none; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(11, 10, 20, 0.45); opacity: 0; pointer-events: none; transition: opacity 0.25s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .main { padding: 24px 20px 56px; }
  .hero { grid-template-columns: 1fr; padding: 40px 20px 24px; gap: 32px; }
  .start, .cards-section { padding: 16px 20px; }
  .iphone-band { margin: 8px 20px 16px; padding: 18px; flex-direction: column; }
  .steps { grid-template-columns: 1fr; }
  .search-btn { min-width: 0; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 44px; height: 44px; justify-content: center; padding: 0; border: 0; background: transparent; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 8px; gap: 4px; }
  .brand-tag { display: none; }
  .pager { grid-template-columns: 1fr; }
  .content .anchor { display: none; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
