/* ============================================================================
   ENGINE BUILD SANDBOX — machine-shop spec-sheet look
   Cool paper gray, ink, tach-red (hp) and steel-blue (torque).
   Type: Barlow Condensed for display (California-signage/racing heritage),
   Barlow for body and data. Tabular numerals on everything numeric.
   ============================================================================ */
:root {
  /* MOC-10: dark repaint (MOC-4, approved). Same variable names as the old
     paper theme so every page re-inks at once; values match css/tokens.css. */
  --paper: #131313;
  --sheet: #1B1B1B;
  --ink: #EDEBE6;
  --muted: #A8A49C;
  --rule: #2C2C2C;
  --rule-dark: #77736C;
  --red: #FF5A4A;
  --red-deep: #E5493A;
  --red-ink: #131313;
  --blue: #6FA8F0;
  --amber-bg: #2A2418;
  --amber-ink: #EFE3C8;
  --focus: #EDEBE6;
  --raised: #232323;
  --radius: 4px;
  /* MOC-59: the rest of css/tokens.css, so subpages (which don't load it) share
     the build sheet's tokens. Same values — on the builder the two agree. */
  --bg: #131313; --surface: #1B1B1B; --line: #2C2C2C; --line-2: #3A3A3A;
  --control: #77736C; --text: #EDEBE6; --stock: #8C8984; --grid: #262626;
  --cream: #EFE3C8; --cream-dim: rgba(239, 227, 200, 0.10);
  --r-ctl: 3px; --r-panel: 12px; --r-pill: 999px;
  --f-body: Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
/* Author display rules (e.g. .opt { display: flex }) otherwise beat the browser's [hidden] rule. */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.5 Barlow, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-variant-numeric: tabular-nums;
}
main { max-width: 980px; margin: 0 auto; padding: 0 20px 56px; }

h1, h2, h3, .stat-v, .step-num {
  font-family: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ------------------------------- masthead -------------------------------- */
.masthead {
  max-width: 980px; margin: 0 auto; padding: 44px 20px 10px;
  border-bottom: 3px solid var(--ink);
}
.masthead h1 {
  margin: 0; font-size: clamp(42px, 7vw, 68px); font-weight: 700;
  line-height: 0.95; letter-spacing: 0.01em; text-transform: uppercase;
}
.masthead-sub { margin: 10px 0 18px; color: var(--muted); font-size: 17px; max-width: 54ch; }

/* --------------------------------- steps --------------------------------- */
.step { padding-top: 34px; }
.step-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; }
.step-head-3 { margin-top: 34px; }
.step-num {
  font-size: 30px; font-weight: 700; color: var(--sheet);
  background: var(--ink); min-width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius);
}
.step-head h2 { margin: 0; font-size: 30px; font-weight: 600; letter-spacing: 0.01em; }

/* ------------------------------ engine picker ----------------------------- */
.picker-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
#engine-search {
  flex: 1 1 260px; padding: 10px 12px; font: inherit;
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet);
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font: 500 14px Barlow, sans-serif; padding: 7px 12px; cursor: pointer;
  border: 1.5px solid var(--rule-dark); background: var(--sheet); color: var(--ink);
  border-radius: 999px;
}
.chip.active { background: var(--ink); color: var(--sheet); border-color: var(--ink); }

.engine-list {
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius);
  background: var(--sheet); max-height: 420px; overflow-y: auto;
}
.engine-row {
  display: grid; grid-template-columns: 1.5fr 1fr 0.9fr; gap: 8px; align-items: baseline;
  width: 100%; text-align: left; cursor: pointer;
  padding: 11px 14px; border: 0; border-bottom: 1px solid var(--rule);
  background: transparent; font: inherit; color: inherit;
}
.engine-row:last-child { border-bottom: 0; }
.engine-row:hover { background: var(--raised); }
.engine-row.selected { background: var(--ink); color: var(--sheet); }
.engine-row.selected .er-config, .engine-row.selected .er-stock, .engine-row.selected .er-years { color: #4A4740; }
.er-name strong { font-weight: 600; }
.er-years { display: block; font-size: 13px; color: var(--muted); }
.er-config, .er-stock { font-size: 14px; color: var(--muted); }
.er-stock { text-align: right; }
.empty-note { padding: 16px; color: var(--muted); }

/* -------------------------------- spec card ------------------------------- */
.spec-card {
  margin-top: 14px; background: var(--sheet); border: 1.5px solid var(--ink);
  border-radius: var(--radius); padding: 18px 20px;
}
.spec-head h3 { margin: 0; font-size: 26px; font-weight: 600; }
.spec-found { margin: 2px 0 14px; color: var(--muted); font-size: 15px; }
.spec-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 10px 22px; margin: 0;
}
.spec-grid dt { font-size: 13px; color: var(--muted); }
.spec-grid dd { margin: 0; font-weight: 500; }

/* ---------------------------------- goal ---------------------------------- */
.goal-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.goal-type { border: 0; padding: 0; margin: 0; }
.goal-type legend { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.goal-type label { margin-right: 14px; font-weight: 500; }
.goal-input { display: flex; align-items: baseline; gap: 10px; }
#goal-num {
  width: 130px; padding: 8px 10px; font: 600 28px "Barlow Condensed", sans-serif;
  border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--sheet);
  font-variant-numeric: tabular-nums;
}
#goal-unit { color: var(--muted); }
#goal-range { width: 100%; margin: 14px 0 4px; accent-color: var(--red); }
.bounds-note { margin: 0; color: var(--muted); font-size: 14px; }

/* --------------------------------- options -------------------------------- */
.seg { display: inline-flex; border: 1.5px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg-btn {
  font: 500 15px Barlow, sans-serif; padding: 9px 16px; cursor: pointer;
  background: var(--sheet); color: var(--ink); border: 0;
}
.seg-btn + .seg-btn { border-left: 1.5px solid var(--ink); }
.seg-btn.active { background: var(--red); color: var(--red-ink); }
.seg-btn:disabled { color: var(--rule-dark); cursor: not-allowed; }
.asp-note, .asp-fixed { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.asp-fixed { font-weight: 500; color: var(--ink); }

.options-row { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; }
.opt { display: flex; flex-direction: column; gap: 5px; font-size: 14px; color: var(--muted); }
.opt select, .opt input {
  font: 15px Barlow, sans-serif; color: var(--ink);
  padding: 8px 10px; border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet);
  min-width: 200px;
}
.opt input { min-width: 130px; }

.conditions { margin-top: 16px; }
.conditions summary { cursor: pointer; color: var(--muted); font-size: 15px; }
.conditions[open] summary { color: var(--ink); }

#generate-btn {
  margin-top: 26px; width: 100%;
  font: 600 22px "Barlow Condensed", sans-serif; letter-spacing: 0.02em; text-transform: uppercase;
  padding: 15px; cursor: pointer;
  background: var(--red); color: var(--red-ink); border: 0; border-radius: var(--radius);
}
#generate-btn:hover:not(:disabled) { background: var(--red-deep); }
#generate-btn:disabled { background: var(--rule-dark); cursor: not-allowed; }

/* --------------------------------- results -------------------------------- */
.results { padding-top: 40px; }
.sheet {
  background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 26px 26px 18px;
}
.sheet-head h2 { margin: 0; font-size: 32px; font-weight: 700; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); }

.stat-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0;
  border-top: 2px solid var(--ink); border-bottom: 1px solid var(--rule);
  margin: 18px 0 0;
}
.stat { padding: 14px 16px 12px; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: 0; }
.stat-v { display: block; font-size: 46px; font-weight: 700; line-height: 1; }
.stat-hp .stat-v { color: var(--red); }
.stat-tq .stat-v { color: var(--blue); }
.stat-u { color: var(--muted); font-size: 14px; }

.callout {
  margin: 18px 0 0; padding: 13px 16px;
  background: var(--amber-bg); color: var(--amber-ink);
  border-left: 4px solid var(--amber-ink); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 15px;
}

/* ---------------------------------- chart --------------------------------- */
.dyno { margin: 22px 0 0; }
.dyno-caption {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 14px; color: var(--muted); margin-bottom: 8px;
}
.legend { display: flex; flex-wrap: wrap; gap: 14px; }
.lg { display: inline-flex; align-items: center; gap: 6px; }
.lg-line { width: 22px; height: 0; border-top: 2.5px solid; display: inline-block; }
.lg-hp { border-color: var(--red); }
.lg-tq { border-color: var(--blue); }
.lg-dash { border-top-style: dashed; opacity: 0.5; }
.dyno-wrap { position: relative; }
#dyno-canvas { width: 100%; height: 380px; display: block; border: 1px solid var(--rule); border-radius: var(--radius); }
.tooltip {
  position: absolute; display: none; pointer-events: none;
  background: var(--raised); color: var(--ink); border: 1px solid #3A3A3A;
  padding: 8px 11px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.45;
  min-width: 128px;
}
.tt-rpm { font-weight: 600; margin-bottom: 2px; }
.tt-row { display: flex; align-items: center; gap: 6px; }
.tt-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.tt-stock { color: #AEB3AC; margin-top: 2px; }

/* -------------------------------- warnings -------------------------------- */
.warnings { margin-top: 22px; background: var(--amber-bg); border-radius: var(--radius); padding: 14px 18px; }
.warnings h3 { margin: 0 0 6px; font-size: 20px; color: var(--amber-ink); }
.warnings ul { margin: 0; padding-left: 20px; color: var(--amber-ink); }
.warnings li { margin: 4px 0; font-size: 15px; }

/* --------------------------------- parts ---------------------------------- */
.parts-title { font-size: 26px; margin: 28px 0 4px; border-bottom: 2px solid var(--ink); padding-bottom: 6px; }
.part-group { padding: 14px 0 4px; border-bottom: 1px solid var(--rule); }
.part-group:last-child { border-bottom: 0; }
.part-group h4 {
  margin: 0 0 8px; font: 600 15px Barlow, sans-serif; color: var(--muted);
}
.part { margin: 0 0 12px; padding-left: 14px; border-left: 3px solid var(--rule-dark); }
.part-name { margin: 0; font-weight: 600; }
.part-why { margin: 2px 0 0; color: var(--muted); font-size: 14.5px; max-width: 78ch; }

/* ---------------------------------- math ---------------------------------- */
.math { margin-top: 26px; border-top: 2px solid var(--ink); padding-top: 12px; }
.math summary { cursor: pointer; font: 600 18px "Barlow Condensed", sans-serif; font-size: 20px; }
.math-row {
  display: grid; grid-template-columns: 200px 1fr 1fr; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--rule); font-size: 14.5px;
}
.math-label { font-weight: 600; }
.math-formula { color: var(--muted); }
.math-foot { color: var(--muted); font-size: 14px; max-width: 90ch; }

.sheet-foot { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 12px; }
.sheet-foot p { color: var(--muted); font-size: 13.5px; margin: 0; max-width: 100ch; }

.page-foot { max-width: 980px; margin: 0 auto; padding: 18px 20px 40px; color: var(--muted); font-size: 13.5px; }
.page-foot code { background: var(--sheet); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--rule); }

/* ----------------------------- v2: modes & custom -------------------------- */
.mode-tabs { margin-left: auto; }
.step-head .mode-tabs { align-self: center; }

.custom-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px 18px; margin-top: 14px;
}
.custom-grid .opt select { min-width: 0; width: 100%; }
.opt-check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); font-size: 15px; }
.opt-check input { accent-color: var(--red); width: 16px; height: 16px; }
.custom-note { color: var(--muted); font-size: 14px; margin: 10px 0 0; }
#c-asp-wrap { margin-top: 16px; }
#c-boost-wrap { margin-top: 4px; }
.boost-opt strong { font-family: "Barlow Condensed", sans-serif; font-size: 22px; color: var(--red); }
.boost-opt input[type=range] { width: 100%; accent-color: var(--red); margin-top: 8px; }
.cap-chip {
  font-size: 12.5px; color: var(--amber-ink); background: var(--amber-bg);
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; white-space: nowrap;
}

/* ------------------------------ compare strip ------------------------------ */
.compare-strip {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 8px 14px; margin-bottom: 10px;
}
.compare-left { display: flex; flex-wrap: wrap; gap: 6px; }
.compare-right { display: flex; align-items: center; gap: 10px; }
.run-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13.5px; padding: 5px 10px; border: 1px solid var(--rule-dark);
  border-radius: 999px; background: var(--sheet);
}
.run-chip.current { border-style: dashed; color: var(--muted); }
.run-chip .lg-line { width: 16px; }
.chip-x {
  border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1;
  color: var(--muted); padding: 0 2px;
}
.chip-x:hover { color: var(--red); }
.pin-btn {
  font: 600 14px Barlow, sans-serif; padding: 7px 13px; cursor: pointer;
  background: var(--ink); color: var(--sheet); border: 0; border-radius: var(--radius);
}
.pin-btn:disabled { background: var(--rule-dark); cursor: not-allowed; }
.pin-btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--rule-dark); }
.tq-toggle { font-size: 13.5px; color: var(--muted); }
.tt-label { color: #C9CDC6; margin-right: 4px; }

/* -------------------------------- responsive ------------------------------ */
@media (max-width: 640px) {
  .engine-row { grid-template-columns: 1fr; gap: 2px; }
  .er-stock { text-align: left; }
  .math-row { grid-template-columns: 1fr; gap: 2px; }
  .sheet { padding: 18px 16px; }
  .stat-v { font-size: 36px; }
}

/* ------------------------------ v3 additions ------------------------------ */
.spec-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: flex-start; }
.variant-opt select { min-width: 240px; }
.seg-small .seg-btn { padding: 5px 10px; font-size: 13px; }
.part-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.part-meta { display: inline-flex; gap: 10px; align-items: baseline; white-space: nowrap; }
.part-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.find-link { font-size: 13px; color: var(--blue); text-decoration: none; border-bottom: 1px solid transparent; }
.find-link:hover { border-bottom-color: var(--blue); }
.total-row {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
  border-top: 2px solid var(--ink); margin-top: 10px; padding-top: 10px;
}
.total-row strong { font-family: "Barlow Condensed", sans-serif; font-size: 30px; }
.total-note { color: var(--muted); font-size: 12.5px; }
.est-note {
  flex-basis: 100%; margin: 6px 0 0; padding: 8px 12px; font-size: 14px;
  background: var(--amber-bg); color: var(--amber-ink);
  border-left: 4px solid var(--amber-ink); border-radius: 0 var(--radius) var(--radius) 0;
}
.total-row .est-note strong { font: inherit; font-weight: 700; }
.est-note a { color: inherit; font-weight: 600; }
.opt-hint { color: var(--muted); font-weight: 400; font-size: 12px; }
.tt-cur .tt-label { font-weight: 600; color: #fff; }
.tt-vals { margin-left: auto; padding-left: 10px; font-variant-numeric: tabular-nums; }
.tt-row { display: flex; align-items: center; gap: 6px; min-width: 230px; }
@media (max-width: 640px) { .part-line { flex-direction: column; gap: 2px; } .tt-row { min-width: 0; } }

/* ============================================================================
   v5 — SITE CHROME & SUBPAGES
   Shared navigation, sign-in, mock ad rails, wiki / forum / contribute /
   admin components. Same spec-sheet language: paper ground, ink rules,
   tach-red accents, condensed display type.
   ============================================================================ */

/* ------------------------------- site bar -------------------------------- */
.site-bar {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper); color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
/* MOC-75: the bar is sticky, so keep focused controls and #anchors from scrolling up underneath it (WCAG 2.4.11) */
html { scroll-padding-top: 64px; }
/* MOC-75: site.js injects the bar after the page's scripts load; hold its height until then so the
   whole page doesn't drop ~50px after first paint (the largest layout shift on every page). */
@supports selector(:has(*)) {
  body:not(:has(> .site-bar))::before { content: ""; display: block; height: 55px; }
  @media (max-width: 760px) { body:not(:has(> .site-bar))::before { height: 49px; } }
}
.site-bar-in {
  max-width: 1020px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 22px; min-height: 54px;
}
.wordmark {
  font: 700 21px/1 "Barlow Condensed", sans-serif; letter-spacing: 0.04em;
  text-transform: uppercase; color: #fff; text-decoration: none; white-space: nowrap;
}
.wordmark span { color: var(--red); padding: 0 1px; }
.site-nav { display: flex; gap: 2px; margin-left: 4px; flex: 1; min-width: 0; }
.site-nav a {
  font: 500 15px Barlow, sans-serif; color: #C9CDC6; text-decoration: none;
  padding: 17px 11px 14px; border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.site-nav a:hover { color: #fff; }
.site-nav a.active { color: #fff; border-bottom-color: var(--red); }
.auth-slot { display: flex; align-items: center; gap: 10px; }
.auth-handle { font-weight: 600; color: #fff; font-size: 14.5px; }
/* Sign in is an outline: red is the horsepower colour (MOC-26/34) */
.auth-btn {
  font: 600 14px Barlow, sans-serif; padding: 7px 14px; cursor: pointer;
  background: transparent; color: #EDEBE6; border: 1px solid var(--control, #77736C); border-radius: var(--radius);
}
.auth-btn:hover { border-color: #EDEBE6; }
.nav-more {
  display: none; font: 600 14px Barlow, sans-serif; padding: 7px 12px; cursor: pointer; min-height: 36px;
  background: transparent; color: #EDEBE6; border: 1px solid var(--control, #77736C); border-radius: var(--radius);
}
.nav-more:hover, .nav-more[aria-expanded="true"] { color: #fff; border-color: #EDEBE6; }
.auth-btn.ghost { background: transparent; color: #C9CDC6; border: 1px solid var(--control, #77736C); }
.auth-btn.ghost:hover { color: #fff; border-color: #C9CDC6; }

/* sign-in dialog */
#signin-pop {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: flex-start; justify-content: center; padding: 12vh 16px 0;
}
.signin-card {
  background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius);
  padding: 20px 22px; max-width: 420px; width: 100%;
}
.signin-card h3 { margin: 0 0 4px; font-size: 24px; }
.signin-card p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
#signin-form { display: flex; gap: 8px; flex-wrap: wrap; }
#signin-handle {
  flex: 1 1 160px; padding: 9px 11px; font: inherit;
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius);
}
.signin-err { color: var(--red-deep); font-size: 14px; margin: 10px 0 0; }

/* ------------------------------ mock ad rails ----------------------------- */
.ad-rail { display: none; position: fixed; top: 86px; z-index: 5; }
.ad-left { left: calc(50vw - 510px - 190px); }
.ad-right { right: calc(50vw - 510px - 190px); }
@media (min-width: 1460px) { .ad-rail { display: block; } }
.ad-box {
  width: 160px; border: 1.5px dashed var(--rule-dark); border-radius: var(--radius);
  background: var(--sheet);
}
.ad-tag {
  display: block; text-align: center; font-size: 10.5px; letter-spacing: 0.08em;
  color: var(--muted); padding: 5px 0 4px; border-bottom: 1px dashed var(--rule);
}
.ad-body {
  height: 560px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 8px; color: var(--rule-dark); text-align: center;
}
.ad-dim { font: 600 18px "Barlow Condensed", sans-serif; color: var(--rule-dark); }
.ad-note { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ------------------------------- site footer ------------------------------ */
.site-foot { border-top: 2px solid var(--ink); margin-top: 56px; background: var(--sheet); }
.site-foot-in { max-width: 1020px; margin: 0 auto; padding: 20px 20px 30px; }
.site-foot p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; max-width: 100ch; }
.site-foot-links a { color: var(--ink); text-decoration: none; font-weight: 500; margin-right: 16px; }
.site-foot-links a:hover { color: var(--red); }
.demo-note { font-size: 12.5px; }

/* ------------------------------- legal pages ------------------------------ */
.legal section { margin: 0 0 24px; max-width: 78ch; }
.legal h2 { font-size: 24px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--ink); }
.legal p, .legal li { font-size: 16px; }
.legal li { margin-bottom: 6px; }
.legal .page-note { font-size: 16px; margin: 0 0 26px; max-width: 78ch; }
.legal-updated { color: var(--muted); font-size: 13.5px; margin-top: 30px; }

/* ----------------------------- subpage scaffold --------------------------- */
.subpage main { max-width: 1020px; margin: 0 auto; padding: 30px 20px 56px; }
.page-head { margin: 6px 0 26px; }
.page-head h1 {
  margin: 0; font-size: clamp(34px, 5vw, 50px); font-weight: 700;
  line-height: 1; letter-spacing: 0.01em; text-transform: uppercase;
}
.page-sub { margin: 10px 0 0; color: var(--muted); font-size: 16px; max-width: 78ch; }
.page-note { margin: 8px 0 0; color: var(--amber-ink); background: var(--amber-bg); padding: 8px 12px; border-radius: var(--radius); font-size: 14px; max-width: 70ch; }
.crumbs { font-size: 14px; color: var(--muted); margin: 2px 0 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumb-sep { margin: 0 7px; color: var(--rule-dark); }
.crumb-here { color: var(--ink); font-weight: 500; }

.btn {
  display: inline-block; font: 600 15px Barlow, sans-serif; cursor: pointer;
  padding: 9px 16px; background: var(--red); color: var(--red-ink); border: 0;
  border-radius: var(--radius); text-decoration: none; text-align: center;
}
.btn:hover { background: var(--red-deep); }
.btn.ghost { background: var(--sheet); color: var(--ink); border: 1.5px solid var(--rule-dark); }
.btn.ghost:hover { border-color: var(--ink); background: var(--sheet); }
.btn.ghost.danger:hover { border-color: var(--red-deep); color: var(--red-deep); }

/* --------------------------------- wiki ----------------------------------- */
.wiki-make { margin: 0 0 30px; }
.wiki-make h2, .board-group h2 {
  font-size: 24px; margin: 0 0 10px; padding-bottom: 6px; border-bottom: 2px solid var(--ink);
}
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 12px; }
.model-card {
  display: flex; flex-direction: column; gap: 3px; text-decoration: none; color: inherit;
  background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius);
  padding: 13px 15px;
}
.model-card:hover { border-color: var(--ink); }
.model-name { font: 600 19px "Barlow Condensed", sans-serif; }
.model-kind { color: var(--muted); font-size: 13.5px; }
.model-gens { color: var(--muted); font-size: 12.5px; margin-top: 5px; }

.gen-block { margin: 0 0 26px; }
.gen-block h2 { font-size: 23px; margin: 0 0 8px; }
.engine-page-list { border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet); }
.engine-page-row {
  display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 10px; align-items: baseline;
  padding: 12px 15px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule);
}
.engine-page-row:last-child { border-bottom: 0; }
.engine-page-row:hover { background: var(--raised); }
.epr-name { font-weight: 600; }
.epr-spec { color: var(--muted); font-size: 14px; }
.epr-go { color: var(--blue); font-size: 14px; font-weight: 500; }
.chip-swap, .chip-sample, .chip-op {
  font: 600 11px Barlow, sans-serif; letter-spacing: 0.03em;
  padding: 2px 7px; border-radius: 999px; vertical-align: 2px;
  background: var(--amber-bg); color: var(--amber-ink);
}
.chip-op { background: var(--paper); color: var(--muted); border: 1px solid var(--rule); }
.wiki-forum-link { margin: 4px 0 0; }
.wiki-forum-link a { color: var(--blue); }

.wiki-page-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px 24px; align-items: flex-start; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 8px; }

.wiki-two { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 8px; }
@media (max-width: 820px) { .wiki-two { grid-template-columns: 1fr; } }
.wiki-spec h2, .wiki-sec h2 { font-size: 23px; margin: 22px 0 10px; padding-bottom: 5px; border-bottom: 2px solid var(--ink); }
.wiki-spec h2 { margin-top: 0; }
.spec-table { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius); font-size: 14.5px; }
.spec-table th { text-align: left; font-weight: 500; color: var(--muted); width: 38%; padding: 8px 12px; vertical-align: top; }
.spec-table td { padding: 8px 12px 8px 0; font-weight: 500; }
.spec-table tr + tr th, .spec-table tr + tr td { border-top: 1px solid var(--rule); }

.wiki-curve figcaption { font-size: 13px; color: var(--muted); margin: 42px 0 8px; }
.wiki-curve .lg-hp-t { color: var(--red); font-weight: 600; }
.wiki-curve .lg-tq-t { color: var(--blue); font-weight: 600; }
#stock-curve { width: 100%; height: 300px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); }
@media (max-width: 820px) { .wiki-curve figcaption { margin-top: 10px; } }

.gen-table, .shelf-table { width: 100%; border-collapse: collapse; background: var(--sheet); border: 1.5px solid var(--rule-dark); font-size: 14.5px; }
.gen-table th, .shelf-table th { text-align: left; font: 600 13px Barlow, sans-serif; color: var(--muted); padding: 8px 12px; border-bottom: 1.5px solid var(--rule-dark); }
.gen-table td, .shelf-table td { padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.gen-table tr:last-child td, .shelf-table tr:last-child td { border-bottom: 0; }
.gen-this td { background: var(--raised); font-weight: 600; }

.issue-list { margin: 0; padding-left: 20px; }
.issue-list li { margin: 7px 0; max-width: 90ch; }
.issue-lead { font-weight: 600; color: var(--amber-ink); }

.prob-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.prob { background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius); padding: 13px 15px; }
.prob h3 { margin: 0 0 7px; font-size: 19px; }
.prob-s, .prob-f { margin: 0 0 6px; font-size: 14px; line-height: 1.5; }
.prob-s span, .prob-f span {
  display: inline-block; font: 600 11.5px Barlow, sans-serif; letter-spacing: 0.04em;
  color: var(--muted); width: 66px;
}
.prob-f span { color: var(--red-deep); }
.upgrade-note { max-width: 88ch; margin: 0 0 12px; }
.shelf-foot { color: var(--muted); font-size: 14px; }
.contrib-callout {
  margin-top: 30px; background: var(--sheet); border: 2px solid var(--ink);
  border-left: 6px solid var(--red); border-radius: var(--radius); padding: 16px 20px;
}
.contrib-callout h2 { margin: 0 0 6px; font-size: 22px; }
.contrib-callout p { margin: 0; color: var(--muted); max-width: 90ch; }

/* --------------------------------- forum ---------------------------------- */
.board-group { margin: 0 0 26px; }
.board-list { border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet); }
.board-row {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 10px;
  align-items: baseline; padding: 12px 15px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--rule);
}
.board-row:last-child { border-bottom: 0; }
.board-row:hover { background: var(--raised); }
.board-name { font-weight: 600; }
.board-blurb { color: var(--muted); font-size: 13.5px; }
.board-count { color: var(--muted); font-size: 13.5px; white-space: nowrap; }
.board-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.empty-board { color: var(--muted); background: var(--sheet); border: 1.5px dashed var(--rule-dark); border-radius: var(--radius); padding: 18px; }

.thread-list { border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet); }
.thread-row { display: block; padding: 12px 15px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--rule); }
.thread-row:last-child { border-bottom: 0; }
.thread-row:hover { background: var(--raised); }
.thread-title { display: block; font-weight: 600; }
.thread-meta { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.thread-h1 { text-transform: none !important; font-size: clamp(26px, 4vw, 38px) !important; }

.post-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.post { background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius); padding: 13px 16px; }
.post-op { border-color: var(--ink); }
.post-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.post-author { font-weight: 600; }
.post-ts { color: var(--muted); font-size: 13px; margin-left: auto; }
.post-body { margin: 0 0 6px; max-width: 92ch; line-height: 1.55; }
.post-body:last-child { margin-bottom: 0; }

.post-form { background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 18px; }
.post-form input, .post-form textarea {
  width: 100%; font: inherit; padding: 9px 11px; margin: 0 0 10px;
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: #FDFDFC;
}
.post-form textarea { resize: vertical; }
.form-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-note { color: var(--muted); font-size: 14px; }

/* ----------------------------- contribute/admin --------------------------- */
.how-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; margin: 0 0 24px; }
.how-step {
  background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius);
  padding: 11px 14px; display: flex; flex-direction: column; gap: 2px;
}
.how-step strong { font: 600 18px "Barlow Condensed", sans-serif; }
.how-step span { color: var(--muted); font-size: 13.5px; }

.req-form { background: var(--sheet); border: 2px solid var(--ink); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 28px; }
.req-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px 18px; margin-bottom: 14px; }
.req-grid .opt select, .req-grid .opt input, .req-grid .opt textarea { min-width: 0; width: 100%; font: inherit; }
.req-grid .opt textarea { padding: 8px 10px; border: 1.5px solid var(--rule-dark); border-radius: var(--radius); resize: vertical; }
.rq-wide { grid-column: 1 / -1; }

.req-mine, .req-recent { margin-bottom: 26px; }
.req-mine h2, .req-recent h2 { font-size: 23px; margin: 0 0 10px; padding-bottom: 5px; border-bottom: 2px solid var(--ink); }
.req-card { background: var(--sheet); border: 1.5px solid var(--rule-dark); border-radius: var(--radius); padding: 13px 16px; margin-bottom: 10px; }
.req-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.req-title { font-weight: 600; }
.req-meta { color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.req-details { margin: 6px 0; font-size: 14.5px; max-width: 95ch; }
.req-source { font-size: 13.5px; margin: 4px 0; word-break: break-all; }
.req-source a { color: var(--blue); }
.req-note { margin: 8px 0 0; font-size: 14px; background: var(--paper); border-left: 3px solid var(--rule-dark); padding: 7px 10px; }
.status-chip { font: 600 12px Barlow, sans-serif; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-pending { background: var(--amber-bg); color: var(--amber-ink); }
.st-approved { background: #1E2A18; color: #A9D18E; }
.st-rejected { background: #F4E0DD; color: var(--red-deep); }
.st-info { background: #182230; color: #9CC3F2; }

.admin-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-actions { border-top: 1px solid var(--rule); margin-top: 10px; padding-top: 10px; }
.admin-note { width: 100%; font: inherit; padding: 8px 10px; margin-bottom: 10px; border: 1.5px solid var(--rule-dark); border-radius: var(--radius); }

/* ------------------------------ chrome tweaks ----------------------------- */
.masthead { border-bottom-width: 2px; padding-top: 30px; }
@media (max-width: 760px) {
  .site-bar-in { position: relative; gap: 10px; padding: 0 16px; min-height: 48px; }
  .wordmark { font-size: 18px; }
  .nav-more { display: block; margin-left: auto; }
  .auth-btn.ghost { display: none; }
  .auth-btn { white-space: nowrap; }
  /* the nav folds behind Menu (js/site.js) rather than scrolling off the edge */
  .site-nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    flex-direction: column; gap: 0; padding: 4px 16px 10px;
    background: var(--paper); border-bottom: 1px solid var(--rule); box-shadow: 0 14px 30px rgba(0, 0, 0, .45);
  }
  .nav-open .site-nav { display: flex; }
  .site-nav a { padding: 12px 4px; margin: 0; font-size: 16px; border-bottom: 1px solid var(--rule); }
  .site-nav a:last-child { border-bottom: 0; }
  .site-nav a.active { border-bottom-color: var(--rule); box-shadow: inset 3px 0 0 var(--red); padding-left: 12px; }
  .engine-page-row, .board-row { grid-template-columns: 1fr; gap: 2px; }
  .page-actions .btn { font-size: 14px; padding: 8px 12px; }
}

/* ---------------- v11: builder step/organization polish ---------------- */
/* Step 2 — generation chips */
.gen-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.gen-chip {
  font: 600 15px "Barlow Condensed", sans-serif; letter-spacing: 0.02em;
  padding: 9px 14px; cursor: pointer;
  border: 1.5px solid var(--rule-dark); background: var(--sheet); color: var(--ink);
  border-radius: var(--radius);
}
.gen-chip:hover { border-color: var(--ink); }
.gen-chip.active { background: var(--ink); color: var(--sheet); border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--red); }
.gen-note { color: var(--muted); font-size: 13px; }
.spec-gen { font-size: 0.72em; font-weight: 500; color: var(--muted); }

/* Step 3 — grouped option sections (goal + custom) */
.opt-group {
  border: 1.5px solid var(--rule); border-radius: var(--radius);
  padding: 14px 16px 16px; margin: 0 0 14px; background: var(--sheet);
}
.opt-group > legend {
  font: 600 14px "Barlow Condensed", sans-serif; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); padding: 0 6px;
}
.opt-group .options-row, .opt-group .custom-grid { margin-top: 8px; }
.opt-group .goal-row { margin-top: 4px; }
.custom-sections { display: flex; flex-direction: column; }
.opt-group .opt-check { align-self: end; padding-bottom: 8px; }
#c-boost-wrap { margin-top: 2px; }
#c-asp-wrap { margin: 2px 0 14px; }

/* ---------------- v12: live-site chrome ---------------- */
/* MOC-59: footer on the dark tokens — hairline, not a 2px white rule; mark + links on one row. */
.site-foot-min { padding: 22px 0 28px; background: var(--bg); border-top: 1px solid var(--line); margin-top: 72px; }
.site-foot-min .site-foot-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: 1020px; padding: 0 20px; }   /* = .site-bar-in */
.page-builder .site-foot-min .site-foot-in { max-width: 1240px; padding: 0 24px; }
.site-foot-min .site-foot-in p { margin: 0; font-size: 14px; color: var(--muted); text-align: left; }
.site-foot .foot-mark { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font: 600 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.site-foot-links { display: flex; flex-wrap: wrap; gap: 4px 20px; }
.site-foot-links a, .site-foot-min a { color: var(--text); font-weight: 500; margin: 0; text-decoration: underline; text-decoration-color: var(--control); text-underline-offset: 3px; }
.site-foot-links a:hover { color: var(--text); text-decoration-color: var(--red); }
.foot-email-blank { border-bottom: 1px dashed var(--control); color: var(--text); cursor: help; }
@media (max-width: 760px) {
  .site-foot-min .site-foot-in { padding: 0 16px; flex-direction: column; align-items: flex-start; }
}
.auth-avatar { width: 26px; height: 26px; border-radius: 50%; vertical-align: middle; margin-right: 7px; border: 1.5px solid var(--sheet); }

/* ============================================================================
   v13 — organization & polish pass + the shop
   One idea: the redline accent belongs to the numbers and active states;
   structure is carried by consistent rules and rhythm, not decoration.
   ============================================================================ */

/* ---- rhythm: every step and section breathes the same ---- */
.step { padding-top: 40px; }
.step + .step { margin-top: 6px; }
.step-head { margin-bottom: 18px; align-items: center; }
.step-head h2 { font-size: 28px; letter-spacing: 0.015em; }
.masthead-sub { font-size: 16.5px; line-height: 1.55; }

/* ---- the brand line under the masthead name ---- */
#masthead-brand { position: relative; }
.masthead { border-bottom: 3px solid var(--ink); box-shadow: 0 3px 0 0 var(--red); }

/* ---- engine picker: clearer hierarchy, calmer meta ---- */
.picker-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
#engine-search {
  flex: 1 1 260px; font: 500 16px Barlow, sans-serif; padding: 10px 14px;
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius); background: var(--sheet);
}
#engine-search:focus { border-color: var(--ink); }
.engine-list { max-height: 460px; }
.engine-row { padding: 12px 16px; gap: 10px; }
.engine-row:hover { background: #F3F5F1; box-shadow: inset 3px 0 0 var(--red); }
.engine-row.selected { box-shadow: inset 3px 0 0 var(--red); }
.er-name strong { font-weight: 600; font-size: 16.5px; }

/* ---- option groups: one consistent internal rhythm ---- */
.opt-group { padding: 16px 18px 18px; margin-bottom: 16px; background: var(--sheet); }
.opt-group > legend { font-size: 13.5px; letter-spacing: 0.1em; }
.opt { gap: 6px; }
.opt select, .opt input[type="number"], .opt input[type="search"] {
  font: 500 15px Barlow, sans-serif; padding: 9px 12px;
  border: 1.5px solid var(--rule-dark); border-radius: var(--radius);
  background: var(--sheet); color: var(--ink); width: 100%;
}
.opt select:hover, .opt input:hover { border-color: var(--ink); }
.custom-grid { gap: 16px 20px; }
.options-row { gap: 16px 20px; }
.options-row .opt { min-width: 220px; flex: 1 1 220px; }

/* ---- results sheet: let the numbers carry the page ---- */
.stat-strip { border-top-width: 3px; }
.stat { padding: 16px 18px 14px; }
.stat-v { font-size: 48px; }
.parts-title { margin-top: 30px; }

/* ---- affiliate / legal line ---- */
.affiliate-note, .shop-disclosure {
  margin: 22px 0 0; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--rule); padding-top: 10px;
}

/* ================================ SHOP ==================================== */
.shop-main .page-head h1 { margin-bottom: 4px; }
.shop-picker {
  background: var(--sheet); border: 1.5px solid var(--ink); border-radius: var(--radius);
  padding: 18px 20px; margin-bottom: 8px;
}
.shop-picker-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px 18px;
}
.shop-note { color: var(--muted); font-size: 14.5px; margin: 12px 0 0; }
.shop-engine-head { margin: 28px 0 4px; border-bottom: 2px solid var(--ink); padding-bottom: 10px; }
.shop-engine-head h2 { margin: 0; font-size: 30px; }
.shop-blurb { color: var(--muted); font-size: 14.5px; margin: 6px 0 0; max-width: 72ch; }
.shop-group { margin-top: 26px; }
.shop-group h2 {
  margin: 0 0 4px; font-size: 21px; font-weight: 600;
  border-bottom: 1px solid var(--rule-dark); padding-bottom: 6px;
}
.shop-count { color: var(--muted); font-weight: 500; font-size: 15px; }
.shop-cards { display: flex; flex-direction: column; }
.shop-card {
  display: flex; gap: 16px; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid var(--rule);
}
.shop-card:last-child { border-bottom: 0; }
.shop-card-main { min-width: 0; }
.shop-card-name { display: block; font-weight: 500; }
.shop-card-note { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; max-width: 72ch; }
.shop-card-side { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }
.shop-card-price { font-weight: 600; font-variant-numeric: tabular-nums; }
.btn.shop-buy { font-size: 14px; padding: 8px 14px; white-space: nowrap; }
@media (max-width: 560px) {
  .shop-card { flex-direction: column; align-items: flex-start; gap: 8px; }
  .shop-card-side { width: 100%; justify-content: space-between; }
}

/* Rating provenance (MOC-13, three tiers MOC-23, treatment MOC-22).
   primary / secondary are quiet citations; unverified is the only marker. */
.rating-src { display: block; margin-top: 4px; font-size: 12px; line-height: 1.45; color: var(--muted); }
.rating-src a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-dark); text-underline-offset: 2px; }
.rating-src a:hover { color: var(--text, var(--ink)); text-decoration-color: var(--red); }
.rs-links cite { font-style: normal; color: var(--text, var(--ink)); }
.rs-note { display: block; margin-top: 6px; padding-left: 10px; border-left: 2px solid var(--rule-dark); max-width: 72ch; }
.rs-note-h { display: block; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text, var(--ink)); }
.rs-k { font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin-right: 4px; }
.rs-primary .rs-k::before, .rs-secondary .rs-k::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border: 1px solid currentColor; }
.rs-primary .rs-k::before { transform: rotate(45deg); }
.rs-secondary .rs-k::before { border-radius: 50%; }
.rs-unverified .rs-flag { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber-ink); background: transparent; border: 1px solid color-mix(in srgb, var(--amber-ink) 55%, transparent); border-radius: 4px; padding: 2px 6px 1px 4px; }
.rs-unverified .rs-flag .ico { width: 12px; height: 12px; }
.rs-unverified .rs-why { margin-left: 6px; }
.rs-unverified .rs-links { margin-left: 4px; }

/* ---------------------- MOC-10: drawn wordmark in the bar ---------------------- */
.wordmark.drawn { display: block; line-height: 0; }
.wordmark.drawn svg { height: 24px; width: auto; display: block; }
