/* ============================================================
   Shared content kit — the long-form page components
   ------------------------------------------------------------
   Loaded by any page whose content needs them (currently the
   Software and Model pages, via their extra_head block).

   These live here rather than in a page's own stylesheet because
   more than one page uses them, and a second copy is how two
   pages quietly stop looking like one site. Components only one
   page needs stay in that page's own file.

     .wiki-fig        a figure: framed, horizontally scrollable on
                      a narrow screen, with a mono-labelled caption
     .wiki-dia        the drawing language every inline SVG speaks
     .wiki-chip       implemented / configuration-dependent / planned
     .wiki-spec       a strip of headline numbers
     .wiki-claims     the does / does-not-claim pair
     .wiki-stage(s)   pipeline-stage cards, greyed when unimplemented
     .wiki-term       a shell block · .wiki-code  a plain listing
     .wiki-table      compact reference tables · .wiki-scroll wrapper
     .wiki-lead       the one sentence that stands for a section
     .wiki-path       a file or symbol path in prose
     .wiki-panehead   a tab-pane title that is not a heading

   The diagrams are authored against a 700-unit viewBox so one
   SVG unit is roughly one CSS pixel in the lg content column;
   that is what keeps a 10px label a real 10px. Below 660px the
   frame scrolls rather than shrinking type into illegibility.
   ============================================================ */

/* Model and Software: full-length chapters with a clear reading hierarchy.
   These rules are scoped so other wiki pages retain their existing layout. */
.story-page .bg-hero.hero-factory {
  min-height: 280px;
  padding: 2rem 0 3.5rem;
  margin-bottom: 1.5rem !important;
}

.story-page .hero-card { max-width: 690px; }
.story-page .hero-card .lead { font-size: 1.08rem; line-height: 1.55; }
.story-page .hero-card h1 { font-size: clamp(2.5rem, 5vw, 3.7rem); }
.story-page #wikiMain { min-width: 0; }
.story { padding: 1.3rem 0 3rem; }
.story p, .story li { font-size: 1.025rem; line-height: 1.7; }
.story p { max-width: 72ch; color: var(--ink-2); }
.story > ul, .story > ol, .story section > ul:not([class]), .story section > ol:not([class]) { max-width: 72ch; }
.story p strong, .story li strong { color: var(--ink); }
.story-page #wikiMain .story h2 {
  max-width: 28ch;
  margin: 3.25rem 0 1rem;
  font-size: clamp(1.6rem, 2.7vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
}
.story-page #wikiMain .story h3 { margin: 2rem 0 0.75rem; font-size: 1.4rem; line-height: 1.3; }
.story-page #wikiMain .story h4 { margin: 1.5rem 0 0.65rem; font-size: 1.08rem; line-height: 1.4; }
.story-page #wikiMain .story .story-intro h2 { margin-top: 0.45rem; max-width: 30ch; }
.story [id] { scroll-margin-top: 90px; }
.story-intro { margin-bottom: 1.5rem; }
.story .story-kicker {
  display: block;
  margin-bottom: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.065em;
  line-height: 1.6;
  text-transform: uppercase;
  color: var(--pipe-blue-deep);
}
.story .story-deck { max-width: 62ch; font-size: 1.2rem; line-height: 1.6; color: var(--ink); }
.story-actions { display: flex; flex-wrap: wrap; gap: 0.65rem; margin: 1.3rem 0; }
.story-actions .btn { white-space: normal; text-align: left; }
.story-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 1rem; margin: 1.3rem 0; }
.story-card { min-width: 0; padding: 1.25rem; border: 1px solid var(--paper-edge); border-radius: 10px; background: var(--card-tint); }
.story-card p { margin: 0.5rem 0 0; font-size: 0.95rem; line-height: 1.6; }
.story-card > strong { display: block; font-family: var(--font-display); font-size: 1.15rem; line-height: 1.4; }
.story-card > :first-child { margin-top: 0 !important; }
.story-card > :last-child { margin-bottom: 0; }
.story-note { max-width: 74ch; padding: 0.8rem 1.1rem; margin: 1.4rem 0; border-left: 3px solid var(--pipe-blue-deep); background: var(--paper-sink); }
.story .story-note, .story-note p { font-size: 0.94rem; line-height: 1.6; }
.story-note p:last-child { margin-bottom: 0; }
.story-case { margin: 1.5rem 0; border: 1px solid var(--paper-edge); border-top: 3px solid var(--pipe-blue-deep); border-radius: 10px; padding: clamp(1rem, 3vw, 1.6rem); background: var(--card-tint); }
.story-case > :first-child { margin-top: 0 !important; }
.story-case > :last-child { margin-bottom: 0; }
.story-flow { counter-reset: story-step; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 0.7rem; list-style: none; padding: 0; margin: 1.5rem 0; }
.story-flow > li { position: relative; min-width: 0; padding: 1rem; margin: 0; border: 1px solid var(--paper-edge); border-radius: 8px; background: var(--card); font-size: 0.92rem; line-height: 1.55; }
.story-flow > li::before { counter-increment: story-step; content: counter(story-step, decimal-leading-zero); display: block; font-family: var(--font-mono); font-size: 0.7rem; color: var(--pipe-blue-deep); margin-bottom: 0.5rem; }
.story-flow > li > strong { display: block; font-family: var(--font-display); font-size: 1.08rem; margin-bottom: 0.3rem; }
.story-flow p { margin: 0.35rem 0 0; font-size: 0.92rem; line-height: 1.55; }
.story-details { border: 1px solid var(--paper-edge); border-radius: 8px; padding: 0 1.2rem; margin: 1rem 0; background: var(--card); }
.story-details > summary { position: relative; list-style: none; margin: 0 -1.2rem; padding: 1rem 3rem 1rem 1.2rem; font-weight: 700; line-height: 1.45; cursor: pointer; color: var(--ink); border-radius: 8px; }
.story-details > summary::-webkit-details-marker { display: none; }
.story-details > summary::after { content: '+'; position: absolute; top: 0.8rem; right: 1.2rem; font-size: 1.3rem; font-weight: 400; color: var(--pipe-blue-deep); }
.story-details[open] > summary::after { content: '−'; }
.story-details > summary:hover { background: var(--paper-sink); }
.story-details > summary:focus-visible { outline: 3px solid var(--pipe-blue); outline-offset: 3px; }
.story-details[open] { padding-bottom: 1.2rem; }
.story-details[open] > summary { margin-bottom: 1.2rem; border-bottom: 1px solid var(--paper-edge); border-radius: 8px 8px 0 0; }
.story-details > :last-child { margin-bottom: 0; }
.story-details .judging { padding: 0; margin: 0; border: 0; background: transparent; }
.story-page #wikiMain .story-details .judging__title { font-size: 1.15rem; margin: 0.5rem 0; max-width: none; }
.story .judging__a, .story .judging__blurb { font-size: 0.95rem; line-height: 1.6; }
.story .judging__where { font-size: 0.8rem; }
.story-details dt { margin-top: 1.25rem; line-height: 1.5; }
.story-details dt:first-child { margin-top: 0; }
.story-details dd { margin-top: 0.5rem; line-height: 1.65; color: var(--ink-2); }
.story .wiki-scroll { max-width: 100%; overflow-x: auto; }
.story .wiki-table, .story-table { font-size: 0.9rem; line-height: 1.6; width: 100%; }
.story .wiki-table th, .story .wiki-table td, .story-table th, .story-table td { padding: 0.75rem 0.8rem; vertical-align: top; }
.story .wiki-table th, .story-table th { color: var(--ink); }
.story .wiki-table thead th, .story-table thead th { color: var(--ink); background: var(--pipe-blue-soft); border-bottom: 2px solid var(--paper-edge); }
.story .wiki-table td, .story-table td { color: var(--ink-2); }
.story .wiki-table__note, .story figcaption { font-size: 0.85rem; line-height: 1.6; color: var(--ink-2); }
.story figcaption { margin-top: 0.8rem; max-width: 85ch; }
.story code { overflow-wrap: anywhere; }
.story .wiki-chip { font-size: 0.72rem; }
.story .wiki-term { box-shadow: none; border-width: 1px; }
.story .wiki-term pre { font-size: 0.85rem; }
.story .wiki-term__c { color: #b9c8d4; }
.story .wiki-spec__k, .story .wiki-spec__n { color: var(--ink-2); }
.story-mechanism { margin: 1.5rem 0 2rem; }
.story-mechanism .story-grid { gap: 0; border: 1px solid var(--paper-edge); border-radius: 10px; overflow: hidden; }
.story-mechanism__state { min-width: 0; padding: 1.1rem 1.2rem; background: var(--card-tint); }
.story-mechanism__state--on { border-left: 1px solid var(--paper-edge); background: var(--card); }
.story-mechanism__state p { font-size: 0.93rem; line-height: 1.55; margin: 0.7rem 0 0; }
.story-mechanism svg, .story-mechanism img.wiki-webp { display: block; width: 100%; max-width: 410px; margin: 0 auto; }
.story-mechanism svg text { font-family: var(--font-sans); font-size: 12px; fill: var(--ink-2); }
.story-mechanism svg path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.story-mechanism .rna-switch { stroke: var(--ink); stroke-width: 3; }
.story-mechanism .rna-pair { stroke: #919191; stroke-width: 1.4; }
.story-mechanism .rna-input { stroke: var(--pipe-blue-deep); stroke-width: 5; }
.story-mechanism .rna-trigger { stroke: var(--cernal-red); stroke-width: 4; }
.story-mechanism .rna-payload { stroke: var(--gate-green-deep); stroke-width: 5; }
.story-mechanism .rna-ribosome { fill: var(--pipe-blue-soft); stroke: var(--pipe-blue-deep); stroke-width: 1.5; }
.story-mechanism .rna-output { stroke: var(--ink-2); stroke-width: 1.5; }

@media (max-width: 767.98px) {
  .story-page .bg-hero.hero-factory { min-height: 250px; padding: 1.6rem 0 3rem; }
  .story-page .hero-card { padding: 1rem 1.15rem; }
  .story { padding-top: 0.6rem; }
  .story p, .story li { font-size: 1rem; }
  .story .story-deck { font-size: 1.1rem; }
  .story-page #wikiMain .story h2 { margin-top: 2.5rem; }
  .story-flow { grid-template-columns: 1fr; }
  .story-flow > li { padding: 0.9rem 1rem 0.9rem 3.2rem; }
  .story-flow > li::before { position: absolute; left: 1rem; top: 1.1rem; }
  .story-details { padding-left: 0.9rem; padding-right: 0.9rem; }
  .story-details > summary { margin-left: -0.9rem; margin-right: -0.9rem; padding-left: 0.9rem; }
  .story .wiki-table, .story-table { font-size: 0.83rem; }
  .story .wiki-table th, .story .wiki-table td, .story-table th, .story-table td { padding: 0.6rem; }
}

@media (max-width: 575.98px) {
  .story-mechanism .story-grid { grid-template-columns: 1fr; }
  .story-mechanism__state--on { border-left: 0; border-top: 1px solid var(--paper-edge); }
}

@media print {
  .story-page .hero-factory, .story-page .wiki-toc { display: none; }
  .story-page #wikiMain { width: 100%; }
  .story-details > summary { break-after: avoid; }
  .story figure, .story-card { break-inside: avoid; }
}

/* ------------------------------------------------------------
   Figures — inline SVG in a framed, scrollable well
   ------------------------------------------------------------ */
.wiki-fig {
  margin: 1.75rem 0 2rem;
}

/* The frame carries the border, so the SVG itself never needs one and
   can bleed to the frame's edge. overflow-x lets a 820-unit diagram
   stay readable on a phone by scrolling instead of scaling down. */
.wiki-fig__frame {
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  background: var(--card);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}

.wiki-fig__frame svg, .wiki-fig__frame img.wiki-webp {
  display: block;
  width: 100%;
  min-width: 660px;
  height: auto;
}

/* A diagram that is genuinely wide (the pipeline, the maturity matrix)
   needs more room than the others before it starts scrolling. */
.wiki-fig--tall .wiki-fig__frame svg, .wiki-fig--tall .wiki-fig__frame img.wiki-webp {
  min-width: 700px;
}

.wiki-fig figcaption {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin-top: 0.6rem;
}

.wiki-fig figcaption b,
.wiki-fig figcaption strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pipe-blue-deep);
}

/* Hint that the frame scrolls, shown only where it can. */
.wiki-fig__hint {
  display: none;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  margin-top: 0.35rem;
}

@media (max-width: 719.98px) {
  .wiki-fig__hint {
    display: block;
  }
}

/* ------------------------------------------------------------
   Status chips — implemented / configuration-dependent / planned
   ------------------------------------------------------------
   The three states the page refuses to conflate. Each chip is a
   bordered mono label; the dot is secondary to the text, so the
   meaning survives greyscale printing and colour blindness.
   ------------------------------------------------------------ */
.wiki-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.1em 0.55em 0.14em;
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-pill);
  background: var(--card);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink-2);
  vertical-align: 0.08em;
}

.wiki-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: 0 0 7px;
}

.wiki-chip--built {
  border-color: var(--acc-green);
  background: var(--acc-green-soft);
  color: var(--gate-green-deep);
}

.wiki-chip--built::before {
  background: var(--acc-green);
}

.wiki-chip--config {
  border-color: var(--acc-gold);
  background: var(--acc-gold-soft);
  color: var(--rna-amber-deep);
}

.wiki-chip--config::before {
  background: var(--acc-gold);
}

.wiki-chip--planned {
  border-color: var(--ink-3);
  background: var(--paper-sink);
  color: var(--ink-3);
}

.wiki-chip--planned::before {
  background: var(--ink-3);
}

/* ============================================================
   Diagram language — shared by every inline SVG in
   wiki/software-figures.html
   ------------------------------------------------------------
   Kept here rather than in a <style> block inside each SVG, so
   the six figures carry geometry and class names only and the
   whole visual language is defined once.

   Authored against a 700-unit viewBox: at xl the figures scale
   up slightly, at lg they sit near 1:1, and below 660px the
   frame scrolls. So these px values are close to the real
   rendered sizes — treat 10px as a genuine 10px.

   Node colour indexes a CATEGORY, never a status, and is always
   accompanied by a text label (iGEM accessibility, and the
   palette's own rule that accents index rather than decorate).
   ============================================================ */
.wiki-dia {
  font-family: var(--font-sans);
}

/* --- surfaces ------------------------------------------------ */
.wiki-dia .d-bg {
  fill: var(--card);
}

/* A grouping container: thin ink-3 hairline, no fill of its own. */
.wiki-dia .d-group {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
}

/* The engine boundary, and any other rule that is enforced rather
   than drawn: dashed, because it is a constraint and not a pipe. */
.wiki-dia .d-bound {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 7 5;
}

.wiki-dia .d-well {
  fill: var(--paper-sink);
  stroke: var(--paper-edge);
  stroke-width: 1;
}

/* --- node categories ---------------------------------------- */
.wiki-dia .n-access {
  fill: var(--acc-blue-soft);
  stroke: var(--acc-blue);
  stroke-width: 1.5;
}

.wiki-dia .n-platform {
  fill: var(--acc-teal-soft);
  stroke: var(--acc-teal);
  stroke-width: 1.5;
}

.wiki-dia .n-engine {
  fill: var(--acc-violet-soft);
  stroke: var(--acc-violet);
  stroke-width: 1.5;
}

.wiki-dia .n-store {
  fill: var(--acc-gold-soft);
  stroke: var(--acc-gold);
  stroke-width: 1.5;
}

/* An external dependency, or anything the project does not own. */
.wiki-dia .n-ext {
  fill: var(--paper-sink);
  stroke: var(--ink-3);
  stroke-width: 1.5;
}

/* Science that is implemented and running. */
.wiki-dia .n-built {
  fill: var(--acc-green-soft);
  stroke: var(--acc-green);
  stroke-width: 1.5;
}

/* Declared but not implemented: grey, flat, and labelled as such. */
.wiki-dia .n-stub {
  fill: var(--paper-sink);
  stroke: var(--ink-3);
  stroke-width: 1.5;
  stroke-dasharray: 5 4;
}

/* The one signal colour. Used for a single thing per figure. */
.wiki-dia .n-signal {
  fill: var(--cernal-red-soft);
  stroke: var(--cernal-red);
  stroke-width: 1.5;
}

/* A two-state marker. The difference is open versus filled rather than
   one colour versus another, so it survives greyscale printing and a
   reader who cannot separate the hues. */
.wiki-dia .n-open {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 2;
}

.wiki-dia .n-fill {
  fill: var(--ink-3);
  stroke: var(--ink);
  stroke-width: 2;
}

.wiki-dia .n-decide {
  fill: var(--card);
  stroke: var(--ink);
  stroke-width: 1.5;
}

/* --- connectors --------------------------------------------- */
.wiki-dia .d-flow {
  fill: none;
  stroke: var(--pipe-blue);
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* A route taken only in one input mode, or an optional dependency. */
.wiki-dia .d-flow-alt {
  fill: none;
  stroke: var(--acc-violet);
  stroke-width: 1.8;
  stroke-dasharray: 6 4;
  stroke-linecap: round;
}

.wiki-dia .d-tick {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1;
}

.wiki-dia marker path {
  fill: var(--pipe-blue);
}

.wiki-dia marker.m-alt path {
  fill: var(--acc-violet);
}

/* --- type --------------------------------------------------- */
/* A band or group heading. */
.wiki-dia .t-group {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.1px;
  fill: var(--ink-3);
}

/* A node's name. */
.wiki-dia .t-node {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  fill: var(--ink);
}

.wiki-dia .t-node-sm {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  fill: var(--ink);
}

/* A node's one-line explanation. */
.wiki-dia .t-sub {
  font-size: 11px;
  fill: var(--ink-2);
}

/* A mono tag: a step number, an edge label, a count. */
.wiki-dia .t-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  fill: var(--ink-3);
}

.wiki-dia .t-edge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
  fill: var(--pipe-blue-deep);
}

.wiki-dia .t-edge-alt {
  fill: var(--acc-violet);
}

/* A sequence or structure string in the mechanism figure. */
.wiki-dia .t-seq {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  fill: var(--ink-2);
}

.wiki-dia .t-mid {
  text-anchor: middle;
}

.wiki-dia .t-end {
  text-anchor: end;
}

/* Label colours, as classes rather than fill="var(--…)" presentation
   attributes: var() inside a presentation attribute is valid CSS but has a
   patchier history than a stylesheet rule, and these figures should not
   lose their colour coding on an older browser. */
.wiki-dia .t-on {
  fill: var(--gate-green-deep);
}

.wiki-dia .t-off {
  fill: var(--cernal-red-deep);
}

.wiki-dia .t-green {
  fill: var(--acc-green);
}

.wiki-dia .t-amber {
  fill: var(--rna-amber-deep);
}

/* --- the mechanism figure's strands --------------------------
   Thicker than a connector, because here the line IS the molecule
   rather than a reference to one. */
.wiki-dia .s-toehold {
  fill: none;
  stroke: var(--acc-blue);
  stroke-width: 3.5;
  stroke-linecap: round;
}

.wiki-dia .s-trigger {
  fill: none;
  stroke: var(--acc-green);
  stroke-width: 3.5;
  stroke-linecap: round;
}

.wiki-dia .s-strand {
  fill: none;
  stroke: var(--ink-2);
  stroke-width: 2.5;
}

/* ------------------------------------------------------------
   Spec strip — the numbers a judge wants in the first screen
   ------------------------------------------------------------ */
.wiki-spec {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 1.5rem 0;
  background: var(--paper-edge);
  border: 1px solid var(--paper-edge);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.wiki-spec__cell {
  background: var(--card);
  padding: 0.85rem 1rem;
}

.wiki-spec__k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 0.2rem;
}

.wiki-spec__v {
  display: block;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}

.wiki-spec__n {
  display: block;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-2);
  margin-top: 0.15rem;
}

/* ------------------------------------------------------------
   Claim / no-claim pair — what the software does and does not say
   ------------------------------------------------------------ */
.wiki-claims {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(265px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.wiki-claims__col {
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 1rem 1.15rem 1.1rem;
}

.wiki-claims__col h4 {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 0.7rem;
}

.wiki-claims__col--does {
  border-left: 0.4rem solid var(--acc-green);
}

.wiki-claims__col--does h4 {
  color: var(--gate-green-deep);
}

.wiki-claims__col--not {
  border-left: 0.4rem solid var(--cernal-red);
}

.wiki-claims__col--not h4 {
  color: var(--cernal-red-deep);
}

/* The list markers carry the sense, so they are set per column rather
   than inherited from style.css's red bullets. */
.wiki-claims ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  font-size: 0.9375rem;
}

.wiki-claims li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

.wiki-claims li:last-child {
  margin-bottom: 0;
}

.wiki-claims li::before {
  position: absolute;
  left: 0;
  top: 0;
  font-family: var(--font-mono);
  font-weight: 700;
}

.wiki-claims__col--does li::before {
  content: "\2713";
  color: var(--acc-green);
}

.wiki-claims__col--not li::before {
  content: "\2717";
  color: var(--cernal-red);
}

/* ------------------------------------------------------------
   Terminal / command block
   ------------------------------------------------------------
   style.css styles inline <code> as a red-on-sink token, which is
   right for an identifier in a sentence and wrong for a block of
   shell. This is the block form: ink slab, mono, with a prompt.
   ------------------------------------------------------------ */
.wiki-term {
  margin: 1.1rem 0;
  border: var(--border-w) solid var(--ink);
  border-radius: var(--radius-md);
  background: var(--ink);
  overflow: hidden;
  box-shadow: var(--shadow-sticker-sm);
}

.wiki-term__bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.8rem;
  background: rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--paper-edge);
}

.wiki-term pre {
  margin: 0;
  padding: 0.9rem 1rem;
  overflow-x: auto;
  color: #F2F2F2;
  font-size: 0.8125rem;
  line-height: 1.7;
  background: transparent;
}

/* Inside the slab, style.css's light-paper <code> rule would invert the
   contrast, so it is overridden back to plain inherited text. */
.wiki-term code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

.wiki-term .wiki-term__p {
  color: var(--pipe-shade);
  user-select: none;
}

.wiki-term .wiki-term__c {
  color: var(--ink-3);
}

/* A plain (non-shell) code listing: JSON, a response body, a snippet. */
.wiki-code {
  margin: 1.1rem 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--paper-edge);
  border-left: 0.4rem solid var(--pipe-blue);
  border-radius: var(--radius-sm);
  background: var(--paper-sink);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.wiki-code code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

/* ------------------------------------------------------------
   Tables — compact variants for the reference matrices
   ------------------------------------------------------------ */
.wiki-table {
  font-size: 0.875rem;
}

.wiki-table th,
.wiki-table td {
  vertical-align: top;
}

/* A numeric column: mono, right-aligned, so weights and ranges line up. */
.wiki-table .wiki-num {
  font-family: var(--font-mono);
  text-align: right;
  white-space: nowrap;
}

/* The first column of a reference table is the thing being named. */
.wiki-table tbody th {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}

.wiki-table__note {
  font-size: 0.8125rem;
  color: var(--ink-2);
  margin-top: -0.5rem;
}

/* Horizontal scroll for the wide matrices rather than a crushed layout. */
.wiki-scroll {
  overflow-x: auto;
  margin: 1.25rem 0;
}

.wiki-scroll .table {
  margin-bottom: 0;
}

/* ------------------------------------------------------------
   Stage cards — the six pipeline stages, as a grid
   ------------------------------------------------------------ */
.wiki-stages {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.wiki-stage {
  position: relative;
  border: 1px solid var(--ink-3);
  border-top: 0.4rem solid var(--pipe-blue);
  border-radius: var(--radius-md);
  background: var(--card);
  padding: 0.95rem 1.1rem 1rem;
}

.wiki-stage__n {
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--pipe-blue-deep);
  text-transform: uppercase;
}

.wiki-stage__t {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.15rem 0 0.4rem;
}

.wiki-stage p {
  font-size: 0.875rem;
  line-height: 1.5;
  margin: 0 0 0.5rem;
}

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

.wiki-stage__src {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  color: var(--ink-3);
  word-break: break-all;
}

/* A stage that is not implemented reads grey rather than blue, so the
   grid itself shows where the pipeline currently stops. */
.wiki-stage--stub {
  border-top-color: var(--ink-3);
  background: var(--paper-sink);
}

.wiki-stage--stub .wiki-stage__n {
  color: var(--ink-3);
}

/* ------------------------------------------------------------
   Shared bits
   ------------------------------------------------------------ */
/* Scoped to the eukaryotic AND report (.euand-report), which is the only content that uses this file; the Model page
   embeds it, so the rules must not reach the rest of that page. */
.euand-report h3,
.euand-report .euand-h3 {
  margin-top: 2.25rem;
}

/* The References accordion header is generated as an h4.accordion-header;
   it is excluded so the margin does not show as a white strip above the button. */
.euand-report h4:not(.accordion-header),
.euand-report .euand-h4 {
  font-size: 1.1rem;
  margin-top: 1.75rem;
}

/* Section lead: one sentence under an h2 that a reader can take
   instead of the section. */
.wiki-lead {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  border-left: var(--border-w-bold) solid var(--ink);
  background: var(--paper-sink);
  padding: 0.8rem 1.05rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 0.75rem 0 1.25rem;
}

/* Title line at the top of a tab pane.
   Deliberately NOT an <h3>: static/toc.js collects every h1-h3 in the page
   and skips only accordions and callouts, so a real heading in a closed tab
   pane becomes a contents entry that scrolls nowhere (a display:none element
   has no layout box to scroll to). The tab button already names the panel via
   aria-labelledby, so nothing is lost by styling this rather than marking it
   up as a heading. */
.wiki-panehead {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 0.75rem;
}

/* A file or symbol path in running prose. */
.wiki-path {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--ink-2);
  background: var(--paper-sink);
  border: 1px solid var(--paper-edge);
  border-radius: 3px;
  padding: 0.08em 0.35em;
  word-break: break-word;
}

/* Legend row under a figure or table. */
.wiki-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: center;
  margin: 0.75rem 0 0;
}

@media (max-width: 575.98px) {
  .wiki-spec__v {
    font-size: 1.15rem;
  }

  .wiki-term pre,
  .wiki-code {
    font-size: 0.75rem;
  }
}

/* The eukaryotic AND report inside the Model page: that page labels every <figure> and every display equation itself
   (Figure M.., Equation M..), so the embedded copy uses div[role=group] with .euand-figcaption instead; the rules below
   give that caption the look of the figcaption rules above. */
.euand-report .euand-figcaption {
  margin: 0;
  padding: 1rem 1.4rem 1.2rem;
  border-top: 1px solid var(--paper-edge);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.euand-report .euand-figcaption b,
.euand-report .euand-figcaption strong {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pipe-blue-deep);
}
.euand-report .gate-structure .euand-figcaption { border-top: 0; padding-inline: 0; }
@media (max-width: 575px) {
  .euand-report .euand-figcaption { padding-inline: 1rem; }
}
.euand-report .euand-equation-display { text-align: center; }
