/* ==========================================================================
   Accessory pages, part 2 — SpecVision (sv-), Mode Switches + Wiring Kit (mk-, rk, mkc-),
   Wiring Kits (wk-, tv-) and ST-Link V2 (sl-). Builds on site.css + demos.css + product.css.
   JS: /js/accessories2.js
   ========================================================================== */

/* ---------- Shared ---------- */
.section[id] { scroll-margin-top: 60px; }
:where(figure).media-frame, :where(figure).device-frame { margin: 0; }
/* "Pairs perfectly with" cards: real photos (black or wooden backgrounds) fill the frame instead of floating */
.a2-cards .pcard__media { overflow: hidden; }
.a2-cards .pcard__media:has(img[src*='/img/wiring-'], img[src*='/img/2in1-'], img[src*='/img/feet-']) { padding: 0; background: #050607; }
.a2-cards .pcard__media img[src*='/img/wiring-'], .a2-cards .pcard__media img[src*='/img/2in1-'], .a2-cards .pcard__media img[src*='/img/feet-'] { width: 100%; height: 100%; max-height: none; object-fit: cover; filter: none; }

/* ==========================================================================
   SpecVision
   ========================================================================== */
.sv-hero__stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.sv-hero__img img { width: auto; max-width: 100%; max-height: 380px; }
.sv-hero__live { margin: 0; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-lg); background: var(--surface); }
.sv-hero__live canvas { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: var(--r-sm); background: #010306; }
.sv-hero__live figcaption { font-size: var(--fs-sm); line-height: 1.4; color: var(--muted); }

.sv-canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; }

/* "What it shows": a plain two-column list */
.a2-feats { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: clamp(24px, 4vw, 56px); border-top: 1px solid var(--line); }
.a2-feats > div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.a2-feats dt { font-weight: 600; color: var(--text); }
.a2-feats dd { margin: 2px 0 0; color: var(--text-2); font-size: 0.9375rem; }

/* Simulator */
.sv-sim .demo__bar { gap: 8px 10px; }
.sv-bar-sep { width: 1px; height: 22px; background: var(--line-2); margin: 0 4px; }
.sv-power { margin-left: auto; }
.sv-sim__body { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(22px, 3.2vw, 44px); align-items: center; }
.sv-sim__screen { display: grid; gap: 16px; min-width: 0; }
.sv-bezel {
  position: relative; padding: clamp(16px, 3vw, 34px); border-radius: clamp(10px, 2vw, 18px);
  background: #15181b; border: 1px solid #050607;
}
.sv-bezel__glass { position: relative; padding: 4% 4.5%; border-radius: 6px; background: #010204; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), inset 0 14px 40px rgba(0, 0, 0, 0.95), 0 0 0 3px #08090b; }
.sv-now { display: grid; grid-template-columns: auto minmax(40px, 1fr) auto; align-items: center; gap: 12px; font: 500 0.74rem/1.3 var(--font-mono); color: var(--text-2); letter-spacing: 0.02em; min-height: 1.4em; }
.sv-now__lbl { display: flex; align-items: center; gap: 8px; }
.sv-now__lbl::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); flex: none; }
.sv-now__bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.sv-now__bar i { display: block; height: 100%; background: var(--cyan); transform-origin: left; transform: scaleX(0); }
.sv-now__clock { color: var(--amber); white-space: nowrap; }

.sv-sim__ctrl { display: grid; gap: 22px; min-width: 0; }
.sv-group h4 { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 0 0 10px; font: 500 var(--fs-xs)/1 var(--font-body); color: var(--muted); }
.sv-group h4 span { text-transform: none; color: var(--dim); }
.sv-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.sv-b {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 42px; padding: 0 13px; border-radius: var(--r-lg);
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); cursor: pointer; text-align: left;
  font: 600 0.75rem/1.15 var(--font-mono); transition: border-color 0.2s, background 0.2s, color 0.2s, opacity 0.2s, box-shadow 0.25s;
}
.sv-b small { font: 500 0.75rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.sv-b:hover { border-color: var(--line-2); color: #fff; }
.sv-b[aria-pressed='true'] { color: #fff; background: rgba(59, 198, 243, 0.14); border-color: var(--cyan); }
.sv-b[aria-pressed='true'] small { color: var(--cyan-hi); }
.sv-b.is-wait, .sv-row .btn.is-wait { opacity: 0.42; }
.sv-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sv-row .tiny { flex: 1 1 180px; }
.sv-sim.is-kb [data-act='disc'] { background: var(--lime); border-color: var(--lime); }

/* What it shows */
.sv-ref { margin-top: clamp(44px, 6vw, 76px); }
.sv-ref__title { font-size: var(--fs-xl); margin-bottom: 20px; }
.sv-ref__note-line { margin: -12px 0 20px; }
.sv-ref__card { display: flex; flex-direction: column; gap: 10px; height: 100%; padding: 12px 12px 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.sv-ref__oled { padding: 9px 10px; border-radius: var(--r); background: #020407; border: 1px solid #10222b; margin-bottom: 4px; }
.sv-ref__hd { display: flex; align-items: center; gap: 9px; padding: 0 4px; }
.sv-ref__hd .ico { color: var(--muted); width: 18px; height: 18px; }
.sv-ref__hd h4 { margin: 0; font-size: 1rem; }
.sv-ref__card p { margin: 0; padding: 0 4px; font-size: var(--fs-sm); line-height: 1.6; color: var(--muted); }
.sv-ref__card code, .sv-ref__note code { font-size: 0.88em; color: var(--text); background: var(--surface-3); padding: 1px 5px; border-radius: var(--r-sm); -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.sv-ref__note { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 18px; }
.sv-ref__note > div { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.sv-ref__note .badge { flex: none; margin-top: 2px; }
.sv-ref__note p { margin: 0; font-size: 0.9rem; color: var(--text-2); }

/* Photos */
.sv-gallery { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: stretch; }
.sv-shot { margin: 0; }
.sv-shot--wide { aspect-ratio: 1600 / 925; }
@media (max-width: 960px) {
  .sv-gallery { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .sv-gallery .photo-slot { grid-column: 1 / -1; aspect-ratio: 16 / 5; }
}
/* The row height comes from the wide photo's aspect ratio; the tall photo fills that height instead of setting it
   (otherwise its own height stretches the row and the wide figure's aspect-ratio pushes it into the tall one). */
.sv-shot--tall img { position: absolute; inset: 0; object-position: 50% 45%; }

/* Utility mirror */
.sv-util-split { align-items: center; }
.sv-real { width: min(100%, 232px); margin: 0 auto; }
.sv-real a { display: block; cursor: zoom-in; }
.sv-real img { display: block; width: 100%; height: auto; }
.sv-real figcaption { margin: 8px 10px 10px; }

/* Install: cable route */
.sv-cable { --w0: #facc15; --w1: #f1f5f9; --w2: #a16207; --w3: #22c55e; }
.sv-chain { display: flex; align-items: center; padding: 18px 2px 6px; }
.sv-node { flex: none; display: grid; justify-items: center; gap: 4px; padding: 10px 12px; min-width: 98px; border-radius: var(--r-lg); text-align: center; background: var(--surface-2); border: 1px solid var(--line-2); transition: opacity 0.4s, transform 0.5s var(--ease); }
.sv-node__k { font: 500 var(--fs-xs)/1.2 var(--font-body); color: var(--dim); }
.sv-node strong { font: 600 0.82rem/1.2 var(--font-display); color: #fff; }
.sv-pins { display: flex; gap: 3px; margin-top: 2px; }
.sv-pins i { font: 600 0.6875rem/1 var(--font-mono); font-style: normal; padding: 3px 4px 2px; border-radius: 4px; background: #0a0f13; color: var(--text-2); border-bottom: 2px solid var(--w); }
.sv-wire { position: relative; flex: 1 1 auto; min-width: 34px; display: grid; gap: 2px; padding: 0 2px; }
.sv-wire i { display: block; height: 2px; border-radius: 2px; background: var(--w0); }
.sv-wire i:nth-of-type(2) { background: var(--w1); }
.sv-wire i:nth-of-type(3) { background: var(--w2); }
.sv-wire i:nth-of-type(4) { background: var(--w3); }
.sv-wire__len { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%); font: 600 0.62rem/1 var(--font-mono); color: var(--muted); white-space: nowrap; }
.sv-cable[data-route='direct'] .sv-wire--short, .sv-cable[data-route='direct'] .sv-node--dm { display: none; }
.sv-cable[data-route='dongle'] .sv-node { min-width: 0; padding: 9px 10px; }
.sv-cable[data-route='dongle'] .sv-node .sv-pins { display: none; }
.sv-cable[data-route='dongle'] .sv-wire { min-width: 64px; }
.sv-cable[data-route='dongle'] .sv-node--dm { animation: svPop 0.5s var(--ease); }
@keyframes svPop { from { opacity: 0; transform: scale(0.9); } }
.sv-pinmap { width: 100%; margin-top: 18px; border-collapse: collapse; font-size: 0.86rem; }
.sv-pinmap th, .sv-pinmap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.sv-pinmap th { font: 500 var(--fs-xs)/1.2 var(--font-body); color: var(--muted); }
.sv-pinmap tr:last-child td { border-bottom: 0; }
.sv-pinmap td { color: var(--text-2); }
.sv-swatch { display: inline-block; width: 14px; height: 14px; margin-right: 9px; border-radius: var(--r-sm); background: var(--c); vertical-align: -2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18); }

/* Dimensions */
.sv-blueprint { margin: 0; padding: clamp(12px, 2vw, 22px); border-radius: var(--r-lg); color: var(--text-2); background: var(--surface); border: 1px solid var(--line); }
.sv-blueprint svg { width: 100%; height: auto; overflow: visible; }
.sv-blueprint figcaption { margin-top: 10px; font: 500 var(--fs-xs)/1 var(--font-body); color: var(--dim); }
.bp-grid path { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; fill: none; }
.bp-l { fill: rgba(255, 255, 255, 0.03); stroke: var(--text-2); stroke-width: 1.6; }
.bp-win { fill: rgba(255, 255, 255, 0.07); }
.bp-nut { fill: rgba(255, 255, 255, 0.05); stroke-dasharray: 5 3; }
.bp-d { stroke: var(--muted); stroke-width: 1.1; fill: none; }
.bp-x { stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; stroke-dasharray: 3 3; fill: none; }
.bp-t { fill: var(--text); font: 500 13px var(--font-mono); }
.bp-h { font-size: 12px; fill: var(--muted); }
.bp-dim { font-size: 11px; fill: var(--muted); }

/* V2 housing: exploded view */
.sv-explode .demo__body { padding: clamp(12px, 2vw, 22px); }
.sv-explode svg { width: 100%; height: auto; overflow: visible; }
.ex-lbl { font: 600 11px var(--font-mono); fill: var(--muted); transition: opacity 0.5s; }
.ex-lbl--c { fill: var(--cyan); }
.ex-part { transition: transform 1.1s var(--ease); }
.ex-frame { transform: translateX(34px); }
.ex-oled { transform: translateX(84px); }
.ex-body { transform: translateX(112px); }
.ex-nut { transform: translateX(500px); }
.is-assembled .ex-body { transform: translateX(270px); transition-delay: 0s; }
.is-assembled .ex-oled { transform: translateX(272px); transition-delay: 0.15s; }
.is-assembled .ex-frame { transform: translateX(258px); transition-delay: 0.35s; }
.is-assembled .ex-nut { transform: translateX(322px); transition-delay: 0.55s; }
.is-assembled .ex-part .ex-lbl { opacity: 0; }
.ex-asm { opacity: 0; transition: opacity 0.6s 1.2s; }
.is-assembled .ex-asm { opacity: 1; }
.ex-click circle { fill: rgba(59, 198, 243, 0.15); stroke: var(--cyan); stroke-width: 1.5; }
.ex-click text { font: 700 10px var(--font-mono); fill: var(--cyan-hi); }
.ex-click { opacity: 0; }
.is-assembled .ex-click { animation: exClick 1.4s var(--ease) 1.05s both; }
@keyframes exClick { 0% { opacity: 0; } 25% { opacity: 1; } 70% { opacity: 1; } 100% { opacity: 0; } }
.sv-housing-shots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.sv-housing-shots figure { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--r); background: #000; }

/* ==========================================================================
   Mode Switches + Wiring Kit
   ========================================================================== */
.mk-hero__photo { aspect-ratio: 4 / 3; margin: 0; }

.mk-tabs { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.mk-demo { padding: clamp(12px, 2.2vw, 26px); }
.mk__grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: clamp(18px, 2.4vw, 30px); align-items: start; }
.mk-board { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 64px; padding: 16px; border-radius: var(--r-lg); background: var(--bg); border: 1px solid var(--line); }
.mk-wires { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 3; }
.mk-panel { position: relative; z-index: 2; display: grid; gap: 8px; align-content: start; }
.mk-panel__hd { display: flex; justify-content: space-between; gap: 10px; padding: 0 4px 8px; border-bottom: 1px dashed var(--line); font: 500 var(--fs-xs)/1 var(--font-body); color: var(--muted); }
.mk-row { display: grid; grid-template-columns: 60px minmax(0, 1fr) 18px; gap: 14px; align-items: center; padding: 9px 10px; border-radius: var(--r-lg); background: rgba(255, 255, 255, 0.02); border: 1px solid var(--line); transition: border-color 0.3s, background 0.3s; }
.mk-row:not([data-pos='O']):not(.mk-row--int):not(.mk-row--disc), .mk-row.is-on { border-color: rgba(59, 198, 243, 0.32); background: rgba(59, 198, 243, 0.04); }
.mk-row__info { min-width: 0; }
.mk-row__name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font: 600 0.95rem/1.2 var(--font-display); color: #fff; }
.mk-row__name span { font: 500 var(--fs-xs)/1 var(--font-body); color: var(--dim); }
.mk-seg { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 7px; }
.mk-seg button { height: 28px; padding: 0 9px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text-2); font: 500 0.75rem/1 var(--font-body); cursor: pointer; transition: all 0.2s var(--ease); }
.mk-seg button:hover { color: #fff; border-color: var(--line-2); }
.mk-seg button[aria-checked='true'] { color: #fff; border-color: var(--w); background: color-mix(in srgb, var(--w) 30%, #0c1115); }
.mk-tags { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 6px; }
.mk-tags span { display: inline-flex; align-items: center; gap: 6px; font: 400 0.75rem/1.3 var(--font-mono); color: var(--muted); }
.mk-tags i { width: 14px; height: 3px; border-radius: 2px; background: var(--w); box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14); }
.mk-terms { display: grid; gap: 6px; justify-items: center; }
.mk-terms i { display: block; width: 13px; height: 8px; border-radius: 2px; background: linear-gradient(180deg, #ecd28a, #a98a32); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5); transition: box-shadow 0.3s; }
.mk-terms i[data-term='C'] { background: linear-gradient(180deg, #c9d2d9, #79838c); }
.mk-terms i.is-on { box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 10px 1px var(--w); }

/* Round rocker switches */
.rk { position: relative; width: 60px; height: 60px; padding: 0; border: 0; background: none; cursor: pointer; perspective: 160px; border-radius: 50%; }
.rk__bezel { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 28%, #31373e, #111417 62%, #08090b); box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.1), 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 0 2px #050607; transition: box-shadow 0.3s; }
.rk__paddle { display: grid; grid-template-rows: repeat(3, 1fr); place-items: center; width: 72%; height: 72%; border-radius: 50%; background: linear-gradient(180deg, #23292f 0%, #14181c 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), inset 0 -2px 3px rgba(0, 0, 0, 0.6); transform: rotateX(var(--tilt, 0deg)); transition: transform 0.35s var(--ease), background 0.35s; }
.rk--2 .rk__paddle { grid-template-rows: repeat(2, 1fr); }
.rk__paddle i { font: 700 0.6rem/1 var(--font-mono); font-style: normal; color: #7fd2ff; }
.mk-row[data-pos='I'] .rk__paddle { --tilt: 22deg; background: linear-gradient(180deg, #14181c 0%, #262c33 100%); }
.mk-row[data-pos='II'] .rk__paddle { --tilt: -22deg; }
.mk-row[data-pos='O'] .rk--2 .rk__paddle { --tilt: -22deg; }
.mk-row:not([data-pos='O']) .rk__bezel { box-shadow: inset 0 2px 1px rgba(255, 255, 255, 0.1), 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 0 2px rgba(59, 198, 243, 0.55), 0 0 22px -4px rgba(59, 198, 243, 0.8); }
.rk:active .rk__paddle { transition-duration: 0.12s; }
.rk--mini { width: 40px; height: 40px; cursor: default; }
.rk--mini .rk__paddle { width: 66%; height: 66%; transform: rotateX(16deg); }
.rk--mini .rk__paddle::before { content: ''; width: 2px; height: 7px; border-radius: 1px; background: #7fd2ff; grid-row: 1; }
.rk--mini.rk--3 .rk__paddle::after { content: ''; width: 5px; height: 2px; border-radius: 1px; background: #7fd2ff; grid-row: 3; }

/* Interlock jumper + DISC button */
.mk-jumper { position: relative; width: 60px; height: 44px; padding: 0; border: 0; border-radius: 10px; background: #0c1115; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2); }
.mk-jumper::before, .mk-jumper::after { content: ''; position: absolute; bottom: 9px; width: 5px; height: 16px; border-radius: 1px; background: linear-gradient(90deg, #a98a32, #ecd28a, #a98a32); }
.mk-jumper::before { left: 20px; }
.mk-jumper::after { right: 20px; }
.mk-jumper__cap { position: absolute; z-index: 1; left: 15px; bottom: 6px; width: 30px; height: 18px; border-radius: 4px; background: linear-gradient(180deg, #ff6be0, #c4209f); box-shadow: 0 6px 10px rgba(0, 0, 0, 0.6); transform: translateY(-16px) rotate(-8deg); opacity: 0.55; transition: transform 0.4s var(--ease), opacity 0.3s; }
.mk-jumper[aria-pressed='true'] .mk-jumper__cap { transform: none; opacity: 1; }
.mk-row--int.is-on { border-color: rgba(255, 79, 216, 0.4); background: rgba(255, 79, 216, 0.04); }
.mk-arcade { position: relative; width: 52px; height: 52px; margin: 0 4px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; background: radial-gradient(circle at 50% 50%, #0f1316 60%, #262c32 62%, #0b0d10 70%); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6), 0 0 0 2px #050607; }
.mk-arcade span { position: absolute; inset: 7px; border-radius: 50%; background: radial-gradient(circle at 38% 30%, #b8f27a, #6eb52c 60%, #3f6e14); box-shadow: inset 0 -3px 5px rgba(0, 0, 0, 0.45); transition: transform 0.12s; }
.mk-arcade:hover span { filter: brightness(1.08); }
.mk-arcade.is-down span { transform: scale(0.9) translateY(1px); box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.5), 0 0 26px 2px rgba(140, 198, 63, 0.9); }
.mk-row--disc.is-on { border-color: rgba(140, 198, 63, 0.45); background: rgba(140, 198, 63, 0.05); }

/* OPTIONS terminal strip */
.mk-strip { position: relative; z-index: 2; align-self: start; padding: 10px 9px 9px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line-2); }
.mk-strip__hd { display: flex; justify-content: space-between; align-items: baseline; margin: 0 2px 8px; font: 600 var(--fs-xs)/1 var(--font-mono); color: var(--text); }
.mk-strip__hd span { font-weight: 400; color: var(--muted); }
.mk-strip ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.mk-pin { position: relative; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; gap: 8px; height: 26px; padding: 0 7px; border-radius: 7px; background: #0b1014; border: 1px solid transparent; transition: background 0.25s, border-color 0.25s; }
.mk-pin__dot { width: 11px; height: 11px; border-radius: 3px; background: #2a333b; box-shadow: inset 0 0 0 2px #0a0e11; transition: background 0.25s, box-shadow 0.25s; }
.mk-pin b { font: 600 0.75rem/1 var(--font-mono); color: var(--text-2); white-space: nowrap; }
.mk-pin em { font: 600 0.625rem/1 var(--font-mono); font-style: normal; padding: 3px 4px; border-radius: var(--r-sm); color: #0b0f12; background: #c9d2d9; }
.mk-pin.is-gnd b { color: var(--muted); }
.mk-pin.is-gnd .mk-pin__dot { background: #c9d2d9; }
.mk-pin.is-default .mk-pin__dot { background: #c9d2d9; box-shadow: inset 0 0 0 2px #0a0e11, 0 0 8px rgba(201, 210, 217, 0.5); }
.mk-pin.is-low:not(.is-default) { background: rgba(59, 198, 243, 0.12); border-color: rgba(59, 198, 243, 0.5); }
.mk-pin.is-low:not(.is-default) .mk-pin__dot { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.mk-pin.is-low b { color: #fff; }
.mk-pin__jumper { position: absolute; right: -5px; top: 7px; width: 9px; height: 40px; border-radius: 3px; background: linear-gradient(90deg, #c4209f, #ff6be0); box-shadow: 0 4px 10px rgba(0, 0, 0, 0.6); opacity: 0; transform: translateX(6px); transition: opacity 0.3s, transform 0.4s var(--ease); z-index: 2; }
[data-mk-panel='4000t'] .mk-pin[data-pin-name='INT'].is-low .mk-pin__jumper { opacity: 1; transform: none; }
.mk-pin[data-pin-name='INT'].is-low { background: rgba(255, 79, 216, 0.1); border-color: rgba(255, 79, 216, 0.45); }
.mk-pin[data-pin-name='INT'].is-low .mk-pin__dot { background: #ff6be0; box-shadow: 0 0 10px #ff6be0; }
.mk-strip__ft { display: flex; align-items: center; gap: 7px; margin: 9px 2px 0; font: 400 var(--fs-xs)/1.2 var(--font-body); color: var(--muted); }
.mk-legend--gnd { width: 10px; height: 10px; border-radius: 3px; background: #c9d2d9; }

/* Wires (measured from the DOM by JS) */
.mkw-gnd__under { stroke: rgba(0, 0, 0, 0.75); stroke-width: 6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mkw-gnd__wire { stroke: #56606b; stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.mkw-gnd__node { fill: #c9d2d9; }
.mkw-lbl { font: 600 9px var(--font-mono); fill: var(--dim); }
.mkw-under { stroke: rgba(0, 0, 0, 0.75); stroke-width: 6; fill: none; stroke-linecap: round; }
.mkw-wire { stroke: var(--c); stroke-width: 2.6; fill: none; stroke-linecap: round; opacity: 0.4; transition: opacity 0.3s; }
.mkw-flow { stroke: #fff; stroke-width: 2; fill: none; stroke-linecap: round; stroke-dasharray: 2 14; opacity: 0; }
.mkw-sig .is-on .mkw-wire { opacity: 1; filter: drop-shadow(0 0 4px var(--c)); }
.mkw-sig .is-on .mkw-flow { opacity: 0.75; animation: mkFlow 0.9s linear infinite; }
@keyframes mkFlow { to { stroke-dashoffset: -16; } }

/* Result column */
.mk-result { display: grid; gap: 12px; min-width: 0; }
.mk-screen { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-lg); overflow: hidden; border: 6px solid #0b0f12; outline: 1px solid var(--line-2); background: #10171d; }
.mk-screen .ovl { width: min(320px, 84%); padding: 16px 18px 12px; }
.mk-screen .ovl:not(.is-corner) .ovl__icon { height: 44px; }
.mk-screen .ovl:not(.is-corner) .ovl__title { font-size: clamp(1.2rem, 0.9rem + 1vw, 1.7rem); }
.mk-screen .ovl.is-corner { width: 168px; right: 10px; bottom: 10px; }
.mk-screen .ovl__chips { font-size: 0.72rem; gap: 10px; }
.mk-screen__lbl { position: absolute; left: 12px; top: 10px; display: flex; align-items: center; gap: 6px; font: 500 var(--fs-xs)/1 var(--font-body); color: var(--dim); }
.mk-screen__lbl .ico { width: 13px; height: 13px; }
.mk-screen .ovl__tag { white-space: normal; width: 92%; text-align: center; line-height: 1.35; }
.mk-screen .ovl.is-corner .ovl__tag { width: auto; }
.mk-state { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 0; }
.mk-state div { padding: 7px 10px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.3s; }
.mk-state dt { font: 500 var(--fs-xs)/1.2 var(--font-body); color: var(--dim); }
.mk-state dd { margin: 2px 0 0; font: 600 var(--fs-sm)/1.25 var(--font-body); color: var(--text-2); }
.mk-state .is-on { border-color: var(--cyan); }
.mk-state .is-on dd { color: var(--text); }
.mk-why { margin: 0; padding: 12px 14px; border-radius: var(--r); min-height: 6.2em; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-sm); line-height: 1.55; color: var(--text-2); }
.mk-why b { color: #fff; }
.mk-why__note { display: block; margin-top: 7px; font-size: var(--fs-xs); color: var(--amber); }
.mk-rules h4 { font-size: var(--fs-md); }
.mk-choose { margin: 18px 0 0; scroll-margin-top: calc(var(--header-h) + 72px); }


/* Recipes */
table.mk-recipes th:first-child { width: 15%; } table.mk-recipes td:nth-child(2) { width: 8%; } table.mk-recipes td:nth-child(3) { width: 12%; } table.mk-recipes td:nth-child(4) { width: 14%; }
table.mk-recipes td code, table.mk-recipes th code { color: var(--text); }
table.mk-recipes tbody th { white-space: normal; }

/* Utility screenshots */
.mk-shots { display: grid; gap: 16px; }
.mk-shots figure { margin: 0; }
.mk-pins-crop { aspect-ratio: 16 / 3.1; overflow: hidden; border-radius: var(--r); }
.mk-pins-crop img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 100%; border-radius: 0; }
.mk-shots__pins figcaption { margin-top: 8px; text-align: center; }

/* Install: fit + dimensions */
.mk-fit { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.mk-fit__left { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.mk-fit__happ { margin: 0; aspect-ratio: 1; }
.mk-fit__happ img { object-position: 50% 100%; transform: scale(1.16); transform-origin: 50% 100%; }
.mk-dims { display: grid; gap: 12px; align-content: start; }
.mk-dims__draw { border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: #0a1116; }
.mk-dims__draw img { width: 100%; height: auto; filter: invert(1) hue-rotate(180deg) brightness(0.92); mix-blend-mode: screen; }


/* ==========================================================================
   Wiring Kits
   ========================================================================== */
.wk-hero__photo { aspect-ratio: 4 / 3; margin: 0; background: #000; }
.wk-kits { display: grid; margin-top: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.wk-kits a { display: flex; align-items: center; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.wk-kits a:last-child { border-bottom: 0; }
.wk-kits a:hover { color: var(--text); background: var(--surface-2); }
.wk-kits a > span { display: flex; align-items: center; gap: 12px; }
.wk-kits b { font: 500 var(--fs-sm)/1.3 var(--font-body); }
.wk-kits .price { font-size: 1rem; }
/* The side-by-side spec table: scrolls inside its frame on a phone, never the page */
.wk-compare { min-width: 620px; }
.wk-compare tbody th { white-space: normal; width: 19%; }
.wk-compare td { font-size: var(--fs-sm); }
.wk-compare td.mono { color: var(--text); }
.wk-compare .price { font-size: 1rem; }
.wk-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.wk-anchors span { display: block; scroll-margin-top: calc(var(--header-h) + 56px); }
@media (max-width: 620px) {
  table.wk-compare, .wk-compare caption, .wk-compare tbody, .wk-compare tr, .wk-compare th, .wk-compare td { display: block; width: 100%; min-width: 0; }
  .wk-compare thead { display: none; }
  .wk-compare tbody tr { padding: 6px 0 8px; border-bottom: 1px solid var(--line); }
  .wk-compare tbody tr:last-child { border-bottom: 0; }
  table.wk-compare tbody th { width: auto; padding: 6px 14px 4px; border: 0; }
  table.wk-compare td { position: relative; padding: 3px 14px 3px 112px; border: 0; }
  .wk-compare td::before { content: attr(data-label); position: absolute; left: 14px; top: 3px; font: 400 var(--fs-xs)/1.7 var(--font-body); color: var(--muted); }
}

.wk-sw { display: inline-block; width: 12px; height: 12px; margin-right: 8px; border-radius: 3px; background: var(--c); vertical-align: -1px; box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22); flex: none; }




/* ==========================================================================
   ST-Link V2
   ========================================================================== */


/* Who needs one: a table on desktop, one block per board on a phone */
.sl-who tbody th { white-space: normal; min-width: 170px; }
.sl-who td:nth-child(2) { white-space: nowrap; color: var(--text); }
.sl-who td { font-size: var(--fs-sm); }
@media (max-width: 760px) {
  table.sl-who, .sl-who tbody, .sl-who tr, .sl-who th, .sl-who td { display: block; width: 100%; min-width: 0; }
  .sl-who thead { display: none; }
  .sl-who tbody tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .sl-who tbody tr:last-child { border-bottom: 0; }
  table.sl-who tbody th, table.sl-who td { padding: 4px 14px; border: 0; white-space: normal; }
  .sl-who td:nth-child(n + 3)::before { content: attr(data-label); display: block; font: 500 var(--fs-xs)/1.6 var(--font-body); color: var(--muted); }
}

/* ATLAS trackball firmware block, inside the step-by-step section (ST-Link page). The ATLAS pages link to #atlas. */
.sl-atlas-block { margin-top: clamp(32px, 5vw, 56px); padding-top: clamp(24px, 3vw, 36px); border-top: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 56px); }
.sl-atlas-block__lead { max-width: 78ch; margin: 0 0 20px; }
.sl-atlas__steps { margin: 0 0 14px; }
.sl-atlas__shot figcaption { margin-top: 8px; text-align: center; }
.sl-atlas__shot { margin: 0; }
.sl-atlas__shot img { display: block; width: 100%; height: auto; }

.sl-photo { margin: 0; overflow: hidden; border-radius: var(--r-xl); border: 1px solid var(--line); background: #fff; }
.sl-photo img { width: 100%; height: auto; padding: 10px 10px 0; }
.sl-photo figcaption { padding: 11px 16px; background: var(--surface); border-top: 1px solid var(--line); font-size: 0.8rem; color: var(--muted); }

.sl-flash { max-width: 760px; }
.sl-dl .btn { flex: none; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .mk__grid { grid-template-columns: minmax(0, 1fr); }
  .mk-result { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .mk-result .mk-screen { grid-row: span 2; }
}
@media (max-width: 960px) {
  .sv-sim__body { grid-template-columns: minmax(0, 1fr); }
  .sv-ref__note { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .mk-board { grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 10px; }
  .mk-wires { display: none; }
  .mk-terms { display: none; }
  .mk-row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .rk, .mk-jumper, .mk-arcade { width: 56px; }
  .rk { height: 56px; }
  .mk-strip ol { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .mk-pin { grid-template-columns: 10px minmax(0, 1fr); gap: 6px; padding: 0 6px; }
  .mk-pin em { display: none; }
  .mk-pin.is-default { box-shadow: inset 0 0 0 1px rgba(201, 210, 217, 0.25); }
  .mk-pin__jumper { display: none; }
  .mk-result { grid-template-columns: minmax(0, 1fr); }
  .mk-result .mk-screen { grid-row: auto; }
  .mk-state { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mk-fit { grid-template-columns: minmax(0, 1fr); }
  .mk-fit__happ { aspect-ratio: 4 / 3; }
  table.mk-recipes thead { display: none; }
  table.mk-recipes, table.mk-recipes tbody, table.mk-recipes tr, table.mk-recipes th, table.mk-recipes td { display: block; width: 100%; }
  table.mk-recipes tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  table.mk-recipes tr:last-child { border-bottom: 0; }
  table.mk-recipes th, table.mk-recipes td, table.mk-recipes th:first-child, table.mk-recipes td:nth-child(n) { width: auto; padding: 0; border: 0; }
  table.mk-recipes tbody th { grid-column: 1 / -1; font-size: 1.02rem; }
  table.mk-recipes td:nth-child(5), table.mk-recipes td:nth-child(6) { grid-column: 1 / -1; }
  table.mk-recipes td::before { content: attr(data-l); display: block; margin-bottom: 2px; color: var(--dim); font: 500 var(--fs-xs)/1.2 var(--font-body); }
  .sv-ref__note > div { flex-direction: column; gap: 8px; }
  .sv-housing-shots { gap: 8px; }
}
@media (max-width: 600px) {
  .a2-feats { grid-template-columns: minmax(0, 1fr); }
  .sv-ref > .grid { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px; margin: 0 calc(-1 * var(--gutter)); padding: 4px var(--gutter) 12px; scrollbar-width: none; overscroll-behavior-x: contain; }
  .sv-ref > .grid::-webkit-scrollbar { display: none; }
  .sv-ref > .grid > * { flex: 0 0 82%; scroll-snap-align: center; }
  .sv-ref__title::after { content: 'Swipe →'; margin-left: 10px; font: 500 var(--fs-xs)/1 var(--font-body); color: var(--dim); vertical-align: middle; }
  .sv-hero__live { grid-template-columns: minmax(0, 1fr); }
  .sv-power { margin-left: 0; }
  .sv-bar-sep { display: none; }
  .sv-sim .demo__bar .chip { height: 32px; padding: 0 12px; }
  .sv-now { grid-template-columns: minmax(0, 1fr) auto; }
  .sv-now__bar { grid-column: 1 / -1; grid-row: 2; }
  .sv-b { min-height: 40px; padding: 0 10px; }
  .sv-gallery { grid-template-columns: minmax(0, 1fr); }
  .sv-shot--tall { aspect-ratio: 4 / 5; max-height: 460px; }
  .sv-gallery .photo-slot { aspect-ratio: auto; }
  .sv-chain { flex-direction: column; align-items: stretch; padding: 4px 0; }
  .sv-node { width: 100%; grid-template-columns: auto 1fr auto; justify-items: start; text-align: left; align-items: center; column-gap: 12px; }
  .sv-node .tiny { justify-self: end; }
  .sv-pins { justify-self: end; }
  .sv-wire { flex: none; width: 22px; height: 40px; min-width: 0; margin-left: 30px; display: flex; gap: 2px; padding: 0; }
  .sv-wire i { width: 2px; height: 100%; }
  .sv-wire__len { left: calc(100% + 12px); bottom: auto; top: 50%; transform: translateY(-50%); }
  .bp-t { font-size: 19px; }
  .bp-h { font-size: 16px; }
  .bp-dim { font-size: 15px; }
  .mk-tabs { flex-direction: column; align-items: flex-start; }
  .mk-strip ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* SpecVision photos at the top of the page: pick one from the row of small pictures (no script needed) */
.sv-gal { position: relative; }
.sv-gal__r { position: absolute; opacity: 0; pointer-events: none; }
.sv-gal__stage figure { display: none; margin: 0; position: relative; height: 420px; background: var(--surface); place-items: center; overflow: hidden; border-radius: var(--r-lg); }
.sv-gal__stage figure img { width: 100%; height: 100%; object-fit: contain; }
.sv-gal__stage figure:not(.acc-stage--lit) img { object-fit: contain; }
.sv-gal__stage figure.sv-gal__cut img { object-fit: contain; width: auto; max-width: 100%; height: auto; max-height: 340px; }
.sv-gal__stage figcaption { position: absolute; left: 0; bottom: 0; padding: 4px 10px; border-top-right-radius: var(--r); background: var(--bg); font-size: var(--fs-xs); color: var(--text-2); }
.sv-gal__thumbs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 8px 0 12px; }
.sv-gal__thumbs label { display: block; height: 56px; border-radius: var(--r); overflow: hidden; border: 2px solid var(--line-2); background: var(--surface-2); cursor: pointer; opacity: 0.7; }
.sv-gal__thumbs label:hover { opacity: 1; }
.sv-gal__thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
#sv-gal-0:checked ~ .sv-gal__stage figure:nth-child(1) { display: grid; }
#sv-gal-0:checked ~ .sv-gal__thumbs label:nth-child(1) { border-color: var(--cyan); opacity: 1; }
#sv-gal-0:focus-visible ~ .sv-gal__thumbs label:nth-child(1) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
#sv-gal-1:checked ~ .sv-gal__stage figure:nth-child(2) { display: grid; }
#sv-gal-1:checked ~ .sv-gal__thumbs label:nth-child(2) { border-color: var(--cyan); opacity: 1; }
#sv-gal-1:focus-visible ~ .sv-gal__thumbs label:nth-child(2) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
#sv-gal-2:checked ~ .sv-gal__stage figure:nth-child(3) { display: grid; }
#sv-gal-2:checked ~ .sv-gal__thumbs label:nth-child(3) { border-color: var(--cyan); opacity: 1; }
#sv-gal-2:focus-visible ~ .sv-gal__thumbs label:nth-child(3) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
#sv-gal-3:checked ~ .sv-gal__stage figure:nth-child(4) { display: grid; }
#sv-gal-3:checked ~ .sv-gal__thumbs label:nth-child(4) { border-color: var(--cyan); opacity: 1; }
#sv-gal-3:focus-visible ~ .sv-gal__thumbs label:nth-child(4) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
#sv-gal-4:checked ~ .sv-gal__stage figure:nth-child(5) { display: grid; }
#sv-gal-4:checked ~ .sv-gal__thumbs label:nth-child(5) { border-color: var(--cyan); opacity: 1; }
#sv-gal-4:focus-visible ~ .sv-gal__thumbs label:nth-child(5) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }
#sv-gal-5:checked ~ .sv-gal__stage figure:nth-child(6) { display: grid; }
#sv-gal-5:checked ~ .sv-gal__thumbs label:nth-child(6) { border-color: var(--cyan); opacity: 1; }
#sv-gal-5:focus-visible ~ .sv-gal__thumbs label:nth-child(6) { outline: 2px solid var(--cyan-hi); outline-offset: 2px; }

/* Gallery photos always show whole, whatever their shape */
.sv-gal__stage figure.acc-stage { padding: 0; }
.sv-gal__stage figure.acc-stage img { position: static; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain !important; }

.sv-gal__stage figure { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.sv-gal__stage figure.acc-stage img { min-height: 0; min-width: 0; height: 100%; width: 100%; }
