/* The standalone documents scroll in the window. Reserve the same space for
   the fixed tabs as the V2 app reserves beneath its scrolling pane. */
html:root, html:root body { height: auto; overflow: visible; }
html:root { scroll-padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
html:root body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
}
@media (max-width: 640px) {
  html:root body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}
html:root, html:root[data-theme] {
  --layout-nav-h: 0px;
  --theme-surface-page: var(--paper);
  --theme-surface-overlay: var(--paper);
  --theme-surface-raised: var(--raised);
  --theme-surface-inset: var(--soft);
  --theme-surface-hover: var(--soft);
  --theme-surface-active: var(--soft);
  --theme-ink-primary: var(--ink);
  --theme-ink-secondary: var(--muted);
  --theme-ink-muted: var(--muted);
  --theme-ink-link: var(--ink);
  --theme-ink-link-hover: var(--muted);
  --theme-rule-standard: var(--rule);
  --theme-rule-subtle: var(--rule);
  --theme-rule-focus: var(--ink);
  --theme-metadata-ink: var(--muted);
  --theme-provenance-ink: var(--muted);
  --theme-accent: var(--ink);
  --theme-mono-ink: var(--ink);
  --theme-mono-surface: var(--soft);
  --theme-status-warning-ink: var(--ink);
}
.reader-masthead .brand, .reader-masthead .navlink, #bottom-nav .navlink { text-decoration: none; }
html .reader-masthead .brand, .reader-footer h2 { font-family: var(--serif); }
@media (min-width: 641px) { .reader-masthead .theme-toggle { margin-inline-start: auto; } }
html .reader-footer { display: block; }
html .new-latest { padding-block-start: 28px; }
html .new-latest h2 { font: 500 1.5rem/1.2 var(--serif); text-transform: none; letter-spacing: normal; }
/* Keep positioned content within its own stacking context below the
   navigation. Dialogs in the browser's top layer still appear above it. */
body:has(.reader-masthead) main { isolation: isolate; z-index: 0; }
@media (max-width: 640px) {
  body:has(.reader-masthead) #bottom-nav { z-index: 100; background-color: var(--paper); }
}

/* The archived Current Read was originally dark only. */
.current-read-shell .current-read-title,
.current-read-shell .research-bridge a { color: var(--ink); }
.current-read-shell :is(.current-read-dek, .current-read-meta-item, .current-read-context p,
  .research-brief-copy, .research-question-list, .research-bridge, .current-read-note),
body .current-read-disclosure { color: var(--muted); }
.current-read-shell :is(.current-read-meta-item, .current-read-frame, .research-brief) {
  border-color: var(--rule);
  background: var(--raised);
  box-shadow: none;
}
/* Long inline API names can wrap in prose. Code samples retain their formatting. */
.page-developers :not(pre) > code { overflow-wrap: anywhere; }
