/* Generated from the mod's ConsoleStyle palette; don't edit. */
:root {
  --console-accent: #5BD6EE;
  --console-active: #4ADE80;
  --console-bevel-dark: #0F141C;
  --console-bevel-light: #2C3649;
  --console-buffer: #7FA6FF;
  --console-energy: #FF4757;
  --console-fuel: #FFB547;
  --console-ground: #0B0F15;
  --console-mode-both: #B57BFF;
  --console-mode-input: #4C8DFF;
  --console-mode-none: #3A4558;
  --console-mode-output: #FF9F1A;
  --console-outline: #05080C;
  --console-panel: #1A2130;
  --console-slot: #121823;
  --console-text: #E6EBF2;
  --console-text-dim: #7D889B;
  --fluid-biodiesel: #A8B83C;
  --fluid-crude-oil: #4A382C;
  --fluid-ethanol: #E8ECD8;
  --fluid-fish-oil: #C08A38;
  --fluid-gasoline: #F0A830;
  --fluid-molten-salt: #FFD9A0;
  --fluid-steam: #E4EAEE;
  --fluid-vegetable-oil: #D8C050;
}

/* Self-hosted Google Fonts (SIL Open Font License; see src/fonts/*-OFL.txt). Generated by tools/fetch_fonts.py. */
@font-face {
  font-family: 'Tiny5';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/tiny5-normal-0.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: italic;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-italic-1.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 400;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal-2.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 600;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal-2.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Sans';
  font-style: normal;
  font-weight: 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("../fonts/ibm-plex-sans-normal-2.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-normal-3.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/ibm-plex-mono-normal-4.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Semantic tokens. Components use these, never the raw --console-* palette, so the light theme
   only has to redefine this file. Colours keep one meaning everywhere: energy is red, stored
   energy blue, fuel amber, running green, and the side-configuration colours mean what they do
   in game. */

:root {
  /* The game's dim text (#7D889B) is too low-contrast for small text on its own panels; the web
     replicas use this lighter one, which passes WCAG AA on --console-panel and --console-slot */
  --console-text-dim-web: #A3AEC0;
  --font-ui: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: "Tiny5", var(--font-ui);
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;

  --measure: 72ch;
  --header-height: 56px;
  --nav-width: 264px;
  --toc-width: 220px;

  /* Dark: the game's console */
  --bg: var(--console-ground);
  --surface: var(--console-panel);
  --surface-sunk: var(--console-slot);
  --bevel-light: var(--console-bevel-light);
  --bevel-dark: var(--console-bevel-dark);
  --outline: var(--console-outline);
  --text: var(--console-text);
  --text-dim: #A3AEC0;
  --text-faint: #8F9AAD;
  --accent: var(--console-accent);
  --accent-text: var(--console-ground);
  --link: var(--console-accent);
  --energy: var(--console-energy);
  --buffer: var(--console-buffer);
  --fuel: var(--console-fuel);
  --active: var(--console-active);
  --mode-input: var(--console-mode-input);
  --mode-output: var(--console-mode-output);
  --mode-both: var(--console-mode-both);
  --mode-none: var(--console-mode-none);
  --focus: var(--console-accent);
  --warning: var(--console-fuel);
}

:root[data-theme="light"] {
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --surface-sunk: #E3E8EF;
  --bevel-light: #FFFFFF;
  --bevel-dark: #C5CDD8;
  --outline: #AEB8C6;
  --text: #141A24;
  --text-dim: #3E4A5C;
  --text-faint: #5D6A7E;
  --accent: #0B7285;
  --accent-text: #FFFFFF;
  --link: #0B6A7C;
  --energy: #C21F2E;
  --buffer: #2B54C2;
  --fuel: #8A5300;
  --active: #12733A;
  --mode-input: #2563EB;
  --mode-output: #B45309;
  --mode-both: #7C3AED;
  --mode-none: #64748B;
  --focus: #0B7285;
  --warning: #8A5300;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EEF1F5;
    --surface: #FFFFFF;
    --surface-sunk: #E3E8EF;
    --bevel-light: #FFFFFF;
    --bevel-dark: #C5CDD8;
    --outline: #AEB8C6;
    --text: #141A24;
    --text-dim: #3E4A5C;
    --text-faint: #5D6A7E;
    --accent: #0B7285;
    --accent-text: #FFFFFF;
    --link: #0B6A7C;
    --energy: #C21F2E;
    --buffer: #2B54C2;
    --fuel: #8A5300;
    --active: #12733A;
    --mode-input: #2563EB;
    --mode-output: #B45309;
    --mode-both: #7C3AED;
    --mode-none: #64748B;
    --focus: #0B7285;
    --warning: #8A5300;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-height) + var(--space-4));
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 var(--font-ui);
  font-optical-sizing: auto;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-ui);
  line-height: 1.25;
  margin: 1.8em 0 0.5em;
  text-wrap: balance;
}
h1, h2 { font-family: var(--font-display); font-weight: 400; letter-spacing: 0.02em; }
h1 { font-size: 2.4rem; margin-top: 0; }
h2 { font-size: 1.55rem; padding-bottom: var(--space-2); border-bottom: 1px solid var(--bevel-light); }
h3 { font-size: 1.15rem; }

p, ul, ol, dl, table, pre, figure { margin: 0 0 1em; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: 0.25em; }

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

code, kbd, pre { font-family: var(--font-mono); font-size: 0.88em; }
code {
  background: var(--surface-sunk);
  padding: 0.1em 0.35em;
  border: 1px solid var(--bevel-dark);
}
kbd {
  background: var(--surface);
  border: 1px solid var(--outline);
  border-bottom-width: 2px;
  padding: 0.05em 0.4em;
}

img { max-width: 100%; height: auto; }
img.pixel, .pixel img { image-rendering: pixelated; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--bevel-light); vertical-align: top; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.9em; }

hr { border: 0; border-top: 1px solid var(--bevel-light); margin: var(--space-6) 0; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100px;
  z-index: 100;
  background: var(--accent);
  color: var(--accent-text);
  padding: var(--space-2) var(--space-4);
  font-weight: 600;
}
.skip-link:focus { top: var(--space-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
pre { overflow-x: auto; max-width: 100%; padding: var(--space-3); background: var(--surface-sunk); border: 1px solid var(--bevel-dark); }
pre code { background: none; border: 0; padding: 0; }
:not(pre) > code { overflow-wrap: anywhere; }

/* Header, three-column shell (nav / content / on this page), footer. */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  height: var(--header-height);
  padding: 0 var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--outline);
  box-shadow: inset 0 -1px 0 var(--bevel-dark);
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
}
.brand-mark { display: block; }

.version-badge {
  font-size: 0.78rem;
  color: var(--text-dim);
  border: 1px solid var(--bevel-light);
  padding: 2px var(--space-2);
  white-space: nowrap;
}

.theme-toggle, .nav-toggle {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--surface-sunk);
  color: var(--text-dim);
  border: 1px solid var(--bevel-light);
  cursor: pointer;
}
.theme-toggle { margin-left: auto; }
.search-open ~ .theme-toggle { margin-left: var(--space-2); }
.nav-toggle { display: none; }
[hidden] { display: none !important; }
.theme-toggle:hover, .nav-toggle:hover { color: var(--accent); border-color: var(--accent); }
.icon { width: 16px; height: 16px; fill: currentColor; }

.shell {
  display: grid;
  grid-template-columns: var(--nav-width) minmax(0, 1fr) var(--toc-width);
  align-items: start;
  max-width: 1480px;
  margin: 0 auto;
}

.site-nav {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: var(--space-5) var(--space-3) var(--space-6) var(--space-4);
  font-size: 0.92rem;
  border-right: 1px solid var(--bevel-light);
  min-height: calc(100vh - var(--header-height));
}

.content {
  min-width: 0;
  padding: var(--space-6) var(--space-6) var(--space-7);
}
.content:focus { outline: none; }
.page { max-width: var(--measure); }

.toc {
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  padding: var(--space-6) var(--space-4) var(--space-6) 0;
  font-size: 0.86rem;
}

.site-footer {
  border-top: 1px solid var(--bevel-light);
  color: var(--text-faint);
  font-size: 0.86rem;
  padding: var(--space-5) var(--space-4);
  text-align: center;
}
.site-footer p { max-width: 80ch; margin: 0 auto; }

.page-home .shell { grid-template-columns: var(--nav-width) minmax(0, 1fr); }

@media (max-width: 1180px) {
  .shell { grid-template-columns: var(--nav-width) minmax(0, 1fr); }
  .toc { display: none; }
}

@media (max-width: 820px) {
  :root { --header-height: 52px; }
  .shell { display: block; }
  .version-badge { display: none; }
  .js .nav-toggle { display: inline-grid; }
  .js .site-nav {
    position: fixed;
    inset: var(--header-height) auto 0 0;
    width: min(320px, 86vw);
    max-height: none;
    background: var(--surface);
    border-right: 1px solid var(--outline);
    transform: translateX(-102%);
    transition: transform 0.18s ease-out;
    z-index: 30;
  }
  .js.nav-open .site-nav { transform: none; }
  .site-nav { position: static; min-height: 0; border-right: 0; border-bottom: 1px solid var(--bevel-light); }
  .content { padding: var(--space-5) var(--space-4) var(--space-6); }
  h1 { font-size: 1.75rem; }
}

/* Capture mode (any page + #capture): no site chrome, a fixed content width and no motion, for clean
   screenshots of a page or its parts. */
.capture .site-header, .capture .site-nav, .capture .toc, .capture .site-footer,
.capture .breadcrumbs, .capture .pager, .capture .skip-link { display: none !important; }
.capture .shell { display: block; max-width: none; }
.capture .content { padding: 32px; max-width: 1000px; }
.capture .page { max-width: none; }
.capture *, .capture *::before, .capture *::after { animation: none !important; transition: none !important; }
/* A part being exported as a shot gets its own background, so it reads on any page */
.shooting { background: var(--console-ground); padding: 24px; margin: 0 !important; }
.shooting.render { background: none; padding: 8px; }

/* Wide tools (the breeding explorer) take the whole content width */
body:has(.explorer) .toc { display: none; }
body:has(.explorer) .shell { grid-template-columns: var(--nav-width) minmax(0, 1fr); }
body:has(.explorer) .page { max-width: none; }
body:has(.explorer) .page > p, body:has(.explorer) .page-header { max-width: var(--measure); }

/* Navigation */

.nav-section { margin-bottom: var(--space-2); }
.nav-section > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
  padding: var(--space-1) 0;
  font-family: var(--font-display);
}
.nav-section > summary::-webkit-details-marker { display: none; }
.nav-section > summary::before {
  content: "";
  display: inline-block;
  width: 0; height: 0;
  margin-right: var(--space-2);
  border: 4px solid transparent;
  border-left-color: var(--text-faint);
  transform: translateY(-1px);
  transition: transform 0.12s;
}
.nav-section[open] > summary::before { transform: translate(-2px, 1px) rotate(90deg); }
.nav-section ul { list-style: none; margin: 0 0 var(--space-2); padding: 0 0 0 var(--space-3); }
.nav-section li { margin: 0; }
.nav-section a, .nav-planned {
  display: block;
  padding: 3px var(--space-2);
  border-left: 2px solid transparent;
  text-decoration: none;
  color: var(--text-dim);
}
.nav-section a:hover { color: var(--text); border-left-color: var(--bevel-light); }
.nav-section a[aria-current="page"] {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--surface-sunk);
  font-weight: 600;
}
.nav-planned { color: var(--text-faint); cursor: default; }
.nav-planned::after { content: " ·"; }
.nav-group {
  margin: var(--space-2) 0 2px var(--space-3);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block;
  width: 16px; height: 2px;
  background: currentColor;
  position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -5px; }
.nav-toggle-bars::after { top: 5px; }

/* Breadcrumbs, pager, on this page */

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-4); font-size: 0.86rem; color: var(--text-faint); }
.breadcrumbs li { margin: 0; }
.breadcrumbs li + li::before { content: "/"; margin-right: var(--space-2); color: var(--bevel-light); }
.breadcrumbs a { color: var(--text-dim); }

.page-header { margin-bottom: var(--space-6); }
.lead { font-size: 1.15rem; color: var(--text-dim); max-width: 60ch; }

.anchor {
  margin-left: var(--space-2);
  color: var(--text-faint);
  text-decoration: none;
  opacity: 0;
  font-weight: 400;
}
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }

.pager { display: flex; justify-content: space-between; gap: var(--space-4); max-width: var(--measure); margin-top: var(--space-7); }
.pager a {
  flex: 1;
  display: block;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark);
  text-decoration: none;
  font-weight: 600;
}
.pager a span { display: block; font-size: 0.78rem; font-weight: 400; color: var(--text-dim); }
.pager-next { text-align: right; }

.toc-title { font-weight: 700; color: var(--text-faint); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: var(--space-2); }
.toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--bevel-light); }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px var(--space-3); color: var(--text-dim); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; }
.toc a:hover { color: var(--text); }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc .toc-l3 a { padding-left: var(--space-5); font-size: 0.95em; }

/* Panels: the console look, square corners and one-pixel bevels */

.panel {
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark);
  padding: var(--space-5);
}

/* Values from data */

.val { font-variant-numeric: tabular-nums; white-space: nowrap; }
.val-default {
  text-decoration: underline dotted var(--text-faint);
  text-underline-offset: 0.22em;
  cursor: help;
}

.item { font-weight: 600; }
.term { color: inherit; text-decoration: underline dotted var(--accent); text-underline-offset: 0.22em; }
.term:hover { color: var(--accent); }
.link-planned { color: var(--text-faint); }

.id-chip {
  font-size: 0.8em;
  color: var(--text-dim);
  background: var(--surface-sunk);
  border: 1px solid var(--bevel-light);
  white-space: nowrap;
}

/* Callouts */

.callout {
  margin: var(--space-5) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--outline);
  border-left: 3px solid var(--accent);
}
.callout > :last-child { margin-bottom: 0; }
.callout-title { font-weight: 700; margin-bottom: var(--space-1); }
.callout-tip { border-left-color: var(--active); }
.callout-warning { border-left-color: var(--warning); }

/* Glossary */

.glossary { display: grid; gap: var(--space-3); }
.glossary-entry { padding: var(--space-3) var(--space-4); background: var(--surface); border: 1px solid var(--outline); }
.glossary-entry:target { border-color: var(--accent); }
.glossary dt { font-weight: 700; }
.glossary dd { margin: var(--space-1) 0 0; color: var(--text-dim); }

/* Home */

.hero { padding: var(--space-6) 0 var(--space-5); }
.hero h1 { font-size: 2.6rem; margin-bottom: var(--space-3); }
.hero .lead { font-size: 1.25rem; }
.page-home .page { max-width: 1120px; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--space-4); margin: var(--space-6) 0; }
.pillar { border-top: 3px solid var(--pillar, var(--accent)); }
.pillar h3 { margin: 0 0 var(--space-2); font-size: 1.15rem; }
.pillar p { color: var(--text-dim); margin: 0; font-size: 0.95rem; }
.pillar-power { --pillar: var(--energy); }
.pillar-machines { --pillar: var(--buffer); }
.pillar-fish { --pillar: var(--active); }
.pillar-weapons { --pillar: var(--fuel); }
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.door { display: block; text-decoration: none; color: var(--text); }
.door.link-planned { border-style: dashed; }
.door strong { display: block; color: var(--accent); margin-bottom: var(--space-1); }
.door span { color: var(--text-dim); font-size: 0.95rem; }
.door:hover { border-color: var(--accent); }

/* Slots and recipe cards: always the game's console palette, in either site theme, so they look
   like the game and screenshot the same way everywhere. */

.slot {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: none;
  background: var(--console-slot);
  box-shadow: inset 2px 2px 0 var(--console-bevel-dark), inset -2px -2px 0 var(--console-bevel-light);
  vertical-align: middle;
}
.slot-lg { width: 52px; height: 52px; }
.slot-lg .icon { width: 40px; height: 40px; }
.slot-empty { opacity: 0.85; }
.slot .icon { width: 32px; height: 32px; display: block; }
.icon-sprite { image-rendering: pixelated; }
.icon-unknown {
  display: grid; place-items: center;
  font: 600 18px/1 var(--font-display);
  color: var(--console-text-dim);
}
.fluid-swatch {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.18), rgba(0,0,0,0.18)),
    var(--fluid, var(--console-buffer));
  width: 24px !important; height: 24px !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
}
/* Small numbers use the UI face: at these sizes the pixel face's 5 reads as a 9 */
.slot-qty, .slot-chance, .slot-tag {
  position: absolute;
  font: 700 13px/1 var(--font-ui);
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 1px 1px 0 #3f3f3f;
  pointer-events: none;
}
.slot-qty { right: 3px; bottom: 2px; }
.slot-chance { left: 2px; top: 2px; font-size: 10.5px; color: var(--console-fuel); }
.slot-tag { right: 3px; top: 2px; font-size: 11px; color: var(--console-text-dim); text-shadow: none; }
.slot-label { font-size: 0.85rem; color: var(--console-text-dim-web); }
.slot-with-caption { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.slot-amount { font: 600 11.5px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--console-buffer); white-space: nowrap; }

.recipe-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0 var(--space-5); }
.recipe {
  margin: 0;
  background: var(--console-panel);
  color: var(--console-text);
  border: 1px solid var(--console-outline);
  box-shadow: inset 1px 1px 0 var(--console-bevel-light), inset -1px -1px 0 var(--console-bevel-dark);
  padding: var(--space-3);
  min-width: 0;
}
.recipe-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  font: 500 15px/1.2 var(--font-display);
  color: var(--console-accent);
  margin-bottom: var(--space-3);
}
.recipe-head .icon { width: 18px; height: 18px; }
.recipe-title { flex: 1 1 auto; min-width: 0; }
.recipe-station {
  display: inline-flex; align-items: center; gap: 5px;
  font: 400 12.5px/1.2 var(--font-ui);
  color: var(--console-text-dim-web);
}
.recipe-needs {
  font: 400 11.5px/1.3 var(--font-ui);
  color: var(--console-fuel);
  border: 1px solid currentColor;
  padding: 1px 6px;
}
.recipe-body { display: flex; align-items: center; gap: var(--space-3); }
.recipe-in, .recipe-out { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.recipe-grid { display: grid; grid-template-columns: repeat(3, 40px); gap: 0; }
.recipe-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 56px;
  color: var(--console-text-dim);
}
.recipe-arrow-icon { width: 30px; height: 15px; fill: var(--console-accent); }
.recipe-meta { font: 600 12.5px/1.1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--console-energy); white-space: nowrap; }
.recipe-meta + .recipe-meta { color: var(--console-fuel); }
.recipe-more { color: var(--text-faint); font-size: 0.9rem; }

/* Inline items */

.item { white-space: nowrap; font-weight: 600; }
a.item { color: inherit; text-decoration-color: var(--accent); }
a.item:hover .item-name { color: var(--accent); }
.item .icon { width: 20px; height: 20px; vertical-align: -4px; margin-right: 4px; }

/* The game's tooltip */

.mc-tooltip {
  position: fixed;
  z-index: 50;
  max-width: 320px;
  padding: 6px 8px;
  background: rgba(18, 24, 35, 0.96);
  border: 2px solid transparent;
  border-image: linear-gradient(180deg, var(--tooltip-top, #2F7280), var(--tooltip-bottom, #1D4750)) 1;
  outline: 2px solid rgba(18, 24, 35, 0.96);
  color: var(--console-text-dim);
  font: 500 15px/1.35 var(--font-display);
  pointer-events: none;
  white-space: pre-line;
}
.mc-tooltip strong { display: block; color: #fff; font-weight: 500; }
.mc-tooltip .mod { color: #5555FF; font-style: italic; }

/* Machine page header: render beside the key facts */

.machine-header { display: grid; grid-template-columns: minmax(180px, 260px) 1fr; gap: var(--space-5); align-items: center; margin-bottom: var(--space-6); }
@media (max-width: 640px) { .machine-header { grid-template-columns: 1fr; } }
.render { margin: 0; display: grid; justify-items: center; gap: var(--space-2); }
.render-img { width: 100%; max-width: 260px; height: auto; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.35)); }
.render-toggle {
  font: 400 14px/1 var(--font-display);
  background: var(--surface-sunk);
  color: var(--text-dim);
  border: 1px solid var(--bevel-light);
  padding: 6px 12px;
  cursor: pointer;
}
.render-toggle[aria-pressed="true"] { color: var(--active); border-color: var(--active); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-3); margin: 0; }
.facts div { background: var(--surface); border: 1px solid var(--outline); box-shadow: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark); padding: var(--space-3); }
.facts dt { font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.facts dd { margin: 2px 0 0; font: 400 1.3rem/1.2 var(--font-display); }
.facts .fact-energy { color: var(--energy); }
.facts .fact-buffer { color: var(--buffer); }
.facts .fact-fuel { color: var(--fuel); }
.facts .fact-id { grid-column: 1 / -1; background: none; border: 0; box-shadow: none; padding: 0; }

/* Tables */

.table-wrap { position: relative; overflow-x: auto; margin: var(--space-4) 0 var(--space-5); border: 1px solid var(--outline); background: var(--surface); }
.data-table { margin: 0; }
.data-table thead th { background: var(--surface-sunk); border-bottom: 1px solid var(--outline); white-space: nowrap; }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.num, .data-table th.num { text-align: right; white-space: nowrap; }
.data-table .item .icon { vertical-align: -5px; }
.config-table td:last-child { color: var(--text-dim); font-size: 0.92em; }

.module-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }

/* Default sides */

.sides { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-6); margin: var(--space-4) 0; }
.sides-list { list-style: none; padding: 0; margin: 0; }
.sides-list li { display: flex; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-1); }
.side-chip { width: 12px; height: 12px; background: var(--mode-colour); flex: none; }
.side-flag { width: 22px; height: 9px; border: 1px solid var(--bevel-light); position: relative; flex: none; background: var(--surface-sunk); }
.side-flag.is-on { background: var(--accent); border-color: var(--accent); }

details.numbers { margin: var(--space-6) 0; border: 1px solid var(--outline); background: var(--surface); }
details.numbers > summary { cursor: pointer; padding: var(--space-3) var(--space-4); font-weight: 600; }
details.numbers > div { padding: 0 var(--space-4) var(--space-2); }
details.numbers .table-wrap { border: 0; }

/* Search */

.search-open {
  display: inline-flex; align-items: center; gap: var(--space-2);
  margin-left: auto;
  height: 36px; padding: 0 var(--space-3);
  background: var(--surface-sunk); color: var(--text-dim);
  border: 1px solid var(--bevel-light);
  font: inherit; font-size: 0.9rem; cursor: pointer;
  min-width: 200px;
}
.search-open:hover { border-color: var(--accent); color: var(--text); }
.search-open kbd { margin-left: auto; font-size: 0.75rem; }
.search-open + .theme-toggle { margin-left: var(--space-2); }
@media (max-width: 820px) { .search-open { min-width: 0; } .search-open-label, .search-open kbd { display: none; } }
.search-dialog {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(5, 8, 12, 0.6);
  display: flex; justify-content: center; align-items: flex-start;
  padding: 10vh var(--space-4) var(--space-4);
}
.search-dialog[hidden] { display: none; }
.search-panel {
  width: min(640px, 100%);
  background: var(--surface);
  border: 1px solid var(--outline);
  box-shadow: inset 1px 1px 0 var(--bevel-light), 0 24px 60px rgba(0, 0, 0, 0.5);
  padding: var(--space-3);
}
.search-panel input {
  width: 100%; font: inherit; font-size: 1.1rem;
  padding: var(--space-3); border: 1px solid var(--bevel-light);
  background: var(--surface-sunk); color: var(--text);
}
.search-panel input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.search-panel ul { list-style: none; margin: var(--space-2) 0 0; padding: 0; max-height: 55vh; overflow-y: auto; }
.search-panel li { margin: 0; }
.search-panel li a { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-2) var(--space-3); color: var(--text); text-decoration: none; border-left: 2px solid transparent; }
.search-panel li[aria-selected="true"] a { background: var(--surface-sunk); border-left-color: var(--accent); }
.search-panel li .icon { width: 24px; height: 24px; image-rendering: pixelated; }
.search-panel li strong { display: block; font-weight: 600; }
.search-panel li small { display: block; color: var(--text-dim); font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52ch; }
.search-status { margin: var(--space-2) 0 0; color: var(--text-dim); font-size: 0.85rem; }
.search-status:empty { display: none; }
.search-help { margin: var(--space-2) 0 0; color: var(--text-dim); font-size: 0.8rem; }
.search-help kbd { font-size: 0.75rem; margin-right: 2px; }
.search-is-open { overflow: hidden; }

.sides-compact { display: flex; flex-wrap: wrap; gap: 4px var(--space-4); align-items: center; }
.sides-compact .side-chip { display: inline-block; margin-right: 6px; vertical-align: -1px; }
.sides-table td, .sides-table th { white-space: nowrap; font-size: 0.86rem; padding: 7px 8px; }
.sides-table .item .icon { display: none; }
.sides-table .side-chip { display: inline-block; margin-right: 6px; vertical-align: -1px; }
.mode-key { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.mode-key li { display: flex; gap: var(--space-3); align-items: baseline; }
.mode-key .side-chip { flex: none; transform: translateY(1px); }

/* Filters */

.filter { position: sticky; top: var(--header-height); z-index: 5; background: var(--bg); padding: var(--space-3) 0; margin-bottom: var(--space-3); border-bottom: 1px solid var(--bevel-light); }
.filter label { display: block; font-size: 0.85rem; color: var(--text-dim); margin-bottom: var(--space-1); }
.filter input { width: 100%; max-width: 420px; font: inherit; padding: var(--space-2) var(--space-3); background: var(--surface-sunk); color: var(--text); border: 1px solid var(--bevel-light); }
.filter input:focus { outline: 2px solid var(--focus); outline-offset: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.chip { font: inherit; font-size: 0.85rem; padding: 4px 10px; background: var(--surface); color: var(--text-dim); border: 1px solid var(--bevel-light); cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
.filter-status { margin: var(--space-2) 0 0; font-size: 0.85rem; color: var(--text-dim); }
.filter-status:empty { display: none; }
.count { font: 400 0.85rem var(--font-ui); color: var(--text-dim); vertical-align: middle; }
.muted { color: var(--text-dim); }
.table-wrap.tall { max-height: 70vh; overflow-y: auto; }
.table-wrap.tall thead th { position: sticky; top: 0; z-index: 1; }
[hidden] { display: none !important; }

/* Species */

.species-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3); margin: var(--space-4) 0 var(--space-6); }
.species-card {
  display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: var(--space-3) var(--space-2);
  background: var(--console-panel);
  border: 1px solid var(--console-outline);
  box-shadow: inset 1px 1px 0 var(--console-bevel-light), inset -1px -1px 0 var(--console-bevel-dark);
  color: var(--console-text); text-decoration: none;
}
.species-card:hover, .species-card:focus-visible { border-color: var(--console-accent); }
.species-sprite { width: 64px; height: 64px; image-rendering: pixelated; }
.species-name { font: 400 15px/1.2 var(--font-display); color: var(--console-accent); }
.species-yield { font-size: 0.82rem; color: var(--console-text-dim-web); display: inline-flex; align-items: center; gap: 4px; }
.species-yield .icon { width: 18px; height: 18px; }
.species-hero { width: 160px; height: 160px; image-rendering: pixelated; }
.species-header figcaption { display: flex; align-items: center; gap: 6px; font-size: 0.9rem; color: var(--text-dim); }
.species-cooked { image-rendering: pixelated; }
.lineage, .lineage ul { list-style: none; padding-left: var(--space-4); border-left: 1px solid var(--bevel-light); }
.lineage { padding-left: var(--space-3); }
.lineage li { margin: var(--space-2) 0; }

.status-chip { display: inline-block; white-space: nowrap; font: 400 15px/1 var(--font-display); color: var(--console-active); background: var(--console-slot); border: 1px solid var(--console-bevel-light); padding: 5px 8px; }
.compact-list { padding-left: 1.2em; }
.compact-list li { margin: 2px 0; }

.matrix th .item { white-space: normal; font-size: 0.8rem; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.matrix th .item .icon { margin: 0; }
.matrix td, .matrix th { padding: 6px 7px; font-size: 0.85rem; }
.matrix tbody th .icon { display: none; }
.matrix tbody th .item { white-space: nowrap; }
.matrix thead th .item { font-weight: 500; }
.matrix thead .icon { width: 24px; height: 24px; image-rendering: pixelated; }

/* Breeding explorer */

.explorer-controls { margin-bottom: var(--space-4); }
.explorer-controls label { display: block; font-size: 0.9rem; color: var(--text-dim); margin-bottom: var(--space-1); }
.explorer-controls input { width: 100%; max-width: 420px; font: inherit; padding: var(--space-2) var(--space-3); background: var(--surface-sunk); color: var(--text); border: 1px solid var(--bevel-light); }
.explorer-path:not(:empty) { background: var(--surface); border: 1px solid var(--outline); border-left: 3px solid var(--accent); padding: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.explorer-path p { margin: 0 0 var(--space-2); }
.explorer-path ol { margin: 0; }
.tree {
  position: relative;
  display: flex; gap: 48px;
  overflow-x: auto;
  padding: var(--space-3) var(--space-2) var(--space-4);
  background: var(--console-ground);
  border: 1px solid var(--console-outline);
}
.tree-lines { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.tree-lines path { fill: none; stroke: var(--console-accent); stroke-width: 2; opacity: 0.8; }
.tree-col { flex: none; width: 210px; position: relative; z-index: 1; }
.tree-col h3 { font: 400 14px/1 var(--font-display); color: var(--console-text-dim-web); margin: 0 0 var(--space-3); letter-spacing: 0.04em; }
.tree-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tree-col li { margin: 0; }
.tree-node {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 8px 4px 4px;
  background: var(--console-panel);
  border: 1px solid var(--console-outline);
  color: var(--console-text); text-decoration: none;
  transition: opacity 0.15s;
}
.tree-node img { image-rendering: pixelated; flex: none; }
.tree-node strong { display: block; font-weight: 600; font-size: 0.88rem; }
.tree-node small { display: block; color: var(--console-text-dim-web); font-size: 0.75rem; }
.tree-node:hover, .tree-node:focus-visible { border-color: var(--console-accent); }
.tree-node.on-path { border-color: var(--console-accent); box-shadow: inset 3px 0 0 var(--console-accent); }
.tree-node.is-target { background: #173039; }
.tree:has(.on-path) .tree-node:not(.on-path) { opacity: 0.45; }
.tree-node.is-unavailable { opacity: 0.25; filter: grayscale(1); }
/* Outside the always-dark recipe cards, requirement badges use the theme's warning colour */
.recipe-needs { color: var(--warning); }
.recipe .recipe-needs { color: var(--console-fuel); }

/* The overview loop: steps in order, each pointing to the next, the last back to the first */

.loop { list-style: none; padding: 0; margin: var(--space-5) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-5) var(--space-6); counter-reset: loop; }
.loop > li {
  position: relative; margin: 0;
  display: grid; grid-template-columns: auto 1fr; gap: 2px var(--space-3); align-items: center;
  padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--outline);
  box-shadow: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark);
  counter-increment: loop;
}
.loop > li .slot { grid-row: span 2; }
.loop > li strong { font: 400 1.05rem/1.2 var(--font-display); }
.loop > li strong::before { content: counter(loop) ". "; color: var(--accent); }
.loop > li span.step-text { color: var(--text-dim); font-size: 0.9rem; line-height: 1.4; }
.loop > li:not(:last-child)::after {
  content: ""; position: absolute; right: -22px; top: 50%;
  width: 0; height: 0; border: 7px solid transparent; border-left-color: var(--accent);
  transform: translateY(-50%);
}
.loop-back { color: var(--text-dim); font-size: 0.9rem; margin-top: calc(-1 * var(--space-3)); }
.branch { border-left: 3px solid var(--fuel); padding-left: var(--space-4); }
.youll-need { background: var(--surface); border: 1px solid var(--outline); padding: var(--space-3) var(--space-4); margin: var(--space-4) 0 var(--space-5); }
.youll-need p { margin: 0 0 var(--space-2); font-weight: 600; }
.youll-need ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.youll-need li { margin: 0; }
ol.steps { counter-reset: step; list-style: none; padding: 0; }
ol.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin: 0 0 var(--space-5); }
ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-text); font: 400 16px/1 var(--font-display);
}
ol.steps > li > strong:first-child { display: block; margin-bottom: var(--space-1); }

/* Calculators */

.calculator { background: var(--surface); border: 1px solid var(--outline); box-shadow: inset 1px 1px 0 var(--bevel-light); padding: var(--space-4); margin: var(--space-4) 0 var(--space-6); }
.calc-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-3) var(--space-5); margin-bottom: var(--space-3); }
.calc-inputs label { display: grid; gap: var(--space-1); font-size: 0.9rem; color: var(--text-dim); }
.calc-inputs output { color: var(--accent); font: 400 1rem var(--font-display); }
.calc-inputs select { font: inherit; color: var(--text); background: var(--surface-sunk); border: 1px solid var(--bevel-light); padding: var(--space-2); }
.calc-inputs input[type="range"] { accent-color: var(--accent); width: 100%; }
.calc-note { font-size: 0.9rem; color: var(--text-dim); margin: 0 0 var(--space-3); }
.calc-note.is-warning { color: var(--warning); }
.calc-results dd { font-size: 1.15rem; }
.planner-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-3); margin-bottom: var(--space-4); }
.planner-row { border: 1px solid var(--bevel-light); padding: var(--space-2) var(--space-3) var(--space-3); margin: 0; display: grid; gap: var(--space-2); }
.planner-row legend { font: 400 0.95rem var(--font-display); color: var(--accent); padding: 0 var(--space-1); }
.planner-row label, .calc-inputs label.check { display: flex; flex-direction: column; gap: 2px; font-size: 0.88rem; color: var(--text-dim); }
.planner-row select { font: inherit; color: var(--text); background: var(--surface-sunk); border: 1px solid var(--bevel-light); padding: 4px; }
label.check { flex-direction: row !important; align-items: center; gap: var(--space-2) !important; }
label.check input { accent-color: var(--accent); width: 18px; height: 18px; }
.planner-yields ul { padding-left: 1.2em; margin: var(--space-3) 0; }

/* Machines at a glance */

.machine-group { font: 400 1rem var(--font-display); color: var(--text-dim); margin: var(--space-5) 0 var(--space-3); }
.machine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: var(--space-3); }
.machine-card {
  display: grid; grid-template-columns: 72px 1fr; gap: var(--space-3); align-items: center;
  padding: var(--space-3);
  background: var(--surface); border: 1px solid var(--outline);
  box-shadow: inset 1px 1px 0 var(--bevel-light), inset -1px -1px 0 var(--bevel-dark);
  color: var(--text); text-decoration: none;
}
.machine-card:hover, .machine-card:focus-visible { border-color: var(--accent); }
.machine-card img { width: 72px; height: 72px; }
.machine-card strong { display: block; font: 400 1.05rem/1.2 var(--font-display); color: var(--accent); margin-bottom: 2px; }
.machine-card small { display: block; color: var(--text-dim); font-size: 0.85rem; line-height: 1.4; }
.hero-strip { display: flex; gap: var(--space-2); margin: var(--space-4) 0 0; flex-wrap: wrap; }
.hero-strip img { width: 84px; height: 84px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.35)); }
.quick-links { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); padding: 0; list-style: none; }
.quick-links li { margin: 0; }
.pillar h3 a, .pillar h3 .link-planned { color: inherit; text-decoration: none; }
.pillar h3 a::after { content: " →"; color: var(--pillar); }
.pillar:has(h3 a:hover) { border-color: var(--pillar); }
/* One column on phones: the loop's arrows point down instead of off the edge */
@media (max-width: 560px) {
  .loop > li:not(:last-child)::after { right: auto; left: 50%; top: auto; bottom: -22px; transform: translateX(-50%); border-left-color: transparent; border-top-color: var(--accent); }
}

/* Machine screens. Every --x/--y/--w/--h is a GUI pixel, multiplied by --px; the drawing mirrors
   the mod's ConsoleStyle: one-pixel bevels, insets, segmented gauges, toggles. Always the console
   palette, in either site theme. */

.screen { margin: var(--space-5) 0 var(--space-6); }
.screen-scroll { overflow-x: auto; max-width: 100%; }
.screen-frame {
  --px: max(1.34px, min(2px, calc((100vw - 48px) / var(--gw))));
  width: calc(var(--gw) * var(--px));
  height: calc(var(--gh) * var(--px));
  position: relative;
}
@media (min-width: 821px) {
  .screen-frame { --px: max(1.34px, min(2px, calc((100vw - var(--nav-width) - 96px) / var(--gw)))); }
}
.screen-canvas {
  position: absolute;
  left: 0;
  width: calc(var(--gw) * var(--px));
  top: calc(21 * var(--px));
  font: 400 calc(8 * var(--px)) / calc(9 * var(--px)) var(--font-display);
  color: var(--console-text);
  -webkit-font-smoothing: none;
}
.cs {
  position: absolute;
  left: calc(var(--x) * var(--px));
  top: calc(var(--y) * var(--px));
  width: calc(var(--w, 0) * var(--px));
  height: calc(var(--h, 0) * var(--px));
  box-sizing: border-box;
}
.cs-text, .cs-status, .cs-legend, .cs-caption { width: auto; height: auto; white-space: nowrap; }
.cs-centred { transform: translateX(-50%); }
.cs-dim { color: var(--console-text-dim-web); }

.cs-panel {
  background: var(--console-panel);
  border: var(--px) solid var(--console-outline);
  box-shadow: inset var(--px) var(--px) 0 var(--console-bevel-light), inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 var(--console-bevel-dark);
}
.cs-inset {
  background: var(--console-slot);
  box-shadow: inset var(--px) var(--px) 0 var(--console-bevel-dark), inset calc(-1 * var(--px)) calc(-1 * var(--px)) 0 var(--console-bevel-light);
}
.cs-framed { background: var(--console-slot); border: var(--px) solid var(--console-bevel-light); }
.cs-readouts { border-color: var(--console-accent); }
.cs-readout {
  position: absolute;
  left: calc(6 * var(--px));
  right: calc(6 * var(--px));
  top: calc((5 + var(--line) * 12) * var(--px));
  display: flex;
  justify-content: space-between;
  white-space: nowrap;
}
.cs-gauge-fill {
  background: repeating-linear-gradient(to top, var(--console-energy) 0 calc(2 * var(--px)), transparent calc(2 * var(--px)) calc(3 * var(--px)));
}
.cs-sprite {
  background-size: calc(256 * var(--px)) calc(256 * var(--px));
  background-position: calc(var(--u) * -1 * var(--px)) calc(var(--v) * -1 * var(--px));
  image-rendering: pixelated;
}
.cs-locked::after {
  content: "";
  position: absolute; inset: 25%;
  background:
    linear-gradient(45deg, transparent 42%, var(--console-bevel-light) 42% 58%, transparent 58%),
    linear-gradient(-45deg, transparent 42%, var(--console-bevel-light) 42% 58%, transparent 58%);
}
.cs-slot-box .slot { width: 100%; height: 100%; background: none; box-shadow: none; }
.cs-slot-box .slot .icon { width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.cs-slot-box .slot-qty { font: 400 calc(8 * var(--px)) / 1 var(--font-display); right: calc(2 * var(--px)); bottom: calc(2 * var(--px)); }
.cs-ghost { position: absolute; left: calc(3 * var(--px)); top: calc(3 * var(--px)); width: calc(16 * var(--px)); height: calc(16 * var(--px)); image-rendering: pixelated; opacity: 0.6; }

.cs-header-right {
  left: auto;
  right: calc((var(--gw) - var(--x)) * var(--px));
  width: auto; height: auto;
  display: flex; align-items: center; gap: calc(6 * var(--px));
}
.cs-status {
  position: relative;
  height: calc(15 * var(--px));
  display: inline-flex;
  align-items: center;
  gap: calc(3 * var(--px));
  padding: 0 calc(5 * var(--px));
  background: var(--console-slot);
  border: var(--px) solid var(--console-bevel-light);
}
.cs-status-dot { width: calc(5 * var(--px)); height: calc(5 * var(--px)); }
.cs-caption { display: flex; align-items: center; gap: calc(6 * var(--px)); width: calc(var(--w) * var(--px)); color: var(--console-text-dim-web); }
.cs-caption i { flex: 1; height: var(--px); background: var(--console-bevel-light); }

.cs-tab {
  padding: 0;
  border: var(--px) solid var(--console-outline);
  background: var(--console-slot);
  box-shadow: inset var(--px) var(--px) 0 var(--console-bevel-light);
  cursor: pointer;
}
.cs-tab .cs-sprite { left: calc(2 * var(--px)); top: calc(2 * var(--px)); }
.cs-tab-icon-active { display: none; }
.cs-side-toggle { background: var(--console-panel); border: var(--px) solid var(--console-outline); }
.cs-side-toggle .cs-sprite { left: calc(2 * var(--px)); top: calc(2 * var(--px)); }

.cs-toggle { background: var(--console-slot); border: var(--px) solid var(--console-bevel-light); }
.cs-toggle i { position: absolute; top: var(--px); left: var(--px); width: calc(5 * var(--px)); height: calc(5 * var(--px)); background: var(--console-mode-none); }
.cs-toggle.is-on { background: var(--console-accent); border-color: var(--console-accent); }
.cs-toggle.is-on i { left: auto; right: var(--px); background: var(--console-ground); }
.cs-segment {
  display: grid; place-items: center;
  background: var(--console-slot);
  border: var(--px) solid var(--console-bevel-light);
  color: var(--console-text-dim-web);
  font-size: calc(7 * var(--px));
}
.cs-segment.is-selected { background: var(--console-accent); border-color: var(--console-accent); color: var(--console-ground); }

.cs-info { overflow-y: auto; padding: calc(5 * var(--px)); }
.cs-info ul { list-style: none; margin: 0; padding: 0; }
.cs-info li { position: relative; padding-left: calc(7 * var(--px)); margin: 0 0 calc(3 * var(--px)); line-height: calc(10 * var(--px)); white-space: normal; }
.cs-info li::before { content: ""; position: absolute; left: var(--px); top: calc(3 * var(--px)); width: calc(2 * var(--px)); height: calc(2 * var(--px)); background: var(--console-accent); }

.cs-face {
  padding: 0;
  border: 0;
  cursor: pointer;
  background: var(--mode-colour);
  box-shadow: inset 0 calc(-1 * var(--px)) 0 rgba(0, 0, 0, 0.25);
  font: 400 calc(8 * var(--px)) / 1 var(--font-display);
  color: var(--console-ground);
}
.cs-face b { font-weight: 400; }
.cs-face-front { background: var(--console-slot); border: var(--px) solid var(--mode-colour); box-shadow: none; }
.cs-face-front .icon { position: absolute; left: 0; top: 0; width: calc(16 * var(--px)); height: calc(16 * var(--px)); }
.cs-face:hover, .cs-face:focus-visible { outline: var(--px) solid var(--console-text); outline-offset: calc(-1 * var(--px)); }
[data-mode="input"] { --mode-colour: var(--console-mode-input); }
[data-mode="output"] { --mode-colour: var(--console-mode-output); }
[data-mode="both"] { --mode-colour: var(--console-mode-both); }
[data-mode="none"] { --mode-colour: var(--console-mode-none); }
.cs-legend { display: flex; align-items: center; gap: calc(3 * var(--px)); color: var(--console-text-dim-web); }
.cs-legend i { width: calc(6 * var(--px)); height: calc(6 * var(--px)); background: var(--mode-colour); }

/* Tabs: only the selected tab's layer shows */
.cs-on-upgrades, .cs-on-config, .cs-on-info { display: none; }
[data-tab="upgrades"] .cs-on-upgrades, [data-tab="config"] .cs-on-config, [data-tab="info"] .cs-on-info { display: block; }
.cs-marker:not(.cs-on-main):not(.cs-on-upgrades):not(.cs-on-config):not(.cs-on-info),
[data-tab="upgrades"] .cs-marker.cs-on-upgrades, [data-tab="config"] .cs-marker.cs-on-config, [data-tab="info"] .cs-marker.cs-on-info { display: grid; }
[data-tab="config"] .cs-toggle.cs-on-config, [data-tab="config"] .cs-segment.cs-on-config { display: grid; }
[data-tab="config"] .cs-text.cs-on-config { display: inline; }
[data-tab]:not([data-tab="main"]) .cs-on-main { display: none; }
[data-tab="upgrades"] .cs-left-column { display: none; }
[data-tab="main"] .cs-marker.cs-on-main { display: grid; }
[data-tab="main"] .cs-tab[data-tab="main"], [data-tab="upgrades"] .cs-tab[data-tab="upgrades"],
[data-tab="config"] .cs-tab[data-tab="config"], [data-tab="info"] .cs-tab[data-tab="info"] {
  background: var(--console-panel);
  border-bottom-color: var(--console-panel);
  z-index: 1;
}
[data-tab="main"] .cs-tab[data-tab="main"] .cs-tab-icon-active, [data-tab="upgrades"] .cs-tab[data-tab="upgrades"] .cs-tab-icon-active,
[data-tab="config"] .cs-tab[data-tab="config"] .cs-tab-icon-active, [data-tab="info"] .cs-tab[data-tab="info"] .cs-tab-icon-active { display: block; }
[data-tab="main"] .cs-tab[data-tab="main"] .cs-tab-icon, [data-tab="upgrades"] .cs-tab[data-tab="upgrades"] .cs-tab-icon,
[data-tab="config"] .cs-tab[data-tab="config"] .cs-tab-icon, [data-tab="info"] .cs-tab[data-tab="info"] .cs-tab-icon { display: none; }

/* Notes */
.cs-marker {
  place-items: center;
  width: calc(11 * var(--px)); height: calc(11 * var(--px));
  background: var(--console-accent);
  color: var(--console-ground);
  font: 400 calc(8 * var(--px)) / 1 var(--font-display);
  text-decoration: none;
  z-index: 3;
  box-shadow: 0 0 0 var(--px) var(--console-ground);
}
.cs-highlight { pointer-events: none; outline: var(--px) dashed var(--console-accent); outline-offset: var(--px); opacity: 0; transition: opacity 0.12s; z-index: 2; }
.cs-highlight.is-lit { opacity: 1; }
.screen-notes { list-style: none; padding: 0; margin: var(--space-4) 0 0; display: grid; gap: var(--space-2); }
.screen-notes li { display: flex; gap: var(--space-3); align-items: baseline; padding: var(--space-2) var(--space-3); border-left: 2px solid transparent; }
.screen-notes li.is-lit, .screen-notes li:target { border-left-color: var(--accent); background: var(--surface); }
.screen-note-n {
  flex: none; display: inline-grid; place-items: center;
  width: 22px; height: 22px;
  background: var(--console-accent); color: var(--console-ground);
  font: 400 14px/1 var(--font-display);
}
.screen-notes p { margin: 0; }
.screen figcaption { color: var(--text-faint); font-size: 0.9rem; margin-top: var(--space-2); }
.no-js-hidden { display: none; }

.cs-border { border: var(--px) solid; }
.cs-tank { overflow: hidden; }
.cs-fluid {
  position: absolute;
  left: calc(2 * var(--px)); right: calc(2 * var(--px)); bottom: calc(2 * var(--px));
  height: calc(var(--fill) * var(--px));
  background-size: calc(16 * var(--px)) calc(16 * var(--px));
  background-position: left bottom;
  image-rendering: pixelated;
}
.cs-ticks i {
  position: absolute;
  right: calc(2 * var(--px));
  width: calc(4 * var(--px)); height: var(--px);
  top: calc((2 + (var(--h) - 4) * var(--t) / 4) * var(--px));
  background: var(--console-text);
}
.cs-gauge-fill[style*="--gauge"] {
  background: repeating-linear-gradient(to top, var(--gauge) 0 calc(2 * var(--px)), transparent calc(2 * var(--px)) calc(3 * var(--px)));
}
.cs-header-readout { white-space: nowrap; }
.cs-lane { background-repeat: no-repeat; }
.cs-bare { background: none; box-shadow: none; }
