/* Legion Brothers — powder-coat graphite, steel plates, butterfly yellow. */
:root {
  --graphite: #171B21;
  --panel: #222832;
  --panel-2: #2B323D;
  --line: #343C48;
  --steel: #E6E9ED;
  --steel-shadow: #C9CED6;
  --text: #EDEFF2;
  --muted: #A2ABB7;
  --yellow: #FFE01B;
  --yellow-deep: #F5C400;
  --red: #E3141B;
  --ink: #171B21;

  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Source Serif 4", Georgia, serif;
  --wrap: 1200px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius-plate: 6px;
  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: clamp(1.75rem, 1.2rem + 2vw, 2.441rem);
  --step-4: clamp(2.1rem, 1.2rem + 3.6vw, 3.6rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0; background: var(--graphite); color: var(--text);
  font-family: var(--font); font-size: var(--step-0); line-height: 1.6;
  font-variation-settings: "wdth" 100;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-color: var(--yellow); text-underline-offset: 3px; }
a:hover { color: var(--yellow); }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 {
  font-family: var(--font); font-variation-settings: "wdth" 118; font-weight: 700;
  line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 0.5em; text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; max-width: 68ch; }
.lede { font-size: var(--step-1); color: var(--muted); line-height: 1.5; max-width: 60ch; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--yellow); color: var(--ink); padding: .5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; padding: .75rem 1.4rem; border-radius: 3px; border: 2px solid transparent;
  font: 600 var(--step-0)/1.2 var(--font); font-variation-settings: "wdth" 105;
  text-decoration: none; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s;
}
.btn-primary { background: var(--yellow); color: var(--ink); }
.btn-primary:hover { background: var(--yellow-deep); color: var(--ink); }
.btn-ghost { border-color: var(--line); color: var(--text); background: transparent; }
.btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.text-link { font-weight: 600; text-decoration: underline; text-decoration-color: var(--yellow); text-decoration-thickness: 2px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50; background: rgba(23, 27, 33, .92);
  backdrop-filter: blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s, padding .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; min-height: 76px; transition: min-height .2s; }
.site-header.is-scrolled .header-row { min-height: 62px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; }
.brand:hover { color: inherit; }
.brand-mark { width: 44px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; color: #fff; letter-spacing: .005em; }
.brand-tag { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: .82rem; color: var(--yellow); }
.site-nav { display: flex; align-items: center; gap: 1.75rem; }
.site-nav > ul { display: flex; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { text-decoration: none; font-weight: 500; }
.site-nav > ul > li > a { padding: .5rem 0; display: inline-block; border-bottom: 2px solid transparent; }
.site-nav > ul > li > a[aria-current="page"] { border-bottom-color: var(--yellow); }
.has-menu { position: relative; }
.menu {
  position: absolute; top: 100%; left: -1rem; min-width: 280px; list-style: none; margin: 0; padding: .5rem 0;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  opacity: 0; visibility: hidden; transform: translateY(4px); transition: opacity .15s, transform .15s, visibility .15s;
}
.has-menu:hover .menu, .has-menu:focus-within .menu, .has-menu.is-open .menu { opacity: 1; visibility: visible; transform: none; }
.menu a { display: block; padding: .55rem 1rem; }
.menu a:hover { background: var(--panel-2); }
.nav-cta { min-height: 42px; padding: .55rem 1.1rem; }
.nav-toggle { display: none; }

@media (max-width: 1180px) {
  .nav-toggle {
    display: inline-flex; width: 48px; height: 48px; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--line); border-radius: 3px; color: var(--text); cursor: pointer;
  }
  .bars, .bars::before, .bars::after { display: block; width: 20px; height: 2px; background: currentColor; position: relative; }
  .bars::before, .bars::after { content: ""; position: absolute; left: 0; }
  .bars::before { top: -6px; } .bars::after { top: 6px; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 1rem;
    padding: 1rem var(--gutter) 1.5rem; background: var(--graphite); border-bottom: 1px solid var(--line);
    display: none;
  }
  .site-nav.is-open { display: flex; }
  html:not(.js) .site-nav { display: flex; position: static; }
  .site-nav > ul { flex-direction: column; gap: 0; }
  .site-nav > ul > li > a { padding: .75rem 0; display: block; }
  .menu { position: static; opacity: 1; visibility: visible; transform: none; border: 0; background: none; padding: 0 0 .5rem 1rem; min-width: 0; }
  .menu a { padding: .4rem 0; color: var(--muted); }
  .brand-name { font-size: 1.2rem; }
}

/* Hero: the scope trace is the signature moment */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); border-bottom: 1px solid var(--line); }
.hero-watermark { position: absolute; right: -8%; top: -10%; width: min(70vw, 780px); opacity: .05; pointer-events: none; transform: rotate(-8deg); }
.hero-grid { position: relative; display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 1.3rem + 3.6vw, 4.1rem); font-variation-settings: "wdth" 122; max-width: 15ch; }
.hero-kicker { color: var(--yellow); font-weight: 600; margin-bottom: 1.25rem; font-variation-settings: "wdth" 110; }
.scope { margin: 0; background: #0F1216; border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem .9rem; box-shadow: inset 0 0 60px rgba(255, 224, 27, .03); }
.scope-head { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: var(--step--1); margin-bottom: .5rem; font-variant-numeric: tabular-nums; }
.scope svg { width: 100%; height: auto; display: block; overflow: visible; }
.scope .grid line { stroke: #232A33; stroke-width: 1; }
.scope .tdc { stroke: #3A4350; stroke-dasharray: 4 5; }
.scope .axis { fill: var(--muted); font: 500 13px var(--font); }
.trace-motored { fill: none; stroke: #59636F; stroke-width: 2; stroke-dasharray: 6 6; }
.trace-fired { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 224, 27, .45)); }
.trace-peak { fill: var(--red); }
.scope figcaption { color: var(--muted); font-size: var(--step--1); margin-top: .6rem; }
html.js .trace-fired { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 2.4s cubic-bezier(.45, .05, .25, 1) .35s forwards; }
html.js .trace-peak { opacity: 0; animation: blip .5s ease-out 2.5s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes blip { 0% { opacity: 0; r: 1; } 60% { opacity: 1; r: 9; } 100% { opacity: 1; r: 5; } }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } }

/* Sections */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-tight { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section + .section:not(.cta-band):not(.capability) { padding-top: 0; }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .5rem 2rem; margin-bottom: 2rem; }
.section-head h2 { margin: 0; }
.section-head h2 a { text-decoration: none; }
.section-head p { color: var(--muted); margin: 0; max-width: 56ch; }
.sub-h { font-size: var(--step-1); margin: 2.5rem 0 1rem; font-variation-settings: "wdth" 110; }
.sub-h:first-child { margin-top: 0; }
.sub-h a { text-decoration: none; }

/* Steel plates hold the white-background rig photos */
.plate {
  background: linear-gradient(180deg, #F1F3F5 0%, var(--steel) 100%);
  border-radius: var(--radius-plate); aspect-ratio: 650 / 560; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 -1px 0 var(--steel-shadow);
}
.plate img { width: 92%; height: 92%; object-fit: contain; mix-blend-mode: multiply; transition: transform .35s ease; }
.plate-empty { color: #7A838F; font-size: var(--step--1); display: grid; justify-items: center; gap: .6rem; }
.plate-empty::before { content: ""; width: 34%; max-width: 160px; aspect-ratio: 700 / 590; background: url(/static/brand/butterfly.svg) center / contain no-repeat; opacity: .18; filter: grayscale(1); }
.plate-large:has(.plate-empty) { aspect-ratio: 650 / 380; }

/* Families on home */
.families { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.25rem; }
.family { grid-column: span 2; }
.family-lead { grid-column: span 4; grid-row: span 2; }
.family:nth-child(2) { grid-column: span 2; }
.family:nth-child(4), .family:nth-child(5) { grid-column: span 3; }
.family a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--panel); border-radius: 8px; padding: .75rem; border: 1px solid transparent; transition: border-color .2s; }
.family a:hover { border-color: var(--yellow); color: inherit; }
.family a:hover .plate img { transform: scale(1.03); }
.family-lead .plate { flex: 1; aspect-ratio: auto; min-height: 320px; }
.family-text { padding: 1rem .5rem .5rem; }
.family-text h3 { margin-bottom: .35rem; }
.family-text p { color: var(--muted); font-size: var(--step--1); margin-bottom: .75rem; }
.count { font-size: var(--step--1); font-weight: 600; color: var(--yellow); }
@media (max-width: 860px) {
  .families { grid-template-columns: 1fr 1fr; }
  .family, .family-lead, .family:nth-child(n) { grid-column: span 1; grid-row: auto; }
  .family-lead { grid-column: span 2; }
  .family-lead .plate { min-height: 220px; }
}
@media (max-width: 520px) { .families { grid-template-columns: 1fr; } .family-lead { grid-column: span 1; } }

/* Capability */
.capability { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.capability-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.points { margin: 0; display: grid; gap: 0; }
.points > div { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.points > div:last-child { border-bottom: 1px solid var(--line); }
.points dt { font-weight: 700; font-variation-settings: "wdth" 112; font-size: var(--step-1); margin-bottom: .2rem; }
.points dd { margin: 0; color: var(--muted); }
@media (max-width: 860px) { .capability-grid { grid-template-columns: 1fr; } }

/* Product grid */
.plate-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.75rem 1.25rem; }
.plate-card a { display: block; text-decoration: none; }
.plate-card a:hover { color: inherit; }
.plate-card a:hover .plate img { transform: scale(1.04); }
.plate-card a:hover .card-name { text-decoration: underline; text-decoration-color: var(--yellow); }
.code { display: block; color: var(--yellow); font-weight: 600; font-size: var(--step--1); font-variant-numeric: tabular-nums; font-variation-settings: "wdth" 90; margin: .85rem 0 .2rem; letter-spacing: .02em; }
.card-name { display: block; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }

/* Page heads & breadcrumbs */
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 clamp(1.5rem, 4vw, 2.5rem); border-bottom: 1px solid var(--line); }
.page-head h1 { max-width: 22ch; overflow-wrap: break-word; }
.crumbs { display: flex; flex-wrap: wrap; gap: .4rem; color: var(--muted); font-size: var(--step--1); margin-bottom: 1.25rem; }
.crumbs a { text-decoration: none; display: inline-flex; align-items: center; min-height: 24px; }
.crumbs a:hover { text-decoration: underline; }
.subnav { list-style: none; padding: 0; margin: 1.5rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.subnav a { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--line); border-radius: 3px; text-decoration: none; font-size: var(--step--1); font-weight: 500; }
.subnav a[aria-current="page"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }

/* Product page */
.product-head { border-bottom: 0; padding-bottom: 0; }
.product-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.plate-large { aspect-ratio: 650 / 600; }
.product-info h1 { font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.6rem); max-width: none; }
.product-info .code { margin-top: 0; font-size: var(--step-0); }
.contact-line { color: var(--muted); font-size: var(--step--1); margin-top: 1.25rem; }
.detail-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.prose h2 { font-size: var(--step-2); margin-top: 1.5em; }
.prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose li::marker { color: var(--yellow); }
.experiments { padding-left: 0; list-style: none; counter-reset: exp; display: grid; gap: .5rem; }
.experiments li { counter-increment: exp; display: grid; grid-template-columns: 2.2rem 1fr; align-items: baseline; margin: 0; padding: .65rem .9rem; background: var(--panel); border-radius: 4px; }
.experiments li::before { content: counter(exp); font-weight: 700; color: var(--yellow); font-variant-numeric: tabular-nums; }
.spec-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); margin-bottom: .75rem; }
.spec-table th, .spec-table td { text-align: left; vertical-align: top; padding: .55rem .75rem .55rem 0; border-top: 1px solid var(--line); }
.spec-table th { font-weight: 600; width: 34%; color: var(--text); font-variation-settings: "wdth" 105; }
.spec-table tr:not(.group-start) td { border-top-color: transparent; }
.spec-table .spec-label { color: var(--muted); width: 26%; }
.spec-note { color: var(--muted); font-size: var(--step--1); }
@media (max-width: 520px) {
  .spec-table, .spec-table tbody, .spec-table tr { display: block; }
  .spec-table tr { display: grid; grid-template-columns: 40% 1fr; }
  .spec-table th { display: block; width: auto; grid-column: 1 / -1; padding-top: .9rem; }
  .spec-table td[colspan] { grid-column: 1 / -1; }
  .spec-table tr:not(.group-start) td { border-top: 0; }
  .spec-table td, .spec-table .spec-label { width: auto; }
}
.quote-box { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: clamp(1.25rem, 3vw, 2rem); position: sticky; top: 90px; }
.quote-box h2 { font-size: var(--step-2); }
.quote-box > p { color: var(--muted); }
.related { border-top: 1px solid var(--line); padding-top: clamp(2.5rem, 5vw, 3.5rem) !important; }
@media (max-width: 860px) {
  .product-grid, .detail-grid { grid-template-columns: 1fr; }
  .quote-box { position: static; }
}

/* Forms */
.quote-form { display: grid; gap: 1rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.quote-form label { display: grid; gap: .35rem; font-size: var(--step--1); font-weight: 600; }
.quote-form input, .quote-form textarea {
  width: 100%; font: 400 var(--step-0)/1.4 var(--font); color: var(--text); background: var(--graphite);
  border: 1px solid var(--line); border-radius: 3px; padding: .75rem .85rem; min-height: 48px;
}
.quote-form input:focus, .quote-form textarea:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--yellow); }
.quote-form .btn { justify-self: start; }
.hp { position: absolute; left: -9999px; }
.form-status { margin: 0; font-weight: 600; min-height: 1.5em; }
.form-status.is-ok { color: var(--yellow); }
.form-status.is-error { color: #FF8A8E; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

/* CTA band */
.cta-band { background: var(--yellow); color: var(--ink); }
.cta-band a:hover { color: var(--ink); }
.cta-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; }
.cta-band h2 { margin-bottom: .3em; }
.cta-band p { margin: 0; }
.cta-band .actions { margin-top: 0; }
.cta-band .btn-primary { background: var(--ink); color: var(--yellow); }
.cta-band .btn-primary:hover { background: #000; color: var(--yellow); }
.cta-band .btn-ghost { border-color: var(--ink); color: var(--ink); }
.cta-band .btn-ghost:hover { background: var(--ink); color: var(--yellow); }

/* Downloads table */
.sheet-table { width: 100%; border-collapse: collapse; margin-bottom: 1rem; }
.sheet-table th { text-align: left; font-size: var(--step--1); color: var(--muted); font-weight: 500; padding: .5rem .75rem; border-bottom: 1px solid var(--line); }
.sheet-table td { padding: .8rem .75rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.sheet-table td.code { margin: 0; display: table-cell; white-space: nowrap; }
.sheet-table td a { text-decoration: none; }
.sheet-table td a:hover { text-decoration: underline; }
.sheet-table .dl { text-align: right; white-space: nowrap; }
.sheet-table .dl a { color: var(--yellow); font-weight: 600; }
@media (max-width: 600px) {
  .sheet-table thead { display: none; }
  .sheet-table tr { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .sheet-table td { border: 0; padding: 0; }
  .sheet-table .dl { grid-column: 2; text-align: left; }
}

/* Contact, clients, empty states */
.contact-info h2 { font-size: var(--step-1); margin-top: 1.75rem; }
.contact-info h2:first-child { margin-top: 0; }
.contact-info address { font-style: normal; color: var(--muted); max-width: 40ch; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: .35rem; }
.empty { color: var(--muted); font-size: var(--step-1); }
.client-list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.client-list li { background: var(--panel); border-radius: 6px; padding: 1.25rem; display: grid; gap: .25rem; }
.client-list img { max-height: 56px; width: auto; margin-bottom: .5rem; }
.client-name { font-weight: 600; }
.client-loc { color: var(--muted); font-size: var(--step--1); }

/* Buying, research, support, installations */
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; margin: 1.5rem 0 0; }
.routes > div { background: var(--panel); border-radius: 6px; padding: 1.25rem 1.25rem 1rem; border-top: 3px solid var(--yellow); }
.routes dt { font-weight: 700; font-size: var(--step-1); font-variation-settings: "wdth" 110; margin-bottom: .4rem; }
.routes dd { margin: 0; color: var(--muted); }
.reg-list { display: flex; flex-wrap: wrap; gap: 1rem 3rem; margin: 1rem 0 0; }
.reg-list dt { color: var(--muted); font-size: var(--step--1); }
.reg-list dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.sheet-table .dl-secondary { color: var(--muted); font-weight: 500; font-size: var(--step--1); }
.note-line { color: var(--muted); margin-top: 1.5rem; }
.pub-list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: 1rem; }
.pub-list li { display: grid; gap: .2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.pub-list a, .pub-title { font-weight: 600; }
.pub-meta { color: var(--muted); font-size: var(--step--1); }
.install-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.install { background: var(--panel); border-radius: 8px; overflow: hidden; }
.install-photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.install-text { padding: 1rem 1.25rem 1.25rem; }
.install-text h2 { font-size: var(--step-1); margin-bottom: .2rem; }
.install-meta { color: var(--muted); font-size: var(--step--1); }
.menu-sep { border-top: 1px solid var(--line); margin-top: .35rem; padding-top: .35rem; }
.quote-form select {
  width: 100%; font: 400 var(--step-0)/1.4 var(--font); color: var(--text); background: var(--graphite);
  border: 1px solid var(--line); border-radius: 3px; padding: .75rem .85rem; min-height: 48px;
}
.quote-form select:focus { outline: 2px solid var(--yellow); outline-offset: 0; border-color: var(--yellow); }

/* Footer */
.site-footer { background: #12151A; border-top: 1px solid var(--line); padding: clamp(3rem, 6vw, 4.5rem) 0 1.5rem; color: var(--muted); font-size: var(--step--1); }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.3fr; gap: 2rem; }
.footer-logo { margin-bottom: 1.25rem; }
.footer-logo .brand-mark { width: 64px; }
.footer-logo .brand-name { font-size: 1.75rem; }
.footer-logo .brand-tag { font-size: .95rem; }
.site-footer .footer-logo:hover { text-decoration: none; }
.footer-h { font-size: var(--step-0); color: var(--text); font-variation-settings: "wdth" 105; margin-bottom: .75rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: .4rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; line-height: 1.7; }
.footer-base { margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.footer-base p { margin: 0; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

/* Scroll reveal: content is visible unless JS is running (html.js) */
html.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html.js .reveal { opacity: 1; transform: none; }
  html.js .trace-fired { stroke-dashoffset: 0; }
  html.js .trace-peak { opacity: 1; }
}

/* ===== Self-Study Programme (SSP) ===== */
:root { --c-air: #4DA3FF; --c-fuel: #FF9F1C; --c-exhaust: #FF5A5F; --c-water: #2BD67B; --c-signal: #B48CFF; }
.ssp-no { display: inline-block; font-weight: 700; color: var(--ink); background: var(--yellow); padding: .15rem .55rem; border-radius: 3px; font-size: var(--step--1); font-variation-settings: "wdth" 110; }
.ssp-cover h1 { margin: .75rem 0 .1rem; max-width: 20ch; }
.ssp-sub { font-size: var(--step-2); color: var(--yellow); font-weight: 600; margin-bottom: 1.25rem; }
.ssp-applies { color: var(--muted); font-size: var(--step--1); margin-top: 1.5rem; max-width: none; }
.ssp-applies a { color: var(--text); }
.ssp-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 3rem; padding-top: 2.5rem; padding-bottom: 4rem; }
.ssp-toc ol { position: sticky; top: 96px; list-style: none; padding: 0; margin: 0; counter-reset: toc; border-left: 1px solid var(--line); }
.ssp-toc li { counter-increment: toc; }
.ssp-toc a { display: block; padding: .45rem 0 .45rem 1rem; text-decoration: none; color: var(--muted); font-size: var(--step--1); border-left: 2px solid transparent; margin-left: -1px; }
.ssp-toc a::before { content: counter(toc) "  "; color: var(--yellow); font-weight: 700; }
.ssp-toc a:hover { color: var(--text); border-left-color: var(--yellow); }
.ssp-ch { padding: 0 0 3.5rem; margin-bottom: 3.5rem; border-bottom: 1px solid var(--line); scroll-margin-top: 90px; }
.ch-no { color: var(--yellow); font-weight: 600; margin-bottom: .25rem; }
.ssp-ch > p { max-width: 70ch; }
@media (max-width: 960px) { .ssp-layout { grid-template-columns: 1fr; } .ssp-toc { display: none; } }

/* rig schematic */
.diagram { margin: 1.5rem 0 1rem; background: #0F1216; border: 1px solid var(--line); border-radius: 8px; padding: 1rem; }
.rig { width: 100%; height: auto; display: block; }
.rig .part rect, .rig .part circle { fill: #222832; stroke: #5A6472; stroke-width: 1.5; transition: fill .15s, stroke .15s; }
.rig .part .glass { fill: #1B2733; }
.rig .part .sensor, .rig .part .sensor-box { fill: #33204A; stroke: var(--c-signal); }
.rig .part .orifice { fill: #12263B; stroke: var(--c-air); }
.rig text { fill: var(--text); font: 600 14px var(--font); text-anchor: middle; pointer-events: none; }
.rig text.small { fill: var(--muted); font-weight: 400; font-size: 12px; }
.rig .line { fill: none; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s; }
.rig .air { stroke: var(--c-air); } .rig .fuel { stroke: var(--c-fuel); } .rig .exhaust { stroke: var(--c-exhaust); } .rig .water { stroke: var(--c-water); }
.rig .signal { stroke: var(--c-signal); stroke-width: 2; stroke-dasharray: 5 5; }
.rig .callout circle { fill: var(--yellow); stroke: #0F1216; stroke-width: 2; }
.rig .callout text { fill: var(--ink); font-size: 12px; font-weight: 700; }
.rig .callout { cursor: pointer; }
html.ssp-js [data-rig="explore"] .part { cursor: pointer; }
html.ssp-js [data-rig="explore"] .part:hover rect, html.ssp-js [data-rig="explore"] .part:hover circle,
.rig .part.is-active rect, .rig .part.is-active circle { stroke: var(--yellow); stroke-width: 3; }
.rig .part:focus { outline: none; }
.rig .part:focus-visible rect, .rig .part:focus-visible circle { stroke: var(--yellow); stroke-width: 3; }
.legend { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; margin-top: .75rem; font-size: var(--step--1); color: var(--muted); }
.lg::before { content: ""; display: inline-block; width: 22px; height: 4px; border-radius: 2px; vertical-align: middle; margin-right: .45rem; }
.lg.air::before { background: var(--c-air); } .lg.fuel::before { background: var(--c-fuel); } .lg.exhaust::before { background: var(--c-exhaust); }
.lg.water::before { background: var(--c-water); } .lg.signal::before { background: repeating-linear-gradient(90deg, var(--c-signal) 0 5px, transparent 5px 9px); }
.parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .75rem; margin: 1.25rem 0 0; }
.parts > div { background: var(--panel); border-radius: 6px; padding: .9rem 1rem; border: 1px solid transparent; transition: border-color .15s; }
.parts > div.is-active { border-color: var(--yellow); }
.parts dt { font-weight: 700; margin-bottom: .3rem; }
.parts dt b { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--yellow); color: var(--ink); font-size: .8rem; margin-right: .4rem; }
.parts dd { margin: 0; color: var(--muted); font-size: var(--step--1); }

/* chapter 2 flows */
.flow-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.flow-tabs button { font: 600 var(--step--1) var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 3px; padding: .55rem .9rem; cursor: pointer; min-height: 40px; }
.flow-tabs button[aria-selected="true"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
[data-rig="flows"][data-focus="air"] .flow:not([data-flow="air"]),
[data-rig="flows"][data-focus="fuel"] .flow:not([data-flow="fuel"]),
[data-rig="flows"][data-focus="signals"] .flow:not([data-flow="signals"]),
[data-rig="flows"][data-focus="exhaust"] .flow:not([data-flow="exhaust"]),
[data-rig="flows"][data-focus="water"] .flow:not([data-flow="water"]) { opacity: .1; }
[data-rig="flows"] .callout { display: none; }
.flow-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.note { background: var(--panel); border-radius: 6px; padding: .9rem 1rem; border-left: 4px solid; transition: opacity .2s; }
.note h3 { font-size: var(--step-0); margin-bottom: .3rem; }
.note p { color: var(--muted); font-size: var(--step--1); margin: 0; }
.note.air { border-color: var(--c-air); } .note.fuel { border-color: var(--c-fuel); } .note.exhaust { border-color: var(--c-exhaust); }
.note.water { border-color: var(--c-water); } .note.signal { border-color: var(--c-signal); }
.note.is-dim { opacity: .3; }

/* chapter 3 stepper */
.stepper { list-style: none; padding: 0; margin: 1.5rem 0 0; counter-reset: st; display: grid; gap: .6rem; }
.stepper li { counter-increment: st; position: relative; padding: 1rem 1.1rem 1rem 3.6rem; background: var(--panel); border-radius: 6px; }
.stepper li::before { content: counter(st); position: absolute; left: 1rem; top: 1rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: var(--line); color: var(--text); font-weight: 700; }
.stepper h3 { font-size: var(--step-0); margin-bottom: .25rem; }
.stepper p { margin: 0; color: var(--muted); font-size: var(--step--1); }
html.ssp-js .stepper.is-stepped li { cursor: pointer; }
html.ssp-js .stepper.is-stepped li:not(.is-current) p { display: none; }
html.ssp-js .stepper.is-stepped li.is-current { outline: 2px solid var(--yellow); }
html.ssp-js .stepper.is-stepped li.is-current::before, html.ssp-js .stepper.is-stepped li.is-done::before { background: var(--yellow); color: var(--ink); }
.stepper-nav { display: none; align-items: center; gap: 1rem; margin-top: 1rem; }
html.ssp-js .stepper-nav { display: flex; }
.stepper-nav span { color: var(--muted); font-size: var(--step--1); }
.stepper-nav .btn:disabled { opacity: .4; cursor: default; }

/* chapter 4 calculator */
.calc { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1.5rem; margin-top: 1.5rem; align-items: start; }
.calc-inputs { background: var(--panel); border-radius: 8px; padding: 1.1rem; display: grid; gap: .55rem; }
.calc-inputs h3 { font-size: var(--step-0); margin-bottom: .25rem; }
.calc-inputs label { display: grid; grid-template-columns: 1fr 96px; align-items: center; gap: .5rem; font-size: .8rem; color: var(--muted); }
.calc-inputs i { font-style: normal; opacity: .8; }
.calc-inputs input { width: 100%; font: 500 .9rem var(--font); color: var(--text); background: var(--graphite); border: 1px solid var(--line); border-radius: 3px; padding: .4rem .5rem; min-height: 36px; font-variant-numeric: tabular-nums; }
.calc-inputs input:focus { outline: 2px solid var(--yellow); border-color: var(--yellow); }
.calc-inputs .btn { margin-top: .5rem; min-height: 40px; }
.calc-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.result { background: var(--panel); border-radius: 8px; padding: 1rem 1.1rem; border-top: 3px solid var(--yellow); }
.result h3 { font-size: var(--step-0); margin-bottom: .35rem; }
.result .formula { color: var(--muted); font-size: .82rem; line-height: 1.55; margin-bottom: .6rem; }
.result .value { font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; font-variation-settings: "wdth" 110; }
.result-wide { grid-column: 1 / -1; }
.heat-bar { display: flex; height: 26px; border-radius: 4px; overflow: hidden; background: var(--line); }
.hb { display: block; height: 100%; transition: width .3s; }
.hb-bp { background: var(--yellow); } .hb-jacket { background: var(--c-water); } .hb-exhaust { background: var(--c-exhaust); } .hb-unaccounted { background: #6B7480; }
.heat-legend { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; font-size: var(--step--1); color: var(--muted); }
.heat-legend b { color: var(--text); font-variant-numeric: tabular-nums; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.tip { margin-top: 1.25rem; background: #1D2229; border-left: 4px solid var(--yellow); border-radius: 4px; padding: .9rem 1.1rem; color: var(--muted); font-size: var(--step--1); }
.tip b { color: var(--yellow); margin-right: .4rem; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }

/* chapter 5/6 cycle */
.cycle { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 1.25rem; margin-top: 1.5rem; align-items: start; }
.crank { width: 150px; background: #0F1216; border: 1px solid var(--line); border-radius: 8px; padding: .5rem; }
.crank .cyl { fill: none; stroke: #5A6472; stroke-width: 3; }
.crank .piston { fill: #8A94A1; }
.crank .rod { stroke: var(--yellow); stroke-width: 6; stroke-linecap: round; }
.crank .crank-circle { fill: none; stroke: #3A4350; stroke-width: 2; stroke-dasharray: 4 4; }
.crank .crank-pin { fill: var(--yellow); } .crank .crank-centre { fill: #8A94A1; }
.cycle-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; }
.chart { margin: 0; background: #0F1216; border: 1px solid var(--line); border-radius: 8px; padding: .75rem; }
.chart figcaption { color: var(--muted); font-size: var(--step--1); margin-bottom: .4rem; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axes line { stroke: #3A4350; stroke-width: 1.5; }
.chart .axes .tdc { stroke-dasharray: 4 5; }
.chart .axes text { fill: var(--muted); font: 500 14px var(--font); }
.chart .fired { fill: none; stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; }
.chart .motored, .chart .baseline { fill: none; stroke: #6B7480; stroke-width: 2; stroke-dasharray: 6 6; }
.chart .marker { fill: var(--red); stroke: #fff; stroke-width: 2; }
.cycle-controls, .explore-controls { grid-column: 1 / -1; display: grid; gap: .75rem; }
.cycle-controls label, .explore-controls label { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 1rem; font-weight: 600; }
.cycle-controls output, .explore-controls output { display: block; color: var(--yellow); font-variant-numeric: tabular-nums; font-weight: 700; }
input[type="range"] { width: 100%; accent-color: var(--yellow); min-height: 32px; }
.readout { color: var(--muted); margin: 0; min-height: 3em; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.kv > div { background: var(--panel); border-radius: 6px; padding: .8rem 1rem; }
.kv dt { color: var(--muted); font-size: var(--step--1); }
.kv dd { margin: .2rem 0 0; font-weight: 600; }
.variant-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.variant-grid h3 { color: var(--yellow); }
.variant-grid p { color: var(--muted); }
.explore { margin-top: 1rem; display: grid; gap: 1rem; }
.model-note { color: var(--muted); font-size: var(--step--1); margin: 0; }
@media (max-width: 700px) {
  .cycle { grid-template-columns: 1fr; } .crank { width: 120px; margin: 0 auto; }
  .variant-grid { grid-template-columns: 1fr; }
  .cycle-controls label, .explore-controls label { grid-template-columns: 1fr; gap: .3rem; }
}

/* chapter 7 quiz */
.quiz { padding-left: 1.25rem; display: grid; gap: 1.25rem; margin-top: 1.5rem; }
.quiz .q-text { font-weight: 600; margin-bottom: .6rem; }
.q-options { list-style: none; padding: 0; margin: 0; display: grid; gap: .4rem; }
.q-options button { width: 100%; text-align: left; font: 500 var(--step-0) var(--font); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: .65rem .9rem; cursor: pointer; min-height: 44px; }
.q-options button:hover { border-color: var(--yellow); }
.q.is-answered button { cursor: default; }
.q-options button.is-right { border-color: var(--c-water); background: #13301F; }
.q-options button.is-wrong { border-color: var(--c-exhaust); background: #3A1719; }
.q-explain { margin: .6rem 0 0; color: var(--muted); font-size: var(--step--1); }
.quiz-score { font-weight: 700; color: var(--yellow); margin-top: 1rem; }
.print-only { display: none; }

/* learn index + product link */
.ssp-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.ssp-card a { display: grid; gap: .5rem; height: 100%; padding: 1.5rem; background: var(--panel); border-radius: 8px; text-decoration: none; border: 1px solid transparent; border-top: 4px solid var(--yellow); }
.ssp-card a:hover { border-color: var(--yellow); color: inherit; }
.ssp-card-title { font-size: var(--step-2); font-weight: 700; line-height: 1.2; font-variation-settings: "wdth" 115; }
.ssp-card-sub { color: var(--yellow); font-weight: 600; }
.ssp-card-text { color: var(--muted); font-size: var(--step--1); }
.ssp-card .ssp-no { justify-self: start; }
.ssp-link { display: flex; align-items: center; gap: .75rem; margin: 0 0 1.75rem; padding: .9rem 1rem; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; text-decoration: none; font-weight: 600; }
.ssp-link:hover { border-color: var(--yellow); color: var(--text); }

/* ===== Print: SSP as a booklet ===== */
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  :root { --graphite: #fff; --panel: #F2F4F6; --panel-2: #E9ECEF; --line: #C9CED6; --text: #111; --muted: #444; --yellow: #B88A00; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  .site-header, .site-footer, .no-print, .skip, .ssp-end, .crumbs { display: none !important; }
  .print-only { display: block; }
  .ssp-layout { display: block; padding: 0; }
  .ssp-ch { break-before: page; border: 0; padding: 0; margin: 0; }
  .ssp-cover { border: 0; padding: 30mm 0 0; }
  .ssp-cover .ssp-no { background: #FFE01B; color: #111; }
  .ssp-sub { color: #B88A00; }
  .diagram, .chart, .crank { background: #fff; border-color: #C9CED6; }
  .rig .part rect, .rig .part circle { fill: #F2F4F6; stroke: #555; }
  .rig .part .glass { fill: #E3EAF2; }
  .rig text { fill: #111; } .rig text.small { fill: #555; }
  .rig .callout circle { fill: #FFE01B; stroke: #111; }
  .chart .fired { stroke: #C99700; } .chart .axes text { fill: #444; }
  .crank .rod, .crank .crank-pin { stroke: #C99700; fill: #C99700; }
  .stepper p, .q-explain { display: block !important; }
  .stepper li, .parts > div, .note, .result, .kv > div { break-inside: avoid; border-color: #C9CED6; }
  .calc { display: block; }
  .result .value { font-size: 15pt; }
  .q-options button { border: 1px solid #C9CED6; background: #fff; padding: .2rem .5rem; min-height: 0; }
  .quiz .q { break-inside: avoid; }
  .answers { break-before: avoid; margin-top: 1rem; font-size: 9.5pt; }
  a { color: #111; text-decoration: none; }
  .rig .flow, .note.is-dim { opacity: 1 !important; }
  .q-options button.is-right, .q-options button.is-wrong { background: #fff; border-color: #C9CED6; }
  .q-explain { display: none !important; }
  .tip { background: #F2F4F6; color: #333; }
  .stepper li.is-current { outline: 0 !important; }
}

/* SSP 02 */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1.25rem 0; }
.compare > div { background: var(--panel); border-radius: 8px; padding: 1.1rem 1.25rem; border-top: 3px solid var(--line); }
.compare > div.hl { border-top-color: var(--yellow); }
.compare ul { margin: .5rem 0 0; padding-left: 1.1rem; color: var(--muted); }
.compare li { margin-bottom: .35rem; }
@media (max-width: 700px) { .compare { grid-template-columns: 1fr; } }
.ecu-diagram svg { width: 100%; height: auto; display: block; }
.ecu-diagram rect { fill: #222832; stroke: #5A6472; stroke-width: 1.5; }
.ecu-diagram .ecu-blk rect { stroke: var(--yellow); stroke-width: 2.5; fill: #2A2410; }
.ecu-diagram .sensor-blk rect { stroke: var(--c-signal); }
.ecu-diagram .act-blk rect { stroke: var(--c-fuel); }
.ecu-diagram text { fill: var(--text); font: 600 14px var(--font); text-anchor: middle; }
.ecu-diagram text.small { fill: var(--muted); font-weight: 400; font-size: 12px; }
.ecu-diagram .col-h { fill: var(--yellow); font-size: 15px; }
.ecu-diagram .wire { fill: none; stroke: #5A6472; stroke-width: 2; }
.ecu-diagram .signal-wire { stroke: var(--c-signal); stroke-dasharray: 5 5; }
.ecu-diagram .blk { transition: opacity .2s; }
[data-kit-show="crdi"] .blk[data-in]:not([data-in~="crdi"]), [data-kit-show="gdi"] .blk[data-in]:not([data-in~="gdi"]),
[data-kit-show="pfi"] .blk[data-in]:not([data-in~="pfi"]), [data-kit-show="gas"] .blk[data-in]:not([data-in~="gas"]) { opacity: .15; }
.timeline { width: 100%; height: auto; display: block; }
.timeline .tl-stroke { fill: #1B2027; stroke: #2E3540; }
.timeline .tl-stroke-t { fill: var(--muted); font: 600 13px var(--font); text-anchor: middle; }
.timeline .tl-tdc { stroke: #3A4350; stroke-dasharray: 3 5; }
.timeline .tl-tdc.fire { stroke: var(--red); stroke-dasharray: none; opacity: .7; }
.timeline .tl-axis { fill: var(--muted); font: 500 11px var(--font); text-anchor: middle; }
.timeline .tl-row { fill: var(--muted); font: 600 11px var(--font); text-anchor: end; }
.timeline .tl-iv { fill: var(--c-air); opacity: .75; } .timeline .tl-ev { fill: var(--c-exhaust); opacity: .75; }
.timeline .tl-tooth { fill: var(--c-signal); } .timeline .tl-cam { fill: var(--c-air); }
.timeline .tl-gap { fill: var(--yellow); font: 600 10px var(--font); text-anchor: middle; }
.timeline .tl-inj { fill: var(--c-fuel); } .timeline .tl-spark { fill: var(--yellow); }
.timeline .tl-lbl { fill: var(--ink); font: 700 11px var(--font); }
.timeline .tl-cursor { stroke: var(--yellow); stroke-width: 2.5; }
.tune-controls { margin-top: .5rem; }
.tune-controls > div { display: grid; gap: .6rem; }
.kit-notes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .75rem; margin-top: 1rem; }
.calc-small { grid-template-columns: 300px minmax(0, 320px); }
@media print { .timeline .tl-stroke { fill: #F2F4F6; } .ecu-diagram rect { fill: #F2F4F6; } .ecu-diagram text, .timeline .tl-row, .timeline .tl-stroke-t { fill: #111; } .ecu-diagram .blk { opacity: 1 !important; } }
.tune-controls > div[hidden] { display: none; }
@media (max-width: 860px) { .calc-small { grid-template-columns: 1fr; } }
.timeline-fig { overflow: hidden; }
.timeline .tl-lbl-out { fill: var(--yellow); font: 700 11px var(--font); text-anchor: middle; }

/* SSP 03 */
.modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; margin: 1.25rem 0 2rem; }
.mode { background: var(--panel); border-radius: 8px; padding: 1.1rem 1.2rem; border-top: 4px solid; }
.mode p { color: var(--muted); font-size: var(--step--1); margin-bottom: .5rem; }
.mode .eq { color: var(--text); font-weight: 700; font-size: var(--step-0); margin: 0; }
.m-cond { border-color: var(--c-fuel); } .m-conv { border-color: var(--c-air); } .m-rad { border-color: var(--c-exhaust); }
@media (max-width: 700px) { .modes { grid-template-columns: 1fr; } }
.app-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .75rem; margin: 1rem 0; }
.app-map > div { background: var(--panel); border-radius: 6px; padding: .9rem 1rem; }
.app-map h4 { margin: 0 0 .4rem; color: var(--yellow); font-size: var(--step-0); }
.app-map ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }
.app-map a { text-decoration: none; font-size: var(--step--1); }
.app-map a:hover { text-decoration: underline; }
.app-map .code { display: inline; margin: 0 .3rem 0 0; }
.ht-split { grid-template-columns: 300px minmax(0, 1fr); }
.ht-split .explore-controls { grid-column: auto; }
.ht-split .explore-controls label { grid-template-columns: 1fr; gap: .3rem; }
.explore-controls select { width: 100%; font: 500 .9rem var(--font); color: var(--text); background: var(--graphite); border: 1px solid var(--line); border-radius: 3px; padding: .45rem .5rem; min-height: 38px; }
.chart .hx-hot { fill: none; stroke: var(--c-exhaust); stroke-width: 3; }
.chart .hx-cold { fill: none; stroke: var(--c-air); stroke-width: 3; }
@media (max-width: 860px) { .ht-split { grid-template-columns: 1fr; } }
@media print { .chart .hx-hot { stroke: #C62828; } .chart .hx-cold { stroke: #1565C0; } .mode, .app-map > div { background: #F2F4F6; } }
.ssp-sub { margin-top: 2.25rem; }
.calc + h3 { margin-top: 2.25rem; }

/* SSP 04 */
.rc-loop svg { max-width: 640px; }
.rc-loop text { fill: var(--text); font: 600 15px var(--font); }
.rc-loop .rc-lbl, .rc-loop .rc-heat { fill: var(--muted); font-weight: 500; font-size: 13px; }
.rc-box { fill: var(--panel); stroke: #4A5563; stroke-width: 2; }
.rc-pipe { fill: none; stroke-width: 6; stroke-linecap: round; }
.rc-gas { stroke: var(--c-exhaust); } .rc-liq { stroke: var(--c-fuel); } .rc-mix { stroke: var(--c-air); } .rc-vap { stroke: #8FC3F0; }
.rc-pt circle { fill: var(--yellow); } .rc-pt text { fill: var(--ink); font-size: 13px; }
.rc-loop figcaption { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; }
.rc-loop .key::before { content: ""; display: inline-block; width: 18px; height: 5px; border-radius: 3px; margin-right: .4rem; vertical-align: middle; background: currentColor; }
.key.rc-gas { color: var(--c-exhaust); } .key.rc-liq { color: var(--c-fuel); } .key.rc-mix { color: var(--c-air); } .key.rc-vap { color: #8FC3F0; }
.chart .grid { stroke: #232A33 !important; stroke-width: 1 !important; }
.chart .dome { fill: rgba(84, 160, 230, .08); stroke: #6E7B8C; stroke-width: 1.5; }
.chart .cyc { fill: rgba(255, 214, 0, .08); stroke: var(--yellow); stroke-width: 3; stroke-linejoin: round; }
.chart .pt circle { fill: var(--yellow); } .chart .pt text { fill: var(--ink); font-size: 11px; font-weight: 700; }
.chart .sat { fill: none; stroke: #8FC3F0; stroke-width: 2.5; }
.chart .rh { fill: none; stroke: #4A5563; stroke-width: 1.2; stroke-dasharray: 5 4; }
.chart .rh-l { fill: var(--muted); font-size: 11px; }
.chart .proc { stroke: var(--yellow); stroke-width: 3; }
.eq-line { background: var(--panel); border-radius: 6px; padding: .8rem 1rem; }
.rf-wrap { overflow-x: auto; margin: 1rem 0; }
.rf-table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 560px; }
.rf-table th, .rf-table td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line); }
.rf-table th { color: var(--muted); font-weight: 600; }
.rf-table td:first-child { font-weight: 700; color: var(--text); white-space: nowrap; }
.checklist { padding-left: 1.2rem; display: grid; gap: .45rem; }
@media print { .chart .cyc { stroke: #B08F00; } .rc-box { fill: #F2F4F6; } .rc-loop text { fill: #111; } }
.ssp-body { min-width: 0; }
.rf-table td:not(:last-child) { white-space: nowrap; }
.variant-grid.rc-three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .variant-grid.rc-three { grid-template-columns: 1fr; } }
/* SSP 05 */
.rc-loop .rc-small { font-size: 13px; }
.rc-shaft { stroke: #8A96A6; stroke-width: 5; }
.chart .cyc.open { fill: none; }
.rf-table.rf-cmp { table-layout: fixed; }
.rf-table.rf-cmp td { white-space: normal; }
.rf-table.rf-cmp th:first-child { width: 22%; }
/* Home-page interactive scope */
.scope-controls { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem 1.2rem; margin-top: .7rem; }
.scope-controls label { display: grid; gap: .25rem; font-size: var(--step--1); color: var(--muted); }
.scope-controls label > span { display: flex; justify-content: space-between; gap: .5rem; }
.scope-controls output { color: var(--text); font-variant-numeric: tabular-nums; }
.scope-controls input[type=range] { width: 100%; accent-color: var(--yellow); margin: 0; }
.scope-read { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: .8rem 0 0; padding-top: .7rem; border-top: 1px solid var(--line); }
.scope-read div { margin: 0; }
.scope-read dt { color: var(--muted); font-size: .72rem; margin-bottom: .1rem; }
.scope-read dd { margin: 0; color: var(--text); font-weight: 600; font-size: var(--step--1); font-variant-numeric: tabular-nums; }
.scope figcaption a { color: var(--yellow); }
@media (max-width: 560px) { .scope-controls { grid-template-columns: 1fr; } .scope-read { grid-template-columns: repeat(2, 1fr); } }
.scope-controls output { white-space: nowrap; }
/* "Supplied to" (home, buying) */
.supplied-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.supplied-group { background: var(--panel); border-radius: 6px; padding: 1.25rem 1.4rem; border-top: 3px solid var(--yellow); }
.supplied-count { margin: 0 0 .8rem; font-size: var(--step-1); color: var(--text); }
.supplied-count b { color: var(--yellow); font-size: 2.2em; font-weight: 800; line-height: 1; margin-right: .15rem; letter-spacing: -.02em; }
.supplied-names { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.supplied-names li { background: var(--graphite); border: 1px solid var(--line); border-radius: 3px; padding: .3rem .6rem; font-size: var(--step--1); color: var(--text); }
.supplied-names li.more { background: none; border-color: transparent; color: var(--muted); }
@media (max-width: 760px) { .supplied-groups { grid-template-columns: 1fr; } }
.supplied-names li { display: inline-flex; align-items: center; gap: .4rem; } .supplied-names img { height: 22px; width: auto; }
/* Product search (Buying, Research) */
.psearch { margin-top: 1.6rem; max-width: 46rem; position: relative; }
.psearch-box { display: flex; align-items: center; gap: .6rem; background: var(--graphite); border: 1px solid var(--line); border-radius: 6px; padding: 0 .9rem; }
.psearch-box:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 3px rgba(255, 214, 0, .18); }
.psearch-box svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.psearch-box input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: var(--text); font: 500 1rem var(--font); padding: .85rem 0; }
.psearch-box input::placeholder { color: var(--muted); }
.psearch-status { margin: .5rem 0 0; color: var(--muted); font-size: var(--step--1); min-height: 1.2em; }
.psearch-results { list-style: none; padding: 0; margin: .5rem 0 0; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.psearch-results li { padding: .75rem 1rem; border-top: 1px solid var(--line); display: grid; gap: .2rem; }
.psearch-results li:first-child { border-top: 0; }
.psearch-title { color: var(--text); font-weight: 600; text-decoration: none; }
.psearch-title:hover { color: var(--yellow); }
.psearch-title .code { display: inline; margin-right: .35rem; }
.psearch-cat { color: var(--muted); font-size: .8rem; }
.psearch-links { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-size: var(--step--1); }
.psearch-links a { color: var(--yellow); }
.psearch-more { color: var(--muted); font-size: var(--step--1); }
