/* TeamVanilla foundation, 2026-11.
   One layer, loaded last on both hosts; it owns everything you see. style.css stays
   underneath for the HQ building, the seasons and the theme switch's icon logic.

   The idea: an engineering datasheet, not a landing page. Hairline rules instead of
   cards, DIN for anything that labels something, real numbers in mono, and TV green
   used the way hardware uses a signal light: in a few places, at full strength.
   The rules behind it are in STYLE.md at the project root. */

/* Tokens ------------------------------------------------------------- */

:root {
  /* Brand, sampled from the artwork in assets/art/ */
  --tv-green: #18b068;      /* the face of the TV logo */
  --tv-green-hi: #38e090;   /* the logo's highlight */
  --tv-green-lo: #12955a;   /* pressed */
  --tv-neon: #00f090;       /* the product wordmarks */
  --tv-red: #e81018;        /* the product wordmarks */
  --tv-black: #001010;      /* the logo's outline */

  /* Type. Everything is installed already: Bahnschrift is Windows' DIN, macOS and iOS
     ship DIN Alternate. No font files are downloaded. */
  --font-display: Bahnschrift, "DIN Alternate", "DIN Next", "Roboto Condensed", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "Cascadia Mono", ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: var(--font-body);
  --mono: var(--font-mono);
  --tv-display: var(--font-display);

  /* Measure */
  --wrap: 82rem;
  --gutter: 2rem;
  --read: 44rem;
  --bar-h: 3.6rem;
  --net-h: 2.15rem;

  /* Light theme: paper */
  --bg: #f1f0eb;
  --bg-2: #e7e6df;
  --bg-3: #e2e1d9;
  --panel: #fafaf7;
  --ink: #0b1513;
  --text: #28322f;
  --muted: #5c6763;
  --rule: #d2d2c9;
  --rule-strong: #0b1513;
  --link: #0a7444;
  --green: #18b068;
  --green-hover: #1fc176;
  --green-deep: #12955a;
  --green-light: #38e090;
  --on-green: #001010;
  --on-green-soft: #0f3b2a;
  --code-bg: #0c1412;
  --code-ink: #d6e2dc;
  --code-dim: #7d8f88;
  --code-key: #38e090;
  --code-str: #f0c674;
  --tag-bg: #e3e2da;
  --select: rgba(24, 176, 104, .28);
  /* Plates: the VanillaCity band and the footer. A shade under the paper in the light theme,
     the logo's black in the dark one. */
  --plate: #e4e3db;
  --plate-line: #cdccc3;
  --plate-ink: #0b1513;
  --plate-text: #2c3633;
  --plate-muted: #5f6a66;
  --plate-link: #0a7444;
  --plate-edge: #0b1513;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #090f0e;
    --bg-2: #0d1513;
    --bg-3: #111a18;
    --panel: #0f1716;
    --ink: #eef3f0;
    --text: #c4cdc9;
    --muted: #8a9691;
    --rule: #202b28;
    --rule-strong: #4a5853;
    --link: #45d98f;
    --green: #18b068;
    --green-hover: #1fc176;
    --green-deep: #12955a;
    --green-light: #38e090;
    --on-green: #001010;
    --on-green-soft: #0f3b2a;
    --code-bg: #050a09;
    --tag-bg: #16211e;
    --select: rgba(24, 176, 104, .35);
    --plate: #001010;
    --plate-line: #1d2e2a;
    --plate-ink: #ffffff;
    --plate-text: #b9c7c1;
    --plate-muted: #7f928b;
    --plate-link: #38e090;
    --plate-edge: #2f433d;
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #090f0e;
  --bg-2: #0d1513;
  --bg-3: #111a18;
  --panel: #0f1716;
  --ink: #eef3f0;
  --text: #c4cdc9;
  --muted: #8a9691;
  --rule: #202b28;
  --rule-strong: #4a5853;
  --link: #45d98f;
  --green: #18b068;
  --green-hover: #1fc176;
  --green-deep: #12955a;
  --green-light: #38e090;
  --on-green: #001010;
  --on-green-soft: #0f3b2a;
  --code-bg: #050a09;
  --tag-bg: #16211e;
  --select: rgba(24, 176, 104, .35);
  --plate: #001010;
  --plate-line: #1d2e2a;
  --plate-ink: #ffffff;
  --plate-text: #b9c7c1;
  --plate-muted: #7f928b;
  --plate-link: #38e090;
  --plate-edge: #2f433d;
  color-scheme: dark;
}

/* The names the help desk, dashboard and shop rules below were written against. */
:root {
  --tv-shell: var(--wrap);
  --tv-read: var(--read);
  --tv-radius: 3px;
  --tv-radius-sm: 2px;
  --tv-signal: var(--tv-green);
  --tv-surface: var(--panel);
  --tv-surface-solid: var(--panel);
  --tv-surface-raised: var(--bg-2);
  --tv-surface-deep: var(--tv-black);
  --tv-surface-deep-2: #062420;
  --tv-line: var(--rule);
  --tv-line-soft: var(--rule);
  --tv-ink-soft: var(--muted);
  --tv-shadow-sm: none;
  --tv-shadow-md: none;
  --tv-shadow-lg: none;
  --tv-green-glow: transparent;
  --tv-header-bg: var(--bg);
  --brand: var(--tv-green);
}

/* The theme switch eases rather than snaps: style.css registers its colour tokens so they can
   be animated; these are the ones this layer adds. */
@property --panel { syntax: "<color>"; inherits: true; initial-value: #fafaf7; }
@property --rule-strong { syntax: "<color>"; inherits: true; initial-value: #0b1513; }
@property --tag-bg { syntax: "<color>"; inherits: true; initial-value: #e3e2da; }
@property --plate { syntax: "<color>"; inherits: true; initial-value: #e4e3db; }
@property --plate-line { syntax: "<color>"; inherits: true; initial-value: #cdccc3; }
@property --plate-ink { syntax: "<color>"; inherits: true; initial-value: #0b1513; }
@property --plate-text { syntax: "<color>"; inherits: true; initial-value: #2c3633; }
@property --plate-muted { syntax: "<color>"; inherits: true; initial-value: #5f6a66; }
@property --plate-link { syntax: "<color>"; inherits: true; initial-value: #0a7444; }
@property --plate-edge { syntax: "<color>"; inherits: true; initial-value: #0b1513; }
@media (prefers-reduced-motion: no-preference) {
  :root {
    transition:
      --bg .45s ease-in-out, --bg-2 .45s ease-in-out, --bg-3 .45s ease-in-out,
      --ink .45s ease-in-out, --text .45s ease-in-out, --muted .45s ease-in-out,
      --rule .45s ease-in-out, --link .45s ease-in-out, --green .45s ease-in-out,
      --panel .45s ease-in-out, --rule-strong .45s ease-in-out, --tag-bg .45s ease-in-out,
      --plate .45s ease-in-out, --plate-line .45s ease-in-out, --plate-ink .45s ease-in-out,
      --plate-text .45s ease-in-out, --plate-muted .45s ease-in-out, --plate-link .45s ease-in-out,
      --plate-edge .45s ease-in-out;
  }
}

/* Base --------------------------------------------------------------- */

/* --head-stick is the pinned header's height on pages that have one: anchors and sticky side panels sit below it. */
html:has(.site-head) { --head-stick: calc(var(--net-h) + var(--bar-h)); }
html { background: var(--bg); scroll-behavior: smooth; scroll-padding-top: calc(var(--head-stick, 0px) + 1.5rem); }
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  background: none;            /* the page colour is on <html>, so the seasons' weather can fall behind the content */
  color: var(--text);
  font: 1.0625rem/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
body::before { content: none; }
body > main { flex: 1 0 auto; }
::selection { background: var(--select); color: var(--ink); }
:focus-visible { outline: 2px solid var(--tv-green); outline-offset: 2px; border-radius: 0; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--ink); text-decoration-thickness: 2px; }
p { margin: 0 0 1.1rem; }
strong { color: var(--ink); font-weight: 650; }
h1, h2, h3, h4 { color: var(--ink); font-family: var(--font-display); font-stretch: 87.5%; font-weight: 600; letter-spacing: 0; }
img { max-width: 100%; height: auto; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; left: -999px; top: 0; z-index: 60; padding: .5rem .8rem; background: var(--tv-green); color: var(--on-green); font-weight: 700; }
.skip:focus { left: 1rem; top: .5rem; }

.tv-wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
/* the old name, still in a few app templates */
.shell { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

/* Small type that labels things: DIN, sentence case, never spaced-out capitals. */
.label { color: var(--muted); font-family: var(--font-display); font-size: .84rem; font-weight: 500; letter-spacing: .01em; }
.mono { font-family: var(--font-mono); font-size: .84em; }

/* Status lights: filled is finished or live, hollow is in development. */
.dot { display: inline-block; flex: none; width: .5rem; height: .5rem; border-radius: 50%; background: var(--tv-green); vertical-align: .08em; }
.dot.is-dev { background: transparent; box-shadow: inset 0 0 0 1.5px var(--muted); }

/* Buttons ------------------------------------------------------------ */
/* Squared, like a key on a piece of equipment. Green with the logo's black for the
   one thing a page wants you to do; outlined for the rest. Discord and GitHub keep
   their own colours. */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  min-height: 2.75rem;
  padding: .55rem 1.05rem;
  border: 1px solid transparent;
  border-radius: 3px;
  box-shadow: none;
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { text-decoration: none; transform: none; }
.btn svg { width: 17px; height: 17px; flex: none; fill: currentColor; }
.btn-primary, .btn-green { background: var(--tv-green); border-color: var(--tv-black); color: var(--tv-black); box-shadow: none; }
.btn-primary:hover, .btn-green:hover { background: var(--tv-green-hi); color: var(--tv-black); }
.btn-secondary, .btn-ghost { background: transparent; border-color: var(--rule-strong); color: var(--ink); }
.btn-secondary:hover, .btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-dark:hover { background: var(--tv-green); border-color: var(--tv-black); color: var(--tv-black); }
.btn-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.btn-discord:hover { background: #4752c4; border-color: #4752c4; color: #fff; }
.btn-github { background: #24292f; border-color: #3d444d; color: #fff; }
.btn-github:hover { background: #32383f; color: #fff; }
.buttons, .actions { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1.6rem 0 0; }

/* A link that leads somewhere else on the site: DIN, with an arrow. */
.go { display: inline-flex; align-items: baseline; gap: .4rem; color: var(--ink); font-family: var(--font-display); font-size: .98rem; font-weight: 600; text-decoration: none; }
.go::after { content: "\2192"; color: var(--tv-green); transition: transform .15s ease; }
.go:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.go:hover::after { transform: translateX(2px); }
.link-arrow { color: var(--ink); font-family: var(--font-display); font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " \2192"; color: var(--tv-green); }

/* Header ------------------------------------------------------------- */
/* Two strips. The network bar (the logo's black) switches between the company and
   the workshop and holds the account links; the signal bar (the logo's green) is the
   site itself. Both are flat: no gradients, no shadow cast on the page. */

/* Sticky: both strips stay pinned to the top of the window. */
.site-head { position: sticky; top: 0; z-index: 40; }

.netbar { background: var(--tv-black); color: #a9b8b2; font-family: var(--font-display); font-size: .84rem; }
.netbar-in { display: flex; align-items: stretch; justify-content: space-between; gap: 1.5rem; min-height: var(--net-h); }
.netbar a { color: #c3d0cb; text-decoration: none; }
.netbar a:hover { color: #fff; }
.netbar-sites { display: flex; align-items: stretch; gap: 0; margin-left: -.75rem; }
.netbar-site { display: inline-flex; align-items: center; gap: .45rem; padding: 0 .75rem; border-top: 2px solid transparent; white-space: nowrap; }
.netbar-site span { color: #6f807a; font-family: var(--font-mono); font-size: .74rem; }
.netbar-site[aria-current] { border-top-color: var(--tv-green); background: #0a1f1b; color: #fff; }
.netbar-site[aria-current] span { color: #93a59f; }
.netbar-tools { display: flex; align-items: center; gap: .15rem; }
.netbar-tools .nav-apps { display: inline-flex; align-items: center; gap: .15rem; }
.netbar-tools a, .netbar-tools .nav-out {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: calc(var(--net-h) - .5rem);
  padding: 0 .6rem;
  border: 0;
  border-radius: 2px;
  background: none;
  box-shadow: none;
  color: #c3d0cb;
  font: inherit;
  white-space: nowrap;
}
.netbar-tools a:hover, .netbar-tools .nav-out:hover { background: #0f2a25; color: #fff; }
.netbar-tools a[aria-current="page"] { color: #fff; box-shadow: inset 0 -2px var(--tv-green); }
.netbar-tools svg { width: 15px; height: 15px; fill: currentColor; }
.netbar-sep { width: 1px; height: 1rem; margin: 0 .45rem; background: #23332f; }
.netbar .nav-form { display: inline-flex; margin: 0; }
.netbar .nav-who { color: #fff; }
.netbar .nav-account { color: var(--tv-green-hi); }
.netbar .nav-account:hover { color: #fff; }
.nav-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.2rem; height: 1.2rem; padding: 0 .3rem; border-radius: 2px; background: var(--tv-green); color: var(--tv-black); font-family: var(--font-mono); font-size: .7rem; font-weight: 700; line-height: 1; }
.netbar .theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 2rem; min-height: calc(var(--net-h) - .5rem); padding: 0; border: 0; border-radius: 2px; background: none; color: #c3d0cb; box-shadow: none; }
.netbar .theme-toggle:hover { background: #0f2a25; color: #fff; }
.netbar .theme-toggle svg { width: 15px; height: 15px; }

.mainbar { position: relative; background: var(--tv-green); color: var(--tv-black); border-bottom: 1px solid var(--tv-black); }
.mainbar-in { display: flex; align-items: stretch; gap: 2rem; min-height: var(--bar-h); }
.lockup { display: inline-flex; flex: none; align-items: center; gap: .7rem; color: var(--tv-black); text-decoration: none; }
.lockup:hover { color: var(--tv-black); }
.lockup img { display: block; width: 50px; height: auto; }
.lockup-name { font-family: var(--font-display); font-size: 1.32rem; font-weight: 700; font-stretch: 87.5%; letter-spacing: -.005em; line-height: 1; }
.lockup-site { padding-left: .7rem; border-left: 1px solid rgba(0, 16, 16, .35); font-family: var(--font-display); font-size: 1.05rem; font-weight: 400; line-height: 1.2; }

.mainnav { display: flex; align-items: stretch; flex: 1 1 auto; justify-content: flex-end; gap: 0; font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.mainnav > a, .menu > a {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 100%;
  margin: 0;
  padding: 0 .9rem;
  color: var(--tv-black);
  text-decoration: none;
  white-space: nowrap;
}
.mainnav > a:hover, .menu > a:hover, .menu:focus-within > a { background: rgba(0, 16, 16, .1); color: var(--tv-black); text-decoration: none; }
/* the page's own section: a black bar on the bar's lower edge, like a selected tab */
.mainnav > a[aria-current]::before, .menu > a[aria-current]::before { content: ""; position: absolute; left: .9rem; right: .9rem; bottom: -1px; height: 4px; background: var(--tv-black); }
.menu { position: relative; display: flex; align-items: stretch; }
/* a menu's caret */
.menu > a { padding-right: 1.7rem; }
.menu > a::after { content: ""; position: absolute; right: .8rem; top: 50%; width: .36rem; height: .36rem; margin-top: -.3rem; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.menu > a[aria-current]::before { right: 1.7rem; }

/* The menus: a black index panel under the bar, opened by hover or keyboard focus. The nav
   sits against the right edge, so every panel hangs from its menu's right side. */
.drop {
  position: absolute;
  top: 100%;
  left: auto;
  right: 0;
  z-index: 50;
  display: none;
  min-width: 19rem;
  margin: 1px 0 0;
  padding: .45rem 0;
  border: 1px solid var(--tv-black);
  border-top: 3px solid var(--tv-black);
  border-radius: 0;
  background: var(--tv-black);
  box-shadow: none;
}
@media (hover: hover) { .menu:hover .drop { display: block; } }
.menu:focus-within .drop { display: block; }
.drop-wide { min-width: 30rem; columns: 2; column-gap: 0; }
.drop a {
  display: block;
  break-inside: avoid;
  padding: .5rem 1.1rem;
  color: #e6efeb;
  font-family: var(--font-display);
  font-size: .98rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  white-space: normal;
}
.drop a:hover, .drop a:focus-visible { background: #0f2a25; color: #fff; outline-offset: -2px; }
.drop-note { display: block; margin-top: .1rem; color: #7f928b; font-family: var(--font-mono); font-size: .72rem; font-weight: 400; letter-spacing: 0; }
.drop a:hover .drop-note { color: #a6bab3; }
.drop-dev { color: #7f928b; font-weight: 400; }

/* Phone menu: a <details>, so it opens without a script. */
.mmenu { display: none; position: static; margin-left: auto; }
.mmenu > summary {
  display: flex;
  align-items: center;
  gap: .6rem;
  height: 100%;
  padding: 0 .2rem 0 .8rem;
  color: var(--tv-black);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  list-style: none;
  cursor: pointer;
}
.mmenu > summary::-webkit-details-marker { display: none; }
.mmenu-bars { position: relative; width: 20px; height: 2px; background: currentColor; }
.mmenu-bars::before, .mmenu-bars::after { content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor; }
.mmenu-bars::before { top: -6px; }
.mmenu-bars::after { top: 6px; }
.mmenu[open] .mmenu-bars { background: transparent; }
.mmenu[open] .mmenu-bars::before { top: 0; transform: rotate(45deg); }
.mmenu[open] .mmenu-bars::after { top: 0; transform: rotate(-45deg); }
.mmenu-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 60;
  max-height: calc(100dvh - var(--bar-h) - var(--net-h));
  overflow-y: auto;
  padding: .5rem var(--gutter) 1.5rem;
  border-top: 1px solid var(--tv-black);
  background: var(--tv-black);
  color: #e6efeb;
  font-family: var(--font-display);
}
/* Closed, the panel is not laid out at all: Chrome otherwise sizes it inside the collapsed
   <details> and its links widen the page on a phone. */
.mmenu:not([open]) .mmenu-panel { display: none; }
.mmenu-panel a { color: #e6efeb; text-decoration: none; }
.mmenu-label { margin: 1.1rem 0 .3rem; color: #7f928b; font-size: .82rem; font-weight: 500; }
.mgroup { border-bottom: 1px solid #1a2b27; }
.mgroup > summary { display: flex; justify-content: space-between; align-items: center; padding: .8rem 0; font-size: 1.12rem; font-weight: 600; list-style: none; cursor: pointer; }
.mgroup > summary::-webkit-details-marker { display: none; }
.mgroup > summary::after { content: "+"; color: var(--tv-green-hi); font-family: var(--font-mono); font-size: 1.1rem; }
.mgroup[open] > summary::after { content: "\2212"; }
.mgroup-links { display: grid; gap: 0; padding: 0 0 .7rem; }
.mgroup-links a { padding: .45rem 0 .45rem .9rem; border-left: 1px solid #1f3530; font-size: 1rem; font-weight: 500; }
.mmenu-panel > .mgroup-links > a, .mmenu-panel > a.mlink { display: block; padding: .8rem 0; border: 0; border-bottom: 1px solid #1a2b27; font-size: 1.12rem; font-weight: 600; }
.mmenu-services .nav-apps, .mmenu-utility, .mmenu-account { display: flex; flex-wrap: wrap; gap: .4rem; }
.mmenu-services { margin: .9rem 0 .2rem; }
.mmenu-services a, .mmenu-utility a, .mmenu-account a, .mmenu-account .nav-out, .mmenu-utility .theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 2.4rem;
  padding: .3rem .8rem;
  border: 1px solid #23332f;
  border-radius: 2px;
  background: none;
  box-shadow: none;
  color: #e6efeb;
  font: 500 .95rem var(--font-display);
}
.mmenu-utility { margin-top: 1.2rem; }
.mmenu-account { margin-top: .6rem; }
.mmenu-account .nav-form { display: inline-flex; margin: 0; }
.mmenu-utility .theme-toggle svg { width: 16px; height: 16px; }

/* Home: the masthead and the index ---------------------------------- */
/* What we make, said once in a plain sentence, then everything in the workshop at a
   glance, the way a hardware maker's menu lists its whole range. */

main.home { width: 100%; max-width: none; margin: 0; padding: 0; }
.masthead { padding: clamp(3rem, 2rem + 4vw, 6rem) 0 0; }
.masthead-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem); gap: 2rem 4rem; align-items: end; }
.masthead h1 {
  max-width: 24ch;
  margin: 0;
  font-size: clamp(2.5rem, 1.3rem + 3.8vw, 4.6rem);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.012em;
}
.masthead-lede { max-width: 40rem; margin: 1.6rem 0 0; color: var(--text); font-size: clamp(1.06rem, 1rem + .3vw, 1.22rem); line-height: 1.6; }
.masthead-side { padding-bottom: .4rem; }
.masthead-side .actions { margin-top: 1rem; }
.masthead-side p { margin: 0; color: var(--muted); font-size: .95rem; }

.index { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin: clamp(2.5rem, 2rem + 2vw, 4rem) 0 0; border-top: 2px solid var(--rule-strong); }
.index-col { min-width: 0; padding: 1.1rem 1.25rem 1.6rem 0; }
.index-col + .index-col { padding-left: 1.25rem; border-left: 1px solid var(--rule); }
.index-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: 0 0 .9rem; color: var(--ink); font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; text-decoration: none; }
.index-head:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.index-head span { color: var(--muted); font-family: var(--font-mono); font-size: .78rem; font-weight: 400; }
.index ul { margin: 0; padding: 0; list-style: none; }
.index li { margin: 0; }
.index li a { display: flex; align-items: baseline; gap: .5rem; padding: .22rem 0; color: var(--text); font-size: .95rem; line-height: 1.35; text-decoration: none; }
.index li a:hover { color: var(--ink); text-decoration: underline; }
.index li .dot { flex: none; transform: translateY(-.05em); }

/* Flagship: VanillaCity --------------------------------------------- */

.flagship { margin: clamp(3.5rem, 3rem + 2vw, 5.5rem) 0 0; background: var(--plate); color: var(--plate-text); }
.flagship-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: center; }
/* The key art is shown whole, at its own 1200 x 630. Its logo and the cat sit near the left
   edge, so stretching it to fill a taller box cut them off; the copy beside it is centred
   on the picture instead. */
.flagship-art { margin: 0; background: #000; }
.flagship-art img { display: block; width: 100%; height: auto; aspect-ratio: 1200 / 630; }
.flagship-copy { padding: clamp(1.5rem, 1rem + 1.5vw, 2.5rem) 0 clamp(1.5rem, 1rem + 1.5vw, 2.5rem) clamp(1.5rem, 1rem + 2vw, 3.5rem); }
.flagship-copy h2 { margin: 0; padding: .9rem 0 0; border: 0; border-top: 1px solid var(--plate-edge); color: var(--plate-ink); font-size: clamp(2.2rem, 1.6rem + 2vw, 3.2rem); line-height: 1; }
.flagship-copy p { margin: 1.1rem 0 0; }
.flagship-copy a:not(.btn) { color: var(--plate-link); }
/* Its facts run as one strip across the band, under the picture and the copy. */
.flagship-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--plate-line); }
.flagship-facts > div { min-width: 0; padding: .9rem 1.25rem 1rem 0; }
.flagship-facts > div + div { padding-left: 1.25rem; border-left: 1px solid var(--plate-line); }
.flagship-facts dt { color: var(--plate-muted); font-family: var(--font-display); font-size: .86rem; font-weight: 500; }
.flagship-facts dd { margin: .25rem 0 0; color: var(--plate-ink); font-size: .95rem; line-height: 1.45; }
.flagship-facts a { color: var(--plate-link); }
.flagship .btn-secondary { border-color: var(--plate-edge); color: var(--plate-ink); }
.flagship .btn-secondary:hover { background: var(--plate-ink); border-color: var(--plate-ink); color: var(--plate); }
.flagship-shots { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; padding: 0; background: var(--plate-line); border-top: 1px solid var(--plate-line); list-style: none; }
.flagship-shots li { margin: 0; background: var(--plate); }
.flagship-shots a { display: block; }
.flagship-shots img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; opacity: .88; transition: opacity .15s ease; }
.flagship-shots a:hover img { opacity: 1; }

/* A fact table: term on the left, value on the right, a hairline between rows. */
.facts-grid { margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.facts-grid > div { display: grid; grid-template-columns: minmax(7rem, 38%) minmax(0, 1fr); gap: 1rem; padding: .55rem 0; border-bottom: 1px solid var(--rule); }
.facts-grid dt { color: var(--muted); font-family: var(--font-display); font-size: .9rem; font-weight: 500; }
.facts-grid dd { margin: 0; color: var(--ink); font-size: .95rem; line-height: 1.45; overflow-wrap: anywhere; }
.facts-grid dd code { font-size: .82rem; }

/* Sheets: the sections of a long page --------------------------------- */
/* A heavy rule, the section's name in the left column, everything else in the right.
   The name is the heading: no slogan above or instead of it. */

.sheet { padding: clamp(3.5rem, 3rem + 2.5vw, 6rem) 0 0; scroll-margin-top: 1rem; }
.sheet-grid { display: grid; grid-template-columns: minmax(12rem, 3fr) minmax(0, 9fr); gap: 1.5rem 3rem; padding-top: 1.1rem; border-top: 2px solid var(--rule-strong); }
.sheet-head h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.45rem); line-height: 1.02; }
.sheet-head .label { display: block; margin-top: .55rem; font-family: var(--font-mono); font-size: .78rem; }
.sheet-intro { max-width: 46rem; margin: 0 0 2rem; color: var(--text); font-size: 1.08rem; }
.sheet-intro p { margin: 0 0 .8rem; }
.sheet-intro p:last-child { margin: 0; }
.sheet-body { min-width: 0; }
.sheet-more { margin: 1.4rem 0 0; }

/* Parts: one row per project, like a parts list ------------------------- */

.parts { margin: 0; border-top: 1px solid var(--rule); }
.part {
  display: grid;
  grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr) auto;
  gap: .4rem 2rem;
  align-items: baseline;
  padding: 1.15rem 0 1.2rem;
  border-bottom: 1px solid var(--rule);
}
.part-id { min-width: 0; }
.part-name { margin: 0; padding: 0; border: 0; font-size: 1.32rem; line-height: 1.15; }
.part-name a { color: var(--ink); text-decoration: none; }
.part-name a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.part-tag { margin: .3rem 0 0; color: var(--muted); font-family: var(--font-mono); font-size: .76rem; line-height: 1.4; }
.part-status { display: inline-flex; align-items: center; gap: .4rem; margin: .45rem 0 0; color: var(--ink); font-family: var(--font-display); font-size: .86rem; font-weight: 600; }
.part-desc { min-width: 0; margin: 0; color: var(--text); font-size: 1rem; line-height: 1.6; }
.part-desc a { color: var(--link); }
.part-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem 1.2rem; white-space: nowrap; }
.part-links a { color: var(--ink); font-family: var(--font-display); font-size: .95rem; font-weight: 600; text-decoration: none; }
.part-links a::after { content: " \2192"; color: var(--tv-green); }
.part-links a:hover { text-decoration: underline; text-decoration-thickness: 2px; }

/* Libraries carry their API on the row: the code is the product shot. */
.part.is-lib { grid-template-columns: minmax(11rem, 15rem) minmax(0, 1fr) minmax(0, 1.15fr); align-items: start; padding: 1.6rem 0; }
.part.is-lib .part-name { font-size: 1.7rem; }
.part.is-lib .part-links { justify-content: flex-start; margin-top: 1rem; }
.part.is-lib .part-main { min-width: 0; }
.part-code { min-width: 0; margin: 0; }
.part-code pre { margin: 0; }

/* Encyclopedias lead with their size. */
.part.is-book { grid-template-columns: 5.5rem minmax(11rem, 15rem) minmax(0, 1fr) auto; }
.part-figure { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 2.6rem; font-weight: 600; font-stretch: 87.5%; line-height: .9; }
.part-figure small { display: block; margin-top: .35rem; color: var(--muted); font-family: var(--font-mono); font-size: .72rem; font-weight: 400; line-height: 1.2; }
.part-figure.is-dev { font-size: 1rem; line-height: 1.2; padding-top: .4rem; }

/* House rules: a spec table with a key column. */
.spec-list { margin: 0; padding: 0; border-top: 1px solid var(--rule); list-style: none; counter-reset: none; }
.spec-list li { display: grid; grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr); gap: 1rem 2rem; margin: 0; padding: .9rem 0; border-bottom: 1px solid var(--rule); }
.spec-list b { color: var(--ink); font-family: var(--font-display); font-size: 1rem; font-weight: 600; }
.spec-list span { color: var(--text); }
.spec-list code { white-space: nowrap; }
.spec-list.is-plain li { grid-template-columns: minmax(0, 1fr); }
.spec-list.is-plain li::before { content: none; }

/* Company page: the press-kit layout indie studios use. The fact sheet holds the left
   column while the sections run on the right. */
.org-grid { display: grid; grid-template-columns: minmax(15rem, 19rem) minmax(0, 1fr); gap: 0 clamp(2rem, 1rem + 3vw, 5rem); align-items: start; margin-top: clamp(2.5rem, 2rem + 2vw, 4rem); }
.factsheet { position: sticky; top: calc(var(--head-stick, 0px) + 1.5rem); border-top: 2px solid var(--rule-strong); }
.factsheet-title { margin: 0; padding: .8rem 0 .7rem; border: 0; font-size: 1.25rem; line-height: 1.1; }
.factsheet .facts-grid > div { grid-template-columns: minmax(0, 44%) minmax(0, 1fr); gap: .75rem; }
.org-main { min-width: 0; }
.org-section { padding: 0 0 clamp(3rem, 2.5rem + 2vw, 4.5rem); scroll-margin-top: 1rem; }
.org-section > h2 { margin: 0 0 1.2rem; padding: .9rem 0 0; border: 0; border-top: 2px solid var(--rule-strong); font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.45rem); line-height: 1.02; }
.org-section > p { max-width: 46rem; }
.org-section > p:first-of-type { color: var(--ink); font-size: 1.1rem; }
.org-section h3 { margin: 2.2rem 0 .8rem; padding: 0; border: 0; font-size: 1.3rem; line-height: 1.15; }
.org-section .spec-list { margin-bottom: 1.5rem; }
.org-section .note { color: var(--muted); font-size: .92rem; }
.org-section .actions { margin-top: 1.2rem; }
.ledger { margin: 0 0 1.5rem; border-top: 1px solid var(--rule); }
.ledger > div { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: .3rem 2rem; padding: .85rem 0; border-bottom: 1px solid var(--rule); }
.ledger dt { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; line-height: 1.3; }
.ledger dt a { color: var(--ink); text-decoration: none; }
.ledger dt a:hover { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; }
.ledger dd { margin: 0; color: var(--text); }

/* The closing contact strip. */
.contact-strip { padding: clamp(3.5rem, 3rem + 2.5vw, 6rem) 0 0; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.5rem 3rem; align-items: center; padding: 1.6rem 0; border-top: 2px solid var(--rule-strong); border-bottom: 1px solid var(--rule); }
.contact-grid h2 { margin: 0; padding: 0; border: 0; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); line-height: 1.1; }
.contact-grid p { max-width: 42rem; margin: .5rem 0 0; color: var(--text); }
.contact-grid .actions { margin: 0; }

/* Code ---------------------------------------------------------------- */
/* Code sits on a dark plate in both themes, like a terminal mounted in a panel. */

code, pre, kbd, samp { font-family: var(--font-mono); }
code { padding: .1em .35em; border-radius: 2px; background: var(--tag-bg); color: var(--ink); font-size: .86em; overflow-wrap: anywhere; }
pre {
  margin: 0 0 1.3rem;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  border: 1px solid var(--tv-black);
  border-left: 3px solid var(--tv-green);
  border-radius: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: .84rem;
  line-height: 1.6;
  tab-size: 4;
}
pre code { padding: 0; background: none; color: inherit; font-size: inherit; overflow-wrap: normal; }
/* Thin scrollbars that sit inside the plate instead of the browser's default track and arrows. */
pre, .scroll, .table-wrap, .seg, .data-table, .account-nav, .admin-nav { scrollbar-width: thin; scrollbar-color: var(--rule-strong) transparent; }
pre { scrollbar-color: color-mix(in srgb, var(--code-ink) 28%, transparent) transparent; }
pre:hover { scrollbar-color: var(--tv-green) transparent; }
pre .c { color: var(--code-dim); }
pre .key { color: var(--code-key); }
pre .str { color: var(--code-str); }
kbd { display: inline-block; padding: .05em .4em; border: 1px solid var(--rule-strong); border-bottom-width: 2px; border-radius: 2px; background: var(--panel); color: var(--ink); font-size: .82em; line-height: 1.4; }

/* Tables -------------------------------------------------------------- */

.scroll { overflow-x: auto; margin: 0 0 1.4rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: .6rem 1rem .6rem 0; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: top; }
th { color: var(--ink); font-family: var(--font-display); font-size: .92rem; font-weight: 600; border-bottom: 2px solid var(--rule-strong); }
th:last-child, td:last-child { padding-right: 0; }
td code { font-size: .82rem; }
tr:target td { background: var(--bg-2); }
tr:target td:first-child { padding-left: .7rem; box-shadow: inset 3px 0 var(--tv-green); }
.nowrap { white-space: nowrap; }

/* Content pages --------------------------------------------------------- */
/* Every product, game and reference page: breadcrumb, title and summary line with the
   project's own artwork beside it, then the document on the left and its spec sheet
   (buttons and facts) on the right, as the forum's Reply column used to be. */

main.doc-main { width: 100%; max-width: none; margin: 0; padding: 0; }
.doc-head { padding: clamp(1.4rem, 1rem + 1.5vw, 2.2rem) 0 0; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .2rem .55rem; margin: 0 0 clamp(1.6rem, 1rem + 2vw, 2.8rem); color: var(--muted); font-family: var(--font-display); font-size: .9rem; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs span[aria-hidden] { color: var(--rule-strong); }
.crumbs [aria-current] { color: var(--ink); }
.doc-head-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem 3rem; align-items: end; padding-bottom: clamp(1.6rem, 1.2rem + 1.5vw, 2.6rem); border-bottom: 2px solid var(--rule-strong); }
.doc-head-grid.has-art { grid-template-columns: minmax(0, 1fr) minmax(14rem, 30rem); }
.doc-head h1 { max-width: 22ch; margin: 0; padding: 0; border: 0; font-size: clamp(2.3rem, 1.5rem + 3vw, 4rem); line-height: 1; letter-spacing: -.01em; }
.doc-sub { max-width: 44rem; margin: 1rem 0 0; color: var(--text); font-size: clamp(1.06rem, 1rem + .3vw, 1.22rem); line-height: 1.55; }
.doc-art { display: flex; align-items: center; justify-content: flex-end; margin: 0; }
.doc-art img { display: block; width: auto; max-width: 100%; max-height: 9.5rem; object-fit: contain; }
.doc-art.is-photo img { max-height: 12rem; border: 1px solid var(--rule); }
.doc-art .art-light { display: none; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .doc-art .art-dark.has-light { display: none; } :root:not([data-theme="dark"]) .doc-art .art-light { display: block; } }
:root[data-theme="light"] .doc-art .art-dark.has-light { display: none; }
:root[data-theme="light"] .doc-art .art-light { display: block; }

.doc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem); grid-template-areas: "doc spec" "doc nav"; grid-template-rows: auto 1fr; gap: 0 clamp(2rem, 1rem + 3vw, 4.5rem); align-items: start; padding: clamp(2rem, 1.5rem + 1.5vw, 3rem) 0 0; }
.doc-grid.single { grid-template-columns: minmax(0, 1fr); grid-template-areas: "doc"; }
.doc-grid > .prose { grid-area: doc; }
.doc-spec { grid-area: spec; min-width: 0; }
.doc-nav { grid-area: nav; position: sticky; top: calc(var(--head-stick, 0px) + 1.5rem); min-width: 0; margin-top: 2rem; }
.doc-grid:not(:has(.doc-spec)) .doc-nav { margin-top: 0; }

.spec { border-top: 2px solid var(--rule-strong); }
.spec-title { margin: 0; padding: .7rem 0 .6rem; color: var(--ink); font-family: var(--font-display); font-size: .95rem; font-weight: 600; }
.spec-actions { display: grid; gap: .45rem; margin: 0 0 1.2rem; }
.spec-actions .btn { justify-content: flex-start; width: 100%; }
.spec-actions .btn span { margin-left: auto; font-family: var(--font-mono); font-size: .72rem; font-weight: 400; opacity: .75; }

.doc-nav-block { border-top: 1px solid var(--rule); padding: .7rem 0 1.1rem; }
.doc-nav-block:first-child { border-top: 2px solid var(--rule-strong); }
.doc-nav-title { margin: 0 0 .45rem; color: var(--ink); font-family: var(--font-display); font-size: .95rem; font-weight: 600; }
.doc-nav-block nav, .doc-nav-block ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.doc-nav-block li { margin: 0; }
.doc-nav-block a { display: block; padding: .28rem 0 .28rem .75rem; border-left: 1px solid var(--rule); color: var(--muted); font-size: .92rem; line-height: 1.35; text-decoration: none; }
.doc-nav-block a:hover { border-left-color: var(--tv-green); color: var(--ink); }
.doc-nav-block .go { margin-top: .6rem; padding: 0; border: 0; color: var(--ink); font-size: .92rem; }
.doc-nav-ask p { margin: 0 0 .6rem; color: var(--muted); font-size: .92rem; }
.doc-nav-ask .go { margin: 0 1rem 0 0; }

.toc-mobile { display: none; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.toc-mobile summary { display: flex; justify-content: space-between; align-items: baseline; padding: .75rem 0; color: var(--ink); font-family: var(--font-display); font-weight: 600; list-style: none; cursor: pointer; }
.toc-mobile summary::-webkit-details-marker { display: none; }
.toc-mobile summary span { color: var(--muted); font-family: var(--font-mono); font-size: .8rem; font-weight: 400; }
.toc-mobile nav { display: grid; padding: 0 0 .8rem; }
.toc-mobile nav a { padding: .35rem 0 .35rem .75rem; border-left: 1px solid var(--rule); color: var(--text); text-decoration: none; }
.toc-mobile nav a:hover { border-left-color: var(--tv-green); color: var(--ink); }

/* The document itself */
.prose { min-width: 0; max-width: var(--read); }
.doc-grid.single .prose { max-width: 56rem; }
.prose > :first-child { margin-top: 0; }
.prose > p:first-of-type { color: var(--ink); font-size: 1.14rem; line-height: 1.6; }
.prose h2 { margin: 3rem 0 1rem; padding: .9rem 0 0; border: 0; border-top: 1px solid var(--rule-strong); font-size: clamp(1.5rem, 1.3rem + .6vw, 1.85rem); line-height: 1.1; scroll-margin-top: 1.5rem; }
.prose h3 { margin: 2rem 0 .5rem; font-size: 1.22rem; line-height: 1.2; }
.prose h4 { margin: 1.5rem 0 .4rem; font-size: 1.05rem; }
.prose ul, .prose ol { margin: 0 0 1.3rem; padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose li::marker { color: var(--muted); }
.prose ul > li::marker { content: "\2013  "; }
.prose blockquote { margin: 0 0 1.3rem; padding: .2rem 0 .2rem 1.1rem; border-left: 3px solid var(--tv-green); color: var(--ink); }
.prose hr { margin: 2.5rem 0; border: 0; border-top: 1px solid var(--rule); }
.prose .feature { margin: 0 0 2rem; }
.prose .feature img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: 0; box-shadow: none; }
.prose figure { margin: 0 0 1.5rem; }
.prose figcaption { margin-top: .5rem; color: var(--muted); font-size: .88rem; }
.prose .note { color: var(--muted); font-size: .95rem; }
.prose dl.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0 0 1.4rem; border-top: 1px solid var(--rule); }
.prose dl.facts dt, .prose dl.facts dd { margin: 0; padding: .5rem 1.5rem .5rem 0; border-bottom: 1px solid var(--rule); }
.prose dl.facts dt { color: var(--muted); font-family: var(--font-display); font-weight: 500; }
.prose .shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.prose .shots li { margin: 0; }
.prose .shots li::marker { content: none; }
.prose .shots img { display: block; width: 100%; height: auto; border: 1px solid var(--rule); }
.prose .shots figcaption { font-size: .84rem; line-height: 1.45; }
.prose .cover img { max-height: 12rem; width: auto; }

/* Phones: tables become labelled cards (content.php adds the labels). */
@media (max-width: 720px) {
  .prose table.table-stack thead { display: none; }
  .prose table.table-stack, .prose table.table-stack tbody, .prose table.table-stack tr, .prose table.table-stack td { display: block; width: 100%; }
  .prose table.table-stack tr { padding: .7rem 0; border-bottom: 1px solid var(--rule); }
  .prose table.table-stack td { padding: .15rem 0; border: 0; }
  .prose table.table-stack td[data-label]::before { content: attr(data-label); display: block; color: var(--muted); font-family: var(--font-display); font-size: .8rem; font-weight: 500; }
  .prose table.table-stack tbody th { padding: .22rem 0; border: 0; }
}

/* About: the building ---------------------------------------------------- */
/* The HQ is the page. It stands on its own black stage, full width, with nothing
   framing it. */

.about-body .page.roster { max-width: none; margin: 0; padding: clamp(2rem, 1.5rem + 1.5vw, 3rem) 0 0; }
.about-body .roster > h2, .about-body .roster > p { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.about-body .roster > h2 { margin-top: 0; margin-bottom: .5rem; padding: 0; border: 0; }
.about-body .roster > p { margin-bottom: 0; color: var(--muted); }
.about-body .roster > p > span { color: var(--ink); }
.about-body .hq { margin-top: 2rem; padding: clamp(1.5rem, 1rem + 2vw, 3rem) 0; background: #05070f; border-top: 1px solid var(--tv-black); border-bottom: 1px solid var(--tv-black); }
.about-body .hq-scene { border-radius: 0; box-shadow: 0 0 0 1px #1b2233; }
main.is-about + .site-foot { margin-top: 0; }
/* The About page's masthead: headline, then an index of the page. */
.about-mast { padding-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.about-mast h1 { max-width: 16ch; }
.about-mast .masthead-lede { margin-top: 1.4rem; }
.about-mast .actions { margin-top: 1.8rem; }
.about-index { margin-top: clamp(2.5rem, 2rem + 2vw, 3.5rem); }
.about-index p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.about-body .roster > h2 { padding-top: .9rem; border-top: 2px solid var(--rule-strong); font-size: clamp(1.8rem, 1.4rem + 1.2vw, 2.45rem); line-height: 1.02; }

/* Not found -------------------------------------------------------------- */
.missing { padding: clamp(3rem, 2rem + 4vw, 6rem) 0; }
.missing h1 { margin: 0; font-size: clamp(2.5rem, 1.5rem + 4vw, 4.5rem); line-height: 1; }
.missing .code { display: block; margin: 0 0 1rem; color: var(--muted); font-family: var(--font-mono); font-size: .85rem; }
.missing p { max-width: 38rem; margin: 1.2rem 0 0; font-size: 1.1rem; }

/* Footer ---------------------------------------------------------------- */
/* The base plate: a shade under the paper in the light theme, the logo's black in the dark. */

.site-foot { width: 100%; max-width: none; margin: clamp(4rem, 3rem + 3vw, 6.5rem) 0 0; padding: 0; border: 0; border-top: 2px solid var(--plate-edge); background: var(--plate); color: var(--plate-text); font-size: .92rem; }
.site-foot a { color: var(--plate-ink); text-decoration: none; }
.site-foot a:hover { color: var(--plate-ink); text-decoration: underline; }
.foot-grid { display: grid; grid-template-columns: minmax(14rem, 1.4fr) repeat(4, minmax(0, 1fr)); gap: 2rem; max-width: none; margin: 0; padding: 3rem 0 2.5rem; border-bottom: 1px solid var(--plate-line); }
.foot-brand { display: flex; flex-direction: column; gap: .8rem; }
.foot-logo { display: inline-flex; align-items: center; gap: .65rem; color: var(--plate-ink); font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; font-stretch: 87.5%; }
.foot-logo:hover { text-decoration: none; }
.foot-logo img { width: 46px; height: auto; }
.foot-brand p { margin: 0; max-width: 22rem; line-height: 1.55; }
.foot-col { display: flex; flex-direction: column; gap: .4rem; }
.foot-heading { margin: 0 0 .4rem; color: var(--plate-muted); font-family: var(--font-display); font-size: .86rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.foot-col a { font-family: var(--font-display); font-size: .98rem; font-weight: 500; line-height: 1.5; }
.foot-legal { max-width: none; padding: 1.3rem 0 2rem; }
.foot-legal p { margin: .25rem 0; max-width: 60rem; color: var(--plate-muted); font-size: .84rem; line-height: 1.6; }
.foot-legal a { color: var(--plate-text); text-decoration: underline; text-decoration-color: var(--plate-line); }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1180px) {
  .mainnav > a, .menu > a { padding: 0 .65rem; font-size: .95rem; }
  .menu > a { padding-right: 1.4rem; }
  .menu > a::after { right: .6rem; }
  .mainnav > a[aria-current]::before { left: .65rem; right: .65rem; }
  .menu > a[aria-current]::before { left: .65rem; right: 1.4rem; }
  .mainbar-in { gap: 1.2rem; }
  .lockup-site { display: none; }
  .part.is-lib { grid-template-columns: minmax(10rem, 13rem) minmax(0, 1fr); }
  .part.is-lib .part-code { grid-column: 1 / -1; }
}

@media (max-width: 1040px) {
  .index { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .index-col:nth-child(4) { padding-left: 0; border-left: 0; }
  .index-col:nth-child(n + 4) { border-top: 1px solid var(--rule); }
  .foot-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 980px) {
  :root { --gutter: 1.25rem; }
  .netbar-tools { display: none; }
  .netbar-in { justify-content: flex-start; }
  .netbar .netbar-mobile-theme { display: inline-flex; margin-left: auto; }
  .mainnav { display: none; }
  .mmenu { display: block; }
  .masthead-grid { grid-template-columns: minmax(0, 1fr); }
  .masthead-side { padding-bottom: 0; }
  .flagship-grid { grid-template-columns: minmax(0, 1fr); }
  .flagship-copy { padding: 1.8rem 0 2rem; }
  .flagship-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flagship-facts > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .flagship-facts > div:nth-child(n + 3) { border-top: 1px solid var(--plate-line); }
  .flagship-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sheet-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
  .part { grid-template-columns: minmax(0, 1fr) auto; }
  .part-desc { grid-column: 1 / -1; grid-row: 2; }
  .part-links { grid-column: 2; grid-row: 1; align-self: start; }
  .part.is-lib { grid-template-columns: minmax(0, 1fr); }
  .part.is-lib .part-links { grid-column: auto; grid-row: auto; }
  .part.is-book { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
  .part.is-book .part-desc { grid-column: 2 / -1; grid-row: 2; }
  .part.is-book .part-figure { grid-row: 1 / span 2; }
  .part.is-book .part-links { grid-column: 3; }
  .doc-head-grid.has-art { grid-template-columns: minmax(0, 1fr); }
  .doc-art { justify-content: flex-start; order: -1; }
  .doc-art img { max-height: 7rem; }
  .doc-grid, .doc-grid.single { grid-template-columns: minmax(0, 1fr); grid-template-areas: "spec" "toc" "doc" "nav"; }
  .doc-spec { margin-bottom: 2rem; }
  .doc-nav { position: static; margin-top: 3rem; }
  .doc-nav .aside-toc-block { display: none; }
  .org-grid { grid-template-columns: minmax(0, 1fr); }
  .factsheet { position: static; margin-bottom: 3rem; }
  .toc-mobile { display: block; grid-area: toc; margin-bottom: 2rem; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px) {
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-col:nth-child(n) { padding-left: 0; border-left: 0; padding-right: .75rem; }
  .index-col:nth-child(even) { padding-left: 1rem; border-left: 1px solid var(--rule); }
  .index-col:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .spec-list li { grid-template-columns: minmax(0, 1fr); gap: .2rem; }
  .ledger > div { grid-template-columns: minmax(0, 1fr); }
  .facts-grid > div { grid-template-columns: minmax(6.5rem, 40%) minmax(0, 1fr); }
  .prose .shots { grid-template-columns: minmax(0, 1fr); }
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 2.4rem; }
  .netbar-site span { display: none; }
}

@media (max-width: 520px) {
  :root { --gutter: 1rem; }
  .lockup img { width: 44px; }
  .lockup-name { font-size: 1.2rem; }
  .part { grid-template-columns: minmax(0, 1fr); }
  .part-links { grid-column: 1; grid-row: auto; justify-content: flex-start; }
  .part.is-book { grid-template-columns: 3.6rem minmax(0, 1fr); }
  .part.is-book .part-links { grid-column: 2; grid-row: auto; }
  .part-figure { font-size: 2rem; }
  .flagship-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actions .btn, .buttons .btn { flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ======================================================================
   Carried over from the 2026 design layer: the help desk, account pages, dashboard,
   shop, team page, tags and BBCode. Radii, weights and the old green were rewritten
   to the tokens above; the block after this one aligns the rest.
   ====================================================================== */

/* App pages: account, admin, help desk ------------------------------- */

main#main:not(.account) { width: min(100% - 3rem, var(--tv-shell)); margin-inline: auto; padding: 2.2rem 0 4.5rem; }
main.content-main, main#main.home, main#main.content-main { width: 100%; max-width: none; margin: 0; padding: 0; }
main#main > h1 { margin: .5rem 0 1.4rem; font-size: clamp(2rem, 3.5vw, 2.8rem); font-weight: 600; letter-spacing: 0; line-height: 1.08; }
main#main > .sub, .sub { color: var(--muted); }
main#main > h2 { margin: 2.6rem 0 .9rem; padding-top: 1.4rem; border-top: 1px solid var(--tv-line); font-size: 1.35rem; font-weight: 600; letter-spacing: 0; }
main#main > h2:first-child { padding-top: 0; border-top: 0; margin-top: 0; }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  max-width: none;
  margin: 0 0 1.3rem;
  padding: 2.75rem 2.5rem;
  border-radius: 3px;
  background:
    radial-gradient(620px 260px at 100% 0%, rgba(24, 176, 104, .15), transparent 68%),
    linear-gradient(145deg, #0b3423, #06281a 62%, #041c12);
  box-shadow: var(--tv-shadow-md);
  color: #d8f0e2;
  text-align: left;
}
.hero::after {
  content: "";
  position: absolute;
  width: 21rem;
  height: 21rem;
  right: -8rem;
  bottom: -15rem;
  border: 1px solid rgba(230, 246, 236, .12);
  border-radius: 50%;
  box-shadow: 0 0 0 3.5rem rgba(255, 255, 255, .025);
  pointer-events: none;
}
.hero-text { position: relative; z-index: 1; max-width: 48rem; }
.hero h1 { margin: 0 0 .65rem; color: #f1fbf5; font-size: clamp(2.15rem, 3.8vw, 3.1rem); font-weight: 600; line-height: 1.02; letter-spacing: 0; }
.hero .sub { max-width: 44rem; margin: 0; color: #aacfba; font-size: .98rem; }
.hero .sub strong { color: #e8f7ee; }
.hero .support-actions { position: relative; z-index: 1; margin: 0; flex: none; }
.hero .support-actions .btn { background: var(--green); color: var(--on-green); }
.hero .support-actions .btn:hover { background: var(--green-hover); }
.hero .btn-ghost { border-color: rgba(230, 246, 236, .26); background: rgba(255, 255, 255, .06); color: #e8f7ee; }

.account-nav, .admin-nav {
  display: flex;
  flex-wrap: wrap;
  gap: .15rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1.6rem;
  padding: .3rem;
  border: 1px solid var(--tv-line);
  border-radius: 3px;
  background: var(--tv-surface);
}
.account-nav a, .admin-nav a { padding: .45rem .8rem; border: 0; border-radius: 3px; color: var(--muted); font-size: .82rem; font-weight: 650; text-decoration: none; }
.account-nav a:hover, .admin-nav a:hover { color: var(--ink); background: rgba(6, 40, 26, .05); }
.account-nav a[aria-current="page"], .admin-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }

.grid { grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: .8rem; margin: 0 0 1.8rem; }
.card {
  position: relative;
  min-width: 0;
  padding: 1.25rem 1.3rem;
  border: 1px solid var(--tv-line);
  border-radius: 3px;
  background: var(--tv-surface);
  box-shadow: var(--tv-shadow-sm);
}
.card h2 { margin: 0 0 .45rem; padding: 0; border: 0; font-size: .85rem; font-weight: 600; letter-spacing: 0; color: var(--ink); }
.card p { margin: 0; color: var(--text); font-size: .9rem; }
.card .sub { color: var(--muted); font-size: .82rem; }
.card > p > strong { color: var(--ink); }

.tag { border-radius: 3px; font-size: .69rem; font-weight: 600; letter-spacing: .02em; padding: .16rem .48rem; }
.table-wrap .table td > .tag, .table-wrap .table td > .pill { justify-self: start; }
.back-link { margin: 0 0 1rem; font-size: .82rem; }
.back-link a { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 650; text-decoration: none; }
.back-link a:hover { color: var(--link); }
.pill { border-radius: 3px; border-color: var(--tv-line); font-size: .68rem; }
.muted { color: var(--muted); }

.support-actions { margin: 0 0 1.25rem; }
.ticket-head { padding: 1.4rem 1.5rem; border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); margin: .75rem 0 0; }
.ticket-head h1 { margin: .1rem 0 .65rem; font-size: clamp(1.8rem, 3.4vw, 2.5rem); font-weight: 600; letter-spacing: 0; line-height: 1.08; }
.ticket-head .meta { color: var(--muted); font-size: .82rem; gap: .5rem 1.25rem; }
.thread { gap: .7rem; margin: 1.2rem 0 1.6rem; }
.msg { padding: 1rem 1.15rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); }
.msg.internal { border-style: dashed; background: var(--tv-surface-raised); }
.msg-head { font-size: .78rem; }
.msg-by { color: var(--ink); }
.msg p { font-size: .92rem; line-height: 1.65; }
.staff-panel { padding: 1.1rem 1.25rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); margin: 0 0 1.3rem; }
.staff-panel h2 { margin: 0 0 .8rem; padding: 0; border: 0; font-size: .95rem; }
.staff-forms { gap: 1.2rem; }
.staff-form { align-items: flex-end; }
.staff-form .field { min-width: 12rem; }
.staff-form select { padding: .55rem .7rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); font: inherit; font-size: .85rem; }

.form-card { padding: 1.4rem 1.5rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); margin: 1rem 0 2.5rem; }
.field > span { margin-bottom: .35rem; color: var(--ink); font-size: .83rem; font-weight: 650; }
.field textarea, .field input, .field select, .account select, .account textarea, .account input[type="text"], .account input[type="email"], .account input[type="password"] {
  padding: .7rem .8rem;
  border: 1px solid var(--tv-line);
  border-radius: 3px;
  background: var(--tv-surface-solid);
  color: var(--text);
  font: inherit;
  font-size: .94rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field textarea:focus, .field input:focus, .field select:focus, .account input:focus, .account select:focus, .account textarea:focus {
  outline: 0;
  border-color: var(--link);
  box-shadow: 0 0 0 3px rgba(24, 176, 104, .16);
}
.field textarea { min-height: 9rem; }
.check { color: var(--muted); font-size: .83rem; }
.roles { gap: .6rem; }
.role-set { gap: .35rem .8rem; }
.role { color: var(--muted); font-size: .78rem; }
.role input { width: auto; margin: 0; accent-color: var(--link); }
.btn-small { min-height: 2.2rem; padding: .35rem .75rem; font-size: .78rem; border-radius: 3px; }

.profile { grid-template-columns: minmax(6rem, max-content) 1fr; gap: .45rem 1rem; margin: 0; }
.profile dt { color: var(--muted); font-size: .78rem; }
.profile dd { color: var(--text); font-size: .87rem; }
.notifications { padding: 1.2rem 1.3rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); margin: 1.3rem 0 1.5rem; }
.notifications h2 { margin: 0 0 .75rem; padding: 0; border: 0; font-size: 1rem; }
.notice-list { gap: .4rem; margin-bottom: .8rem; }
.notice-list li { padding: .55rem .7rem; border: 1px solid var(--tv-line-soft); border-radius: 3px; background: var(--tv-surface-solid); font-size: .86rem; }
.notice-list li.unread { border-left: 3px solid var(--link); }
.note { padding: .7rem .85rem; border: 1px solid rgba(24, 176, 104, .28); border-radius: 3px; background: rgba(24, 176, 104, .08); color: var(--text); font-size: .87rem; }
.note[role="status"] { margin: 0 0 1rem; }

.kb-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .8rem; margin: 1rem 0 .75rem; }
.kb-card { padding: 1.25rem 1.3rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); transition: transform .2s ease, border-color .2s ease; }
.kb-card:hover { transform: translateY(-2px); border-color: rgba(23, 181, 102, .5); text-decoration: none; }
.kb-card h2, .kb-card h3 { margin: 0 0 .35rem; padding: 0; border: 0; font-size: 1rem; font-weight: 600; }
.kb-card p { color: var(--muted); font-size: .85rem; line-height: 1.55; }
.kb-card .sub { color: var(--muted); font-size: .72rem; font-weight: 650; }
.article { max-width: var(--tv-read); margin: .75rem 0 3rem; }
.article h1 { margin: .25rem 0 .65rem; font-size: clamp(2rem, 3.7vw, 3rem); font-weight: 600; letter-spacing: 0; line-height: 1.05; }
.article-body { font-size: 1rem; line-height: 1.7; }
.article-body h2 { margin: 2.6rem 0 .8rem; border: 0; padding: 0; font-size: 1.55rem; }
.article-body h3 { margin: 1.9rem 0 .5rem; }
.article-body p { margin: 0 0 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.1rem 1.2rem; padding: 0; }
.article-body blockquote { padding: .7rem 1rem; border-left: 3px solid var(--green); background: var(--tv-surface); color: var(--muted); }

.account {
  max-width: 31rem;
  margin: 3.5rem auto 4.5rem;
  padding: 2.4rem 2.4rem 2.5rem;
  border: 1px solid var(--tv-line);
  border-radius: 3px;
  background: var(--tv-surface);
  box-shadow: var(--tv-shadow-md);
}
.account.wide { max-width: 52rem; }
.account h1 { margin: 0 0 .45rem; font-size: clamp(2rem, 3.7vw, 2.8rem); font-weight: 600; letter-spacing: 0; line-height: 1.04; }
.account .sub { margin: 0 0 1.5rem; color: var(--muted); font-size: .93rem; }
.account label { margin: 1rem 0 .35rem; color: var(--ink); font-size: .83rem; font-weight: 650; }
.account input { width: 100%; padding: .7rem .8rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); font: inherit; }
.account .btn { margin-top: 1.25rem; }
.account .small { margin-top: 1.4rem; color: var(--muted); }
.account .alert { padding: .7rem .85rem; border: 1px solid rgba(180, 45, 45, .35); border-radius: 3px; background: rgba(180, 45, 45, .09); color: var(--text); font-size: .86rem; }
:root[data-theme="dark"] .account .alert { background: rgba(255, 100, 100, .09); }
.account .row { gap: 1rem; }
.check-inline { margin-top: 1.15rem; font-size: .84rem; }
.check-inline input { width: auto; }

/* Dashboard: lists, panels, switches --------------------------------- */

.sub-nav, .filter-pills { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.4rem 0 1.4rem; }
.sub-nav a, .filter-pills a { padding: .38rem .75rem; border: 1px solid var(--tv-line); border-radius: 2px; color: var(--muted); font-size: .8rem; font-weight: 650; text-decoration: none; }
.sub-nav a:hover, .filter-pills a:hover { color: var(--ink); border-color: var(--link); }
.sub-nav a[aria-current="page"], .filter-pills a[aria-current="page"] { border-color: var(--link); background: rgba(24, 176, 104, .12); color: var(--ink); }
.filter-pills a span { margin-left: .3rem; color: var(--muted); font-weight: 600; }

.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin: 0 0 1rem; }
.toolbar input[type="search"], .toolbar select { min-height: 2.4rem; padding: .45rem .7rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); font: inherit; font-size: .88rem; }
.toolbar input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.toolbar-count { margin-left: auto; color: var(--muted); font-size: .8rem; }

.rows { display: grid; gap: .45rem; margin: 0 0 2rem; padding: 0; list-style: none; }
.rows > li { margin: 0; }
.row-link { display: flex; align-items: center; gap: .9rem; padding: .8rem 1rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease; }
a.row-link:hover { border-color: var(--link); transform: translateY(-1px); text-decoration: none; }
.row-main { display: flex; flex: 1 1 auto; flex-direction: column; gap: .15rem; min-width: 0; }
.row-title { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; color: var(--ink); font-weight: 600; font-size: .95rem; }
.row-meta { display: block; color: var(--muted); font-size: .78rem; font-weight: 500; overflow-wrap: anywhere; }
.row-title .row-meta { display: inline; }
.row-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .3rem; max-width: 45%; }
.row-side { flex: none; min-width: 5.5rem; color: var(--ink); font-size: .88rem; text-align: right; }
.row-side form { margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .35rem; }
.row-code { flex: none; padding: .3rem .55rem; border-radius: 3px; background: var(--tv-surface-deep); color: var(--tv-green-hi); font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.row-code-lg { padding: .6rem .85rem; font-size: 1.05rem; }
.rows-empty { padding: 1.2rem; border: 1px dashed var(--tv-line); border-radius: 3px; color: var(--muted); text-align: center; }
.mono { font-family: var(--mono); }

.avatar { display: inline-grid; flex: none; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--green-deep)); color: #04150e; font-weight: 600; font-size: .95rem; }
.avatar-lg { width: 3.6rem; height: 3.6rem; font-size: 1.4rem; }
.thumb { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 3px; object-fit: cover; }
.thumb-lg { display: block; width: 7rem; height: 7rem; margin: .2rem 0 .5rem; }

.chip { display: inline-flex; align-items: center; padding: .14rem .55rem; border: 1px solid var(--tv-line); border-radius: 2px; background: var(--tv-surface-solid); color: var(--text); font-size: .72rem; font-weight: 650; white-space: nowrap; }
.chip-owner { border-color: rgba(24, 176, 104, .5); background: rgba(24, 176, 104, .16); color: var(--ink); }
.chip-off { border-style: dashed; color: var(--muted); }
.chip-warn, .status-pending { border-color: rgba(230, 160, 20, .5); background: rgba(230, 160, 20, .14); color: var(--ink); }
.status-paid, .status-fulfilled { border-color: rgba(24, 176, 104, .5); background: rgba(24, 176, 104, .16); color: var(--ink); }
.status-cancelled, .status-refunded { color: var(--muted); text-decoration: line-through; }

.panel { margin: 0 0 1.4rem; padding: 1.4rem 1.5rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); }
.panel > h2, .form-grid > h2 { margin: 0 0 .9rem; padding: 0; border: 0; font-size: 1.1rem; }
.section-title { margin: 2rem 0 .8rem; padding: 0; border: 0; font-size: 1.15rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem 1.2rem; }
.span-2 { grid-column: 1 / -1; }
.form-grid .field, .panel .field { display: flex; flex-direction: column; gap: .3rem; margin: 0; }
.field input[type="file"] { padding: .5rem 0; border: 0; background: none; }
.field small { color: var(--muted); font-size: .75rem; }
.button-row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-top: .4rem; }
.btn-danger { border: 1px solid rgba(200, 60, 60, .55); background: transparent; color: #c04040; }
.btn-danger:hover { background: rgba(200, 60, 60, .12); color: #c04040; }
:root[data-theme="dark"] .btn-danger, :root[data-theme="dark"] .btn-danger:hover { color: #ff8f8f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-danger, :root:not([data-theme="light"]) .btn-danger:hover { color: #ff8f8f; } }

.switch-group { margin: 0 0 1.2rem; padding: 0; border: 0; }
.switch-group legend { margin-bottom: .5rem; padding: 0; color: var(--muted); font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.switch-row { position: relative; display: flex; align-items: flex-start; gap: .85rem; padding: .75rem .9rem; border: 1px solid var(--tv-line-soft); border-radius: 3px; background: var(--tv-surface-solid); cursor: pointer; }
.switch-group .switch-row + .switch-row { margin-top: .4rem; }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { position: relative; flex: none; width: 2.5rem; height: 1.4rem; margin-top: .1rem; border-radius: 2px; background: var(--tv-line); transition: background .15s ease; }
.switch::after { content: ""; position: absolute; top: .15rem; left: .15rem; width: 1.1rem; height: 1.1rem; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .15s ease; }
.switch-row input:checked + .switch { background: var(--tv-signal); }
.switch-row input:checked + .switch::after { transform: translateX(1.1rem); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--green); outline-offset: 2px; }
.switch-row:has(input:checked) { border-color: rgba(24, 176, 104, .45); }
.switch-text { display: flex; flex-direction: column; gap: .1rem; }
.switch-text strong { color: var(--ink); font-size: .9rem; }
.switch-text span { color: var(--muted); font-size: .8rem; }

.choice-group { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; border: 0; }
.choice-group legend { width: 100%; margin-bottom: .4rem; color: var(--ink); font-size: .83rem; font-weight: 650; }
.choice { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .75rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); font-size: .85rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--link); background: rgba(24, 176, 104, .12); }
.choice input { width: auto; margin: 0; accent-color: var(--link); }

.person-head { display: flex; align-items: center; gap: 1rem; margin: 0 0 1.2rem; }
.person-head h1 { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0; }
.person-head .sub { margin: .2rem 0 0; }
.fact-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .6rem; margin: 0 0 1.4rem; }
.fact-strip > div { padding: .7rem .9rem; border: 1px solid var(--tv-line-soft); border-radius: 3px; background: var(--tv-surface); }
.fact-strip dt { color: var(--muted); font-size: .72rem; font-weight: 650; }
.fact-strip dd { margin: .15rem 0 0; color: var(--ink); font-size: .9rem; font-weight: 650; overflow-wrap: anywhere; }

.action-list { display: grid; gap: .5rem; }
.action-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0; }
.action-list .action-row { padding: .7rem .9rem; border: 1px solid var(--tv-line-soft); border-radius: 3px; background: var(--tv-surface-solid); }
.action-row > span { display: flex; flex-direction: column; gap: .1rem; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; margin: 0 0 1.6rem; }
.dash-card { display: flex; flex-direction: column; gap: .25rem; padding: 1.1rem 1.2rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); color: var(--text); text-decoration: none; box-shadow: var(--tv-shadow-sm); transition: border-color .15s ease, transform .15s ease; }
a.dash-card:hover { border-color: var(--link); transform: translateY(-2px); text-decoration: none; }
.dash-title { color: var(--muted); font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.dash-big { color: var(--ink); font-family: var(--tv-display); font-size: 1.45rem; font-weight: 600; letter-spacing: 0; }
.dash-small { color: var(--muted); font-size: .8rem; }

.activity { display: grid; gap: 0; margin: 0 0 .8rem; padding: 0; list-style: none; border-top: 1px solid var(--tv-line-soft); }
.activity li { display: grid; grid-template-columns: 8.5rem 7rem minmax(0, 1fr); gap: .8rem; padding: .55rem 0; border-bottom: 1px solid var(--tv-line-soft); font-size: .84rem; }
.panel .activity li { grid-template-columns: 8.5rem minmax(0, 1fr); }
.activity-when { color: var(--muted); font-family: var(--mono); font-size: .76rem; }
.activity-who { color: var(--ink); font-weight: 650; }
.activity-what { overflow-wrap: anywhere; }

.empty-state { margin: 0 0 2rem; padding: 2rem 1.5rem; border: 1px dashed var(--tv-line); border-radius: 3px; text-align: center; }
.empty-state p { margin: .3rem 0; }
.method-card { padding: .9rem 0; border-top: 1px solid var(--tv-line-soft); }
.method-card:first-of-type { border-top: 0; padding-top: 0; }
.method-card .form-grid { margin-top: .7rem; }
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin: 0 0 1rem; }
.share-table { width: 100%; margin: 0 0 1rem; border-collapse: collapse; font-size: .88rem; }
.share-table th { padding: .5rem; border-bottom: 1px solid var(--tv-line); color: var(--muted); font-size: .72rem; text-align: left; text-transform: uppercase; }
.share-table td { padding: .55rem .5rem; border-bottom: 1px solid var(--tv-line-soft); vertical-align: middle; }
.share-table input { width: 6rem; padding: .4rem .55rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); font: inherit; }
.check-list { display: grid; gap: .35rem; margin: 0; padding: 0; list-style: none; }
.check-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .75rem; border-radius: 3px; background: var(--tv-surface-solid); }
.check-list li.done { border-left: 3px solid var(--green); }
.check-list li.todo { border-left: 3px solid #e6a014; }

/* Shop (public) ------------------------------------------------------ */

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 0 0 2.5rem; }
.shop-card { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); color: var(--text); text-decoration: none; box-shadow: var(--tv-shadow-sm); transition: transform .2s ease, border-color .2s ease; }
.shop-card:hover { transform: translateY(-3px); border-color: var(--link); text-decoration: none; }
.shop-card img, .shop-card-art { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: linear-gradient(135deg, var(--tv-surface-deep), var(--tv-surface-deep-2)); color: var(--tv-green-hi); font-family: var(--tv-display); font-size: 3rem; font-weight: 600; }
.shop-card-body { display: flex; flex-direction: column; gap: .3rem; padding: 1rem 1.1rem 1.2rem; }
.shop-card-name { color: var(--ink); font-weight: 600; font-size: 1.05rem; }
.shop-card-summary { color: var(--muted); font-size: .86rem; }
.shop-card-price { margin-top: .3rem; color: var(--ink); font-family: var(--tv-display); font-size: 1.25rem; font-weight: 600; }
.how-it-works { margin: 0 0 3rem; padding: 1.4rem 1.6rem; border-radius: 3px; background: var(--tv-surface-deep); color: #c7e4d4; }
.how-it-works h2 { margin: 0 0 .6rem; padding: 0; border: 0; color: #f1fbf5; font-size: 1.1rem; }
.how-it-works ol { margin: 0; padding-left: 1.2rem; }
.how-it-works li { margin: .3rem 0; }
.how-it-works strong { color: #f1fbf5; }
.how-it-works code { padding: .05em .35em; border-radius: 4px; background: rgba(24, 176, 104, .14); color: var(--tv-green-hi); }
.how-it-works .link { color: var(--tv-green-hi); }
.item-layout { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 2.5rem; align-items: start; margin: 0 0 3rem; }
.item-art img, .item-art .shop-card-art { width: 100%; border-radius: 3px; aspect-ratio: 1; object-fit: cover; }
.item-info h1 { margin: 0 0 .3rem; }
.item-price { margin: 0 0 1rem; color: var(--ink); font-family: var(--tv-display); font-size: 1.8rem; font-weight: 600; }
.checkout { margin-top: 1.5rem; }
.pay-choices { display: grid; gap: .5rem; margin: 0 0 1rem; padding: 0; border: 0; }
.pay-choices legend { margin-bottom: .5rem; color: var(--ink); font-weight: 600; }
.pay-choice { display: flex; align-items: center; gap: .7rem; padding: .8rem 1rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); cursor: pointer; }
.pay-choice:has(input:checked) { border-color: var(--link); background: rgba(24, 176, 104, .12); }
.pay-choice input { width: auto; margin: 0; accent-color: var(--link); }
.pay-name { color: var(--ink); font-weight: 600; }
.order-card { max-width: 36rem; margin: 1rem auto 3rem; padding: 2rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-md); text-align: center; }
.order-card h1 { margin: .4rem 0; font-size: 1.4rem; }
.order-card .sub { margin: 0; }
.order-code { margin: .2rem 0 .6rem; color: var(--ink); font-family: var(--mono); font-size: 2rem; font-weight: 600; letter-spacing: .08em; }
.pay-steps { margin: 1.2rem auto; padding-left: 1.2rem; max-width: 26rem; text-align: left; }
.pay-steps li { margin: .35rem 0; }
/* Payment buttons: a brand tile with the service's own logo, then plain text on the site's card. */
.pay-options { display: grid; gap: .55rem; max-width: 28rem; margin: 1.3rem auto; text-align: left; }
.pay-option { --brand: var(--link); display: flex; align-items: center; gap: .9rem; padding: .75rem .95rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface-solid); color: var(--text); text-decoration: none; transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease; }
.pay-option:hover { border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 10px 24px -14px var(--brand); text-decoration: none; }
.pay-option:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.pay-logo { display: inline-grid; flex: none; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: 3px; background: var(--brand, var(--link)); }
.pay-logo img { display: block; width: 1.6rem; height: 1.6rem; }
.pay-logo-sm { width: 1.4rem; height: 1.4rem; border-radius: 3px; }
.pay-logo-sm img { width: .95rem; height: .95rem; }
.pay-text { display: flex; flex: 1 1 auto; flex-direction: column; gap: .1rem; min-width: 0; }
.pay-option-name { color: var(--ink); font-weight: 600; font-size: 1rem; }
.pay-option-help { color: var(--muted); font-size: .78rem; line-height: 1.4; }
.pay-go { flex: none; color: var(--ink); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.pay-go span { display: inline-block; margin-left: .2rem; color: var(--muted); transition: transform .15s ease, color .15s ease; }
.pay-option:hover .pay-go span { color: var(--ink); transform: translateX(3px); }
.pay-cashapp { --brand: #00d64f; }
.pay-paypal { --brand: #003087; }
.pay-bmc { --brand: #ffdd00; }
.pay-list { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: 0 0 .9rem; color: var(--muted); font-size: .88rem; }
.pay-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem .2rem .25rem; border: 1px solid var(--tv-line); border-radius: 2px; background: var(--tv-surface-solid); color: var(--ink); font-size: .8rem; font-weight: 650; }
.method-card .switch-row { align-items: center; }
.method-card .pay-logo { width: 2.3rem; height: 2.3rem; border-radius: 3px; }
.method-card .pay-logo img { width: 1.35rem; height: 1.35rem; }
.order-card form { margin-top: 1rem; }

/* Team page ---------------------------------------------------------- */

.team-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; margin: 2.5rem 0 4rem; }
.team-card { padding: 1.5rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); box-shadow: var(--tv-shadow-sm); }
.team-card h2 { margin: .8rem 0 .15rem; padding: 0; border: 0; font-size: 1.15rem; }
.team-role { margin: 0 0 .6rem; color: var(--link); font-size: .85rem; font-weight: 600; }
.team-bio { margin: 0 0 .6rem; color: var(--text); font-size: .9rem; }
.team-empty { margin: 2.5rem 0 4rem; }
.policy-doc .kicker { margin: 0 0 .3rem; }
.policy-doc h1 { margin: 0 0 1rem; }

@media (max-width: 720px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .row-link { flex-wrap: wrap; }
  .row-chips { max-width: none; justify-content: flex-start; order: 3; width: 100%; }
  .row-side { min-width: 0; text-align: left; }
  .action-row { flex-direction: column; align-items: flex-start; }
  .activity li, .panel .activity li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .item-layout { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .order-card { padding: 1.4rem 1.1rem; }
  .order-code { font-size: 1.6rem; }
  .btn-pay { min-width: 0; width: 100%; }
  .toolbar-count { width: 100%; margin-left: 0; }
}
/* Tags, and the knowledge base's reader feedback ------------------------- */
.chip-tag { background: rgba(24, 176, 104, .1); border-color: rgba(24, 176, 104, .3); color: var(--text); text-decoration: none; }
a.chip-tag:hover { border-color: var(--link); text-decoration: none; }
.chip-tag span { margin-left: .35rem; color: var(--muted); font-weight: 500; }
.chip-tag.is-on { background: var(--tv-signal); border-color: var(--tv-signal); color: #06281a; }
.chip-tag.is-on span { color: #06281a; }
.row-tags, .article-tags, .tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; }
.row-tags { margin-top: .3rem; }
.tag-filter { margin: 0 0 .9rem; }
.article-tags { margin: 0 0 1rem; }
.kb-card .article-tags { margin: .4rem 0 .2rem; }
.article-vote { margin: 2rem 0 1rem; padding: 1rem 1.2rem; border: 1px solid var(--tv-line); border-radius: 3px; background: var(--tv-surface); }
.article-vote form { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.article-vote p { margin: 0; }

/* Rendered BBCode (articles, policies, shop pages, tickets, the editor's preview) */
.title-icon { display: inline-block; width: 1.15em; height: 1.15em; margin-right: .45rem; vertical-align: -.18em; color: var(--tv-signal, #18b068); }
.bb { overflow-wrap: anywhere; }
.bb blockquote.bb-quote { margin: .8rem 0; padding: .6rem .9rem; border-left: 3px solid var(--tv-signal, #18b068); border-radius: 0; background: rgba(24, 176, 104, .08); }
.bb .bb-quote-by { margin-bottom: .25rem; color: var(--muted); font-size: .8rem; font-weight: 600; }
.bb .bb-spoiler { margin: .7rem 0; border: 1px solid var(--tv-line, rgba(128, 128, 128, .3)); border-radius: 3px; }
.bb .bb-spoiler > summary { padding: .45rem .8rem; cursor: pointer; font-weight: 600; }
.bb .bb-spoiler-body { padding: .2rem .9rem .7rem; }
.bb pre.bb-code { margin: .8rem 0; padding: .75rem .9rem; overflow-x: auto; border-radius: 3px; background: #0a1a12; color: #d8f5e4; font-size: .86rem; line-height: 1.5; }
.bb ul.bb-list, .bb ol.bb-list { margin: .6rem 0; padding-left: 1.4rem; }
.bb .bb-align-left { text-align: left; } .bb .bb-align-center { text-align: center; } .bb .bb-align-right { text-align: right; }
.bb .bb-img { display: block; max-width: 100%; height: auto; margin: .7rem 0; border-radius: 3px; }
.bb .bb-c-red { color: #d6453d; } .bb .bb-c-orange { color: #e07b1a; } .bb .bb-c-yellow { color: #c79a00; } .bb .bb-c-green { color: #1f9d55; }
.bb .bb-c-teal { color: #0f9a8e; } .bb .bb-c-blue { color: #2f7fe0; } .bb .bb-c-purple { color: #8a54d6; } .bb .bb-c-pink { color: #d6468f; } .bb .bb-c-gray { color: #7b8a83; }
.bb .bb-s-1 { font-size: .7em; } .bb .bb-s-2 { font-size: .85em; } .bb .bb-s-3 { font-size: 1em; } .bb .bb-s-4 { font-size: 1.2em; }
.bb .bb-s-5 { font-size: 1.45em; } .bb .bb-s-6 { font-size: 1.8em; } .bb .bb-s-7 { font-size: 2.3em; }
.msg-body { overflow-wrap: anywhere; }
.msg-body > :first-child { margin-top: 0; }

/* App pages, brought onto the foundation -------------------------------- */
/* The help desk, account, dashboard and shop keep their components (above). These
   rules give their headings, labels and panels the same type, rules and colours as
   the public pages, and take out the glow and gradients they were drawn with. */

/* The public pages run full width; their own .tv-wrap sets the measure. This has to match the
   specificity of the app rule above it. */
main#main.doc-main, main#main.home { width: 100%; max-width: none; margin: 0; padding: 0; }
main#main:not(.account):not(.home):not(.doc-main) { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; padding: clamp(1.6rem, 1rem + 1.5vw, 2.6rem) 0 0; }
main#main > h1, .article h1, .account h1, .ticket-head h1, .policy-doc h1 { color: var(--ink); font-family: var(--font-display); font-stretch: 87.5%; font-weight: 600; letter-spacing: 0; line-height: 1.02; }
main#main > h2, .card h2, .panel h2, .team-card h2, .section-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; }
main#main > h2 { border-top-color: var(--rule-strong); }

.hero {
  overflow: visible;
  margin: 0 0 2rem;
  padding: 0 0 1.6rem;
  border: 0;
  border-bottom: 2px solid var(--rule-strong);
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--text);
}
.hero::before, .hero::after { content: none; display: none; }
.hero h1 { margin: 0 0 .7rem; color: var(--ink); font-family: var(--font-display); font-stretch: 87.5%; font-size: clamp(2.2rem, 1.5rem + 2.6vw, 3.6rem); font-weight: 600; letter-spacing: 0; line-height: 1; }
.hero .sub { color: var(--text); font-size: 1.06rem; }
.hero .sub strong { color: var(--ink); }
.hero .support-actions .btn { background: var(--tv-green); border-color: var(--tv-black); color: var(--tv-black); }
.hero .support-actions .btn:hover { background: var(--tv-green-hi); }
/* the second action beside the main one is outlined, as everywhere else */
.hero .support-actions .btn-dark, .hero .btn-ghost { border-color: var(--rule-strong); background: transparent; color: var(--ink); }
.hero .support-actions .btn-dark:hover, .hero .btn-ghost:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.account-nav, .admin-nav { padding: 0; border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: none; gap: 0; width: 100%; }
.account-nav a, .admin-nav a { padding: .55rem .9rem; border-radius: 0; color: var(--muted); font-family: var(--font-display); font-size: .95rem; font-weight: 500; }
.account-nav a:hover, .admin-nav a:hover { background: none; color: var(--ink); box-shadow: inset 0 -2px var(--rule-strong); }
.account-nav a[aria-current="page"], .admin-nav a[aria-current="page"] { background: none; color: var(--ink); box-shadow: inset 0 -3px var(--tv-green); }

.sub-nav a, .filter-pills a { font-family: var(--font-display); font-size: .9rem; font-weight: 500; }
.sub-nav a[aria-current="page"], .filter-pills a[aria-current="page"] { border-color: var(--rule-strong); background: var(--ink); color: var(--bg); }
.sub-nav a[aria-current="page"] span, .filter-pills a[aria-current="page"] span { color: var(--bg); }

.dash-title, .switch-group legend, .share-table th { font-family: var(--font-display); font-size: .86rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.dash-big { font-family: var(--font-display); font-stretch: 87.5%; font-weight: 600; letter-spacing: 0; }
.row-code { background: var(--tv-black); color: var(--tv-green-hi); border-radius: 2px; }
.avatar { background: var(--tv-green); color: var(--tv-black); }
.shop-card-art { background: var(--bg-2); }
.shop-card-price, .item-price { font-family: var(--font-display); font-stretch: 87.5%; }
.how-it-works { border-radius: 0; background: var(--tv-black); }
.pay-option:hover { transform: none; box-shadow: none; }
.kb-card:hover, .row-link:hover, .shop-card:hover { transform: none; box-shadow: none; }
.switch { border-radius: 999px; }
.switch::after { box-shadow: none; }
.field input:focus, .field select:focus, .field textarea:focus, .account input:focus, .staff-form select:focus, .toolbar input:focus, .toolbar select:focus { border-color: var(--tv-green); box-shadow: 0 0 0 2px rgba(24, 176, 104, .25); outline: none; }
.note { border-radius: 0; border-width: 0 0 0 3px; border-color: var(--tv-green); background: var(--bg-2); }
.bb pre.bb-code { background: var(--code-bg); border-left: 3px solid var(--tv-green); border-radius: 0; }
.team-card { border-radius: 0; border-width: 2px 0 0; border-color: var(--rule-strong); background: none; padding: 1rem 0 0; }
.team-role { color: var(--muted); font-family: var(--font-display); font-weight: 500; }
.title-icon { color: var(--tv-green); }
/* In the app templates class="wrap" on a table cell means "let this break": long paths and
   addresses must not widen the page on a phone. (The page container is .tv-wrap.) */
td.wrap, th.wrap { overflow-wrap: anywhere; }

@media (max-width: 980px) {
  .kb-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { flex-direction: column; align-items: flex-start; gap: 1.2rem; }
  .hero .support-actions { width: 100%; }
  .account { margin-top: 1.5rem; }
}
@media (max-width: 720px) {
  .kb-grid { grid-template-columns: 1fr; }
  .account-nav, .admin-nav { overflow-x: auto; flex-wrap: nowrap; }
  .account-nav a, .admin-nav a { white-space: nowrap; }
  .account { padding: 1.6rem 1.3rem; margin: 1rem auto 3rem; }
  .ticket-head { padding: 1.1rem 1.15rem; }
  .form-card { padding: 1.1rem; }
}
