/* SPDX-License-Identifier: MIT
 *
 * genera.css — Symbolics Genera Dynamic Windows + Classic Web + Minimalist Lisp Machine Theme
 *
 * Visual rules:
 *  - Default Black-on-White (BOW) paper polarity matching XL1200 VIDEO_CTRL_BOW_MODE=0,
 *    with toggleable White-on-Black (WOB) inverse video polarity.
 *  - Old-style blue underlined links even when not hovered (#0000ee / #551a8b).
 *  - Genera Dynamic Windows presentation hover box (1px outline) on hover/focus.
 *  - 1px hairline window frames with crisp 1-bit drop shadows (3px 3px 0).
 *  - Fixed bottom Genera Who-Line & Mouse Documentation bar.
 */

@font-face {
  font-family: "Michroma";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/michroma-latin-400-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;
  --bg: #f6f6f0;
  --surface: #ffffff;
  --surface-alt: #efefe7;
  --ink: #111111;
  --ink-muted: #4b4b45;
  --border: #111111;
  --border-soft: #b8b8ae;
  --shadow: #111111;
  --link: #0000ee;
  --link-visited: #551a8b;
  --link-hover-bg: rgba(0, 0, 238, 0.06);
  --code-bg: #f2f2ea;
  --code-border: #222220;
  --inv-bg: #111111;
  --inv-ink: #fafaf5;
  --callout-note-bg: #f2f5fb;
  --callout-imp-bg: #f7f2fb;
  --callout-warn-bg: #fbf7eb;
  --callout-caut-bg: #fbf0f0;
  --status-done-bg: #e4f3e8;
  --status-done-ink: #0c4d1e;
  --status-done-border: #1e6e34;
  --status-partial-bg: #fbf3d9;
  --status-partial-ink: #6a4200;
  --status-partial-border: #9a6500;
  --status-wip-bg: #e5effc;
  --status-wip-ink: #0b3c7a;
  --status-wip-border: #1d5ca8;
  --status-todo-bg: #efefe7;
  --status-todo-ink: #4b4b45;
  --status-todo-border: #78786e;
  --stamp-ink: #a61c1c;
  --font-display: "Michroma", "Eurostile", "Microgramma", var(--font-sans);
  --font-serif: "Charter", "Bitstream Charter", "Iowan Old Style", "Georgia", "Times New Roman", serif;
  --font-mono: "Berkeley Mono", "IBM Plex Mono", "JetBrains Mono", "DejaVu Sans Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --wholine-h: 28px;
}

html[data-theme="bow"] {
  color-scheme: light;
}

html[data-theme="wob"] {
  color-scheme: dark;
  --bg: #0d0f12;
  --surface: #14171c;
  --surface-alt: #1b2028;
  --ink: #e8e8e0;
  --ink-muted: #a2a6ae;
  --border: #d6d6cc;
  --border-soft: #484e58;
  --shadow: #000000;
  --link: #70a8ff;
  --link-visited: #c89eff;
  --link-hover-bg: rgba(112, 168, 255, 0.14);
  --code-bg: #0f1217;
  --code-border: #68707d;
  --inv-bg: #e8e8e0;
  --inv-ink: #0d0f12;
  --callout-note-bg: #141c28;
  --callout-imp-bg: #1f1728;
  --callout-warn-bg: #262012;
  --callout-caut-bg: #281517;
  --status-done-bg: #12291a;
  --status-done-ink: #8ce09d;
  --status-done-border: #4ea864;
  --status-partial-bg: #2b2210;
  --status-partial-ink: #f3c96b;
  --status-partial-border: #c5952f;
  --status-wip-bg: #142338;
  --status-wip-ink: #8cc2ff;
  --status-wip-border: #4d8fd6;
  --status-todo-bg: #1d2129;
  --status-todo-ink: #b2b7c0;
  --status-todo-border: #68707d;
  --stamp-ink: #e06c6c;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="bow"]) {
    color-scheme: dark;
    --bg: #0d0f12;
    --surface: #14171c;
    --surface-alt: #1b2028;
    --ink: #e8e8e0;
    --ink-muted: #a2a6ae;
    --border: #d6d6cc;
    --border-soft: #484e58;
    --shadow: #000000;
    --link: #70a8ff;
    --link-visited: #c89eff;
    --link-hover-bg: rgba(112, 168, 255, 0.14);
    --code-bg: #0f1217;
    --code-border: #68707d;
    --inv-bg: #e8e8e0;
    --inv-ink: #0d0f12;
    --callout-note-bg: #141c28;
    --callout-imp-bg: #1f1728;
    --callout-warn-bg: #262012;
    --callout-caut-bg: #281517;
    --status-done-bg: #12291a;
    --status-done-ink: #8ce09d;
    --status-done-border: #4ea864;
    --status-partial-bg: #2b2210;
    --status-partial-ink: #f3c96b;
    --status-partial-border: #c5952f;
    --status-wip-bg: #142338;
    --status-wip-ink: #8cc2ff;
    --status-wip-border: #4d8fd6;
    --status-todo-bg: #1d2129;
    --status-todo-ink: #b2b7c0;
    --status-todo-border: #68707d;
    --stamp-ink: #e06c6c;
  }
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0 0 calc(var(--wholine-h) + 20px) 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

/* ========================================================================== *
 * Links: Old-Style Blue + Underlined + Genera Presentation Box on Hover      *
 * ========================================================================== */

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  border-radius: 0;
}

a:visited {
  color: var(--link-visited);
}

a:hover,
a:focus-visible {
  outline: 1px solid var(--border);
  outline-offset: 2px;
  background: var(--link-hover-bg);
}

/* ========================================================================== *
 * Top Genera Window Bar                                                      *
 * ========================================================================== */

.genera-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

.genera-topbar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0.45rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1rem;
}

.genera-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  padding: 0.1rem 0.25rem;
}

.genera-brand:visited {
  color: var(--ink);
}

.genera-brand-badge {
  background: var(--inv-bg);
  color: var(--inv-ink);
  padding: 0.08rem 0.42rem;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.genera-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
}

.genera-nav a {
  padding: 0.1rem 0.25rem;
}

.genera-nav a.active {
  background: var(--inv-bg);
  color: var(--inv-ink);
  text-decoration: underline;
  outline: 1px solid var(--border);
}

.genera-btn {
  appearance: none;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 0.18rem 0.55rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--shadow);
}

.genera-btn:hover,
.genera-btn:focus-visible {
  background: var(--inv-bg);
  color: var(--inv-ink);
  outline: 1px solid var(--border);
  outline-offset: 2px;
}

/* ========================================================================== *
 * Genera Window Pane Frame                                                   *
 * ========================================================================== */

.pane {
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  margin-bottom: 1.5rem;
}

.pane-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.32rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pane-titlebar-meta {
  font-weight: 400;
  color: var(--ink-muted);
  text-transform: none;
  letter-spacing: 0;
}

.pane-body {
  padding: 1.25rem 1.5rem;
}

/* ========================================================================== *
 * Home Layout                                                                *
 * ========================================================================== */

.home-wrap {
  position: relative;
  max-width: 1120px;
  margin: 1.5rem auto 2rem auto;
  padding: 0 1rem;
}

.ai-stamp {
  float: right;
  width: 196px;
  margin: -0.15rem 0 0.5rem 0.9rem;
  color: var(--stamp-ink);
  user-select: none;
  cursor: help;
}

.ai-stamp svg {
  display: block;
  width: 100%;
  height: auto;
}

@media (min-width: 1620px) {
  .ai-stamp {
    position: absolute;
    top: 1.5rem;
    left: calc(100% + 1rem);
    float: none;
    width: 220px;
    margin: 0;
  }
}

@media (max-width: 640px) {
  .ai-stamp {
    float: none;
    display: block;
    width: 205px;
    margin: 0 auto 0.75rem auto;
  }
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 1.72rem;
  font-weight: 400;
  font-style: italic;
  font-synthesis: style;
  line-height: 1.26;
  margin: 0 0 0.85rem 0;
  letter-spacing: 0.02em;
}

.hero-lead {
  font-size: 1.05rem;
  margin: 0 0 1rem 0;
}

.spec-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-left: 1px solid var(--border);
  margin: 1rem 0 0.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.spec-cell {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 0.65rem;
  background: var(--surface-alt);
}

.spec-cell strong {
  display: block;
  font-size: 0.9rem;
  color: var(--ink);
}

.spec-cell span {
  color: var(--ink-muted);
}

.hero-figure {
  margin: 0;
  border: 1px solid var(--border);
  background: #0d0f12;
  padding: 4px;
}

.hero-figure img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;
}

.hero-figure figcaption {
  background: var(--surface-alt);
  color: var(--ink-muted);
  border-top: 1px solid var(--border);
  padding: 0.35rem 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.quick-links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.1rem;
  margin-top: 0.9rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.gallery-card {
  margin: 0;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}

.gallery-card img {
  display: block;
  width: 100%;
  height: auto;
  border-bottom: 1px solid var(--border);
  cursor: zoom-in;
}

.gallery-card figcaption {
  padding: 0.45rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--ink-muted);
}

.doc-group-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.doc-group-box {
  border: 1px solid var(--border);
  padding: 0.8rem 1rem;
  background: var(--surface-alt);
}

.doc-group-box h3 {
  margin: 0 0 0.5rem 0;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.3rem;
}

.doc-group-box ul {
  margin: 0;
  padding-left: 1.15rem;
}

.doc-group-box li {
  margin: 0.3rem 0;
  font-size: 0.93rem;
}

/* ========================================================================== *
 * Documentation Layout (Sidebar + Main Pane)                                 *
 * ========================================================================== */

.docs-shell {
  max-width: 1320px;
  margin: 1.25rem auto 2rem auto;
  padding: 0 1rem;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.docs-shell.docs-shell-with-toc {
  max-width: 1520px;
  grid-template-columns: 265px minmax(0, 1fr) 240px;
}

.docs-toc {
  position: sticky;
  top: 52px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 0.75rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
}

.docs-toc #TableOfContents ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-toc #TableOfContents ul ul {
  margin: 0.18rem 0 0.25rem 0.25rem;
  padding-left: 0.7rem;
  border-left: 1px solid var(--border-soft);
}

.docs-toc #TableOfContents li {
  margin: 0.22rem 0;
}

.docs-toc #TableOfContents a {
  display: block;
  padding: 0.08rem 0.25rem;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.docs-toc #TableOfContents a.current {
  background: var(--inv-bg);
  color: var(--inv-ink);
  font-weight: 700;
}

.docs-sidebar {
  position: sticky;
  top: 52px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: 3px 3px 0 var(--shadow);
  padding: 0.75rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.79rem;
}

.sidebar-filter {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.sidebar-section {
  margin-bottom: 0.9rem;
}

.sidebar-section-title {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 0.2rem;
  margin: 0 0 0.35rem 0;
}

.sidebar-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-list li {
  margin: 0.26rem 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
}

.sidebar-list a {
  display: inline-block;
  padding: 0.08rem 0.25rem;
  line-height: 1.38;
  flex: 1 1 auto;
  min-width: 0;
}

.sidebar-list a.current {
  background: var(--inv-bg);
  color: var(--inv-ink);
  font-weight: 700;
}

/* ========================================================================== *
 * Roadmap & Sidebar Status Tokens ([DONE], [PARTIAL], [WIP], [TODO])         *
 * ========================================================================== */

.status-token {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.08rem 0.32rem;
  border: 1px solid var(--border);
  white-space: nowrap;
  vertical-align: middle;
  flex-shrink: 0;
}

.status-done {
  background: var(--status-done-bg);
  color: var(--status-done-ink);
  border-color: var(--status-done-border);
}

.status-partial {
  background: var(--status-partial-bg);
  color: var(--status-partial-ink);
  border-color: var(--status-partial-border);
}

.status-wip {
  background: var(--status-wip-bg);
  color: var(--status-wip-ink);
  border-color: var(--status-wip-border);
}

.status-todo {
  background: var(--status-todo-bg);
  color: var(--status-todo-ink);
  border-color: var(--status-todo-border);
}

.pane-titlebar-left {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ========================================================================== *
 * Prose Typography, Lists, Math, Code, Tables & Genera Callout Boxes         *
 * ========================================================================== */

.doc-content ul,
.doc-content ol {
  margin: 0.55rem 0 0.95rem 0;
  padding-left: 1.55rem;
}

.doc-content li {
  margin: 0.28rem 0;
}

.doc-content li > ul,
.doc-content li > ol {
  margin-top: 0.28rem;
  margin-bottom: 0.35rem;
}

.doc-content li > p {
  margin: 0.3rem 0;
}

.doc-content li > p:first-child {
  margin-top: 0;
}

.doc-content li > p:last-child {
  margin-bottom: 0;
}

/* LaTeX / KaTeX math blocks & inline spans */
.math-block {
  margin: 1rem 0 1.15rem 0;
  padding: 0.7rem 1rem;
  background: var(--surface-alt);
  border: 1px solid var(--border-soft);
  overflow-x: auto;
  text-align: center;
}

.math-block .katex-display {
  margin: 0;
}

.math-inline .katex {
  font-size: 1.02em;
}

.doc-content h1,
.doc-content h2,
.doc-content h3,
.doc-content h4 {
  font-family: var(--font-serif);
  line-height: 1.25;
  margin-top: 1.6rem;
  margin-bottom: 0.65rem;
  scroll-margin-top: 64px;
}

.doc-content h1 {
  font-size: 1.85rem;
  margin-top: 0;
  padding-bottom: 0.45rem;
  border-bottom: 2px solid var(--border);
}

.doc-content h2 {
  font-size: 1.38rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--border-soft);
}

.doc-content h3 {
  font-size: 1.12rem;
}

.doc-content hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 1.5rem 0;
}

.doc-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  cursor: zoom-in;
}

.doc-content code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--code-bg);
  border: 1px solid var(--border-soft);
  padding: 0.05rem 0.28rem;
}

.doc-content pre {
  font-family: var(--font-mono);
  font-size: 0.83rem;
  line-height: 1.48;
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  padding: 0.85rem 1rem;
  overflow-x: auto;
  margin: 0.9rem 0 1.1rem 0;
}

.doc-content pre code {
  border: 0;
  padding: 0;
  background: transparent;
  font-size: inherit;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem 0;
  font-size: 0.86rem;
  display: block;
  overflow-x: auto;
}

.doc-content th,
.doc-content td {
  border: 1px solid var(--border);
  padding: 0.36rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.doc-content th {
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.doc-content blockquote {
  margin: 1rem 0;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  background: var(--surface-alt);
}

.doc-content blockquote > p:first-child { margin-top: 0; }
.doc-content blockquote > p:last-child { margin-bottom: 0; }

.callout {
  margin: 1rem 0;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
  border-left: 5px solid var(--border);
  background: var(--callout-note-bg);
}

.callout-important { background: var(--callout-imp-bg); }
.callout-warning   { background: var(--callout-warn-bg); }
.callout-caution   { background: var(--callout-caut-bg); }

.callout-title {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
}

.callout p:last-child { margin-bottom: 0; }

.doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.84rem;
}

/* Related Chip Datasheets panel on hardware / emulator / plan pages */
.datasheet-box {
  margin-top: 1.75rem;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.datasheet-box-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.3rem 0.75rem;
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.datasheet-box-bar a {
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.datasheet-list {
  list-style: none;
  margin: 0 !important;
  padding: 0.55rem 0.85rem !important;
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.datasheet-list li {
  margin: 0.32rem 0 !important;
  line-height: 1.45;
}

.datasheet-meta {
  color: var(--ink-muted);
  font-size: 0.74rem;
}

/* ========================================================================== *
 * Chroma Syntax Highlighting (Hugo, BOW + WOB Readable Contrast)             *
 * ========================================================================== */

.chroma { background: var(--code-bg); color: var(--ink); }
.chroma .c, .chroma .c1, .chroma .cm, .chroma .ch, .chroma .cs { color: #5a6058; font-style: italic; }
.chroma .k, .chroma .kd, .chroma .kn, .chroma .kp, .chroma .kr, .chroma .kt { color: #003b8e; font-weight: 700; }
.chroma .s, .chroma .s1, .chroma .s2, .chroma .sb, .chroma .sa, .chroma .sc, .chroma .sd { color: #7a2600; }
.chroma .m, .chroma .mi, .chroma .mh, .chroma .mf, .chroma .mb, .chroma .mo, .chroma .il { color: #0b6623; }
.chroma .nf, .chroma .nc, .chroma .fm { color: #5b1b7c; font-weight: 700; }
.chroma .cp, .chroma .cpf { color: #6e4500; font-weight: 700; }

html[data-theme="wob"] .chroma .c,
html[data-theme="wob"] .chroma .c1,
html[data-theme="wob"] .chroma .cm,
html[data-theme="wob"] .chroma .ch,
html[data-theme="wob"] .chroma .cs { color: #8c96a4; }
html[data-theme="wob"] .chroma .k,
html[data-theme="wob"] .chroma .kd,
html[data-theme="wob"] .chroma .kn,
html[data-theme="wob"] .chroma .kp,
html[data-theme="wob"] .chroma .kr,
html[data-theme="wob"] .chroma .kt { color: #82b4ff; }
html[data-theme="wob"] .chroma .s,
html[data-theme="wob"] .chroma .s1,
html[data-theme="wob"] .chroma .s2,
html[data-theme="wob"] .chroma .sb,
html[data-theme="wob"] .chroma .sa,
html[data-theme="wob"] .chroma .sc,
html[data-theme="wob"] .chroma .sd { color: #f0b07a; }
html[data-theme="wob"] .chroma .m,
html[data-theme="wob"] .chroma .mi,
html[data-theme="wob"] .chroma .mh,
html[data-theme="wob"] .chroma .mf,
html[data-theme="wob"] .chroma .mb,
html[data-theme="wob"] .chroma .mo,
html[data-theme="wob"] .chroma .il { color: #8cd896; }
html[data-theme="wob"] .chroma .nf,
html[data-theme="wob"] .chroma .nc,
html[data-theme="wob"] .chroma .fm { color: #d5a6ff; }
html[data-theme="wob"] .chroma .cp,
html[data-theme="wob"] .chroma .cpf { color: #e8c77a; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="bow"]) .chroma .c,
  html:not([data-theme="bow"]) .chroma .c1,
  html:not([data-theme="bow"]) .chroma .cm,
  html:not([data-theme="bow"]) .chroma .ch,
  html:not([data-theme="bow"]) .chroma .cs { color: #8c96a4; }
  html:not([data-theme="bow"]) .chroma .k,
  html:not([data-theme="bow"]) .chroma .kd,
  html:not([data-theme="bow"]) .chroma .kn,
  html:not([data-theme="bow"]) .chroma .kp,
  html:not([data-theme="bow"]) .chroma .kr,
  html:not([data-theme="bow"]) .chroma .kt { color: #82b4ff; }
  html:not([data-theme="bow"]) .chroma .s,
  html:not([data-theme="bow"]) .chroma .s1,
  html:not([data-theme="bow"]) .chroma .s2,
  html:not([data-theme="bow"]) .chroma .sb,
  html:not([data-theme="bow"]) .chroma .sa,
  html:not([data-theme="bow"]) .chroma .sc,
  html:not([data-theme="bow"]) .chroma .sd { color: #f0b07a; }
  html:not([data-theme="bow"]) .chroma .m,
  html:not([data-theme="bow"]) .chroma .mi,
  html:not([data-theme="bow"]) .chroma .mh,
  html:not([data-theme="bow"]) .chroma .mf,
  html:not([data-theme="bow"]) .chroma .mb,
  html:not([data-theme="bow"]) .chroma .mo,
  html:not([data-theme="bow"]) .chroma .il { color: #8cd896; }
  html:not([data-theme="bow"]) .chroma .nf,
  html:not([data-theme="bow"]) .chroma .nc,
  html:not([data-theme="bow"]) .chroma .fm { color: #d5a6ff; }
  html:not([data-theme="bow"]) .chroma .cp,
  html:not([data-theme="bow"]) .chroma .cpf { color: #e8c77a; }
}

/* Mermaid diagrams */
pre.mermaid {
  background: var(--surface);
  text-align: center;
  padding: 1rem;
}

/* ========================================================================== *
 * Fixed Bottom Genera Who-Line & Mouse Documentation Strip                   *
 * ========================================================================== */

.genera-wholine {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--wholine-h);
  z-index: 50;
  background: var(--inv-bg);
  color: var(--inv-ink);
  border-top: 2px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.85rem;
  gap: 1rem;
  white-space: nowrap;
  overflow: hidden;
}

.wholine-mouse {
  overflow: hidden;
  text-overflow: ellipsis;
}

.wholine-status {
  flex-shrink: 0;
  opacity: 0.9;
}

/* ========================================================================== *
 * Lightbox Modal for Screenshots                                             *
 * ========================================================================== */

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.lightbox-backdrop.open {
  display: flex;
}

.lightbox-frame {
  max-width: 94vw;
  max-height: 90vh;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: 5px 5px 0 #000000;
  display: flex;
  flex-direction: column;
}

.lightbox-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-alt);
  font-family: var(--font-mono);
  font-size: 0.8rem;
}

.lightbox-frame img {
  max-width: 92vw;
  max-height: 82vh;
  display: block;
  object-fit: contain;
}

@media (max-width: 1180px) {
  .docs-shell.docs-shell-with-toc {
    max-width: 1320px;
    grid-template-columns: 265px minmax(0, 1fr);
  }
  .docs-shell.docs-shell-with-toc > .docs-sidebar {
    grid-column: 1;
    grid-row: 1 / span 2;
  }
  .docs-shell.docs-shell-with-toc > .docs-toc {
    grid-column: 2;
    grid-row: 1;
    position: static;
    max-height: none;
  }
  .docs-shell.docs-shell-with-toc > .pane {
    grid-column: 2;
    grid-row: 2;
  }
}

@media (max-width: 960px) {
  .hero-grid,
  .two-col,
  .doc-group-grid {
    grid-template-columns: 1fr;
  }
  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .docs-shell,
  .docs-shell.docs-shell-with-toc {
    grid-template-columns: 1fr;
  }
  .docs-shell.docs-shell-with-toc > .docs-sidebar,
  .docs-shell.docs-shell-with-toc > .docs-toc,
  .docs-shell.docs-shell-with-toc > .pane {
    grid-column: auto;
    grid-row: auto;
  }
  .docs-sidebar,
  .docs-toc {
    position: static;
    max-height: none;
  }
  .spec-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-grid {
    grid-template-columns: 1fr;
  }
  .wholine-status {
    display: none;
  }
}
