/* Reusable components. */

button,
select,
input {
  font: inherit;
  color: inherit;
}
input::placeholder {
  color: var(--c-placeholder);
}
/* The playback speed menus (.fw-speed, .bench-speed) keep the browser's own look, which follows color-scheme:
   giving them a colour would replace that look in the light theme too (dark-theme round 2). */

/* ---------------------------------------------------------------- buttons */
.btn,
.menu-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-3);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
}
.btn:hover,
.menu-btn:hover {
  background: var(--c-panel-strong);
  border-color: var(--c-border-strong);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--control-h);
  height: var(--control-h);
  padding: 0;
  flex: none;
  background: var(--c-pill-bg);
  border: 1px solid var(--c-pill-border);
  border-radius: 50%;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}
.icon-btn:hover {
  background: var(--c-pill-bg-hover);
  border-color: var(--c-border-strong);
}
.icon-btn:active {
  transform: translateY(1px);
}
.info-btn {
  font: italic 700 16px/1 Georgia, "Times New Roman", serif;
}

/* Three-bar icon drawn with gradients: no image request, no inline style. */
.menu-icon {
  width: 14px;
  height: 10px;
  background:
    linear-gradient(currentColor, currentColor) 0 0 / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 50% / 100% 2px no-repeat,
    linear-gradient(currentColor, currentColor) 0 100% / 100% 2px no-repeat;
}

/* "by ryu-kazuho ↗" capsule link in the header */
.home-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--pill-h);
  padding: 0 var(--space-3);
  background: var(--c-pill-bg);
  border: 1px solid var(--c-pill-border);
  border-radius: 999px;
  color: var(--c-text);
  font-size: 0.8125rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), transform var(--transition);
}
.home-pill:hover {
  background: var(--c-pill-bg-hover);
  border-color: var(--c-border-strong);
}
.home-pill:active {
  transform: translateY(1px);
}
.home-pill:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
.ext-arrow {
  font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
  .home-pill,
  .icon-btn,
  .btn,
  .menu-btn {
    transition: none;
  }
}

/* ---------------------------------------------------------------- line icons (ui/icons.js) */
.icon {
  width: 24px;
  height: 24px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon--sm {
  width: 16px;
  height: 16px;
  stroke-width: 1.6;
}
.icon .faint {
  stroke-opacity: 0.35;
}
.icon .dash {
  stroke-dasharray: 2 2.5;
  stroke-opacity: 0.6;
}

/* ---------------------------------------------------------------- language menu */
.lang {
  position: relative;
}
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--control-h);
  padding: 0 var(--space-4) 0 var(--space-3);
  color: var(--c-text);
  background: var(--c-panel-strong);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--transition), border-color var(--transition);
}
.lang-btn .icon {
  color: var(--c-text-muted);
}
.lang-btn:hover,
.lang-btn[aria-expanded="true"] {
  background: var(--c-pill-bg-hover);
  border-color: var(--c-pill-border);
}
.lang-btn:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
.lang-list {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 168px;
  margin: 0;
  padding: var(--space-1);
  list-style: none;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 8px 24px var(--c-shadow-md);
}
.lang-list[hidden] {
  display: none;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 7px var(--space-4) 7px var(--space-3);
  border-radius: 6px;
  font-size: 0.875rem;
  white-space: nowrap;
  cursor: pointer;
}
.lang-option:hover,
.lang-option:focus {
  background: var(--c-panel-strong);
  outline: none;
}
.lang-option:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: -2px;
}
.lang-option__check {
  width: 1em;
  color: var(--c-link);
  visibility: hidden;
}
.lang-option[aria-selected="true"] {
  font-weight: 600;
}
.lang-option[aria-selected="true"] .lang-option__check {
  visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
  .lang-btn {
    transition: none;
  }
}

/* ---------------------------------------------------------------- chapter groups */
.g-foundation {
  --g-bg: var(--grp-foundation-bg);
  --g-fg: var(--grp-foundation-fg);
  --g-accent: var(--grp-foundation-accent);
}
.g-arch {
  --g-bg: var(--grp-arch-bg);
  --g-fg: var(--grp-arch-fg);
  --g-accent: var(--grp-arch-accent);
}
.g-highspeed {
  --g-bg: var(--grp-highspeed-bg);
  --g-fg: var(--grp-highspeed-fg);
  --g-accent: var(--grp-highspeed-accent);
}
.g-metrics {
  --g-bg: var(--grp-metrics-bg);
  --g-fg: var(--grp-metrics-fg);
  --g-accent: var(--grp-metrics-accent);
}
.g-practice {
  --g-bg: var(--grp-practice-bg);
  --g-fg: var(--grp-practice-fg);
  --g-accent: var(--grp-practice-accent);
}
.g-circuit {
  --g-bg: var(--grp-circuit-bg);
  --g-fg: var(--grp-circuit-fg);
  --g-accent: var(--grp-circuit-accent);
}

/* ---------------------------------------------------------------- chapter lists (menu, sidebar) */
.ch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr));
  gap: var(--space-1) var(--space-4);
}
.ch-list--toc {
  grid-template-columns: 1fr;
}
.ch-list a,
.ch-soon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  min-height: var(--control-h);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-3);
  border-radius: var(--radius);
  box-shadow: inset 3px 0 0 var(--g-accent, transparent);
  font-size: 0.875rem;
}
.ch-list a {
  color: var(--c-text);
  text-decoration: none;
  transition: background-color var(--transition), box-shadow var(--transition);
}
.ch-list a:hover {
  background-color: var(--c-panel);
  background-image: linear-gradient(90deg, var(--g-bg, var(--c-panel)), var(--c-sheen-clear));
}
/* the current chapter: group tint fading to the right, a thin outline in the group colour beside the accent bar */
.ch-list a[aria-current="page"] {
  background-color: var(--g-bg, var(--c-panel-strong));
  background-image: linear-gradient(90deg, var(--c-sheen-clear) 35%, var(--c-sheen-soft));
  box-shadow: inset 3px 0 0 var(--g-accent, transparent), inset 0 0 0 1px color-mix(in srgb, var(--g-accent, var(--c-border)) 30%, transparent);
  font-weight: 600;
}
.is-soon .ch-soon {
  color: var(--c-text-muted);
  cursor: default;
}
.is-current .ch-soon {
  background: var(--g-bg, var(--c-panel));
  color: var(--g-fg, var(--c-text));
}
.toc__title {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin: 0 0 var(--space-2) var(--space-2);
}

.badge-soon {
  display: inline-block;
  padding: 0 var(--space-2);
  font-size: 0.6875rem;
  line-height: 1.6;
  font-weight: 400;
  font-style: normal;
  color: var(--c-badge-fg);
  background: var(--c-badge-bg);
  border: 1px solid var(--c-border);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------------------------------------------------------------- home page
   One step larger than the compact base. Since 1.0 (plan A of docs/rlc-poles-design.md §8) the chapters are grouped
   in sections with a jump bar and the page may scroll; the spacing is the uncompressed one (the 2E desktop tightening
   for a no-scroll home is gone). tests/browser/run.js: the first screen shows the title, the jump bar and the first
   group; no horizontal scroll at any width. */
.page--home {
  padding-top: var(--space-5);
  padding-bottom: var(--space-6);
}
.hero {
  padding: 0 0 var(--space-2);
}
.hero h1 {
  font-size: 2rem;
  margin-bottom: var(--space-1);
  color: var(--c-name); /* solid fallback of the site-name gradient (layout.css) */
}
.hero__tagline {
  font-size: 1.1rem;
  color: var(--c-text-muted);
  margin-bottom: var(--space-3);
}
.hero__intro {
  font-size: 1rem;
  margin-bottom: var(--space-5);
}
.cards-title {
  font-size: 1.1rem;
  margin-bottom: var(--space-3);
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
@media (min-width: 560px) {
  .cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (min-width: 820px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (min-width: 1000px) {
  .cards {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* the jump bar: one pill per group (group colours), wrapping on narrow screens */
.home-jump__list {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.home-jump__link {
  display: inline-block;
  padding: 4px 12px;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--g-fg, var(--c-text));
  background-color: var(--g-bg, var(--c-panel));
  background-image: linear-gradient(180deg, var(--c-sheen), var(--c-sheen-clear));
  border: 1px solid color-mix(in srgb, var(--g-accent, var(--c-border)) 60%, var(--c-edge-base));
  border-radius: 999px;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.home-jump__link:hover {
  border-color: var(--g-accent, var(--c-border-strong));
  box-shadow: 0 4px 12px -4px color-mix(in srgb, var(--g-accent, var(--c-border)) 55%, transparent);
  transform: translateY(-1px);
}
.home-jump__link:focus-visible,
.home-group__title:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}
/* one section per group: a heading with the group's accent bar, then the cards */
.home-group {
  margin: 0 0 var(--space-5);
  scroll-margin-top: 60px; /* clear of the sticky header on desktop */
}
.home-group__title {
  margin: 0 0 var(--space-3);
  padding-left: 10px;
  font-size: 1rem;
  color: var(--g-fg, var(--c-text));
  border-left: 4px solid var(--g-accent, var(--c-border));
  /* a soft band of the group colour that fades out behind the heading (no layout change) */
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--g-accent, var(--c-border)) 14%, transparent), transparent 45%);
}

.card {
  position: relative;
  min-width: 0;
  padding: 14px 14px 14px 14px;
  /* solid group tint (what the contrast checks read) under a light sheen; a thin outline in the group colour */
  background-color: var(--g-bg, var(--c-panel));
  background-image: linear-gradient(135deg, var(--c-sheen), var(--c-sheen-clear) 60%);
  border: 1px solid color-mix(in srgb, var(--g-accent, var(--c-border)) 32%, var(--c-edge-base));
  border-left: 4px solid var(--g-accent, var(--c-border));
  border-radius: 8px;
  box-shadow: 0 1px 2px var(--c-shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card__inner {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: var(--space-4);
  align-items: start;
  min-width: 0;
}
.card__icon {
  color: var(--g-accent, var(--c-text-muted));
  margin-top: 1px;
}
.card__text {
  min-width: 0;
}
.card__title {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
  line-height: 1.35;
  color: var(--g-fg, var(--c-text));
}
/* The badge never wraps; it floats beside the title's first line only. */
.card__text > .badge-soon {
  float: right;
  margin: 2px 0 0 var(--space-2);
}
/* Description: up to two lines (space for two is reserved so every card has the same rhythm). */
.card__desc {
  margin: 0;
  min-height: 3em;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--c-text-muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.card__link {
  color: inherit;
  text-decoration: none;
}
.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card:has(.card__link:hover),
.card:has(.card__link:focus-visible) {
  border-color: var(--g-accent, var(--c-border-strong));
  box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--g-accent, var(--c-border)) 50%, transparent),
    0 0 0 3px color-mix(in srgb, var(--g-accent, var(--c-border)) 12%, transparent);
}
.card:has(.card__link:hover) {
  transform: translateY(-2px);
}
/* reduced motion: no lift (the transitions are already off, base.css); forced colours and print: no sheen or glow */
@media (prefers-reduced-motion: reduce) {
  .card:has(.card__link:hover),
  .home-jump__link:hover {
    transform: none;
  }
}
@media (forced-colors: active), print {
  .card,
  .home-jump__link,
  .home-group__title,
  .ch-list a:hover,
  .ch-list a[aria-current="page"] {
    background-image: none;
  }
  .card,
  .card:has(.card__link:hover),
  .card:has(.card__link:focus-visible),
  .home-jump__link:hover {
    box-shadow: none;
    transform: none;
  }
}

/* ---------------------------------------------------------------- chapter pages */
.chapter-head {
  position: relative; /* anchors the decorative lines below; size and layout unchanged */
  max-width: var(--maxw-text);
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  background: var(--g-bg, var(--c-panel));
  border-left: 4px solid var(--g-accent, var(--c-border));
  border-radius: var(--radius);
}
/* decoration in the group colour beside the title: the accent bar fades along its length, and a hairline runs
   along the bottom edge and fades out (absolutely positioned, aria-free pseudo-elements) */
.chapter-head::before,
.chapter-head::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.chapter-head::before {
  left: -4px;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: var(--radius) 0 0 var(--radius);
  background-image: linear-gradient(180deg, var(--g-accent, var(--c-border)), color-mix(in srgb, var(--g-accent, var(--c-border)) 35%, var(--c-brand-to)));
}
.chapter-head::after {
  left: 0;
  right: var(--radius);
  bottom: 0;
  height: 2px;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--g-accent, var(--c-border)) 70%, transparent), transparent 70%);
}
@media (forced-colors: active), print {
  .chapter-head::before,
  .chapter-head::after {
    display: none;
  }
}
.chapter-head h1 {
  margin: 0 0 var(--space-1);
  font-size: 1.4rem;
  color: var(--g-fg, var(--c-text));
}
.chapter-head p {
  margin: 0;
  color: var(--c-text-muted);
}

.notice {
  max-width: var(--maxw-text);
  padding: var(--space-3) var(--space-4);
  background: var(--c-panel);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
}
.notice h1,
.notice h2 {
  font-size: 1.05rem;
}
.notice p:last-child {
  margin-bottom: 0;
}

/* ---------------------------------------------------------------- info dialog
   Typography and spacing: 13 px text with
   line height 1.5, a 14 px semibold title, 13 px semibold section headings, a 12 px muted version line
   under the title, and the changelog as a 12 px semibold "version · date" line over a 12 px list (indent
   20 px). The title bar with the close button stays put; only the body scrolls. */
.dialog {
  width: min(560px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--c-shadow-xl);
}
.dialog[open] {
  display: flex;
  flex-direction: column;
}
.dialog::backdrop {
  background: var(--c-backdrop);
}
.dialog__head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: 10px 12px 8px 16px;
  border-bottom: 1px solid var(--c-border);
}
.dialog__head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.dialog__close {
  font-size: 18px;
  line-height: 1;
}
.dialog__body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 10px 16px 14px;
}
.dialog__titles {
  min-width: 0;
}
/* version line right under the title (title margin 10 px, version −6 px → 4 px apart) */
.dialog .dialog__version {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--c-text-muted);
}
/* contributors and copyright */
.dialog .dialog__meta {
  font-size: 12px;
  color: var(--c-text-muted);
}
.dialog .dialog__contributors {
  margin: 14px 0 0;
}
.dialog .dialog__copyright {
  margin: 2px 0 6px;
}
.dialog h3 {
  margin: 14px 0 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--c-text);
}
.dialog p {
  margin: 0 0 4px;
}
.dialog__actions {
  margin-top: 10px;
}
.dialog .dialog__changelog-version {
  margin: 8px 0 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--c-text-soft);
}
.dialog .status {
  font-size: 12px;
}
.dialog__changelog-list {
  margin: 0;
  padding-left: 20px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--c-text-soft);
}
.status {
  min-height: 1.5em;
  margin: var(--space-1) 0 0;
  font-size: 0.875rem;
  color: var(--c-text-muted);
}

/* ---------------------------------------------------------------- site search (ui/search.js, docs/search-design.md §4)
   Header button: a 32 px circle like the theme and "i" buttons, with a 44 × 44 px hit area (::before). Dialog: anchored
   at the top (only the list grows, downwards, and scrolls inside), the info dialog's frame and colours; every touch
   target (box, close button, results) at least 44 px tall. */
.search-btn {
  position: relative;
  margin-left: auto;
}
.search-btn::before {
  content: "";
  position: absolute;
  inset: -7px; /* from the padding box (inside the 1 px border): 30 + 2 × 7 = 44 px */
}
.search-dialog {
  --search-top: min(12vh, 96px);
  width: min(640px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - var(--search-top) - 16px - env(keyboard-inset-height, 0px));
  margin: var(--search-top) auto auto;
  padding: 0;
  overflow: hidden;
  color: var(--c-text);
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 10px;
  box-shadow: 0 12px 32px var(--c-shadow-xl);
}
.search-dialog[open] {
  display: flex;
  flex-direction: column;
}
.search-dialog::backdrop {
  background: var(--c-backdrop);
}
@media (max-width: 559px) {
  .search-dialog {
    --search-top: 8px;
    width: calc(100vw - 16px);
  }
}
@media (prefers-reduced-motion: no-preference) {
  .search-dialog[open] {
    animation: search-in 0.12s ease-out;
  }
}
@keyframes search-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}
.search-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--c-border);
}
.search-head__icon {
  color: var(--c-text-muted);
}
.search-input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0 var(--space-3);
  font-size: 1rem; /* 16 px: no zoom on focus in mobile Safari */
  background: var(--c-field-bg);
  border: 1px solid var(--c-border-strong);
  border-radius: 8px;
}
.search-input:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}
.search-close {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}
.search-close:hover {
  color: var(--c-text);
  background: var(--c-panel-strong);
}
.search-status-box {
  flex: none;
}
.search-status {
  margin: 0;
  padding: var(--space-2) var(--space-4);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--c-text-muted);
}
.search-results {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 var(--space-2) var(--space-2);
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
}
.search-results:empty {
  display: none;
}
.search-option {
  display: block;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  cursor: pointer;
}
.search-option:hover {
  background: var(--c-panel);
}
.search-option[aria-selected="true"] {
  background: var(--c-panel-strong);
  outline: 2px solid var(--c-focus);
  outline-offset: -2px;
}
.search-option__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.search-option__title {
  min-width: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.search-kind {
  flex: none;
  padding: 0 var(--space-2);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--c-badge-fg);
  background: var(--c-badge-bg);
  border-radius: 999px;
}
.search-option__snippet {
  display: block;
  margin-top: 2px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--c-text-muted);
  overflow-wrap: anywhere;
}
.search-dialog mark {
  padding: 0 1px;
  color: var(--c-search-mark-fg);
  background: var(--c-search-mark);
  border-radius: 2px;
}
@media print {
  .search-btn,
  .search-dialog {
    display: none !important;
  }
}

.noscript {
  max-width: var(--maxw-page);
  margin: 0 auto;
  padding: var(--space-4) var(--gutter);
}
.noscript span {
  display: block;
}

/* ---------------------------------------------------------------- physical quantities
   {q:SYM,SUB} in the dictionaries → <var class="q">SYM<sub>SUB</sub></var> (i18n.js).
   Convention: bold italic main symbol; subscript upright, 0.75× size,
   dropped 0.2× of the main size (vertical-align in the subscript's own em: 0.2 / 0.75). */
var.q {
  font-style: italic;
  font-weight: 700;
}
var.q sub {
  font-style: normal;
  font-size: 0.75em;
  vertical-align: -0.267em;
  line-height: 0;
}

/* ---------------------------------------------------------------- hint boxes (ui/hint.js) */
.hint {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  max-width: var(--maxw-text);
  margin: var(--space-3) 0;
  padding: var(--space-3) var(--space-4);
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 0.875rem;
  color: var(--c-text);
}
.hint--action {
  background: var(--c-hint-action-bg);
  border-color: var(--c-hint-action-border);
}
.hint--tip {
  background: var(--c-hint-tip-bg);
  border-color: var(--c-hint-tip-border);
}
.hint__icon {
  width: 20px;
  height: 20px;
  margin-top: 0.15em;
}
.hint--action .hint__icon {
  color: var(--c-hint-action-icon);
}
.hint--tip .hint__icon {
  color: var(--c-hint-tip-icon);
}
.hint__body {
  min-width: 0;
}
.hint__body > p {
  margin: 0;
}
.hint__body > p + p {
  margin-top: var(--space-2);
}
.hint__body > p[hidden] {
  display: none;
}

/* ---------------------------------------------------------------- "where next" link (ui/chapter-link.js) */
.next-link {
  max-width: var(--maxw-text);
  margin: var(--space-6) 0 0;
  padding-top: var(--space-4);
  border-top: 1px solid var(--c-border);
}
.next-link__target {
  font-weight: 600;
}
.next-link__target.is-soon {
  color: var(--c-text-muted);
}
.next-link__target .badge-soon {
  margin-left: var(--space-1);
  vertical-align: 0.1em;
}

/* An active-low signal name written with a bar ({ov:RST} in the dictionaries): a styled span, no combining character */
.ovl {
  text-decoration: overline;
  text-decoration-thickness: 0.06em;
}
/* narrow screens: the jump bar is one row that scrolls sideways inside itself (the page never widens) */
@media (max-width: 559px) {
  .home-jump {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    margin: 0 0 var(--space-5);
  }
  .home-jump__list {
    flex-wrap: nowrap;
    width: max-content;
    margin: 0;
    padding: 4px 2px 6px;
  }
  .home-jump__link {
    white-space: nowrap;
  }
}

/* ---------------------------------------------------------------- layout stability (lib/stable.js) */
.stable {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: start;
  min-width: 0;
}
.stable > * {
  grid-area: 1 / 1;
  min-width: 0;
}
/* outweighs the single-class margins of the blocks held (they move to the wrapper, below) */
.stable.stable > * {
  margin-block: 0;
}
.stable > .stable__ghost,
.stable > [hidden] {
  visibility: hidden;
}
/* a candidate never widens the page */
.stable > .stable__ghost {
  overflow-x: clip;
}
/* a hidden alternative keeps its box */
.stable > p[hidden],
.stable > div[hidden],
.stable > ul[hidden] {
  display: block;
}
.stable > .ctl[hidden] {
  display: grid;
}
.stable > .ctl-group[hidden],
.stable > .bench-row[hidden] {
  display: flex;
}
/* the wrapper takes the margins of the block it holds (the block itself has none inside it) */
.stable:has(> .readout) {
  margin-bottom: var(--space-3);
}
.stable:has(> .lab-error) {
  margin-block: var(--space-3);
}
.stable:has(> .rlc-formula) {
  margin: var(--space-2) 0;
}
/* stacked controls fill their cell, as a control alone in a grid row does */
.stable:has(> .ctl) {
  align-items: stretch;
}
.stable:has(> :is(.sm-status, .xy-note, .jitter-parts)) {
  margin-top: var(--space-2);
}
.stable:has(> .ring-plot-read) {
  margin-top: var(--space-1);
}
.stable:has(> .rlc-read) {
  margin-block: var(--space-2);
}
.stable:has(> .coarse-now) {
  margin: var(--space-2) 0 var(--space-1);
}
.stable:has(> :is(.bench-sketch__note, .fq-nyquist, .np-parts)) {
  margin-top: calc(-1 * var(--space-2));
}
.stable:has(> .np-edge-read) {
  margin-top: calc(-1 * var(--space-1));
}
/* a plot legend stays centred beside its plot */
.stable:has(> .lp-legend) {
  align-items: center;
}
.hint__body > .stable + p {
  margin-top: var(--space-2);
}
.stable--inline {
  display: inline-grid;
  justify-items: center;
}
/* mode-dependent controls: a hidden alternative keeps its box */
.stable > .ctl.bs-ctl-choice[hidden] {
  display: grid;
}
.stable > .lab-share-input[hidden] {
  display: block;
  visibility: hidden;
}
/* a parameter error covers the top of the results (which are then out of date): no row of its own */
.lab-results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
.lab-results > * {
  grid-area: 1 / 1;
  min-width: 0;
}
.lab-results > .lab-error {
  align-self: start;
  z-index: 1;
}
.lab-results > .lab-error[hidden] {
  display: none;
}
