/* DCC Train Automation — control-panel / track-schematic theme.
   Fonts: Oxanium (headings), Asap (text), Share Tech Mono (read-outs) — SIL OFL, see /assets/fonts/OFL.txt */
@font-face { font-family: "Oxanium"; src: url("/assets/fonts/oxanium.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Asap"; src: url("/assets/fonts/asap.woff2") format("woff2"); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Asap"; src: url("/assets/fonts/asap-italic.woff2") format("woff2"); font-weight: 100 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Share Tech Mono"; src: url("/assets/fonts/share-tech-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --bg: #10161c; --bg2: #161f27; --bg3: #1c2731; --bg4: #233140;
  --line: #2b3946; --line2: #3d5062;
  --ink: #e4ebf0; --ink2: #a9b8c5; --ink3: #8496a6;
  --green: #39d98a; --green-d: #1f7a4d; --amber: #f2b33d; --red: #ff6b6b; --blue: #6cb6ff;
  --link: #6fe3ab; --link-h: #b5f5d4; --focus: #f2b33d;
  --lcd-bg: #08140e; --lcd: #7dffb5;
  --head: "Oxanium", "Bahnschrift", "DIN Alternate", system-ui, sans-serif;
  --text: "Asap", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Share Tech Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 4px;
  --wrap: 1180px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0; background-color: var(--bg); color: var(--ink); font: 17px/1.6 var(--text);
  background-image: linear-gradient(rgba(108, 182, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(108, 182, 255, .035) 1px, transparent 1px);
  background-size: 32px 32px;
  overflow-x: hidden;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--link-h); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; letter-spacing: .01em; margin: 1.4em 0 .5em; font-weight: 650; }
h1 { font-size: clamp(1.85rem, 4.2vw, 2.7rem); font-weight: 700; margin-top: .2em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.7rem); }
h3 { font-size: 1.2rem; }
p, ul, ol, dl { margin: 0 0 1em; }
code, kbd { font-family: var(--mono); font-size: .95em; background: var(--bg3); border: 1px solid var(--line); padding: 0 .3em; border-radius: 3px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--amber); color: #111; padding: 10px 14px; font-weight: 700; }
.skip:focus { top: 8px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 780px; }
.narrow-l { max-width: 960px; }
.small { font-size: .9rem; }
.muted { color: var(--ink2); }
.ic { width: 1.2em; height: 1.2em; vertical-align: -.22em; flex: none; }
.ic-s { width: 1em; height: 1em; vertical-align: -.14em; }
.ic-l { width: 30px; height: 30px; }
main { display: block; min-height: 50vh; }
main:focus { outline: none; }

/* read-outs */
.lcd, .lcd-sm { font-family: var(--mono); color: var(--lcd); background: var(--lcd-bg); border: 1px solid #1d3a2a; border-radius: 3px; padding: .05em .45em; letter-spacing: .04em; white-space: nowrap; text-shadow: 0 0 6px rgba(125, 255, 181, .35); }
.lcd { font-size: 1.35rem; display: inline-block; min-width: 2.6em; text-align: right; }
.lcd-sm { font-size: .95em; }
.cvn { font-family: var(--mono); color: var(--amber); letter-spacing: .02em; white-space: nowrap; }
.led { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #2a3a33; box-shadow: inset 0 0 0 1px #3b5246; margin-right: 8px; vertical-align: .08em; flex: none; }

/* ------------------------------------------------------------------ header */
.site-head { background: linear-gradient(#0c1116, #121920); border-bottom: 1px solid var(--line); position: relative; }
.site-head::after { /* the track line along the bottom of the header */
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px; height: 6px; pointer-events: none;
  background: linear-gradient(var(--line2), var(--line2)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line2), var(--line2)) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 10px, rgba(61, 80, 98, .7) 10px 12px);
}
.head-in { display: flex; align-items: center; gap: 12px 20px; padding-top: 14px; padding-bottom: 14px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--head); font-weight: 700; font-size: 1.3rem; letter-spacing: .06em; text-transform: uppercase; line-height: 1.1; }
.brand-tag { font-family: var(--mono); font-size: .78rem; color: var(--ink2); letter-spacing: .03em; line-height: 1.3; margin-top: 3px; }
.head-search { display: flex; flex: 0 1 330px; position: relative; }
.head-search input { flex: 1; min-width: 0; height: 42px; background: var(--bg); color: var(--ink); border: 1px solid var(--line2); border-right: 0; border-radius: var(--r) 0 0 var(--r); padding: 0 12px; font: inherit; font-size: 1rem; }
.head-search button { width: 46px; height: 42px; border: 1px solid var(--line2); background: var(--bg3); color: var(--green); border-radius: 0 var(--r) var(--r) 0; cursor: pointer; }
.nav-main { border-top: 1px solid var(--line); background: #0e1419; }
.nav-main ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0; margin: 0 auto; padding-top: 0; padding-bottom: 0; }
.nav-main a { display: flex; align-items: center; padding: 11px 14px; color: var(--ink); text-decoration: none; font-family: var(--head); font-weight: 600; font-size: .95rem; letter-spacing: .04em; border-right: 1px solid var(--line); }
.nav-main li:first-child a { border-left: 1px solid var(--line); }
.nav-main a:hover { background: var(--bg3); color: #fff; }
.nav-main a:hover .led { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.nav-main a[aria-current] { background: var(--bg3); color: #fff; }
.nav-main a[aria-current] .led { background: var(--green); box-shadow: 0 0 8px var(--green); }
.nav-mobile { display: none; }
.nav-mobile summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 12px; border: 1px solid var(--line2); border-radius: var(--r); font-family: var(--head); font-weight: 600; }
.nav-mobile summary::-webkit-details-marker { display: none; }
.burger { display: inline-flex; flex-direction: column; gap: 3px; }
.burger i { display: block; width: 18px; height: 2px; background: var(--green); }
.nav-mobile nav { position: absolute; left: 0; right: 0; top: 100%; z-index: 40; background: #0e1419; border-bottom: 2px solid var(--green-d); }
.nav-mobile ul { list-style: none; margin: 0; padding: 6px 16px 12px; }
.nav-mobile a { display: block; padding: 11px 4px; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); font-family: var(--head); font-weight: 600; }
.nav-mobile a[aria-current] { color: var(--green); }

/* search suggestions */
.sg { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 45; list-style: none; margin: 0; padding: 4px 0; background: var(--bg2); border: 1px solid var(--line2); border-radius: var(--r); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); max-height: 70vh; overflow: auto; }
.sg a { display: block; padding: 8px 12px; color: var(--ink); text-decoration: none; }
.sg small { display: block; color: var(--ink2); font-size: .8rem; }
.sg [aria-selected="true"] a, .sg a:hover { background: var(--bg4); }
.sg-all a { color: var(--link); border-top: 1px solid var(--line); }

/* ------------------------------------------------------------------ buttons, forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--green); border-radius: var(--r); background: var(--green); color: #06140c; font: 700 1rem/1.2 var(--head); letter-spacing: .03em; text-decoration: none; cursor: pointer; }
.btn:hover { background: #6ff0b0; color: #06140c; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line2); }
.btn-line:hover { background: var(--bg3); color: #fff; border-color: var(--green); }
.btn-amz { background: transparent; color: var(--amber); border-color: rgba(242, 179, 61, .55); font-size: .92rem; min-height: 40px; }
.btn-amz:hover { background: rgba(242, 179, 61, .1); color: #ffd27a; }
label { display: block; font-weight: 600; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 44px; padding: 9px 11px; background: var(--bg); color: var(--ink); border: 1px solid var(--line2); border-radius: var(--r); font: inherit; font-size: 1rem;
}
input[type=number] { font-family: var(--mono); font-size: 1.15rem; color: var(--lcd); }
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--amber); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--green); vertical-align: -4px; flex: none; }
fieldset { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px 6px; margin: 0 0 14px; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--head); }
.radio { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin: 6px 0; }
.opt { font-weight: 400; color: var(--ink2); font-size: .9rem; }
.form > label { margin-top: 14px; }
.ok-msg { background: rgba(57, 217, 138, .1); border-left: 4px solid var(--green); padding: 10px 14px; }
.err-msg { background: rgba(255, 107, 107, .1); border-left: 4px solid var(--red); padding: 10px 14px; }

/* ------------------------------------------------------------------ headings and bands */
.kicker { font-family: var(--mono); text-transform: uppercase; letter-spacing: .12em; font-size: .82rem; color: var(--amber); margin: 0 0 .4em; }
.kicker a { color: var(--amber); text-decoration: none; }
.kicker a:hover { text-decoration: underline; }
.lead { font-size: 1.15rem; color: #cbd6df; max-width: 68ch; }
.page-head { padding: 26px 0 8px; }
.band { padding-top: 34px; padding-bottom: 6px; }
.band-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px 20px; flex-wrap: wrap; margin-bottom: 14px; }
.band-head h2 { margin: 0; }
.sec-no { font-family: var(--mono); color: var(--green); font-size: .8em; margin-right: 8px; border: 1px solid var(--green-d); padding: 0 6px; border-radius: 3px; vertical-align: .12em; }
.more { font-family: var(--head); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sec-h { position: relative; padding-bottom: 12px; margin-top: 1.8em; }
.sec-h::after { /* a short length of track under section headings */
  content: ""; position: absolute; left: 0; bottom: 0; width: min(100%, 220px); height: 7px;
  background: linear-gradient(var(--line2), var(--line2)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line2), var(--line2)) 0 100% / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, var(--line2) 0 2px, transparent 2px 10px);
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 14px; padding: 0; font-size: .88rem; font-family: var(--mono); color: var(--ink2); }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--line2); }
.crumbs a { color: var(--ink2); }
.crumbs a:hover { color: var(--link); }

/* ------------------------------------------------------------------ hero */
.hero { border-bottom: 1px solid var(--line); background: radial-gradient(ellipse at 80% 20%, rgba(57, 217, 138, .08), transparent 60%); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 30px; align-items: center; padding-top: 34px; padding-bottom: 34px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.1rem); margin-bottom: .3em; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--ink2); font-size: .95rem; margin: 14px 0 0; }
.hero-stats strong { margin-right: 4px; }
.hero-diagram { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #0b1015; }
.hd-grid path { stroke: rgba(108, 182, 255, .07); stroke-width: 1; fill: none; }
.hd-track { stroke: #c9d6e0; stroke-width: 4; fill: none; stroke-linecap: round; }
.hd-occ { stroke: var(--red); stroke-width: 6; fill: none; stroke-linecap: round; opacity: .85; }
.hd-gaps path { stroke: var(--amber); stroke-width: 3; }
.hd-sig path { stroke: #8496a6; stroke-width: 2; fill: none; }
.hd-sig rect { fill: #0b1015; stroke: #8496a6; stroke-width: 1.5; }
.hd-g { fill: var(--green); filter: drop-shadow(0 0 4px var(--green)); }
.hd-r { fill: var(--red); filter: drop-shadow(0 0 4px var(--red)); }
.hd-y { fill: var(--amber); filter: drop-shadow(0 0 4px var(--amber)); }
.hd-loco { fill: #f2f5f7; }
.hd-txt text { font: 11px var(--mono); fill: var(--ink3); letter-spacing: .05em; }
.hd-cv rect { fill: var(--lcd-bg); stroke: #1d3a2a; }
.hd-cv text { font: 15px var(--mono); fill: var(--lcd); }

.bigsearch { margin: 20px 0 0; max-width: 640px; }
.bigsearch-l { font-family: var(--head); font-size: .95rem; letter-spacing: .04em; color: var(--ink2); }
.bigsearch-row { display: flex; position: relative; border: 1px solid var(--line2); border-radius: var(--r); background: var(--bg); }
.bigsearch-row:focus-within { border-color: var(--amber); }
.bigsearch-pre { display: flex; align-items: center; padding: 0 0 0 12px; font-family: var(--mono); color: var(--green); }
.bigsearch input { flex: 1; min-width: 0; border: 0; background: transparent; min-height: 52px; font-size: 1.05rem; }
.bigsearch input:focus-visible { outline: none; }
.btn-go { border-radius: 0 3px 3px 0; min-height: 52px; }

/* start-here route: stations along a line */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0; position: relative; }
.route li { position: relative; }
.route a { display: flex; flex-direction: column; gap: 6px; padding: 30px 16px 14px 0; text-decoration: none; color: var(--ink); position: relative; height: 100%; }
.route a::before { content: ""; position: absolute; top: 9px; left: 0; right: 0; height: 4px; background: var(--line2); }
.route a::after { content: ""; position: absolute; top: 3px; left: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--bg); border: 3px solid var(--green); }
.route a:hover::after { background: var(--green); }
.route-n { font-family: var(--mono); color: var(--green); font-size: .85rem; }
.route-t { font-family: var(--head); font-weight: 600; font-size: 1.05rem; line-height: 1.3; }
.route a:hover .route-t { color: var(--link-h); text-decoration: underline; }

/* topic tiles: panel modules */
.cat-grid, .tool-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.cat-tile { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 2px 12px; align-items: center; padding: 14px; height: 100%; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; color: var(--ink); text-decoration: none; }
.cat-tile:hover { border-color: var(--green); background: var(--bg3); color: #fff; }
.cat-ic { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 6px; background: #0d1318; border: 1px solid var(--line2); color: var(--green); }
.cat-name { font-family: var(--head); font-weight: 650; font-size: 1.05rem; line-height: 1.25; }
.cat-n { font-family: var(--mono); font-size: .82rem; color: var(--ink2); display: inline-flex; align-items: center; }
.cat-tile.is-live .led { background: var(--green); box-shadow: 0 0 6px var(--green); }
.tool-grid { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tool-tile { display: flex; flex-direction: column; gap: 6px; padding: 16px; height: 100%; background: var(--bg2); border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 6px; color: var(--ink); text-decoration: none; }
.tool-tile .ic { color: var(--amber); }
.tool-tile:hover { background: var(--bg3); color: #fff; border-color: var(--amber); }
.tool-main { border-top-color: var(--green); }
.tool-main .ic { color: var(--green); }
.tool-name { font-family: var(--head); font-weight: 700; font-size: 1.15rem; }
.tool-d { color: var(--ink2); font-size: .95rem; }
.tool-lcd { margin-top: auto; font-family: var(--mono); color: var(--lcd); background: var(--lcd-bg); border: 1px solid #1d3a2a; padding: 4px 8px; border-radius: 3px; font-size: .9rem; align-self: flex-start; }

/* guide cards: the left edge is a signal aspect for difficulty */
.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.card a { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 16px 14px 20px; background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 6px; color: var(--ink); text-decoration: none; }
.card a:hover { background: var(--bg3); border-color: var(--line2); color: #fff; }
.card-easy a { border-left-color: var(--green); }
.card-medium a { border-left-color: var(--amber); }
.card-hard a { border-left-color: var(--red); }
.card-cat { font-family: var(--mono); font-size: .8rem; color: var(--ink2); text-transform: uppercase; letter-spacing: .06em; }
.card-t { font-family: var(--head); font-weight: 650; font-size: 1.12rem; line-height: 1.3; }
.card a:hover .card-t { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.card-s { color: var(--ink2); font-size: .95rem; }
.card-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: auto; font-size: .85rem; color: var(--ink2); font-family: var(--mono); }
.diff { display: inline-flex; align-items: center; gap: 6px; }
.lamp { width: 9px; height: 9px; border-radius: 50%; background: var(--ink3); }
.card-easy .lamp { background: var(--green); box-shadow: 0 0 6px var(--green); }
.card-medium .lamp { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.card-hard .lamp { background: var(--red); box-shadow: 0 0 6px var(--red); }

.how-band { margin-top: 30px; margin-bottom: 30px; }
.how-band h2 { margin-top: 0; }
.how-list { list-style: none; counter-reset: how; margin: 0 0 20px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.how-list li { counter-increment: how; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 14px; color: var(--ink2); font-size: .95rem; }
.how-list li::before { content: counter(how, decimal-leading-zero); display: block; font-family: var(--mono); color: var(--green); }
.how-list strong { display: block; color: var(--ink); font-family: var(--head); }
.suggest-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px; border: 1px dashed var(--line2); border-radius: 6px; }
.suggest-strip p { margin: 0; }

/* ------------------------------------------------------------------ lists */
.list-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; align-items: baseline; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 8px 0; margin: 8px 0 18px; font-family: var(--mono); font-size: .9rem; color: var(--ink2); }
.list-bar p { margin: 0; }
.sorts a, .sort-on { margin-left: 8px; }
.sort-on { color: var(--green); }
.page-head-ic { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; }
.page-head-ic > .crumbs, .page-head-ic > .lead, .page-head-ic > p:not(.kicker) { grid-column: 1 / -1; }
.page-head-ic .cat-ic-lg { grid-row: 2 / span 2; width: 64px; height: 64px; align-self: center; }
.cat-ic-lg .ic-l { width: 36px; height: 36px; }
.page-head-ic .kicker, .page-head-ic h1 { grid-column: 2; }
.page-head-ic h1 { margin-bottom: 0; }
.subcat-nav ul, .chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 0; }
.subcat-nav a, .chip-list a { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 6px 12px; background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; color: var(--ink); text-decoration: none; font-size: .92rem; }
.subcat-nav a:hover, .chip-list a:hover { border-color: var(--green); color: #fff; }
.chip-nav { margin: 6px 0 10px; }
.empty, .empty-box { color: var(--ink2); }
.empty-box { background: var(--bg2); border: 1px dashed var(--line2); border-radius: 6px; padding: 16px; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 26px 0; font-family: var(--mono); }
.pager ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; min-height: 42px; padding: 0 10px; border: 1px solid var(--line2); border-radius: var(--r); text-decoration: none; color: var(--ink); }
a.pg:hover { border-color: var(--green); }
.pg-on { background: var(--green); color: #06140c; border-color: var(--green); }
.cat-list { list-style: none; margin: 0 0 30px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.cat-row { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 14px; }
.cat-row-h { display: flex; gap: 12px; align-items: center; text-decoration: none; color: var(--ink); margin-bottom: 8px; }
.cat-row-h .cat-ic { grid-row: auto; }
.cat-row p { color: var(--ink2); margin: 0; font-size: .95rem; }
.subcats { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.az-nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 0 0 18px; padding: 0; }
.az-nav a, .az-nav span { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 3px; font-family: var(--mono); text-decoration: none; }
.az-nav span { color: var(--ink3); opacity: .5; }
.az-nav a[aria-current] { background: var(--green); color: #06140c; }
.az-h { font-family: var(--mono); color: var(--green); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.az-list { columns: 2 300px; column-gap: 30px; padding-left: 1.1em; }
.az-list li { margin: 0 0 6px; break-inside: avoid; }
.toolkit-link { margin: 26px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg2); }
.toolkit-link .ic { color: var(--amber); }

/* ------------------------------------------------------------------ guide */
.guide-head { border-bottom: 1px solid var(--line); padding: 24px 0 22px; background: linear-gradient(180deg, rgba(28, 39, 49, .6), transparent); }
.plate { display: flex; flex-wrap: wrap; gap: 0; margin: 18px 0 0; border: 1px solid var(--line2); border-radius: 6px; background: #0d1318; max-width: 860px; }
.plate > div { padding: 10px 16px; border-right: 1px solid var(--line); flex: 1 1 auto; }
.plate > div:last-child { border-right: 0; }
.plate dt { font-family: var(--mono); font-size: .76rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); }
.plate dd { margin: 2px 0 0; font-weight: 600; font-family: var(--head); font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.plate-sub { font-weight: 400; color: var(--ink2); font-size: .9rem; font-family: var(--text); }
.aspect { display: inline-flex; flex-direction: column; gap: 2px; padding: 3px; background: #05080b; border: 1px solid var(--line2); border-radius: 5px; }
.aspect i { width: 7px; height: 7px; border-radius: 50%; background: #22303a; }
.aspect-red i:nth-child(1) { background: var(--red); box-shadow: 0 0 5px var(--red); }
.aspect-amber i:nth-child(2) { background: var(--amber); box-shadow: 0 0 5px var(--amber); }
.aspect-green i:nth-child(3) { background: var(--green); box-shadow: 0 0 5px var(--green); }
.guide-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.guide-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 40px; padding-top: 24px; }
.guide-main { min-width: 0; max-width: 800px; }
.guide-side .side-in { position: sticky; top: 16px; }
.side-steps { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.side-steps h2 { font-size: .95rem; margin: 0 0 8px; font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); }
.side-steps ol, .jump ol { list-style: none; margin: 0; padding: 0; }
.side-steps li, .jump li { margin: 0 0 4px; }
.side-steps a, .jump a { display: flex; gap: 8px; text-decoration: none; color: var(--ink); font-size: .93rem; line-height: 1.35; padding: 3px 0; }
.side-steps a:hover, .jump a:hover { color: var(--link-h); }
.jn { font-family: var(--mono); color: var(--green); min-width: 1.6em; }
.side-links { margin-top: 14px; }
.jump { display: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin-bottom: 18px; }
.jump-h { margin: 0 0 8px; font-size: 1rem; }
.panel { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px 4px; margin: 0 0 20px; }
.panel-h { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-size: 1.15rem; }
.panel-h .ic { color: var(--green); }
.need-list { list-style: none; margin: 0 0 10px; padding: 0; }
.need-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.need-list li:last-child { border-bottom: 0; }
.need-box { width: 14px; height: 14px; border: 2px solid var(--line2); border-radius: 2px; flex: none; align-self: center; }
.need-item { flex: 1 1 200px; }
.amz { color: var(--amber); font-size: .9rem; font-family: var(--mono); }
.amz:hover { color: #ffd27a; }
.amz-note { margin-top: 4px; }
.safety { border-color: rgba(255, 107, 107, .5); border-left: 4px solid var(--red); }
.safety .panel-h .ic { color: var(--red); }
.tips { border-left: 4px solid var(--green); }
.pro { border-left: 4px solid var(--amber); }
.pro .panel-h .ic { color: var(--amber); }
.steps { list-style: none; margin: 0; padding: 0; position: relative; }
.steps::before { /* the line the steps sit on */
  content: ""; position: absolute; top: 10px; bottom: 30px; left: 25px; width: 10px;
  background: linear-gradient(var(--line2), var(--line2)) 0 0 / 2px 100% no-repeat, linear-gradient(var(--line2), var(--line2)) 100% 0 / 2px 100% no-repeat,
    repeating-linear-gradient(transparent 0 8px, rgba(61, 80, 98, .7) 8px 10px);
}
.step { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 0 16px; padding: 6px 0 22px; position: relative; scroll-margin-top: 12px; }
.step-badge span { position: relative; display: flex; align-items: center; justify-content: center; width: 60px; height: 44px; background: var(--lcd-bg); border: 2px solid var(--green-d); border-radius: 6px; font-family: var(--mono); font-size: 1.35rem; color: var(--lcd); text-shadow: 0 0 6px rgba(125, 255, 181, .4); }
.step-body { min-width: 0; padding-top: 4px; }
.step-h { margin: 6px 0 10px; font-size: 1.3rem; }
.step:target .step-badge span { border-color: var(--amber); }
.step:target .step-h { color: var(--amber); }
.step-next { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: .88rem; text-decoration: none; margin-top: 4px; }
.step-body h4, .step-body h5 { font-size: 1.05rem; margin: 1em 0 .4em; }
.prose h2 { margin-top: 1.6em; }
.prose ul, .prose ol, .step-body ul, .step-body ol, .faq-a ul, .faq-a ol { padding-left: 1.3em; }
.prose li, .step-body li { margin-bottom: .35em; }
.callout { margin: 0 0 1em; padding: 10px 14px; border-left: 4px solid var(--blue); background: rgba(108, 182, 255, .07); border-radius: 0 var(--r) var(--r) 0; }
.callout p:last-child { margin-bottom: 0; }
.callout-h { font-family: var(--mono); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin: 0 0 4px; color: var(--blue); }
.callout.warn { border-left-color: var(--red); background: rgba(255, 107, 107, .08); }
.callout.warn .callout-h { color: var(--red); }
.callout.tip { border-left-color: var(--green); background: rgba(57, 217, 138, .07); }
.callout.tip .callout-h { color: var(--green); }
.table-wrap { overflow-x: auto; margin: 0 0 1em; border: 1px solid var(--line); border-radius: 6px; max-width: 100%; }
.md-table, .ref-table, .st-table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.md-table th, .md-table td, .ref-table th, .ref-table td, .st-table th, .st-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.md-table thead th, .ref-table thead th, .st-table thead th { background: #0d1318; font-family: var(--mono); font-weight: 400; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem; color: var(--ink2); }
.ref-table tbody th { font-family: var(--head); font-weight: 650; }
.ref-table tbody tr:hover, .md-table tbody tr:hover { background: rgba(255, 255, 255, .02); }
caption { text-align: left; padding: 8px 12px; font-family: var(--head); font-weight: 600; }
.faq details { border: 1px solid var(--line); border-radius: 6px; margin: 0 0 8px; background: var(--bg2); }
.faq summary { cursor: pointer; padding: 12px 44px 12px 14px; font-weight: 600; position: relative; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 14px; top: 8px; font-family: var(--mono); font-size: 1.4rem; color: var(--green); }
.faq details[open] summary::after { content: "−"; }
.faq details[open] summary { border-bottom: 1px solid var(--line); }
.faq-a { padding: 12px 14px 2px; }
.sources ol, .src-list { padding-left: 1.4em; font-size: .95rem; }
.sources li, .src-list li { margin-bottom: 4px; }
.tags { font-size: .92rem; margin-top: 18px; }
.tags-l { font-family: var(--mono); color: var(--ink2); }
.tags a { display: inline-block; margin: 2px 6px 2px 0; padding: 2px 10px; border: 1px solid var(--line2); border-radius: 14px; text-decoration: none; color: var(--ink); }
.tags a:hover { border-color: var(--green); }
.notice { display: flex; gap: 12px; align-items: flex-start; margin: 26px 0; padding: 12px 14px; background: #0d1318; border: 1px solid var(--line); border-radius: 6px; font-size: .92rem; color: var(--ink2); }
.notice p { margin: 0; }
.notice-i { color: var(--blue); width: 22px; height: 22px; margin-top: 2px; }
.helpful { margin: 26px 0 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg2); }
.helpful-h { margin: 0 0 8px; font-size: 1.1rem; }
.helpful-f { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.helpful-msg { flex-basis: 100%; margin: 0; }
.report { margin: 12px 0 30px; border: 1px solid var(--line); border-radius: 6px; padding: 0 16px; }
.report summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--ink2); }
.report[open] { padding-bottom: 14px; }
.related { padding-bottom: 30px; }
.print-foot { display: none; }
.fig { margin: 0 0 20px; }
.fig img { display: block; width: 100%; height: auto; border-radius: 6px; }
.fig figcaption, .photo-credit { font-size: .85rem; color: var(--ink2); margin-top: 6px; }

/* ------------------------------------------------------------------ wiring diagrams */
.diagram { max-width: 820px; margin: 6px 0 22px; background: #0b1015; border: 1px solid var(--line2); border-radius: 6px; overflow: hidden; }
.diagram svg { display: block; width: 100%; height: auto; }
.diagram figcaption { padding: 10px 14px 12px; border-top: 1px solid var(--line); font-size: .92rem; color: var(--ink2); }
.diagram-t { display: block; font-family: var(--head); font-weight: 650; color: var(--ink); font-size: 1rem; }
.d-bg { fill: #0b1015; }
.d-sl { stroke: #2c3a47; stroke-width: 5; }
.d-rail { stroke: #c9d6e0; stroke-width: 3; fill: none; }
.d-track { stroke: #c9d6e0; stroke-width: 5; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.d-zone { stroke: var(--amber); stroke-width: 5; opacity: .55; }
.d-joint { stroke: #6d8193; stroke-width: 2; }
.d-bus { fill: none; stroke-width: 3.5; stroke-linejoin: round; }
.d-a { stroke: #ff7a7a; fill: #ff7a7a; }
.d-b { stroke: #6cb6ff; fill: #6cb6ff; }
.d-bus.d-a, .d-bus.d-b, .d-drop { fill: none; }
.d-drop { stroke-width: 2; }
.d-feed, .d-out, .d-link { stroke: #a9b8c5; stroke-width: 2.2; fill: none; stroke-linejoin: round; }
.d-link { stroke-dasharray: 2 4; }
.d-fb { stroke: var(--green); stroke-width: 2; fill: none; stroke-dasharray: 6 5; }
.d-gap { stroke: var(--amber); stroke-width: 3; }
.d-box { fill: #141d25; stroke: #6d8193; stroke-width: 1.5; }
.d-box.d-hi { stroke: var(--green); }
.d-box.d-cb { stroke: var(--amber); }
.d-box.d-occ { stroke: var(--red); fill: #2a1416; }
.d-box.d-sm { fill: #141d25; }
.d-t { font: 600 14px var(--head); fill: var(--ink); }
.d-ts { font: 12px var(--mono); fill: #a9b8c5; }
.d-l { font: 600 13px var(--head); fill: #d5dee5; }
.d-note { fill: #a9b8c5; font-weight: 400; }
.d-head { font-size: 16px; fill: var(--amber); }
.d-warn-t { fill: var(--amber); }
.d-zone-t { fill: var(--amber); }
.d-occ-t { fill: #ff8f8f; }
.d-dot { fill: #c9d6e0; }
.d-loco { fill: #e9eef2; stroke: #0b1015; stroke-width: 1; }
.d-arrow { stroke: var(--green); stroke-width: 2.5; fill: none; }
.d-buffer { stroke: var(--red); stroke-width: 5; }
.d-plat { fill: #24323f; }
.d-sensor { fill: #0b1015; stroke: var(--green); stroke-width: 3; }
.d-sep { stroke: var(--line2); stroke-dasharray: 4 6; stroke-width: 1.5; }
.d-cv { font: 13px var(--mono); fill: var(--lcd); }
.d-post { stroke: #8496a6; stroke-width: 3; }
.d-head-box { fill: #05080b; stroke: #8496a6; stroke-width: 1.5; }
.d-lamp { stroke: none; }
.d-off { fill: #1d2830; }
.d-red { fill: var(--red); }
.d-yellow { fill: var(--amber); }
.d-green { fill: var(--green); }
.dg-list .dg { margin-bottom: 26px; }
.dg-rel { font-size: .95rem; }
.key { font-family: var(--mono); padding: 0 4px; }
.key-a { color: #ff7a7a; } .key-b { color: #6cb6ff; } .key-gap { color: var(--amber); }

/* ------------------------------------------------------------------ CV calculator */
.cv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 10px 0 20px; }
.cv-card { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 16px 18px 6px; scroll-margin-top: 12px; position: relative; }
.cv-card::before { content: ""; position: absolute; top: 12px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.cv-wide { grid-column: 1 / -1; }
.cv-h { margin: 0 0 14px; font-size: 1.25rem; padding-right: 24px; }
.cv-code { display: block; font-family: var(--mono); color: var(--amber); font-size: .85rem; font-weight: 400; letter-spacing: .06em; margin-bottom: 2px; }
.cv-row { display: flex; gap: 10px; flex-wrap: wrap; }
.cv-row input { flex: 1 1 140px; width: auto; }
.cv-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 4px; }
.cv-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cv-pair label { font-size: .92rem; }
.cv-form p { margin: 10px 0; }
.cv-out { margin: 14px 0; padding: 12px 14px; background: #0b1015; border: 1px solid var(--line2); border-radius: 6px; min-height: 70px; }
.cv-out:focus { outline: 2px solid var(--line2); }
.readout { display: flex; flex-wrap: wrap; gap: 12px 26px; margin: 0; }
.readout dt { font-size: .85rem; color: var(--ink2); }
.readout dd { margin: 4px 0 0; }
.ro-na { font-family: var(--mono); color: var(--ink3); }
.ro-note { margin: 12px 0 0; font-size: .9rem; color: var(--ink2); }
.cv-err { margin: 0; color: #ffb0b0; font-weight: 600; }
.cv29-cols { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; }
.bits { padding-bottom: 8px; }
.bit { display: grid; grid-template-columns: auto auto 1fr; gap: 4px 10px; align-items: baseline; font-weight: 400; padding: 7px 0; border-bottom: 1px dashed var(--line); margin: 0; }
.bit:last-child { border-bottom: 0; }
.bit input { align-self: center; }
.bit-n { font-family: var(--mono); color: var(--amber); font-size: .85rem; white-space: nowrap; }
.bit-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: .92rem; }
.bit-list li { padding: 4px 0 4px 18px; position: relative; color: var(--ink2); }
.bit-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: #2a3a33; }
.bit-list .bit-on { color: var(--ink); }
.bit-list .bit-on::before { background: var(--green); box-shadow: 0 0 6px var(--green); }
.shape { margin-top: 12px; }
.st-chart { display: block; width: 100%; max-width: 420px; height: auto; margin: 0 0 12px; background: var(--lcd-bg); border: 1px solid #1d3a2a; border-radius: 4px; }
.st-grid { stroke: #173325; stroke-width: 1; fill: none; }
.st-line { stroke: var(--lcd); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.st-table { font-size: .9rem; }
.st-table td, .st-table th { padding: 4px 10px; }
#speed-out .table-wrap { max-height: 300px; overflow: auto; }
.st-table .lcd { font-size: .95rem; min-width: 3em; }

/* ------------------------------------------------------------------ reference pages */
.aka { display: block; font-family: var(--mono); font-weight: 400; font-size: .82rem; color: var(--ink2); }
.panel-h .aka { display: inline; }
.plug-cards, .sw-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin: 22px 0; align-items: start; }
.plug, .sw { scroll-margin-top: 12px; margin: 0; }
.spec { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; margin: 0 0 12px; font-size: .95rem; }
.spec div { display: contents; }
.spec dt { color: var(--ink2); font-family: var(--mono); font-size: .82rem; text-transform: uppercase; letter-spacing: .05em; padding-top: .2em; }
.spec dd { margin: 0; }
.pin-table td:first-child { width: 4em; }
.gloss { margin: 0 0 10px; }
.gloss > div { padding: 12px 0; border-bottom: 1px solid var(--line); scroll-margin-top: 12px; }
.gloss dt { font-family: var(--head); font-weight: 700; font-size: 1.1rem; color: var(--ink); }
.gloss dd { margin: 4px 0 0; }
.gloss dd p:last-child { margin-bottom: 0; }
.gloss > div:target { background: rgba(242, 179, 61, .06); box-shadow: -10px 0 0 rgba(242, 179, 61, .06), 10px 0 0 rgba(242, 179, 61, .06); }
.gloss > div:target dt { color: var(--amber); }
.see { font-size: .9rem; color: var(--ink2); margin-top: 6px; }
.faq details:target { border-color: var(--amber); }

/* toolkit (parts & tools) */
.tk-sec { margin-bottom: 26px; }
.tk-sec .sec-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-sec .sec-h .cat-ic { width: 38px; height: 38px; }
.tk-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.tk-item { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.tk-name { margin: 0; font-size: 1.05rem; }
.tk-used { margin: 0; font-size: .9rem; color: var(--ink2); }
.tk-item .btn { align-self: flex-start; margin-top: auto; }

/* misc pages */
.err-page { padding: 40px 16px 50px; }
.err-links { margin-top: 20px; }
.contact-card { font-size: 1.15rem; padding: 14px 16px; background: var(--bg2); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; }
.credits-list, .kit-credits-list { padding-left: 1.2em; }

/* ------------------------------------------------------------------ footer */
.site-foot { margin-top: 50px; background: #0b1015; border-top: 1px solid var(--line); color: var(--ink2); font-size: .95rem; position: relative; }
.foot-track { height: 8px; background: linear-gradient(var(--line2), var(--line2)) 0 0 / 100% 1px no-repeat, linear-gradient(var(--line2), var(--line2)) 0 100% / 100% 1px no-repeat, repeating-linear-gradient(90deg, transparent 0 10px, rgba(61, 80, 98, .7) 10px 12px); }
.foot-top { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; padding: 26px 0 10px; }
.foot-name { font-family: var(--head); font-weight: 700; color: var(--ink); letter-spacing: .06em; text-transform: uppercase; display: block; }
.foot-disclaimer { display: flex; gap: 10px; align-items: flex-start; }
.foot-disclaimer .ic { color: var(--amber); margin-top: 3px; }
.foot-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 14px 0; border-top: 1px solid var(--line); }
.foot-h { font-family: var(--mono); font-weight: 400; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--amber); margin: 6px 0 10px; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { margin: 0 0 6px; }
.foot-cols a { color: var(--ink2); text-decoration: none; }
.foot-cols a:hover { color: var(--link); text-decoration: underline; }
.foot-legal { border-top: 1px solid var(--line); padding: 16px 0 26px; font-size: .88rem; }
.foot-legal p { margin: 0 0 6px; }
.foot-copy { font-family: var(--mono); font-size: .8rem; color: var(--ink3); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  .guide-layout { grid-template-columns: minmax(0, 1fr); }
  .guide-side { display: none; }
  .jump { display: block; }
  .hero-in { grid-template-columns: minmax(0, 1fr); }
  .hero-diagram { max-width: 520px; }
  .foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-main { display: none; }
  .nav-mobile { display: block; }
  .head-in { position: relative; }
  .head-search { order: 3; flex: 1 1 100%; }
  .cv-grid { grid-template-columns: minmax(0, 1fr); }
  .cv29-cols { grid-template-columns: minmax(0, 1fr); }
  .foot-top { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .brand-name { font-size: .92rem; letter-spacing: .03em; }
  .brand { gap: 8px; }
  .nav-mobile summary { padding: 0 9px; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cat-tile { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .cat-tile .cat-ic { grid-row: auto; width: 40px; height: 40px; }
  .cat-name { font-size: .98rem; }
  .brand-tag { display: none; }
  .brand-mark { width: 38px; height: 38px; }
  .hero-diagram { display: none; }
  .plate > div { flex: 1 1 45%; border-bottom: 1px solid var(--line); }
  .step { grid-template-columns: 46px minmax(0, 1fr); gap: 0 12px; }
  .step-badge span { width: 46px; height: 38px; font-size: 1.1rem; }
  .steps::before { left: 18px; }
  .cv-three { grid-template-columns: minmax(0, 1fr); }
  .cv-pair { grid-template-columns: minmax(0, 1fr); }
  .bit { grid-template-columns: auto 1fr; }
  .bit > span:last-child { grid-column: 2; }
  .plug-cards, .sw-cards, .cat-list { grid-template-columns: minmax(0, 1fr); }
  .spec { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .spec dd { margin-bottom: 8px; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); }
  .bigsearch-row { flex-wrap: wrap; }
  .bigsearch-pre { display: none; }
  .btn-go { flex: 1 1 100%; border-radius: 0 0 3px 3px; }
  .lcd { font-size: 1.15rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  .card a, .cat-tile, .tool-tile, .btn { transition: background-color .15s, border-color .15s, color .15s; }
}

/* ------------------------------------------------------------------ print */
@media print {
  @page { margin: 14mm 14mm 16mm; }
  body { background: #fff !important; color: #000; font-size: 11pt; line-height: 1.45; }
  .site-head, .site-foot, .skip, .guide-actions, .jump, .guide-side, .helpful, .report, .related, .tags, .step-next, .need-list .amz, .amz-note, .crumbs, .pager, .bigsearch, .notice-i, .chip-nav, .cv-form button, .steps::before { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  h1, h2, h3, h4, .kicker, .lead, .plate dd, .panel-h, .step-h, .card-t { color: #000 !important; }
  .guide-head { background: none; border-bottom: 2px solid #000; padding: 0 0 10px; }
  .plate, .panel, .cv-card, .cv-out, .faq details, .table-wrap, .diagram { background: #fff !important; border-color: #000 !important; }
  .plate dt, .muted, .ro-note, .card-s { color: #333 !important; }
  .lcd, .lcd-sm, .step-badge span, .tool-lcd { background: #fff !important; color: #000 !important; border-color: #000 !important; text-shadow: none !important; }
  .cvn { color: #000; }
  .guide-layout { display: block; padding-top: 12px; }
  .panel { break-inside: avoid; }
  .step { break-inside: avoid; border-bottom: 1px solid #999; }
  .faq details > * { display: block; }
  .faq summary::after { content: none !important; }
  .faq-a { display: block !important; }
  .faq details::details-content { content-visibility: visible; display: block; }
  .callout { background: #fff; border: 1px solid #000; border-left-width: 4px; }
  a { color: #000; text-decoration: none; }
  .step-body a[data-url]::after, .extra a[data-url]::after, .faq-a a[data-url]::after { content: " (" attr(data-url) ")"; font-size: 9pt; }
  .md-table th, .ref-table th, .st-table th { background: #fff !important; color: #000 !important; }
  .md-table th, .md-table td, .ref-table th, .ref-table td { border-color: #000; }
  .notice { background: #fff; border: 1px solid #000; font-size: 9pt; color: #000; }
  .print-foot { display: block; font-size: 9pt; border-top: 1px solid #000; padding-top: 6px; margin-top: 12px; }
  .diagram { break-inside: avoid; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .diagram svg { background: #0b1015; }
  .diagram figcaption { color: #000; }
  .aspect, .lamp, .led { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* additions: guide SVG diagrams, software flags, wire colour swatches */
.diagram-svg { padding: 14px; color: #c9d6e0; }
.diagram-svg svg { display: block; width: 100%; height: auto; }
.flag { display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; font-family: var(--mono); font-size: .78rem; font-weight: 400; color: var(--red); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line2); vertical-align: -2px; background: #666; }
.swatch[data-c="red"] { background: #e23b3b; } .swatch[data-c="black"] { background: #000; } .swatch[data-c="orange"] { background: #f08a24; }
.swatch[data-c="grey"], .swatch[data-c="gray"] { background: #8a8f94; } .swatch[data-c="white"] { background: #fff; } .swatch[data-c="yellow"] { background: #f2d33d; }
.swatch[data-c="green"] { background: #2fb35c; } .swatch[data-c="blue"] { background: #3a7be0; } .swatch[data-c="violet"], .swatch[data-c="purple"] { background: #8a4fd6; }
.swatch[data-c="brown"] { background: #7a4a21; }
.cvt td:first-child { white-space: nowrap; }
@media print { .diagram-svg { color: #000; } .diagram-own { background: #fff !important; } }
.swatch[data-c="black-white-stripe"] { background: repeating-linear-gradient(45deg, #000 0 3px, #fff 3px 6px); }
.swatch[data-c="brown-or-violet"], .swatch[data-c="violet-or-brown"] { background: linear-gradient(90deg, #7a4a21 50%, #8a4fd6 50%); }
.diagram-svg text { font-family: var(--mono); }
