/* ============================================================================
   MockDyno — dark treatment for the subpages (wiki, shop, contribute, admin,
   legal). MOC-59: the MOC-22 skin folded into the live site. Loaded after
   css/style.css on every page except the builder (which has build-sheet.css).
   Tokens are the shipped ones (css/style.css :root mirrors css/tokens.css);
   nothing new is introduced. Caution reuses the build sheet's cream — the
   same role .watch / .notice give it there — so --amber below is an alias.

     red   = the one primary action per view + active-state ticks
     cream = caution callouts and money (prices on these pages stay plain)
     everything else warm greys
   ============================================================================ */
/* ---- 1. remap the live palette onto the approved tokens ------------------ */
:root {
  --amber: var(--cream);
  --amber-dim: var(--cream-dim);
  --paper: var(--bg);
  --sheet: var(--surface);
  --ink: var(--text);
  --rule: var(--line);
  --rule-dark: var(--line-2);   /* decorative card borders; controls get --control below */
  --red-deep: #FF7B6E;          /* "hover" on dark goes lighter, not darker: 7.4:1 on surface */
  --amber-bg: var(--amber-dim);
  --amber-ink: var(--amber);
  --radius: var(--r-ctl);
  color-scheme: dark;
}
html { background: var(--bg); }
body { background: var(--bg); color: var(--text); font-family: var(--f-body); }
h1, h2, h3, .stat-v { font-family: var(--f-display); }
a { color: var(--text); }
::selection { background: rgba(255, 90, 74, .35); color: var(--text); }
#signin-pop { background: rgba(0, 0, 0, .6); }
.signin-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); box-shadow: 0 24px 60px rgba(0,0,0,.6); }
.signin-card p { color: var(--muted); }
#signin-handle { background: var(--raised); color: var(--text); border: 1px solid var(--control); min-height: 44px; }
.signin-err { color: var(--amber); }

.ad-box { background: transparent; border: 1px dashed var(--line-2); }
.ad-tag { color: var(--muted); border-bottom-color: var(--line); font: 600 10px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; padding: 7px 0 6px; }
.ad-dim, .ad-body { color: var(--stock); }
.ad-note { color: var(--muted); }
/* ---- 3. shared subpage scaffold ----------------------------------------- */
.subpage main { padding-top: 40px; }   /* width stays master's 1020, aligned with the site bar */
.page-head { margin: 4px 0 30px; }
.page-head h1 { font-size: clamp(36px, 5.4vw, 56px); letter-spacing: .005em; }
.page-sub { color: var(--muted); font-size: 17px; line-height: 1.55; }
.page-sub a, .shop-blurb a, .shelf-foot a, .contrib-callout a { color: var(--text); text-decoration-color: var(--control); text-underline-offset: 3px; }
.page-note {
  color: var(--text); background: var(--amber-dim); border: 0; border-left: 2px solid var(--amber);
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0; padding: 10px 14px; font-size: 15px;
}
.crumbs { color: var(--muted); font: 500 13px/1.4 var(--f-mono); letter-spacing: .02em; margin-bottom: 18px; }
.crumbs a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.crumbs a:hover { color: var(--text); text-decoration-color: var(--control); }
.crumb-sep { color: var(--muted); }
.crumb-here { color: var(--text); }

/* buttons: one red primary per view; everything else outlined */
.btn {
  font: 700 15px/1 var(--f-body); letter-spacing: .02em; color: var(--red-ink); background: var(--red);
  border: 0; border-radius: var(--r-pill); padding: 13px 20px; min-height: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn:hover { background: #FF7B6E; }
.btn.ghost { font-weight: 600; color: var(--text); background: none; border: 1px solid var(--control); padding: 12px 18px; }
.btn.ghost:hover { background: none; border-color: var(--text); }
.btn.ghost.danger:hover { color: var(--amber); border-color: var(--amber); }
.btn .ico { width: 16px; height: 16px; flex: 0 0 auto; }

/* inputs: the approved tokens.css .select / .input look, applied to the live classes */
.opt { color: var(--muted); font: 600 11px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; gap: 8px; }
.opt .opt-hint { font: 400 12px/1.3 var(--f-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.opt select, .opt input, .opt textarea, .opt input[type="number"], .opt input[type="search"],
#engine-search, .admin-note, .post-form input, .post-form textarea,
.req-grid .opt select, .req-grid .opt input, .req-grid .opt textarea {
  font: 500 16px/1.3 var(--f-body); letter-spacing: 0; text-transform: none;
  color: var(--text); background: var(--raised); border: 1px solid var(--control);
  border-radius: var(--r-ctl); padding: 11px 12px; min-height: 44px;
}
.opt select, .req-grid .opt select {
  appearance: none; -webkit-appearance: none; padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.opt select:disabled, .req-grid .opt select:disabled { color: var(--muted); border-color: var(--line-2); background-image: none; cursor: not-allowed; opacity: 1; }
/* opacity: 1 cancels Chromium's UA dimming of disabled selects, which took the shop's "—" to 2.93:1.
   WCAG 1.4.3 exempts inactive controls; this is the shop's default state, so it is held to 4.5 anyway
   (6.3:1). "Not yet available" still reads from the --line-2 border, no chevron, and the "—". */
.opt select:hover:not(:disabled), .opt input:hover, .opt textarea:hover, #engine-search:hover, .admin-note:hover { border-color: var(--muted); }
.opt select:focus-visible, .opt input:focus-visible, .opt textarea:focus-visible, #engine-search:focus-visible, .admin-note:focus-visible, #signin-handle:focus-visible { border-color: var(--text); }
::placeholder { color: var(--stock); opacity: 1; }

/* segmented control → tokens.css .seg, with the live .active class as the pressed state */
.seg { display: inline-flex; overflow: visible; padding: 3px; gap: 2px; background: var(--raised); border: 1px solid var(--control); border-radius: var(--r-pill); }
.seg-btn { font: 600 14px/1 var(--f-body); color: var(--muted); background: none; border: 0; border-radius: var(--r-pill); padding: 9px 14px; min-height: 36px; }
.seg-btn + .seg-btn { border-left: 0; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--text); color: var(--bg); }
.seg-btn:disabled { color: var(--control); }

/* callouts: amber = caution, text stays near-white so it is read, not decorated */
.callout, .warnings, .est-note {
  background: var(--amber-dim); color: var(--text); border: 0; border-left: 2px solid var(--amber); border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
}
.warnings h3 { color: var(--amber); }
.warnings ul { color: var(--text); }
.cap-chip {
  font: 600 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase;
  background: none; color: var(--amber); border: 1px solid rgba(239, 227, 200, .55); border-radius: var(--r-ctl); padding: 3px 6px 2px;
}
.chip-op, .chip-swap, .chip-sample { font: 600 10px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; background: none; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r-ctl); }

/* section heads: the old 2px ink rule becomes a hairline with a short red tick — the brand's dyno-trace peak */
.wiki-make h2, .wiki-spec h2, .wiki-sec h2, .req-mine h2, .req-recent h2, .legal h2, .shop-engine-head, .parts-title {
  border-bottom: 1px solid var(--line-2); position: relative;
}
.wiki-make h2::after, .wiki-spec h2::after, .wiki-sec h2::after, .req-mine h2::after, .req-recent h2::after, .shop-engine-head::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 28px; height: 2px; background: var(--red);
}
/* ---- 6. wiki — boring on purpose: dark, legible, no motion -------------- */
.wiki-make { margin-bottom: 40px; }
.wiki-make h2 { font-size: 26px; padding-bottom: 8px; margin-bottom: 14px; }
.model-grid { gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.model-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 16px 18px 15px; gap: 4px; transition: border-color .15s, background .15s; }
.model-card:hover { border-color: var(--control); background: var(--raised); }
.model-name { font: 700 21px/1.1 var(--f-display); letter-spacing: .01em; }
.model-kind { color: var(--muted); font: 600 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.model-gens { color: var(--muted); font-size: 13.5px; margin-top: 8px; }

.gen-block h2 { font-size: 24px; }
.engine-page-list { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); overflow: hidden; }
.engine-page-row { border-bottom-color: var(--line); padding: 14px 18px; }
.engine-page-row:hover { background: var(--raised); }
.engine-page-row:focus-visible { outline-offset: -3px; }
.epr-spec { color: var(--muted); font-variant-numeric: tabular-nums; }
.epr-go { color: var(--text); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.epr-go::after { content: "→"; color: var(--muted); }
.wiki-forum-link a { color: var(--text); }

.wiki-spec h2, .wiki-sec h2 { font-size: 24px; margin: 34px 0 14px; padding-bottom: 8px; }
.wiki-spec h2 { margin-top: 0; }
.spec-table { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); border-collapse: separate; border-spacing: 0; font-size: 15px; overflow: hidden; }
.spec-table th { color: var(--muted); font: 600 10.5px/1.5 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; padding: 11px 14px; width: 36%; }
.spec-table td { padding: 10px 14px 10px 0; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1.45; }
.spec-table tr + tr th, .spec-table tr + tr td { border-top: 1px solid var(--line); }

.wiki-curve figcaption { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 50px 0 10px; }
.wiki-curve .lg-hp-t { color: var(--red); }
.wiki-curve .lg-tq-t { color: var(--blue); }
#stock-curve { background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-panel); }

.gen-table, .shelf-table { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); border-collapse: separate; border-spacing: 0; overflow: hidden; font-size: 15px; }
.gen-table th, .shelf-table th { color: var(--muted); font: 600 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; padding: 11px 14px; border-bottom: 1px solid var(--line-2); background: var(--raised); }
.gen-table td, .shelf-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.shelf-table th:last-child, .shelf-table td:last-child { text-align: right; white-space: nowrap; }
.gen-this td { background: var(--raised); font-weight: 600; }
.gen-this td:first-child { box-shadow: inset 3px 0 0 var(--red); }

.issue-list { padding-left: 0; list-style: none; }
.issue-list li { padding: 10px 0 10px 18px; margin: 0; border-bottom: 1px solid var(--line); position: relative; line-height: 1.55; }
.issue-list li::before { content: ""; position: absolute; left: 0; top: 18px; width: 7px; height: 7px; border: 1.5px solid var(--amber); transform: rotate(45deg); }
.issue-lead { color: var(--amber); }

.prob-list { gap: 12px; }
.prob { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 16px 18px; }
.prob h3 { font-size: 20px; margin-bottom: 10px; }
.prob-s, .prob-f { font-size: 14.5px; line-height: 1.55; display: grid; grid-template-columns: 66px 1fr; gap: 0 4px; }
.prob-s span, .prob-f span { font: 600 10px/2.1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); width: auto; }
.prob-f span { color: var(--text); }
.upgrade-note { line-height: 1.6; }
.shelf-foot { color: var(--muted); margin-top: 12px; }

.contrib-callout { background: var(--surface); border: 1px solid var(--line-2); border-left: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 20px 22px; display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; }
.contrib-callout::before { content: ""; grid-row: 1 / 3; width: 3px; border-radius: 2px; background: var(--red); }
.contrib-callout h2 { font-size: 23px; }
.contrib-callout p { color: var(--muted); line-height: 1.55; }

/* ---- 7. shop — long lists, plain prices, a disclosure you can read ------ */
.shop-picker { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 20px 22px; }
.shop-note { color: var(--muted); }
.shop-engine-head { margin-top: 36px; padding-bottom: 14px; }
.shop-engine-head h2 { font-size: 34px; }
.shop-blurb { color: var(--muted); }
.shop-group { margin-top: 36px; }
.shop-group h2 { display: flex; align-items: center; gap: 10px; font: 700 22px/1.1 var(--f-display); letter-spacing: .01em; border-bottom: 1px solid var(--line-2); padding-bottom: 10px; }
.shop-group h2 .ico { color: var(--muted); flex: 0 0 auto; }
.shop-count { font: 600 11px/1 var(--f-mono); letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 4px 8px 3px; }
.shop-card { border-bottom-color: var(--line); padding: 14px 4px; gap: 20px; }
.shop-card:hover { background: linear-gradient(90deg, transparent, var(--surface) 12%, var(--surface) 88%, transparent); }
.shop-card-name { font-weight: 500; }
.shop-card-note { color: var(--muted); font-size: 14px; }
.shop-card-price { font-weight: 600; font-size: 17px; min-width: 6ch; text-align: right; }
/* 40 red buttons in a list would spend the only accent on a commodity action — outlined instead */
.btn.shop-buy { font: 600 14px/1 var(--f-body); color: var(--text); background: none; border: 1px solid var(--control); padding: 10px 14px 10px 16px; min-height: 40px; }
.btn.shop-buy:hover { border-color: var(--text); background: none; }
.btn.shop-buy::after {
  content: ""; width: 11px; height: 11px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M3 9 9.5 2.5M4 2.5h5.5V8'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6'%3E%3Cpath d='M3 9 9.5 2.5M4 2.5h5.5V8'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* FTC disclosure: full-strength text, its own labelled panel — not 13px grey under a hairline */
.shop-disclosure, .affiliate-note {
  margin: 40px 0 0; padding: 16px 18px; border: 1px solid var(--line-2); border-radius: var(--r-panel); background: var(--surface);
  color: var(--text); font-size: 15px; line-height: 1.55;
}
.shop-disclosure::before {
  content: "Affiliate disclosure"; display: block; margin-bottom: 6px;
  font: 600 10.5px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.shop-disclosure.no-aff::before { content: "About these prices and links"; }
.shop-disclosure a { color: var(--text); text-decoration-color: var(--control); text-underline-offset: 3px; font-weight: 600; }
@media (max-width: 560px) {
  .shop-card-price { text-align: left; }
}

/* ---- 8. contribute + admin -------------------------------------------- */
.how-strip { counter-reset: how; gap: 12px; }
.how-step { counter-increment: how; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 14px 16px; gap: 4px; }
.how-step::before { content: "0" counter(how); font: 600 11px/1 var(--f-mono); letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; }
.how-step strong { font: 700 20px/1.1 var(--f-display); }
.how-step span { color: var(--muted); }
.req-form { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 24px; }
.req-grid { gap: 18px 20px; margin-bottom: 20px; }
.req-grid .opt textarea { min-height: 120px; line-height: 1.5; }
.form-note { color: var(--muted); }
.req-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 16px 18px; }
.req-meta { color: var(--muted); }
.req-meta strong { color: var(--text); }
.req-details { line-height: 1.55; }
.req-source a { color: var(--text); text-decoration-color: var(--control); }
.req-note { background: var(--raised); border-left: 2px solid var(--control); color: var(--text); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; }
/* status: the glyph and the word carry it; colour only for "waiting on someone" */
.status-chip { display: inline-flex; align-items: center; gap: 6px; font: 600 10.5px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; background: none; border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 5px 10px 4px 8px; }
.status-chip::before { font: 700 12px/1 var(--f-body); }
.st-pending { color: var(--amber); border-color: rgba(239, 227, 200, .55); }
.st-pending::before { content: "◷"; }
.st-info { color: var(--text); border-color: var(--control); }
.st-info::before { content: "?"; }
.st-approved { color: var(--text); border-color: var(--control); }
.st-approved::before { content: "✓"; }
.st-rejected { color: var(--muted); border-color: var(--line-2); }
.st-rejected::before { content: "×"; }
.admin-tools .seg { flex-wrap: wrap; }
.admin-actions { border-top-color: var(--line); margin-top: 14px; padding-top: 14px; }
.admin-note { width: 100%; margin-bottom: 12px; }
.empty-board { color: var(--muted); background: none; border: 1px dashed var(--line-2); border-radius: var(--r-panel); padding: 22px; text-align: center; }

/* ---- 9. legal pages — long-form reading, a different contrast problem -----
   Instrument readouts want small bright numbers; three screens of prose want
   less glare: body at --text on --bg (15.6:1) but softened weight 400, 17px,
   1.7 leading, 68ch measure. Muted grey is NOT used for any sentence that
   carries legal meaning. */
.legal .page-head { max-width: 68ch; }
.legal section { max-width: 68ch; margin: 0 0 40px; }
.legal h2 { font-size: 26px; margin: 0 0 14px; padding-bottom: 0; border-bottom: 0; }
.legal h2::before { content: ""; display: block; width: 28px; height: 2px; background: var(--line-2); margin-bottom: 14px; }
.legal p, .legal li { font-size: 17px; line-height: 1.7; color: var(--text); font-weight: 400; }
.legal p { margin: 0 0 14px; }
.legal ul, .legal ol { padding-left: 22px; margin: 0; }
.legal li { margin-bottom: 10px; padding-left: 4px; }
.legal li::marker { color: var(--muted); }
.legal strong { font-weight: 600; color: var(--text); }
.legal a { color: var(--text); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.legal a:hover { text-decoration-color: var(--red); }
.legal code { font: 500 .88em var(--f-mono); background: var(--raised); padding: 1px 5px; border-radius: var(--r-ctl); }
.legal .page-note {
  display: flex; align-items: center; gap: 12px; max-width: 68ch; margin: 0 0 40px;
  font-size: 17px; padding: 14px 18px; border-left-width: 3px;
}
.legal .page-note .ico { color: var(--amber); flex: 0 0 auto; }
.legal-updated { color: var(--muted); font-size: 14px; margin-top: 48px; padding-top: 16px; border-top: 1px solid var(--line); max-width: 68ch; }
.legal-updated a { color: var(--muted); }
.legal table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 6px 0 14px; }
.legal th, .legal td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.legal th { color: var(--muted); font: 600 10.5px/1.3 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; }
.legal-toc { max-width: 68ch; margin: -10px 0 40px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }

/* ---- 10. phone ---------------------------------------------------------- */
@media (max-width: 760px) {
  .subpage main, main { padding-left: 16px; padding-right: 16px; }
  .subpage main { padding-top: 26px; }
  .page-head h1 { font-size: 36px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1 1 auto; font-size: 14px; padding: 11px 14px; }
  .spec-table th { width: 40%; padding: 10px 10px 10px 12px; }
  .spec-table td { padding-right: 12px; }
  .wiki-curve figcaption { margin-top: 18px; }
  .legal p, .legal li { font-size: 16.5px; }
}
.legal .page-note strong { line-height: 1.4; }


/* same as css/tokens.css — subpages do not load it */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
