/* Garage Codex — dark, elegant theme */
:root {
  --bg: #0a0908;
  --bg-2: #13110f;
  --panel: rgba(22, 19, 16, 0.62);
  --panel-solid: #17140f;
  --line: rgba(232, 200, 138, 0.16);
  --line-2: rgba(255, 255, 255, 0.07);
  --text: #eee7db;
  --muted: #9d9384;
  --dim: #6c6458;
  --brass: #c9a46a;
  --brass-2: #ecd09a;
  --warn: #f0b54b;
  --ok: #7bd389;
  --bad: #ef6b5b;
  --serif: "Bodoni 72", "Didot", "Playfair Display", "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --top: calc(env(safe-area-inset-top, 0px) + 64px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans);
  overflow: hidden; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
a { color: var(--brass-2); }

#stage { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; transition: filter 900ms var(--ease), opacity 900ms var(--ease); }
body.dim-stage #stage { filter: blur(6px) brightness(.35) saturate(.8); }
body.hide-stage #stage { opacity: 0; }
#vignette { position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 55%, transparent 45%, rgba(0,0,0,.65) 100%); }

/* ── top bar ───────────────────────────── */
#topbar { position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: var(--top);
  padding: env(safe-area-inset-top, 0) 18px 0; display: flex; align-items: center; gap: 14px;
  background: linear-gradient(to bottom, rgba(10,9,8,.85), rgba(10,9,8,0)); }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; height: 40px; min-width: 40px; padding: 0 12px;
  border-radius: 20px; border: 1px solid var(--line); background: var(--panel); backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px); cursor: pointer; transition: border-color .25s, background .25s, transform .2s; }
.icon-btn:hover { border-color: rgba(232,200,138,.45); background: rgba(40,33,25,.7); }
.icon-btn:active { transform: scale(.96); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: var(--brass-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#back span { font-size: 14px; letter-spacing: .02em; }
#back[hidden] { display: none; }
#crumbs { flex: 1; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase; overflow: hidden; white-space: nowrap; }
#crumbs b { color: var(--brass-2); font-weight: 500; }
#crumbs i { font-style: normal; color: var(--dim); }

/* ── views & transitions ───────────────── */
#views { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.view { position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(18px) scale(.985); transition: opacity 650ms var(--ease), transform 650ms var(--ease), visibility 0s 650ms; }
.view.active { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition: opacity 650ms var(--ease), transform 650ms var(--ease); }
.view.leave-back { transform: translateY(-14px) scale(1.02); }
#view-showroom.active { pointer-events: none; }
#view-showroom.active > * { pointer-events: auto; }

.glass { background: var(--panel); border: 1px solid var(--line); border-radius: 18px;
  backdrop-filter: blur(22px) saturate(1.2); -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.04); }
.eyebrow { font-size: 11px; letter-spacing: .28em; text-transform: uppercase; color: var(--brass); }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: .01em; }

/* ── showroom overlay ──────────────────── */
.showroom-title { position: absolute; top: calc(var(--top) + 6px); left: 0; right: 0; text-align: center; pointer-events: none; }
.showroom-title h1 { font-size: clamp(30px, 5vw, 58px); color: #f4ecdd; text-shadow: 0 4px 40px rgba(0,0,0,.6); }
.showroom-title p { margin: 8px 0 0; color: var(--muted); font-size: 14px; letter-spacing: .12em; text-transform: uppercase; }
.placard { position: absolute; left: 0; right: 0; margin: 0 auto; bottom: calc(env(safe-area-inset-bottom, 0px) + 28px);
  width: min(560px, calc(100vw - 32px)); padding: 20px 24px; display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; align-items: center;
  animation: rise 900ms var(--ease) both 300ms; }
.placard h2 { font-size: 26px; }
.placard .specs { grid-column: 1; color: var(--muted); font-size: 13px; letter-spacing: .04em; }
.placard .cta { grid-row: 1 / span 3; grid-column: 2; }
.swatches { display: flex; gap: 8px; margin-top: 6px; }
.swatch { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.15); cursor: pointer; transition: transform .2s, border-color .2s; }
.swatch.on, .swatch:hover { border-color: var(--brass-2); transform: scale(1.12); }
.vehicle-pager { position: absolute; top: 50%; width: 100%; display: flex; justify-content: space-between; padding: 0 14px; pointer-events: none; }
.vehicle-pager .icon-btn { pointer-events: auto; }
.btn { display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(236,208,154,.55); color: #1a140c; font-weight: 600; letter-spacing: .06em; font-size: 13px; text-transform: uppercase;
  background: linear-gradient(180deg, #f1d8a6, #c9a46a); box-shadow: 0 10px 30px rgba(201,164,106,.25), inset 0 1px 0 rgba(255,255,255,.5);
  transition: transform .2s, box-shadow .3s; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 40px rgba(201,164,106,.38), inset 0 1px 0 rgba(255,255,255,.5); }
.btn.ghost { background: transparent; color: var(--brass-2); box-shadow: none; }

/* ── system picker ─────────────────────── */
#view-systems { overflow-y: auto; padding: calc(var(--top) + 8px) 22px 40px; }
.picker-head { text-align: center; margin: 8px 0 26px; }
.picker-head h1 { font-size: clamp(34px, 5vw, 56px); }
.picker-head p { color: var(--muted); margin: 8px 0 0; }
.system-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; max-width: 1180px; margin: 0 auto; }
.system-card { position: relative; padding: 18px 18px 16px; min-height: 132px; cursor: pointer; text-align: left;
  border-radius: 18px; border: 1px solid var(--line-2); background: linear-gradient(160deg, rgba(34,29,23,.72), rgba(15,13,11,.72));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); overflow: hidden;
  opacity: 0; transform: translateY(16px); transition: transform .35s var(--ease), border-color .3s, box-shadow .35s, opacity .35s; }
.view.active .system-card { animation: rise 700ms var(--ease) both; animation-delay: calc(var(--i) * 40ms + 150ms); }
.system-card::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(400px 120px at 0% 0%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); opacity: .55; transition: opacity .3s; }
.system-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, transparent);
  box-shadow: 0 20px 50px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--c) 25%, transparent); }
.system-card:hover::before { opacity: 1; }
.system-card .ico { width: 34px; height: 34px; stroke: var(--c); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.system-card h3 { font-size: 21px; margin-top: 12px; }
.system-card p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.system-card .count { position: absolute; top: 16px; right: 16px; font-size: 11px; color: var(--dim); letter-spacing: .08em; }
.system-grid.chosen .system-card:not(.pick) { opacity: 0 !important; transform: scale(.94); transition-duration: .45s; animation: none; }
.system-grid.chosen .system-card.pick { transform: scale(1.04); border-color: var(--c); animation: none; opacity: 1; }

/* ── diagram view ──────────────────────── */
#view-diagram { display: grid; grid-template-rows: auto 1fr; padding: calc(var(--top)) 18px 18px; gap: 10px; }
.diagram-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.diagram-head h1 { font-size: clamp(28px, 4vw, 44px); }
.diagram-head p { color: var(--muted); max-width: 760px; margin: 6px 0 0; font-size: 13.5px; line-height: 1.5; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.legend span::before { content: ""; display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--k); }
.diagram-wrap { position: relative; min-height: 0; display: grid; grid-template-columns: 1fr 300px; gap: 14px; }
.diagram-stage { position: relative; min-height: 0; border-radius: 22px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, rgba(44,37,28,.55), rgba(10,9,8,.9) 70%), repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(255,255,255,.018) 0 1px, transparent 1px 28px);
  border: 1px solid var(--line-2); }
.diagram-stage svg { width: 100%; height: 100%; display: block; touch-action: none; }
.part-list { overflow-y: auto; padding: 10px; }
.part-list h4 { margin: 6px 8px 10px; font-size: 11px; letter-spacing: .22em; color: var(--brass); text-transform: uppercase; font-weight: 500; }
.part-row { display: flex; gap: 10px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; cursor: pointer; text-align: left; font-size: 13.5px; color: var(--text); }
.part-row:hover, .part-row.hot { background: rgba(255,255,255,.06); }
.part-row i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.part-row small { margin-left: auto; color: var(--dim); font-family: var(--mono); font-size: 11px; }
.orient { position: absolute; left: 16px; bottom: 12px; font-size: 10.5px; letter-spacing: .18em; color: var(--dim); text-transform: uppercase; }
.zoom-ctl { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 6px; }

/* svg diagram styling */
.car-outline { fill: rgba(255,255,255,.015); stroke: rgba(236,208,154,.22); stroke-width: 1.4; }
.car-detail { fill: none; stroke: rgba(236,208,154,.1); stroke-width: 1; }
.node { cursor: pointer; transition: opacity .5s var(--ease); }
.node .shape { fill: color-mix(in srgb, var(--c) 16%, rgba(15,13,11,.85)); stroke: var(--c); stroke-width: 1.4; transition: fill .25s, stroke-width .25s, filter .25s; }
.node text { fill: #e9e1d3; font-size: 10px; font-family: var(--sans); pointer-events: none; paint-order: stroke; stroke: rgba(10,9,8,.85); stroke-width: 3px; letter-spacing: .02em; }
.node:hover .shape, .node.hot .shape { fill: color-mix(in srgb, var(--c) 45%, rgba(15,13,11,.6)); stroke-width: 2.4; filter: url(#glow); }
.node.faded { opacity: .18; }
.node.enter { animation: pop .6s var(--ease) both; animation-delay: calc(var(--i) * 35ms + 200ms); }
.flow { fill: none; stroke-width: 2.2; stroke-linecap: round; opacity: .7; stroke-dasharray: 6 8; animation: flow 1.2s linear infinite; transition: opacity .3s; }
.flow.hot { opacity: 1; stroke-width: 3.2; filter: url(#glow); }
.flow.faded { opacity: .08; }
@keyframes flow { to { stroke-dashoffset: -28; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

#tooltip { position: fixed; z-index: 50; pointer-events: none; max-width: 320px; padding: 12px 14px; font-size: 12.5px; line-height: 1.45;
  transition: opacity .15s; }
#tooltip h5 { margin: 0 0 4px; font-size: 15px; font-family: var(--serif); font-weight: 400; color: #fff; }
#tooltip .pn { font-family: var(--mono); color: var(--brass-2); font-size: 11.5px; }
#tooltip .conn { color: var(--muted); margin-top: 6px; }
#tooltip .hint { color: var(--dim); margin-top: 6px; font-size: 11px; letter-spacing: .06em; }

/* ── part page ─────────────────────────── */
#view-part { overflow-y: auto; padding: calc(var(--top) + 4px) 22px 60px; }
.part-page { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.1fr .9fr; gap: 18px; }
.part-hero { grid-column: 1 / -1; padding: 26px 28px; position: relative; overflow: hidden; }
.part-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--c) 35%, transparent), transparent 70%); pointer-events: none; }
.part-hero h1 { font-size: clamp(30px, 4.4vw, 50px); margin-top: 6px; }
.part-hero .lede { color: #d8cfbf; font-size: 15.5px; line-height: 1.6; max-width: 760px; margin: 12px 0 0; }
.part-hero .how { color: var(--muted); font-size: 14px; line-height: 1.6; max-width: 760px; margin: 10px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.chip { font-size: 11.5px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: rgba(255,255,255,.02); }
.chip.installed { color: var(--ok); border-color: rgba(123,211,137,.4); }
.card { padding: 20px 22px; }
.card h3 { font-size: 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 10px; }
.card h3 .n { font-family: var(--sans); font-size: 11px; color: var(--dim); letter-spacing: .1em; }
.kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.kv td { padding: 9px 6px; border-top: 1px solid var(--line-2); vertical-align: top; }
.kv td:first-child { color: var(--muted); width: 38%; }
.kv tr:first-child td { border-top: 0; }
.mono { font-family: var(--mono); color: var(--brass-2); }
.src { display: block; color: var(--dim); font-size: 11px; margin-top: 3px; }
.badge { display: inline-block; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; margin-left: 6px; vertical-align: middle; }
.badge.unv { color: var(--warn); border: 1px solid rgba(240,181,75,.45); background: rgba(240,181,75,.08); }
.badge.ver { color: var(--ok); border: 1px solid rgba(123,211,137,.35); }
.badge.chk { color: var(--warn); border: 1px dashed rgba(240,181,75,.5); }
.empty { color: var(--dim); font-size: 13px; line-height: 1.55; }
.conn-list { display: grid; gap: 8px; }
.conn-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line-2); background: rgba(255,255,255,.02); cursor: pointer; text-align: left; width: 100%; transition: border-color .2s, background .2s; }
.conn-item:hover { border-color: var(--line); background: rgba(255,255,255,.05); }
.conn-item .k { width: 26px; height: 3px; border-radius: 2px; background: var(--k); flex: none; }
.conn-item b { font-weight: 500; font-size: 14px; }
.conn-item span { color: var(--muted); font-size: 12px; display: block; }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.pages figure { margin: 0; cursor: zoom-in; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); background: #fff; aspect-ratio: 8.5 / 11; position: relative; }
.pages img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; transition: transform .4s var(--ease); }
.pages figure:hover img { transform: scale(1.04); }
.pages figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 6px 8px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.span2 { grid-column: 1 / -1; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photos figure { margin: 0; border-radius: 12px; overflow: hidden; background: #fff; cursor: zoom-in; border: 1px solid var(--line-2); }
.photos img { width: 100%; aspect-ratio: 16 / 10; object-fit: contain; display: block; background: #fff; transition: transform .4s var(--ease); }
.photos figure:hover img { transform: scale(1.05); }
.photos figcaption { padding: 8px 10px; font-size: 12px; color: var(--muted); background: var(--panel-solid); line-height: 1.35; }
.diagram-stage svg:not(.labels) .node:not(.hot):not(.wide) text { opacity: 0; transition: opacity .2s; }
.diagram-stage svg .node text { transition: opacity .2s; }

/* ── search & lightbox ─────────────────── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(5,4,3,.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  display: grid; place-items: start center; padding-top: calc(var(--top) + 10px); animation: fade .3s var(--ease); }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0; } }
.search-panel { width: min(680px, calc(100vw - 24px)); padding: 12px; max-height: 76vh; display: flex; flex-direction: column; }
#search-input { width: 100%; padding: 14px 16px; font-size: 17px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.35); color: var(--text); outline: none; }
#search-input:focus { border-color: rgba(236,208,154,.5); }
#search-results { overflow-y: auto; margin-top: 8px; }
.result { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; }
.result:hover, .result.sel { background: rgba(255,255,255,.06); }
.result b { font-weight: 500; }
.result span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.result .mono { font-size: 12px; }
#lightbox { place-items: center; padding: 20px; }
#lightbox img { max-width: 96vw; max-height: 90vh; border-radius: 10px; box-shadow: 0 30px 90px rgba(0,0,0,.6); touch-action: pinch-zoom; }
#lightbox .close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 14px); right: 14px; }

/* ── loader ────────────────────────────── */
#loader { position: fixed; inset: 0; z-index: 100; display: grid; place-content: center; justify-items: center; gap: 18px; background: var(--bg); transition: opacity 1s var(--ease), visibility 0s 1s; }
#loader.done { opacity: 0; visibility: hidden; }
.loader-mark { font-family: var(--serif); font-size: 46px; color: var(--brass-2); letter-spacing: .1em; border: 1px solid var(--line); border-radius: 50%; width: 96px; height: 96px; display: grid; place-items: center; }
.loader-bar { width: 180px; height: 2px; background: rgba(255,255,255,.08); border-radius: 2px; overflow: hidden; }
.loader-bar i { display: block; height: 100%; width: 30%; background: var(--brass); animation: load 1.2s var(--ease) infinite; }
#loader p { color: var(--muted); font-size: 12px; letter-spacing: .2em; text-transform: uppercase; margin: 0; }
@keyframes load { from { transform: translateX(-100%); } to { transform: translateX(340%); } }

/* ── responsive ────────────────────────── */
@media (max-width: 860px) {
  #view-diagram { display: block; overflow-y: auto; padding-bottom: 30px; }
  .diagram-head { margin-bottom: 12px; }
  .diagram-wrap { grid-template-columns: 1fr; grid-template-rows: 74vh auto; }
  .part-list { max-height: none; }
  .part-page { grid-template-columns: 1fr; }
  .placard { grid-template-columns: 1fr; }
  .placard .cta { grid-row: auto; grid-column: 1; justify-self: start; margin-top: 8px; }
  #back span { display: none; }
  .diagram-head p { font-size: 12.5px; }
  .system-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .system-card { min-height: 118px; padding: 14px; }
  .system-card h3 { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── wiring (AAW circuits) ─────────────── */
.tabs { display: flex; gap: 6px; margin: 2px 2px 10px; }
.tab { flex: 1; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line-2); background: transparent; color: var(--muted);
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; }
.tab span { color: var(--dim); letter-spacing: .05em; margin-left: 4px; }
.tab.on { color: var(--brass); border-color: color-mix(in srgb, var(--brass) 50%, transparent); background: rgba(255,255,255,.04); }
.wire-sw { display: inline-block; width: 22px; height: 8px; border-radius: 4px; background: var(--w); vertical-align: middle; flex: none;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18), 0 0 8px color-mix(in srgb, var(--w) 50%, transparent); }
.wire-kit h5 { margin: 14px 4px 6px; font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--brass); font-weight: 500; }
.wire-kit:first-child h5 { margin-top: 2px; }
.wire-row { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: start; padding: 8px 6px; border-top: 1px solid var(--line-2);
  font-size: 13px; line-height: 1.4; cursor: default; border-radius: 8px; }
.wire-row .wire-sw { margin-top: 5px; }
.wire-row b { font-weight: 500; color: var(--text); }
.wire-row .wc { color: var(--dim); font-size: 11.5px; margin-left: 4px; }
.wire-row .wr { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.wire-row .pg { border: 1px solid var(--line-2); background: transparent; color: var(--brass-2); font-family: var(--mono); font-size: 11px;
  padding: 3px 7px; border-radius: 7px; cursor: pointer; }
.wire-row .pg:hover { border-color: var(--brass); }
.circuits .wire-row { cursor: pointer; }
.circuits .wire-row .wr { display: none; }
.circuits .wire-row.open .wr, .circuits .wire-row:hover .wr { display: block; }
.circuits .wire-row:hover, .circuits .wire-row.open { background: rgba(255,255,255,.05); }
.pinout { margin-bottom: 16px; }
.pinout h5 { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--text); }
.kv.pins td:first-child { width: 48px; color: var(--brass-2); }
.kv.pins td:nth-child(2) { width: 34%; color: var(--muted); white-space: nowrap; }

/* ── real part photos on diagrams ───────── */
.node .shape.foot { fill: color-mix(in srgb, var(--c) 7%, transparent); stroke-opacity: .45; stroke-dasharray: 3 3; }
.node .badge-bg { fill: #f3efe8; }
.node .badge-ring { fill: none; stroke: var(--c); stroke-width: 2; transition: stroke-width .25s; }
.node:hover .badge-ring, .node.hot .badge-ring { stroke-width: 3.4; filter: url(#glow); }
.node image { pointer-events: none; }
.tip-ph { display: block; width: 100%; max-height: 150px; object-fit: contain; background: #f3efe8; border-radius: 10px; margin-bottom: 8px; }
.part-row .row-ph { width: 30px; height: 30px; border-radius: 50%; object-fit: contain; background: #f3efe8; flex: none; box-shadow: 0 0 0 1.5px var(--c); }
.photo-note { font-size: 11.5px; color: var(--dim); margin: 6px auto 0; max-width: 380px; line-height: 1.4; }
.picker-car { display: block; width: min(420px, 80vw); margin: 0 auto 6px; filter: drop-shadow(0 18px 18px rgba(0,0,0,.6)); animation: rise .8s var(--ease) both; }

/* ---- factory manuals: page strips, page reader, search hits ---- */
.pages.strip { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pages figure.more { display: grid; place-items: center; background: rgba(255,255,255,.04); color: var(--brass-2); font-size: 12px; text-align: center; padding: 8px; cursor: pointer; }
.man-sec + .man-sec { margin-top: 16px; }
.man-sec h4 { margin: 0 0 8px; font-weight: 500; font-size: 14px; }
.man-sec h4 .n { color: var(--muted); font-size: 12px; margin-left: 6px; }
.head-r { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.doc-btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.doc-btns .btn { padding: 7px 14px; font-size: 12px; border: 1px solid var(--line-2); }
.res-head { padding: 12px 12px 4px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brass-2); }
.result.man span:last-child { white-space: normal; line-height: 1.45; }
#reader { position: fixed; inset: 0; z-index: 200; background: rgba(6,6,8,.96); display: flex; flex-direction: column; }
#reader[hidden] { display: none; }
.rd-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-radius: 0; }
.rd-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.rd-count { color: var(--muted); font-size: 12px; }
.rd-bar .icon-btn:disabled { opacity: .3; }
.rd-page { flex: 1; overflow: auto; display: flex; justify-content: center; padding: 14px; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
.rd-page img { width: min(100%, 900px); height: auto; align-self: flex-start; background: #fff; border-radius: 6px; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.manuals-card .ico { width: 34px; height: 34px; fill: none; stroke: var(--c); stroke-width: 1.4; }
@media (max-width: 700px) { .head-r { align-items: flex-start; } .doc-btns { justify-content: flex-start; } }
.part-page > * { min-width: 0; }
.empty .mono { overflow-wrap: anywhere; }

/* ---- polish pass: frosted top bar on scroll, torque/spec cards, hero photo, diagram leaders, specs tab ---- */
#topbar { transition: background .3s, box-shadow .3s, backdrop-filter .3s; }
#topbar.solid { background: rgba(12,10,9,.78); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 1px 0 var(--line-2), 0 10px 30px rgba(0,0,0,.35); }
.part-hero.has-ph { display: grid; grid-template-columns: 1fr auto; column-gap: 26px; }
.part-hero.has-ph > :not(.hero-ph) { grid-column: 1; }
.hero-ph { grid-column: 2; grid-row: 1 / span 6; margin: 0; width: 190px; height: 190px; align-self: center; border-radius: 22px; overflow: hidden;
  background: #f4f1ea; border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.45); cursor: zoom-in; position: relative; z-index: 1; }
.hero-ph img { width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; }
.chip.torque { color: var(--brass-2); border-color: rgba(232,200,138,.4); }
.torque-card { border-color: rgba(232,200,138,.28); }
.kv.tq td:first-child { color: var(--text); width: 52%; }
.kv.tq b { font-size: 17px; font-weight: 500; color: var(--brass-2); letter-spacing: .01em; }
.kv b { font-weight: 500; color: var(--text); }
.thr { display: block; color: var(--dim); font-size: 11.5px; margin-top: 2px; }
button.cite { display: block; background: none; border: 0; padding: 0; margin-top: 3px; font: inherit; font-size: 11px; color: var(--dim);
  cursor: pointer; text-align: left; }
button.cite:hover { color: var(--brass-2); }
.diagram-stage .leader { stroke: var(--c, #c9a46a); stroke-opacity: .55; stroke-width: 1.2; stroke-dasharray: 2 3; }
.diagram-stage .leader-dot { fill: var(--c, #c9a46a); fill-opacity: .8; }
.qspecs { padding: 6px 4px 12px; }
.qs-group { padding: 10px 10px 12px; border-bottom: 1px solid var(--line-2); }
.qs-group h5 { margin: 0 0 6px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--brass-2); font-weight: 500; }
.qs-group .kv { font-size: 12.5px; }
.qs-group .kv td { padding: 6px 4px; }
.qspecs > .empty { padding: 10px; font-size: 12px; }
@media (max-width: 700px) {
  .part-hero.has-ph { grid-template-columns: 1fr; }
  .hero-ph { grid-column: 1; grid-row: auto; width: 100%; height: 180px; margin-bottom: 14px; order: -1; }
  .kv.tq td:first-child { width: 58%; }
}
.card > button.cite { margin-top: 10px; font-size: 11.5px; }
/* ---- torque & specs page ---- */
.spec-filter { margin-top: 16px; }
.spec-filter input { width: 100%; max-width: 520px; padding: 12px 14px; font-size: 15px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(0,0,0,.35); color: var(--text); outline: none; }
.spec-filter input:focus { border-color: rgba(236,208,154,.5); }
.spec-jump { margin-top: 14px; }
.spec-jump .chip { text-decoration: none; }
.spec-jump .chip:hover { color: var(--text); border-color: var(--c); }
.spec-sys { scroll-margin-top: calc(var(--top) + 12px); }
.spec-sys h3 .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 10px; vertical-align: middle; }
.qs-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; margin-bottom: 14px; }
.qs-grid .qs-group { border: 1px solid var(--line-2); border-radius: 12px; background: rgba(255,255,255,.02); }
.kv.all td:first-child a { color: var(--text); text-decoration: none; }
.kv.all td:first-child a:hover { color: var(--brass-2); }
.kv.all .thr { font-family: inherit; font-size: 12px; color: var(--muted); }
.kv.tq.all b { font-size: 15px; }
.kv tr[hidden], .qs-group[hidden], .spec-sys[hidden] { display: none; }

/* offline save progress (main.js saveOffline) */
#offline-pill{position:fixed;left:50%;bottom:calc(16px + env(safe-area-inset-bottom));transform:translateX(-50%);z-index:60;
  padding:8px 14px;border-radius:999px;font:500 13px/1.2 system-ui,sans-serif;color:#e9dcc3;background:rgba(20,17,13,.88);
  border:1px solid rgba(201,164,106,.45);backdrop-filter:blur(8px);-webkit-backdrop-filter:blur(8px);pointer-events:none;white-space:nowrap}
#offline-pill.ok{border-color:rgba(120,190,120,.6)}
