/*
 * The new Gallery's one stylesheet (docs/plans/art/GALLERY-REDESIGN.md §2.8): the game's dark chrome and amber accent
 * (docs/STYLE_GUIDE.md tokens), pixel-crisp edges, 44 px touch targets, iPad first. One card, one badge, one chip and
 * one empty-state style for every section of the site. Pixel art always sits on a neutral checkerboard and is never
 * smoothed.
 */
:root {
  --uc-bg: #0b0b0e;
  --uc-panel: #121216;
  --uc-panel-raised: #1a1a20;
  --uc-panel-sunken: #0d0d10;
  --uc-edge: #2c2c34;
  --uc-edge-light: #3e3e48;
  --uc-edge-dark: #050507;
  --uc-text: #d8d4c8;
  --uc-text-muted: #8c887e;
  --uc-text-faint: #86837a;
  --uc-accent: #e8b04a;
  --uc-accent-hi: #ffd27a;
  --uc-accent-lo: #9a6e22;
  --uc-on-accent: #1a1206;
  --uc-focus: #ffd27a;
  --st-approved: #6cc04a;
  --st-proposed: #e8b04a;
  --st-missing: #d8483c;
  --st-na: #8c887e;
  /* drawn by the game's code (coverage `code`): the game's EXP teal (--uc-exp), complete but not art */
  --st-code: #5ab4c8;
  /* status words as text: the §2.8 red is under 4.5:1 on the panels at 13 px, so text uses a lighter tint of it */
  --st-missing-text: #ec6c60;
  --uc-px: 3px;
  --uc-touch: 44px;
  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --gutter-l: max(var(--s4), env(safe-area-inset-left));
  --gutter-r: max(var(--s4), env(safe-area-inset-right));
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-display: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --checker: repeating-conic-gradient(#24242b 0% 25%, #1b1b21 0% 50%) 50% / 16px 16px;
  color-scheme: dark;
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--uc-bg);
  color: var(--uc-text);
  font: 16px/1.5 var(--font-body);
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--uc-accent);
}

:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
  outline-offset: 2px;
}

h1 {
  margin: var(--s5) 0 var(--s3);
  font: 600 30px/1.2 var(--font-display);
  color: var(--uc-accent);
  letter-spacing: 0.01em;
}

code {
  font-family: var(--font-mono);
}

[hidden] {
  display: none !important;
}

/* ------------------------------------------------------------------ header */

.top {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  padding: max(var(--s2), env(safe-area-inset-top)) var(--gutter-r) var(--s2) var(--gutter-l);
  background: rgb(11 11 14 / 0.94);
  border-bottom: var(--uc-px) solid var(--uc-edge);
  box-shadow: 0 var(--uc-px) 0 var(--uc-edge-dark);
}

@supports (backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px)) {
  .top {
    background: rgb(11 11 14 / 0.82);
    -webkit-backdrop-filter: saturate(1.2) blur(10px);
    backdrop-filter: saturate(1.2) blur(10px);
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: var(--uc-touch);
  color: var(--uc-text);
  text-decoration: none;
}

.brand-mark {
  width: 18px;
  height: 18px;
  background: var(--uc-accent);
  box-shadow:
    inset -3px -3px 0 var(--uc-accent-lo),
    inset 3px 3px 0 var(--uc-accent-hi);
}

.brand-name {
  font: 600 20px/1 var(--font-display);
  letter-spacing: 0.02em;
}

.search-wrap {
  flex: 1 1 280px;
  min-width: 0;
}

.search {
  width: 100%;
  min-height: var(--uc-touch);
  padding: 0 var(--s3);
  font: 16px var(--font-body); /* never under 16 px: iOS zooms into smaller fields */
  color: var(--uc-text);
  background: var(--uc-panel-sunken);
  border: var(--uc-px) solid var(--uc-edge);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.search::placeholder {
  color: var(--uc-text-faint);
}

.search:focus {
  border-color: var(--uc-accent);
  outline: none;
}

.search:disabled {
  color: var(--uc-text-faint);
  cursor: not-allowed;
}

.topnav {
  display: flex;
  gap: var(--s1);
}

.navlink {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
  padding: 0 var(--s3);
  color: var(--uc-text);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 14px;
}

.navlink:focus-visible {
  color: var(--uc-accent-hi);
}

/* ------------------------------------------------------------------ main, notice, intro */

.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--gutter-r) max(var(--s6), env(safe-area-inset-bottom)) var(--gutter-l);
  outline: none;
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  /* lines up with the centred main column (max 1400 px including its gutters) */
  margin: var(--s3) max(var(--gutter-r), calc((100% - 1400px) / 2 + var(--gutter-r))) 0
    max(var(--gutter-l), calc((100% - 1400px) / 2 + var(--gutter-l)));
  padding: var(--s2) var(--s3);
  background: var(--uc-panel-raised);
  border-left: var(--uc-px) solid var(--uc-accent);
}

.notice p {
  margin: 0;
}

.loading {
  padding: var(--s6) 0;
  color: var(--uc-text-muted);
}

.intro .lead {
  max-width: 62ch;
  margin: 0 0 var(--s2);
  font-size: 18px;
}

.meta {
  margin: 0 0 var(--s4);
  color: var(--uc-text-muted);
  font-size: 14px;
}

.section-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--s2);
  margin-bottom: var(--s5);
}

.section-link {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: var(--s2) var(--s3);
  color: var(--uc-text);
  text-decoration: none;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
  box-shadow: inset var(--uc-px) var(--uc-px) 0 var(--uc-edge-light);
}

.section-link:focus-visible {
  border-color: var(--uc-accent);
  color: var(--uc-accent-hi);
}

/* G10e: home's section entry matches, "look inside a section" and guide search results. */
.name-hits,
.section-hits,
.guide-hits {
  margin-bottom: var(--s3);
}

.name-hits .section-links,
.section-hits .section-links,
.guide-hits .section-links {
  margin-bottom: var(--s2);
}

.section-link--more {
  font-style: italic;
}

.section-link--match {
  border-color: var(--uc-accent);
}

/* ------------------------------------------------------------------ buttons, chips, badges */

.btn,
.seg,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
  padding: 0 var(--s4);
  font: 15px var(--font-body);
  color: var(--uc-text);
  text-decoration: none;
  background: var(--uc-panel-raised);
  border: var(--uc-px) solid var(--uc-edge);
  border-radius: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.btn:active,
.seg:active,
.chip:active {
  transform: translateY(1px);
}

.btn--quiet {
  background: transparent;
}

.seg[aria-pressed='true'],
.chip[aria-pressed='true'] {
  color: var(--uc-on-accent);
  background: var(--uc-accent);
  border-color: var(--uc-accent-hi);
}

.segmented {
  display: inline-flex;
}

.segmented .seg + .seg {
  border-left-width: 0;
}

.badge {
  display: inline-block;
  padding: 1px var(--s2);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uc-accent);
  border: 1px solid var(--uc-accent-lo);
}

.badge--muted {
  color: var(--uc-text-muted);
  border-color: var(--uc-edge-light);
}

/* the four status dots: filled done, hollow open, grey not applicable */
.dots {
  display: inline-flex;
  gap: 5px;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--st-approved);
}

.dot--done {
  background: var(--st-approved);
}

.dot--open {
  background: transparent;
  border-color: var(--uc-text-muted);
}

/* not applicable: a struck-through grey box (a shape, not only a colour, and at least 3:1 on the panels) */
.dot--na {
  background: linear-gradient(
    135deg,
    transparent calc(50% - 1px),
    var(--st-na) calc(50% - 1px) calc(50% + 1px),
    transparent calc(50% + 1px)
  );
  border-color: var(--st-na);
}

/* ------------------------------------------------------------------ toolbar and filters */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s3);
  margin: var(--s3) 0;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.count {
  margin: 0;
  color: var(--uc-text-muted);
}

.filters {
  display: grid;
  gap: var(--s3);
  margin-bottom: var(--s4);
  padding: var(--s3) var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.chip-group {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.chip-group legend {
  padding: 0;
  margin-bottom: var(--s2);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--uc-accent);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.chip {
  padding: 0 var(--s3);
  font-size: 14px;
  background: var(--uc-panel-sunken);
}

/* ------------------------------------------------------------------ results: grid */

.results.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--s3);
}

/* §2.8: the list becomes two columns in portrait on the iPad */
@media (orientation: portrait) and (max-width: 1100px) {
  .results.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .results.grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--uc-text);
  text-decoration: none;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
  box-shadow: var(--uc-px) var(--uc-px) 0 var(--uc-edge-dark);
}

.card:focus-visible {
  border-color: var(--uc-accent);
}

.checker {
  background: var(--checker);
}

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.thumb img,
.tthumb img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  object-fit: contain;
}

.thumb img {
  width: 100%;
  height: 100%;
}

.thumb-none {
  padding: 2px var(--s2);
  color: var(--uc-text-faint);
  font-size: 13px;
  background: var(--uc-panel-sunken); /* the checkerboard's light squares are under 4.5:1 behind faint text */
}

/* Missing-file fallback: a picture whose file is not on the site (list.ts `missingBox`), drawn in the warning colour. */
.thumb-missing {
  color: var(--st-missing-text);
  border: 1px dashed currentColor;
}

/* lane gallery-clean: the old Gallery never had the file (list.ts `missingBox`): art still needed, not a lost file. */
.thumb-missing--art {
  border-style: solid;
}

.card-body {
  display: grid;
  gap: var(--s1);
  padding: var(--s2) var(--s3) var(--s3);
  min-width: 0;
}

.card-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.card-id {
  font-size: 13px;
  color: var(--uc-text-muted);
  overflow-wrap: anywhere;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  min-height: 20px;
}

/* ------------------------------------------------------------------ results: table */

.thead,
.trow {
  display: grid;
  grid-template-columns: 56px minmax(0, 2.4fr) minmax(0, 1fr) 76px minmax(0, 0.9fr) minmax(0, 0.9fr);
  gap: var(--s3);
  align-items: center;
  padding: 0 var(--s3);
}

.thead {
  min-height: 36px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--uc-accent);
  border-bottom: var(--uc-px) solid var(--uc-edge);
}

.trow {
  min-height: 60px;
  color: var(--uc-text);
  text-decoration: none;
  border-bottom: 1px solid var(--uc-edge);
}

.trow:nth-child(even) {
  background: var(--uc-panel);
}

.trow:focus-visible {
  background: var(--uc-panel-raised);
}

.tthumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
}

.tname {
  display: grid;
  min-width: 0;
}

.tkind {
  color: var(--uc-text-muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.cov {
  font-size: 13px;
  color: var(--uc-text-muted);
}

.cov--covered {
  color: var(--st-approved);
}

.cov--partial,
.cov--stand-in {
  color: var(--st-proposed);
}

.cov--code {
  color: var(--st-code);
}

.cov--missing {
  color: var(--st-missing-text);
}

@media (max-width: 700px) {
  .thead {
    display: none;
  }

  .trow {
    grid-template-columns: 56px minmax(0, 1fr) auto;
    padding: var(--s2) var(--s3);
  }

  .trow .tkind,
  .trow .cov {
    display: none;
  }
}

/* ------------------------------------------------------------------ more, empty */

.more {
  display: flex;
  margin: var(--s4) auto 0;
}

.sentinel {
  height: 1px;
}

.empty {
  margin: var(--s5) 0;
  padding: var(--s5);
  text-align: center;
  color: var(--uc-text-muted);
  background: var(--uc-panel);
  border: var(--uc-px) dashed var(--uc-edge-light);
}

.empty p {
  margin: 0 0 var(--s3);
}

.empty .empty-title {
  font: 600 20px/1.3 var(--font-display);
  color: var(--uc-text);
}

/* hover looks only where there is a pointer that hovers: on the iPad a tapped item would keep its hover look */
@media (hover: hover) {
  .navlink:hover {
    color: var(--uc-accent-hi);
  }

  .section-link:hover,
  .card:hover {
    border-color: var(--uc-accent);
  }

  .section-link:hover {
    color: var(--uc-accent-hi);
  }

  .btn:hover,
  .seg:not([aria-pressed='true']):hover,
  .chip:not([aria-pressed='true']):hover {
    border-color: var(--uc-edge-light);
  }

  .trow:hover {
    background: var(--uc-panel-raised);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }

  .btn:active,
  .seg:active,
  .chip:active {
    transform: none;
  }
}

/* ================================================================== asset page (lane G6a) ==================
 * §2 page header, section bar and sections 0, 1, 2 and 5 (sections 3 and 4 draw into their mounts, lane G6b).
 * --head-h is the sticky header's measured height (set by asset.ts), so the section bar sticks right under it.
 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--uc-text-muted);
}

.asset-head {
  padding-top: var(--s3);
}

.asset-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
}

.asset-nav-step {
  display: inline-flex;
  gap: var(--s2);
}

.btn--off {
  color: var(--uc-text-faint);
  cursor: default;
  background: transparent;
}

.asset-title {
  margin-bottom: var(--s1);
  overflow-wrap: anywhere;
}

.asset-ids {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin: 0 0 var(--s3);
  color: var(--uc-text-muted);
}

.asset-ids code {
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* the status strip: four plain steps, a shape and a word for each state (never colour alone) */
.strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s1);
  margin: 0 0 var(--s3);
  padding: 0;
  list-style: none;
}

.strip-step {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: var(--s2);
  padding: var(--s2) var(--s3);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.strip-step--done {
  border-color: var(--st-approved);
}

.strip-label {
  font-size: 14px;
  font-weight: 600;
}

.strip-state {
  grid-column: 2;
  font-size: 13px;
  color: var(--uc-text-muted);
}

.strip-step--done .strip-state {
  color: var(--st-approved);
}

@media (max-width: 700px) {
  .strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* the sticky section bar 0 · 1 · 2 · 3 · 4 · 5 */
.secbar {
  position: sticky;
  top: var(--head-h, 64px);
  z-index: 5;
  /* full bleed across the main column: each side cancels the gutter of the same side of .main */
  margin: 0 0 var(--s4);
  margin-left: calc(-1 * var(--gutter-l));
  margin-right: calc(-1 * var(--gutter-r));
  padding: var(--s1) 0;
  padding-left: var(--gutter-l);
  padding-right: var(--gutter-r);
  background: rgb(11 11 14 / 0.94);
  border-bottom: var(--uc-px) solid var(--uc-edge);
}

.secbar-list {
  display: flex;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}

.secbar-list li {
  flex: 1 0 auto;
}

.secbar-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
  padding: 0 var(--s3);
  font-size: 14px;
  color: var(--uc-text);
  text-decoration: none;
  background: var(--uc-panel);
  border: 1px solid var(--uc-edge);
}

.secbar-n {
  font-family: var(--font-mono);
  color: var(--uc-accent);
}

.secdot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--uc-text-muted);
}

.secdot--full {
  background: var(--uc-accent);
  border-color: var(--uc-accent);
}

@media (max-width: 900px) {
  .secbar-word {
    display: none;
  }
}

/* one section */
.asec {
  margin: 0 0 var(--s6);
  scroll-margin-top: calc(var(--head-h, 64px) + 64px);
}

.asec-h {
  display: flex;
  align-items: baseline;
  gap: var(--s3);
  margin: 0 0 var(--s3);
  padding-bottom: var(--s2);
  font: 600 24px/1.25 var(--font-display);
  color: var(--uc-text);
  border-bottom: var(--uc-px) solid var(--uc-edge);
  outline: none;
}

.asec-h:focus-visible {
  color: var(--uc-accent-hi);
}

.asec-n {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--uc-accent);
}

.asec--empty .asec-h {
  color: var(--uc-text-muted);
}

.subhead {
  margin: var(--s4) 0 var(--s2);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--uc-accent);
}

.alink {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
}

.alink-off {
  color: var(--uc-text-muted);
}

.btn--link {
  justify-content: flex-start;
  width: 100%;
  color: var(--uc-accent);
}

.hscroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* section 0 */
.ctx-grid {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s5);
}

@media (max-width: 900px) {
  .ctx-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

.ctx-text {
  max-width: 70ch;
  margin: 0;
  font-size: 17px;
}

.afacts {
  display: grid;
  gap: 0;
  margin: var(--s4) 0 0;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.fact {
  display: grid;
  grid-template-columns: minmax(110px, 38%) minmax(0, 1fr);
  gap: var(--s3);
  align-items: center;
  min-height: 40px;
  padding: var(--s1) var(--s3);
  border-bottom: 1px solid var(--uc-edge);
}

.fact:last-child {
  border-bottom: 0;
}

.fact dt {
  font-size: 13px;
  color: var(--uc-text-muted);
}

.fact dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.swatch {
  display: inline-block;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  border: 2px solid var(--uc-edge-light);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tag {
  padding: 2px var(--s2);
  font-size: 14px;
  background: var(--uc-panel-raised);
  border: 1px solid var(--uc-edge);
}

.atable-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.atable {
  width: 100%;
  margin-bottom: var(--s3);
  border-collapse: collapse;
  font-size: 14px;
}

.atable th,
.atable td {
  padding: var(--s2) var(--s3);
  text-align: left;
  border-bottom: 1px solid var(--uc-edge);
}

.atable th {
  font-size: 13px;
  color: var(--uc-accent);
}

.act--drawn {
  color: var(--st-approved);
}

.act--missing {
  color: var(--st-missing-text);
}

.act--code {
  color: var(--st-code);
}

.act--unknown,
.act--none {
  color: var(--uc-text-muted);
}

.format-box,
.guidelines {
  margin-top: var(--s4);
  padding: 0 var(--s4) var(--s3);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
  border-left-color: var(--uc-accent);
}

.arich p,
.arich ul {
  margin: 0 0 var(--s2);
}

.arich pre {
  overflow-x: auto;
  padding: var(--s2);
  font-size: 13px;
  background: var(--uc-panel-sunken);
}

.guidelines .empty {
  margin: var(--s2) 0;
}

.guide-links {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-links li {
  display: grid;
  border-bottom: 1px solid var(--uc-edge);
}

.guide-link {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  font-weight: 600;
}

.guide-fold-summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  font-weight: 600;
  cursor: pointer;
}

.guide-fold > .guide-links {
  padding-left: var(--s3);
}

.guide-why,
.guide-src {
  padding-bottom: var(--s2);
  font-size: 13px;
  color: var(--uc-text-muted);
}

/* fold-outs: one style for every carried and long text */
.afold {
  margin-top: var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.afold-summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  padding: 0 var(--s3);
  font-weight: 600;
  cursor: pointer;
}

.afold[open] > .afold-summary {
  border-bottom: 1px solid var(--uc-edge);
}

.afold > :not(summary) {
  margin-left: var(--s3);
  margin-right: var(--s3);
}

.afold--origin {
  margin-top: var(--s2);
}

.afold--origin > .afold-summary {
  font-size: 13px;
  font-weight: 400;
  color: var(--uc-text-muted);
}

.origin-note {
  margin: var(--s2) 0;
  font-size: 13px;
}

.study .afold.afold--origin {
  margin: 0 0 var(--s2);
  border-width: 1px;
}

.legacy-part h4 {
  margin: var(--s3) 0 var(--s1);
  color: var(--uc-accent);
}

/* section 1: 8 per row on iPad landscape, 4 in portrait */
.studies {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 1000px) {
  .studies {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .studies {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.study {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--uc-panel);
  border: 1px solid var(--uc-edge);
}

.study-pic,
.pic,
.concept-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.study-pic {
  aspect-ratio: 1;
}

.study-pic img,
.pic img,
.concept-pic img,
.concept-thumb img,
.orig-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* nearest-neighbour: crisp-edges first as the fallback, pixelated last so it wins wherever it is supported */
  image-rendering: crisp-edges;
  image-rendering: pixelated;
}

.study-body {
  display: grid;
  gap: 2px;
  padding: var(--s1) var(--s2);
}

.study-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.study-meta,
.study-fact {
  margin: 0;
  font-size: 13px;
  color: var(--uc-text-muted);
  overflow-wrap: anywhere;
}

.study .afold {
  margin-top: auto;
  border-width: 1px 0 0;
}

.study-note {
  margin: var(--s2) 0;
  font-size: 14px;
  white-space: pre-line;
}

.sha {
  font-size: 13px;
  word-break: break-all;
}

.adls {
  display: grid;
  gap: var(--s1);
  margin: var(--s2) 0;
}

.adl {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  font-size: 14px;
}

/* section 2 */
.concept-main {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  gap: var(--s4);
}

@media (orientation: portrait) and (max-width: 1100px) {
  .concept-main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.concept-pic {
  min-height: 320px;
  max-height: 70vh;
  border: var(--uc-px) solid var(--uc-edge);
}

.concept-pic img {
  width: 100%;
  height: 100%;
  max-height: 70vh;
}

.concept-facts p {
  margin: 0 0 var(--s2);
}

.concept-title {
  font: 600 20px/1.3 var(--font-display);
}

.concept-scope {
  font-size: 17px;
}

.concept-others {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.concept-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  padding: var(--s1);
  border: var(--uc-px) solid var(--uc-edge);
  cursor: pointer;
}

.concept-thumb[aria-pressed='true'] {
  border-color: var(--uc-accent);
}

/* section 5 */
.orig-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s3);
}

.badge--warn {
  color: var(--st-missing-text);
  border-color: var(--st-missing);
}

.orig-scales {
  display: flex;
  align-items: flex-end;
  gap: var(--s4);
  padding-bottom: var(--s2);
}

.orig-at {
  margin: 0;
}

.orig-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  min-height: 64px;
  padding: var(--s2);
  border: 1px solid var(--uc-edge);
}

.orig-at--4 .orig-frame img,
.orig-at--1 .orig-frame img {
  max-width: none;
  max-height: none;
}

.orig-at figcaption {
  font-size: 13px;
  color: var(--uc-text-muted);
}

.orig-none {
  padding: var(--s4) 0;
}

.orig-states {
  display: flex;
  gap: var(--s2);
  margin: 0;
  padding: 0 0 var(--s2);
  list-style: none;
}

.orig-state {
  display: grid;
  justify-items: center;
  gap: 2px;
  font-size: 13px;
}

.orig-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.orig-links .alink-off {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  padding: 0 var(--s3);
  border: 1px dashed var(--uc-edge);
}

.mapping {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.map-step {
  display: grid;
  flex: 1 1 180px;
  padding: var(--s2) var(--s3);
  background: var(--uc-panel);
  border: 1px solid var(--uc-edge);
}

.map-title {
  font-size: 13px;
  color: var(--uc-text-muted);
}

.map-value {
  overflow-wrap: anywhere;
}

.map-value a {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
}

@media (hover: hover) {
  .secbar-link:hover {
    border-color: var(--uc-accent);
  }
}
/* ================================================================== end of asset page (lane G6a) ========== */

/* ================================================================== lane G6b: export models, reels, lightbox
 * Section 3 export cards (sectionExports.ts), the #/exports list (exports.ts), the section 4 reel player and earlier
 * motion clips (reelPlayer.ts), and the lightbox (lightbox.ts). Same card, badge and empty-state look as the rest. */

.badge--approved {
  color: var(--st-approved);
  border-color: var(--st-approved);
}

.badge--proposed {
  color: var(--st-proposed);
  border-color: var(--uc-accent-lo);
}

.exp-cards,
.exp-list {
  display: grid;
  gap: var(--s4);
}

.exp-card,
.reel-model,
.clips-part {
  min-width: 0;
  padding: var(--s3) var(--s4) var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
  box-shadow: var(--uc-px) var(--uc-px) 0 var(--uc-edge-dark);
}

.exp-card--retired {
  border-style: dashed;
}

.exp-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2) var(--s3);
}

.exp-title {
  margin: 0;
  font: 600 19px/1.3 var(--font-display);
  color: var(--uc-text);
  overflow-wrap: anywhere;
}

.exp-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.exp-asset {
  margin: var(--s2) 0 0;
}

.exp-asset a {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  /* A short asset name ("Oil") is still a 44 px target (S4 walk, 2026-10-28). */
  min-width: var(--uc-touch);
}

.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--s1) var(--s3);
  margin: var(--s3) 0;
  font-size: 15px;
}

.facts dt {
  color: var(--uc-text-muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.exp-part {
  margin-top: var(--s4);
  padding-top: var(--s3);
  border-top: 1px solid var(--uc-edge);
}

.exp-part-title,
.exp-sheet h4 {
  margin: 0 0 var(--s2);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uc-accent);
}

.exp-sheet h4 {
  color: var(--uc-text);
}

.exp-tools,
.reel-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin: var(--s2) 0;
}

.exp-pics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s3);
}

.exp-pic {
  margin: 0;
  min-width: 0;
}

.exp-pic figcaption {
  margin-top: var(--s1);
  font-size: 13px;
  color: var(--uc-text-muted);
}

.exp-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 160px;
  max-height: 520px;
  padding: var(--s3);
  overflow: auto;
  border: var(--uc-px) solid var(--uc-edge);
  border-radius: 0;
  cursor: zoom-in;
}

.exp-frame--none {
  cursor: default;
}

.exp-box {
  position: relative;
  display: inline-block;
  line-height: 0;
}

.exp-img,
.reel-canvas,
.lb-img,
.clip-fallback img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.exp-img {
  max-width: none;
}

/* the pivot and canvas overlay: hidden until the toggle is on */
.exp-canvas,
.exp-pivot {
  position: absolute;
  display: none;
  pointer-events: none;
}

.exp-pics--overlay .exp-canvas,
.exp-pics--overlay .exp-pivot {
  display: block;
}

.exp-canvas {
  inset: 0;
  outline: 1px dashed var(--uc-accent-hi);
}

.exp-pivot {
  width: 11px;
  height: 11px;
  margin: -5px 0 0 -5px;
  background:
    linear-gradient(var(--st-missing), var(--st-missing)) 50% / 100% 1px no-repeat,
    linear-gradient(var(--st-missing), var(--st-missing)) 50% / 1px 100% no-repeat;
  outline: 1px solid var(--uc-edge-dark);
}

.exp-sheet {
  margin-bottom: var(--s3);
}

.exp-actions {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.exp-actions th,
.exp-actions td {
  padding: var(--s1) var(--s2);
  text-align: left;
  border-bottom: 1px solid var(--uc-edge);
}

.exp-actions thead th {
  color: var(--uc-text-muted);
  font-weight: 400;
}

/* eight compass cells around an empty centre: filled drawn, outlined mirrored, struck missing */
.compass {
  display: inline-grid;
  grid-template-columns: repeat(3, 28px);
  gap: 2px;
}

.compass-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  font: 13px var(--font-mono);
  border: 1px solid var(--uc-edge-light);
}

.compass-cell--centre {
  border-color: transparent;
}

.compass-cell--drawn {
  color: var(--uc-on-accent);
  background: var(--st-approved);
  border-color: var(--st-approved);
}

.compass-cell--mirrored {
  color: var(--st-approved);
  border-color: var(--st-approved);
}

.compass-cell--missing {
  color: var(--st-missing-text);
  text-decoration: line-through;
}

.dl-list {
  display: grid;
  gap: var(--s1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.dl {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 var(--s3);
  padding: 0 var(--s2);
  background: var(--uc-panel-sunken);
  border: 1px solid var(--uc-edge);
}

.dl-name {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  overflow-wrap: anywhere;
}

.dl-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s3);
  min-width: 0;
  max-width: 100%;
  font-size: 13px;
  color: var(--uc-text-muted);
}

.dl-hash {
  min-width: 0;
  font-size: 13px;
}

/* the full hash, wrapping anywhere and selected whole with one tap */
.dl-hash-value {
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-all;
  -webkit-user-select: all;
  user-select: all;
}

/* the reserved "Origin and rights" place (G15b panel later) */
.origin-text {
  margin: var(--s1) 0 0;
  font-size: 15px;
  color: var(--uc-text-muted);
}

.dl--fold {
  display: block;
}

.fold {
  margin-top: var(--s3);
}

.fold > summary,
.dl--fold summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  cursor: pointer;
  color: var(--uc-accent);
}

.rich pre {
  overflow: auto;
  padding: var(--s2);
  background: var(--uc-panel-sunken);
}

.notice-inline {
  padding: var(--s2) var(--s3);
  color: var(--st-missing-text);
  border: 1px solid var(--st-missing);
}

/* section 4: reels and clips */
.reel-model,
.clips-part {
  margin-bottom: var(--s4);
}

.reels,
.clips {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--s3);
  margin-top: var(--s3);
}

.reel,
.clip {
  margin: 0;
  min-width: 0;
}

.reel-title {
  margin-bottom: var(--s1);
}

.reel-count,
.reel-status,
.reel-info,
.clip-meta {
  font-size: 13px;
  color: var(--uc-text-muted);
}

.reel-status,
.reel-info {
  margin: var(--s1) 0 0;
}

.reel-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 160px;
  padding: var(--s3);
  overflow: auto;
  border: var(--uc-px) solid var(--uc-edge);
}

.reel-canvas {
  max-width: 100%;
  height: auto;
}

.reel-play {
  min-width: 88px;
}

.reel-stills {
  margin: var(--s3) 0 0;
  padding-left: var(--s4);
  color: var(--uc-text-muted);
}

.clip-video {
  display: block;
  width: 100%;
  max-height: 420px;
  background: #000;
}

.clip-fallback {
  display: grid;
  justify-items: center;
  gap: var(--s2);
  padding: var(--s3);
}

.clip-fallback img {
  max-width: 100%;
  max-height: 320px;
}

.clip-note {
  margin: 0;
  padding: 2px var(--s2);
  background: var(--uc-panel-sunken);
}

.clip figcaption {
  display: grid;
  gap: var(--s1);
  margin-top: var(--s1);
}

/* the lightbox */
.lightbox {
  width: 100vw;
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0;
  padding: max(var(--s2), env(safe-area-inset-top)) var(--gutter-r) var(--s2) var(--gutter-l);
  color: var(--uc-text);
  background: var(--uc-bg);
  border: 0;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.lightbox::backdrop {
  background: rgb(0 0 0 / 0.8);
}

.lb-bar,
.lb-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s2);
}

.lb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.lb-title {
  margin: 0;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.lb-size,
.lb-count {
  margin: 0;
  font-size: 13px;
  color: var(--uc-text-muted);
}

.lb-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  touch-action: pan-x pan-y pinch-zoom;
  border: var(--uc-px) solid var(--uc-edge);
}

.lb-stage--fit {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-stage--fit .lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

@media (hover: hover) {
  .exp-frame:hover {
    border-color: var(--uc-accent);
  }
}
/* ================================================================== end lane G6b */

/* ================================================================== S2 media sections (lane gallery-s2) */
/* Design guides, Studies, Screenshots, Posters, Cinematics and Videos (tools/gallery-site/src/media.ts, videos.ts,
   originNote.ts). Class names shared with other lanes (.entry-nav, .rich, .origin-note) are scoped to these six pages
   (.media-page, set by media.ts), so the asset page (G6a/G6b) and the classic pages (S3b) keep their own look. */

.view .lead {
  max-width: 70ch;
  margin: 0 0 var(--s3);
  font-size: 17px;
}

.media-links,
.media-page .entry-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s4);
}

.media-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
  margin: 0 0 var(--s3);
}

.media-tools .section-search {
  flex: 1 1 280px;
  width: auto;
}

.media-tools .count {
  margin: 0;
}

.media-filters {
  margin-bottom: var(--s4);
}

.media-group {
  margin: 0 0 var(--s5);
}

.media-group > h2,
.view--design-guides h2,
.view--studies h2,
.view--screenshots h2,
.view--posters h2,
.view--cinematics h2,
.view--videos h2 {
  margin: var(--s5) 0 var(--s3);
  font: 600 20px/1.3 var(--font-display);
  color: var(--uc-accent);
  scroll-margin-top: 96px;
}

/* the "did not load" line uses G6b's .notice-inline look; on these pages it keeps a gap below */
.view--videos .notice-inline {
  margin: 0 0 var(--s4);
}

/* table of contents: buttons, because the hash belongs to the router */
.toc {
  margin: 0 0 var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.toc-title {
  margin: 0 0 var(--s2);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--uc-text-muted);
}

.toc ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0 var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: var(--uc-touch);
  padding: 0 var(--s2);
  font: 15px var(--font-body);
  text-align: left;
  color: var(--uc-text);
  background: transparent;
  border: 0;
  border-left: var(--uc-px) solid var(--uc-edge-light);
  cursor: pointer;
}

.toc-link--3,
.toc-link--4 {
  padding-left: var(--s5);
  color: var(--uc-text-muted);
}

.toc-link:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
  outline-offset: -3px;
}

/* the carried text, word for word: line breaks kept */
.media-page .rich {
  max-width: 78ch;
  margin: 0 0 var(--s5);
  line-height: 1.55;
}

.media-page .rich p,
.media-page .rich li {
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.media-page .rich h2,
.media-page .rich h3,
.media-page .rich h4 {
  scroll-margin-top: 96px;
  margin: var(--s5) 0 var(--s2);
  font-family: var(--font-display);
  color: var(--uc-text);
}

.media-page .rich h3 {
  font-size: 18px;
}

.media-page .rich h4 {
  font-size: 16px;
  color: var(--uc-accent);
}

.media-page .rich ul {
  margin: 0 0 var(--s3);
  padding-left: var(--s5);
}

.media-page .rich pre {
  overflow-x: auto;
  padding: var(--s3);
  font: 14px/1.45 var(--font-mono);
  background: var(--uc-panel-sunken);
  border: var(--uc-px) solid var(--uc-edge);
}

.media-page .rich a,
.carried a {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-accent-hi);
}

.rt-table {
  max-width: 100%;
  margin: 0 0 var(--s3);
  overflow-x: auto;
  border: var(--uc-px) solid var(--uc-edge);
}

.rt-table:focus-visible {
  outline: 2px solid var(--uc-accent);
  outline-offset: 2px;
}

.rt-table table {
  border-collapse: collapse;
  font-size: 15px;
}

.rt-table th,
.rt-table td {
  padding: var(--s2) var(--s3);
  text-align: left;
  vertical-align: top;
  white-space: pre-line;
  border: 1px solid var(--uc-edge);
}

.rt-table th {
  color: var(--uc-text);
  background: var(--uc-panel);
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.entry-assets {
  margin: 0 0 var(--s4);
}

.chips .chip-link,
.card-meta .chip-link,
.fig-downloads .chip-link {
  margin: 0 var(--s1) var(--s1) 0;
}

.chip-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
  padding: 0 var(--s3);
  font: 14px var(--font-mono);
  color: var(--uc-accent-hi);
  text-decoration: none;
  background: var(--uc-panel-sunken);
  border: 1px solid var(--uc-edge-light);
  overflow-wrap: anywhere;
}

.chip-link:focus-visible {
  border-color: var(--uc-accent);
}

.carried {
  margin: var(--s5) 0;
  padding: 0 var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.carried summary,
.fig .fig-note summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  cursor: pointer;
  color: var(--uc-text);
}

.carried ul {
  margin: 0 0 var(--s3);
  padding-left: var(--s5);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* picture grid */
.fig-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--s3);
}

@media (orientation: portrait) and (max-width: 1100px) {
  .fig-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fig {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.fig-open {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  color: var(--uc-text-muted);
  text-decoration: none;
  border: 0;
  cursor: zoom-in;
}

a.fig-open {
  cursor: pointer;
}

.fig-open img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
}

.fig-open:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
  outline-offset: -3px;
}

.fig figcaption {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s2) var(--s3);
  font-size: 14px;
}

.fig figcaption .meta {
  margin: 0;
  font-size: 13px;
}

.fig .fig-title {
  overflow-wrap: anywhere;
}

.fig .fig-note p {
  margin: 0 0 var(--s2);
  white-space: pre-line;
}

.fig-wrap .more,
.media-more .more,
.video-list-wrap .more {
  margin-top: var(--s3);
}

/* videos */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--s3);
}

@media (max-width: 700px) {
  .video-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.video {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
  margin: 0;
  padding: var(--s2);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.video video,
.video-poster {
  display: block;
  width: 100%;
  max-height: 70vh;
  background: #000;
  object-fit: contain;
}

.video-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
}

.video-title {
  overflow-wrap: anywhere;
}

.video-fallback {
  display: flex;
  flex-direction: column;
  gap: var(--s2);
}

.video-fallback-box {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 9;
  color: var(--uc-text-muted);
}

.video-note {
  margin: 0;
  color: var(--uc-text);
}

.media-download {
  align-self: flex-start;
}

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

.video-row {
  padding: var(--s3) 0;
  border-bottom: 1px solid var(--uc-edge);
}

.video-row-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s3);
}

.video-row-text {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  min-width: 0;
}

.video-slot:not(:empty) {
  margin-top: var(--s3);
}

.video-page-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: var(--uc-touch);
  font-weight: 600;
  color: var(--uc-accent-hi);
}

.video-page .video {
  margin: 0 0 var(--s4);
}

/* "Origin and rights" (originNote.ts): the reserved fold-out until lane G15b's panel arrives */
.media-page .origin-note {
  margin: 0;
  font-size: 14px;
  color: var(--uc-text-muted);
}

.media-page .origin-note summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  cursor: pointer;
}

.media-page .origin-note p {
  margin: 0 0 var(--s2);
  font-size: 15px;
  color: var(--uc-text);
}

@media (hover: hover) {
  .toc-link:hover,
  .chip-link:hover {
    color: var(--uc-accent-hi);
    border-color: var(--uc-accent);
  }
}

/* ================================================================== end S2 media sections */

/* ------------------------------------------------------------------ S3b: Game Graphics and Game Codex (classic.ts) */

.classic-lead {
  max-width: 70ch;
  margin: 0 0 var(--s3);
}

.release-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: var(--s3) 0;
}

.release-note {
  margin: 0;
  color: var(--uc-text-muted);
  font-size: 14px;
}

.release-missing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s3);
  margin: 0 0 var(--s3);
  padding: var(--s2) var(--s3);
  background: var(--uc-panel-raised);
  border-left: var(--uc-px) solid var(--uc-accent);
}

.release-missing p {
  margin: 0;
}

.classic-search-wrap {
  max-width: 560px;
  margin: var(--s3) 0 0;
}

/* classic pictures: nearest-neighbour only, at whole-number scales (§2.8) */
img.pixel {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.entry-nav {
  margin-top: var(--s4);
}

.entry-head h1 {
  margin-bottom: var(--s2);
  overflow-wrap: anywhere;
}

.entry-head .meta {
  overflow-wrap: anywhere;
}

.recheck-flag {
  margin: 0 0 var(--s3);
  padding: var(--s2) var(--s3);
  color: var(--uc-text);
  background: var(--uc-panel-raised);
  border-left: var(--uc-px) solid var(--st-missing);
}

.classic-section {
  margin: var(--s4) 0;
}

.classic-figs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--s3);
}

.classic-fig {
  display: flex;
  flex-direction: column;
  margin: 0;
  min-width: 0;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.classic-pic {
  display: flex;
  min-height: 180px;
  padding: var(--s3);
  overflow: auto;
}

/* classic.ts sizes the picture to a whole-number scale that fits the box; never shrink it to an uneven one (a box that
   got narrower after a rotation scrolls instead) */
.classic-pic img {
  flex: none;
  max-width: none;
  margin: auto; /* centred, yet scrollable to both edges when wider than the box (unlike justify-content: center) */
}

.classic-pic .thumb-none {
  margin: auto;
}

.classic-fig figcaption {
  display: grid;
  gap: 2px;
  padding: var(--s2) var(--s3) var(--s3);
  font-size: 14px;
}

.fig-title {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.fig-size,
.fig-note {
  color: var(--uc-text-muted);
}

.rich {
  max-width: 80ch;
}

.rich p {
  margin: 0 0 var(--s3);
  overflow-wrap: anywhere;
}

.rich-h {
  margin: var(--s4) 0 var(--s2);
  font: 600 19px/1.3 var(--font-display);
  color: var(--uc-accent);
}

.rich-list {
  margin: 0 0 var(--s3);
  padding-left: var(--s5);
}

.rich-list li {
  margin-bottom: var(--s1);
  overflow-wrap: anywhere;
}

.rich-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.rich-code {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.asset-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
}

.asset-links .btn {
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ end S3b */

/* ================================================================== lane G7p: the coverage view (#/coverage) ==== */
/* tools/gallery-site/src/coverage.ts; every class starts with cov- (scoped to .cov-page where a name is generic). */

.cov-part {
  margin: 0 0 var(--s6);
}

.cov-part h2 {
  margin: 0 0 var(--s2);
  font: 22px var(--font-display);
  color: var(--uc-accent);
}

.cov-help {
  max-width: 70ch;
  margin: 0 0 var(--s3);
  font-size: 15px;
  color: var(--uc-text-muted);
}

/* the mapping check: a red banner naming each failure, or one quiet line when it passed */
.cov-banner {
  margin: 0 0 var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--uc-panel-raised);
  border: var(--uc-px) solid var(--st-missing);
  border-left-width: calc(var(--uc-px) * 3);
}

.cov-page .cov-banner h2 {
  color: var(--st-missing-text);
}

.cov-banner p {
  margin: 0 0 var(--s2);
}

.cov-fails {
  margin: 0;
  padding-left: var(--s5);
  font-size: 15px;
}

.cov-fails li {
  margin: 0 0 var(--s1);
  overflow-wrap: anywhere;
}

.cov-ok {
  margin: 0 0 var(--s5);
  padding: var(--s2) var(--s3);
  font-size: 15px;
  background: var(--uc-panel);
  border-left: var(--uc-px) solid var(--st-approved);
}

.cov-inline {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-accent-hi);
  overflow-wrap: anywhere;
}

.cov-inline code {
  font-size: 14px;
}

/* where the art is: one bar per group */
.cov-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2) var(--s4);
  margin: 0 0 var(--s3);
  padding: 0;
  font-size: 14px;
  list-style: none;
}

.cov-legend li {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
}

.cov-key {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 1px solid var(--uc-edge-light);
}

.cov-seg--ingame {
  background: repeating-linear-gradient(-45deg, var(--st-approved) 0 4px, #2f6a1f 4px 8px);
}

.cov-seg--approved {
  background: var(--st-approved);
}

.cov-seg--exported {
  background: var(--st-proposed);
}

/* a pattern as well as a colour, so the three steps differ without colour */
.cov-seg--concept {
  background: repeating-linear-gradient(45deg, var(--uc-accent-lo) 0 4px, #6d4e18 4px 8px);
}

.cov-seg--none {
  background: var(--uc-panel-sunken);
}

.cov-bars {
  display: grid;
  gap: var(--s1);
}

.cov-bar-row {
  display: grid;
  grid-template-columns: minmax(110px, 160px) 1fr minmax(150px, auto);
  align-items: center;
  gap: var(--s3);
}

.cov-bar-row--total {
  padding-bottom: var(--s2);
  margin-bottom: var(--s2);
  border-bottom: 1px solid var(--uc-edge);
}

.cov-bar-name {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-text);
  font-size: 15px;
}

.cov-bar-row--total .cov-bar-name {
  color: var(--uc-accent);
  font-weight: 600;
}

.cov-bar {
  display: flex;
  height: 20px;
  overflow: hidden;
  background: var(--uc-panel-sunken);
  border: 1px solid var(--uc-edge-light);
}

.cov-seg {
  display: block;
  height: 100%;
}

.cov-bar-figure {
  font-size: 14px;
  color: var(--uc-text-muted);
  text-align: right;
  white-space: nowrap;
}

/* the two count tables */
.cov-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--uc-edge);
}

.cov-table-wrap:focus-visible {
  outline: 2px solid var(--uc-focus);
}

.cov-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.cov-table th,
.cov-table td {
  padding: 0 var(--s2);
  border-bottom: 1px solid var(--uc-edge);
}

.cov-table thead th {
  padding: var(--s2);
  font-size: 13px;
  font-weight: 600;
  color: var(--uc-accent);
  text-align: right;
  vertical-align: bottom;
  background: var(--uc-panel);
}

.cov-table thead th:first-child,
.cov-table th[scope='row'] {
  text-align: left;
}

.cov-table th.cov-mode {
  text-align: center;
  border-bottom: 1px solid var(--uc-edge-light);
}

.cov-table th[scope='row'] {
  position: sticky;
  left: 0;
  font-weight: 400;
  white-space: nowrap;
  background: var(--uc-panel);
}

.cov-table .cov-total th,
.cov-table .cov-total td {
  font-weight: 600;
  background: var(--uc-panel-raised);
  border-top: var(--uc-px) solid var(--uc-edge-light);
}

.cov-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cov-link {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: var(--uc-touch);
  min-height: var(--uc-touch);
  color: var(--uc-accent-hi);
}

.cov-zero {
  color: var(--uc-text-faint);
}

/* the states and actions table: "x of y" cells, full ones in the approved colour, group names as links */
.cov-table td.cov-num:not(:has(a)) {
  height: var(--uc-touch);
}

.cov-full {
  color: var(--st-approved);
}

.cov-row-link {
  display: flex;
  align-items: center;
  min-width: var(--uc-touch);
  min-height: var(--uc-touch);
  color: var(--uc-accent-hi);
}

/* the re-check list by family */
.cov-families {
  display: grid;
  gap: var(--s2);
}

.cov-family {
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.cov-family summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3);
  min-height: var(--uc-touch);
  padding: 0 var(--s3);
  font-size: 15px;
  cursor: pointer;
}

.cov-family-count {
  font-variant-numeric: tabular-nums;
  color: var(--uc-accent);
}

.cov-family-open {
  margin: 0;
  padding: var(--s2) var(--s3) var(--s3);
}

.cov-entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 var(--s3);
  margin: 0;
  padding: 0 var(--s3);
  list-style: none;
}

.cov-entry {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: var(--uc-touch);
  padding: var(--s1) 0;
  color: var(--uc-text);
  overflow-wrap: anywhere;
}

.cov-entry code {
  font-size: 13px;
  color: var(--uc-text-muted);
}

/* the retired list */
.cov-retired-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--s3);
}

.cov-retired {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--s3);
  padding: var(--s3);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.cov-pic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  background: var(--checker);
}

.cov-pic img {
  max-width: 100%;
  max-height: 100%;
  image-rendering: pixelated;
}

.cov-pic--none {
  font-size: 13px;
  color: var(--uc-text-muted);
  background: var(--uc-panel-sunken);
}

.cov-retired h3 {
  margin: 0;
  font-size: 15px;
}

.cov-retired p {
  margin: 0 0 var(--s2);
}

.cov-facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--s1) var(--s3);
  margin: 0;
  font-size: 14px;
}

.cov-facts dt {
  color: var(--uc-text-muted);
}

.cov-facts dd {
  margin: 0;
}

/* iPad portrait and narrower: the bar's figure goes under the bar */
@media (max-width: 820px) {
  .cov-bar-row {
    grid-template-columns: minmax(100px, 130px) 1fr;
  }

  .cov-bar-figure {
    grid-column: 2;
    text-align: left;
  }
}

@media (max-width: 520px) {
  .cov-retired-list {
    grid-template-columns: 1fr;
  }
}

/* ================================================================== end lane G7p */

/* ================================================================== lane G14: the Designer guide (guide.ts) */

.guide-notice {
  margin: 0 0 var(--s4);
  padding: var(--s2) var(--s3);
  color: var(--uc-text);
  background: var(--uc-panel);
  border: 1px solid var(--uc-accent-lo);
  border-left: var(--uc-px) solid var(--uc-accent);
}

.guide-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--s1);
  margin: 0 0 var(--s1);
  font-size: 14px;
  color: var(--uc-text-muted);
}

.guide-crumbs a,
.guide-page .guide-src a,
.guide-doc-title a,
.guide-sec-title a {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  min-width: var(--uc-touch);
  color: var(--uc-accent-hi);
}

.guide-page .guide-src {
  max-width: 78ch;
  margin: 0 0 var(--s3);
  overflow-wrap: anywhere;
}

.guide-page .guide-src code {
  font: 13px var(--font-mono);
  color: var(--uc-text);
}

/* the library's table of contents: one card per guide */
.guide-library .media-group > h2 {
  margin-top: var(--s5);
}

.guide-doc {
  margin: 0 0 var(--s3);
  padding: var(--s2) var(--s4) var(--s3);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.guide-doc-title {
  margin: 0;
  font: 600 18px/1.3 var(--font-display);
}

.guide-doc .meta {
  margin: 0 0 var(--s2);
  overflow-wrap: anywhere;
}

.guide-doc-toc summary,
.guide-assets summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  padding: 0 var(--s2);
  font-size: 15px;
  color: var(--uc-text);
  cursor: pointer;
}

.guide-doc-toc summary:focus-visible,
.guide-assets summary:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
  outline-offset: -3px;
}

.guide-toc {
  margin: 0 0 var(--s5);
  padding: var(--s3) var(--s4);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.guide-toc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0 var(--s3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-toc-link {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  padding: var(--s1) var(--s2);
  font-size: 15px;
  color: var(--uc-text);
  text-decoration: none;
  border-left: var(--uc-px) solid var(--uc-edge-light);
  overflow-wrap: anywhere;
}

.guide-toc-link--3,
.guide-toc-link--4 {
  padding-left: var(--s5);
  color: var(--uc-text-muted);
}

.guide-toc-link[aria-current] {
  color: var(--uc-accent-hi);
  border-left-color: var(--uc-accent);
}

.guide-toc-link:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
  outline-offset: -3px;
}

/* the sections of a guide; the asked one highlighted */
.guide-sec {
  margin: 0 0 var(--s4);
  padding: var(--s2) var(--s4) var(--s3);
  border: var(--uc-px) solid transparent;
  border-left: var(--uc-px) solid var(--uc-edge);
  scroll-margin-top: 96px;
}

.guide-sec--3,
.guide-sec--4 {
  margin-left: var(--s4);
}

.guide-sec--target {
  background: var(--uc-panel);
  border-color: var(--uc-accent);
}

.guide-sec-title {
  margin: 0 0 var(--s1);
  font: 600 20px/1.3 var(--font-display);
}

.guide-sec--3 .guide-sec-title,
.guide-sec--4 .guide-sec-title {
  font-size: 18px;
}

.guide-sec-title:focus {
  outline: none;
}

.guide-sec-title:focus-visible {
  outline: var(--uc-px) solid var(--uc-focus);
}

.guide-page .guide-sec .rich {
  margin-bottom: var(--s3);
}

.guide-assets {
  margin: 0 0 var(--s3);
  padding: 0 var(--s3) var(--s1);
  background: var(--uc-panel-sunken);
  border: 1px solid var(--uc-edge);
}

.guide-assets[open] {
  padding-bottom: var(--s3);
}

.guide-assets p {
  margin: var(--s2) 0;
}

.guide-why {
  margin: var(--s2) 0;
  padding-left: var(--s5);
  line-height: 1.5;
}

.guide-asset-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin: 0 0 var(--s2);
  padding: 0;
  list-style: none;
}

.guide-prevnext {
  margin: var(--s3) 0 0;
}

.guide-prevnext .btn {
  max-width: 100%;
  overflow-wrap: anywhere;
}

/* the search results */
.guide-results {
  display: grid;
  gap: var(--s2);
  margin: 0 0 var(--s4);
}

.guide-hit {
  display: grid;
  gap: var(--s1);
  min-height: var(--uc-touch);
  padding: var(--s2) var(--s3);
  color: var(--uc-text);
  text-decoration: none;
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

.guide-hit:focus-visible {
  border-color: var(--uc-accent);
}

.guide-hit-title {
  font: 600 17px/1.3 var(--font-display);
  color: var(--uc-accent-hi);
}

.guide-hit .meta {
  margin: 0;
}

.guide-hit-text {
  font-size: 14px;
  color: var(--uc-text-muted);
  overflow-wrap: anywhere;
}

@media (hover: hover) {
  .guide-toc-link:hover,
  .guide-hit:hover {
    color: var(--uc-accent-hi);
    border-color: var(--uc-accent-lo);
  }
}

/* ================================================================== end lane G14 */

/* ================================================================== lane G15b: origin and rights (originNote.ts, rights.ts) */

/* the "Origin and rights" slot on every card: what the record holds, and the link to the register */
.origin-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s1) var(--s3);
  margin: var(--s2) 0;
  font-size: 14px;
}

.origin-facts dt {
  color: var(--uc-text-muted);
}

.origin-facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.origin-more {
  margin: var(--s1) 0 var(--s2);
}

.origin-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-accent);
  font-size: 14px;
}

.origin-link:focus-visible {
  outline: 2px solid var(--uc-focus);
  outline-offset: 2px;
}

.classic-fig > .origin,
.clip > .origin {
  margin: var(--s2) 0 0;
  font-size: 14px;
  color: var(--uc-text-muted);
}

.classic-fig > .origin > summary,
.clip > .origin > summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  cursor: pointer;
}

/* the rights register page */
.rights-postponed {
  max-width: 70ch;
  margin: 0 0 var(--s4);
  padding: var(--s3) var(--s4);
  font-size: 15px;
  border-left: 3px solid var(--uc-accent);
  background: var(--uc-panel);
}

.rights-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s2);
  margin: 0 0 var(--s4);
}

.rights-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--uc-edge);
}

.rights-table-wrap:focus-visible {
  outline: 2px solid var(--uc-focus);
}

.rights-table {
  border-collapse: collapse;
  font-size: 14px;
}

.rights-table th,
.rights-table td {
  padding: var(--s2);
  border-bottom: 1px solid var(--uc-edge);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  min-width: 8ch;
}

.rights-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-accent);
}

.rights-link:focus-visible {
  outline: 2px solid var(--uc-focus);
  outline-offset: 2px;
}

.rights-table thead th {
  font-size: 13px;
  font-weight: 600;
  color: var(--uc-accent);
  background: var(--uc-panel);
  white-space: nowrap;
}

/* ================================================================== end lane G15b */

/* lane gallery-clean: pictures withdrawn from the page, kept in its history (asset.ts withdrawnBlock) */
.withdrawn {
  margin: 0 0 var(--s6);
}

.withdrawn-list {
  margin: var(--s2) 0 0;
  padding: 0;
  list-style: none;
}

.withdrawn-item {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
  padding: var(--s2) 0;
  border-top: var(--uc-px) solid var(--uc-edge);
  font-size: 14px;
}

.withdrawn-reason {
  color: var(--uc-text);
}

.withdrawn-meta,
.withdrawn-path {
  color: var(--uc-text-muted);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.withdrawn-path {
  font-family: var(--font-mono);
}

/* ------------------------------------------------------------------ How to use this site (lane gallery-howto) */

.howto-page .lead {
  max-width: 72ch;
}

.howto-index {
  display: grid;
  gap: var(--s3);
  margin: 0 0 var(--s5);
  padding: 0;
  list-style: none;
}

.howto-index-item {
  display: flex;
  flex-direction: column;
  gap: var(--s1);
}

.howto-summary {
  margin: 0;
  color: var(--uc-text-muted);
  font-size: 15px;
}

.howto-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) minmax(0, 1fr);
  gap: var(--s5);
  align-items: start;
}

@media (max-width: 900px) {
  .howto-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.howto-toc {
  position: sticky;
  top: 96px;
  padding: 0 var(--s3);
  background: var(--uc-panel);
  border: var(--uc-px) solid var(--uc-edge);
}

@media (max-width: 900px) {
  .howto-toc {
    position: static;
  }
}

/* The fold's one row: a 44 px target that opens and closes the contents (closed above the article on a narrow screen). */
.howto-toc-summary {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-text);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* The browser's own triangle is replaced by the +/− sign on the right (WebKit draws it with its own pseudo-element). */
.howto-toc-summary {
  list-style: none;
}

.howto-toc-summary::-webkit-details-marker {
  display: none;
}

.howto-toc-summary::after {
  margin-left: auto;
  padding-left: var(--s2);
  color: var(--uc-accent-hi);
  content: '+';
}

.howto-toc[open] > .howto-toc-summary::after {
  content: '\2212';
}

.howto-toc-summary:focus-visible {
  outline: 2px solid var(--uc-focus);
  outline-offset: -3px;
}

.howto-toc[open] > nav {
  padding-bottom: var(--s3);
}

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

.howto-toc-home,
.howto-toc-link,
.howto-crumb {
  display: flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-text);
  font-size: 15px;
  text-decoration: none;
}

.howto-crumb {
  display: inline-flex;
  color: var(--uc-accent-hi);
}

.howto-toc-home {
  color: var(--uc-accent-hi);
  font-weight: 600;
}

.howto-toc-link[aria-current='page'] {
  color: var(--uc-accent-hi);
  border-left: var(--uc-px) solid var(--uc-accent);
  padding-left: var(--s2);
}

.howto-toc-home:focus-visible,
.howto-toc-link:focus-visible,
.howto-crumb:focus-visible,
.howto-link:focus-visible {
  outline: 2px solid var(--uc-focus);
}

.howto-article {
  min-width: 0;
  max-width: 920px;
  font-size: 16px;
  line-height: 1.55;
}

.howto-h {
  margin: var(--s5) 0 var(--s2);
  font: 600 20px/1.3 var(--font-display);
}

.howto-link {
  display: inline-flex;
  align-items: center;
  min-height: var(--uc-touch);
  color: var(--uc-accent-hi);
}

.howto-code {
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.howto-list {
  margin: 0 0 var(--s3);
  padding-left: var(--s5);
}

.howto-list li {
  margin-bottom: var(--s1);
}

.howto-note {
  padding: var(--s3);
  background: var(--uc-panel-raised);
  border-left: var(--uc-px) solid var(--uc-accent);
}

.howto-table-wrap {
  max-width: 100%;
  margin: 0 0 var(--s4);
  overflow-x: auto;
}

.howto-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.howto-table th,
.howto-table td {
  padding: var(--s2);
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--uc-edge);
  /* break-word, not anywhere: a column never shrinks below its longest word, so a link stays touch-sized */
  overflow-wrap: break-word;
}

/* An address or path in a table breaks only where it must, never letter by letter down a narrow column. */
.howto-table .howto-code {
  overflow-wrap: break-word;
}

.howto-table th[scope='row'] {
  min-width: 9em;
}

.howto-table thead th {
  background: var(--uc-panel-raised);
}

.howto-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--s2);
  margin: var(--s5) 0;
}

.howto-sources {
  color: var(--uc-text-muted);
  font-size: 14px;
}
