/* Restored inspection readout and the automatic cover-to-board zoom state. */
.key-perspective-container{aspect-ratio:var(--board-ratio,1114 / 1411)}
.front-image{mix-blend-mode:var(--front-board-blend,screen)}
.back-image{transform:scale(var(--back-board-scale,.91))}
.key-buttons--4{gap:7px}.key-buttons--4 i{width:40px;height:40px}.key-buttons--5{gap:5px}.key-buttons--5 i{width:34px;height:34px}
.connection-overlay .route-mask{fill:none;stroke:#27653b;stroke-width:1.15;stroke-linecap:round;stroke-linejoin:round;opacity:.94;mix-blend-mode:color;pointer-events:none}.connection-overlay path[data-route-id]{fill:none;stroke:#176bff;stroke-width:2;vector-effect:non-scaling-stroke;stroke-linecap:round;stroke-linejoin:round;opacity:0;filter:drop-shadow(0 0 2px #176bff);transition:opacity .2s ease,stroke .2s ease}.connection-overlay path[data-route-id].is-active{opacity:1;stroke:#00c8ff;stroke-width:2.2;stroke-dasharray:3 6;animation:signalFlow .65s linear infinite;filter:drop-shadow(0 0 2px #00c8ff)}
.board-stage.is-key-view .animated-key-fob{animation:keyHover 2.8s cubic-bezier(.45,.05,.55,.95) infinite}
@keyframes keyHover{0%,100%{transform:translateY(0) rotateZ(0)}50%{transform:translateY(-13px) rotateZ(1.2deg)}}
.key-buttons{gap:14px}.key-buttons i{width:49px;height:49px;border:2px solid #d6e1e4;border-radius:50%;background:radial-gradient(circle at 36% 28%,#f4fbfc 0 5%,#607278 8%,#263136 43%,#080c0e 69%);box-shadow:inset 2px 2px 3px rgba(255,255,255,.55),inset -4px -4px 5px #010304,0 4px 7px rgba(0,0,0,.58)}.key-buttons i:after{color:#f8ffff;font-size:17px;text-shadow:0 1px 2px #000}.key-trunk:after{font-size:26px!important}
.key-buttons i:after{content:none}.key-buttons i svg{width:53%;height:53%;fill:none;stroke:#f8ffff;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;filter:drop-shadow(0 1px 1px #000)}
.key-buttons i{display:grid;place-items:center;line-height:0;background:linear-gradient(145deg,#58666b 0,#2b373b 35%,#11181b 68%,#05090a 100%)}.key-buttons i svg{display:block;flex:none}.key-trunk svg{width:58%;height:58%}
.interactive-target-node{border:1.5px solid color-mix(in srgb,var(--target,#00ffcc) 72%,transparent);background:color-mix(in srgb,var(--target,#00ffcc) 8%,transparent);box-shadow:inset 0 0 0 1px rgba(0,0,0,.16),0 0 10px color-mix(in srgb,var(--target,#00ffcc) 30%,transparent);cursor:zoom-in;animation:targetBeacon 2.2s ease-in-out infinite}.interactive-target-node:after{content:'';position:absolute;top:-1px;right:-1px;width:2px;height:2px;border:.5px solid rgba(236,255,247,.6);border-radius:50%;background:var(--target,#00ffcc);box-shadow:0 0 2px var(--target,#00ffcc)}.interactive-target-node:hover,.interactive-target-node:focus-visible{border-color:var(--target,#00ffcc);background:color-mix(in srgb,var(--target,#00ffcc) 19%,transparent);box-shadow:0 0 25px color-mix(in srgb,var(--target,#00ffcc) 92%,transparent),0 0 10px color-mix(in srgb,var(--target,#00ffcc) 68%,transparent),inset 0 0 12px color-mix(in srgb,var(--target,#00ffcc) 26%,transparent);animation:none}@keyframes targetBeacon{0%,100%{box-shadow:inset 0 0 0 1px rgba(0,0,0,.16),0 0 8px color-mix(in srgb,var(--target,#00ffcc) 24%,transparent)}50%{box-shadow:inset 0 0 0 1px rgba(0,0,0,.16),0 0 16px color-mix(in srgb,var(--target,#00ffcc) 52%,transparent)}}
.component-readout{display:grid;grid-template-columns:160px minmax(0,1fr);gap:18px;align-items:start;margin-top:14px;padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:linear-gradient(105deg,rgba(5,29,21,.9),rgba(7,43,31,.58));box-shadow:inset 0 1px rgba(255,255,255,.04)}.component-readout>span{padding-top:4px;color:var(--mint);font:600 10px 'DM Mono',monospace;letter-spacing:.12em}.component-readout strong{display:block;color:#effff7;font:600 18px/1.15 'Space Grotesk',sans-serif}.component-readout p{max-width:720px;margin:7px 0 0;color:#a7c4b6;font-size:13px}
@media(max-width:620px){.component-readout{grid-template-columns:1fr;gap:7px}.component-readout strong{font-size:16px}}

/* Side-by-side inspection layout: descriptions are visible but never cover the key. */
.inspection-workspace{display:grid;grid-template-columns:minmax(0,1fr) 310px;align-items:stretch}.inspection-workspace .board-stage{min-width:0}.inspection-workspace .component-readout{display:flex;flex-direction:column;align-items:stretch;gap:14px;margin:0;padding:24px 22px;border:0;border-left:1px solid var(--line);border-radius:0;background:linear-gradient(160deg,rgba(6,36,26,.94),rgba(2,19,14,.88));box-shadow:none}.readout-kicker{color:var(--mint);font:600 10px 'DM Mono',monospace;letter-spacing:.14em}.readout-icon{display:grid;place-items:center;width:48px;height:48px;border:1px solid rgba(0,255,188,.28);border-radius:13px;background:rgba(0,255,188,.08);color:var(--mint);font:700 26px/1 'DM Mono',monospace}.component-readout strong{font-size:20px;letter-spacing:-.02em}.component-readout p{margin-top:8px;color:#b7d0c4;font-size:14px;line-height:1.65}.readout-tip{margin-top:auto;padding-top:14px;border-top:1px solid rgba(157,255,205,.16);color:#82a698;font:10px/1.6 'DM Mono',monospace;letter-spacing:.01em}
@media(max-width:980px){.inspection-workspace{grid-template-columns:1fr}.inspection-workspace .component-readout{min-height:220px;border-top:1px solid var(--line);border-left:0}.readout-tip{margin-top:8px}}

/* Primary navigation for the two physical sides of the key. */
.primary-flip{position:relative;min-height:34px;padding:8px 14px!important;border-color:rgba(0,255,188,.75)!important;background:linear-gradient(135deg,rgba(0,255,188,.28),rgba(0,255,188,.08))!important;box-shadow:0 0 0 1px rgba(0,255,188,.12),0 0 15px rgba(0,255,188,.18);color:#f0fff9!important;font-weight:700!important}.primary-flip:before{content:'';display:inline-block;width:6px;height:6px;margin-right:7px;border-radius:50%;background:#00ffbc;box-shadow:0 0 8px #00ffbc;vertical-align:middle}.primary-flip:hover{transform:translateY(-1px);box-shadow:0 0 0 1px rgba(0,255,188,.3),0 0 23px rgba(0,255,188,.34)}
.stage-flip{position:absolute;z-index:12;top:18px;right:18px}.board-stage.is-key-view .key-animation{pointer-events:auto;cursor:zoom-in}.board-stage.is-key-view .key-animation:focus-visible{outline:2px solid var(--mint);outline-offset:8px;border-radius:42px}.board-stage.is-key-view .animated-key-fob:after{content:'CLICK TO INSPECT';position:absolute;z-index:8;top:50%;left:50%;bottom:auto;transform:translate(-50%,-50%);padding:9px 12px;border:1px solid rgba(160,255,211,.32);border-radius:7px;background:rgba(0,255,188,.035);color:rgba(223,255,242,.82);font:700 12px 'DM Mono',monospace;letter-spacing:.16em;white-space:nowrap;text-shadow:0 0 11px rgba(0,255,188,.65);box-shadow:0 0 22px rgba(0,255,188,.1);animation:inspectPrompt 1.8s ease-in-out infinite}@keyframes inspectPrompt{0%,100%{opacity:.58;scale:.97}50%{opacity:1;scale:1.02}}
.inspection-note{padding:12px 13px;border:1px solid rgba(0,255,188,.17);border-radius:9px;background:rgba(0,255,188,.045)}.inspection-note span{color:#71e9b8;font:600 9px 'DM Mono',monospace;letter-spacing:.11em}.inspection-note p{margin:6px 0 0!important;color:#c4ded2!important;font-size:12px!important;line-height:1.55!important}
.repair-overview{display:grid;grid-template-columns:minmax(230px,.7fr) minmax(0,1.3fr);gap:34px;margin-top:26px;padding:26px;border:1px solid var(--line);border-radius:15px;background:linear-gradient(135deg,rgba(7,40,29,.72),rgba(3,20,14,.85))}.overview-heading>span{color:var(--mint);font:600 10px 'DM Mono',monospace;letter-spacing:.13em}.overview-heading h2{margin:9px 0;color:#effff7;font:600 clamp(24px,2.6vw,34px)/1.05 'Space Grotesk',sans-serif;letter-spacing:-.04em}.overview-heading p{margin:0;color:#a9c5b8;font-size:14px;line-height:1.65}.guide-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:11px}.guide-grid article{padding:16px;border:1px solid rgba(157,255,205,.15);border-radius:10px;background:rgba(1,16,11,.28);transition:border-color .2s ease,transform .2s ease}.guide-grid article:hover{border-color:rgba(0,255,188,.42);transform:translateY(-2px)}.guide-grid b{color:#00ffbc;font:600 11px 'DM Mono',monospace}.guide-grid h3{margin:7px 0 4px;color:#eafff4;font:600 16px 'Space Grotesk',sans-serif}.guide-grid p{margin:0;color:#a8c4b7;font-size:12px;line-height:1.55}@media(max-width:850px){.repair-overview{grid-template-columns:1fr}.guide-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:500px){.guide-grid{grid-template-columns:1fr}.primary-flip{flex:1}.toolbar-actions{gap:7px}}
/* Keep the added draft safety controls inside the existing footer on narrow screens. */
.calibration-actions { flex-wrap: wrap; }
.board-footer { flex-wrap: wrap; }

/* Framing-only override. Pixel resolution and percentage maps are unchanged. */
.inspection-workspace .board-stage {
  height:clamp(420px,72svh,760px);min-height:0;
}
.key-perspective-container {
  flex:none;min-width:0;max-width:none;
}
.board-stage .key-card-flipper,
.board-stage.is-macro .key-card-flipper,
.board-stage.is-macro .key-card-flipper.is-flipped {
  scale:var(--inspection-scale,1);
}

/* Pan lives on the shared outer board frame. The image, targets and routes
   remain descendants of the same transformed frame, so their calibrated
   percentage coordinates stay together. */
.key-perspective-container {
  translate:var(--board-pan-x,0px) var(--board-pan-y,0px);
  transition:opacity .45s ease,transform .6s cubic-bezier(.22,1,.36,1),translate .05s linear;
}
.board-stage.is-pannable { touch-action:none; }
.board-stage.is-pannable .key-perspective-container { cursor:grab; }
.board-stage.is-panning .key-perspective-container { cursor:grabbing; }
.board-stage.is-panning { user-select:none; }

.component-basics-link,
.pcb-legend-link {
  display:inline-flex;
  align-items:center;
  width:max-content;
  max-width:100%;
  padding:7px 9px;
  border:1px solid rgba(0,255,188,.28);
  border-radius:6px;
  background:rgba(0,255,188,.06);
  color:#dfffee;
  font:600 9px 'DM Mono',monospace;
  letter-spacing:.08em;
  text-decoration:none;
  transition:border-color .2s ease,background .2s ease;
}
.component-basics-link:hover,.component-basics-link:focus-visible,.pcb-legend-link:hover,.pcb-legend-link:focus-visible { border-color:var(--mint); background:rgba(0,255,188,.16); }
.pcb-legend { margin:0; padding:12px 16px; border-bottom:1px solid rgba(157,255,205,.16); background:#07251b; }
.pcb-legend h2 { margin:0 0 5px; color:#dfffee; font:600 10px 'DM Mono',monospace; letter-spacing:.1em; }
#pcbLegend .pcb-legend-items { grid-template-columns:repeat(3,minmax(0,1fr)); gap:4px 8px; }
#pcbLegend .pcb-legend-item { font-size:10px; padding:4px 6px; }
#pcbLegend .pcb-legend-note { margin:6px 0 0; padding-top:5px; }
#pcbLegend .pcb-legend-link { padding:4px 7px; margin:6px 0 0; }
@media(max-width:600px){#pcbLegend .pcb-legend-items{grid-template-columns:repeat(2,minmax(0,1fr))}#pcbLegend .pcb-legend-item{font-size:9px}}
.pcb-legend summary { display:flex; align-items:center; justify-content:space-between; gap:8px; padding:13px 0 9px; color:#dfffee; cursor:pointer; font:600 10px 'DM Mono',monospace; letter-spacing:.1em; list-style:none; }
.pcb-legend summary::-webkit-details-marker { display:none; }
.pcb-legend summary::after { content:'+'; color:var(--mint); font-size:15px; line-height:1; }
.pcb-legend[open] summary::after { content:'−'; }
.pcb-legend summary span { color:#7fa792; font-size:8px; }
.pcb-legend>p { margin:0 0 9px; color:#a8c5b7; font-size:11px; line-height:1.5; }
.pcb-legend-items { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:6px; }
.pcb-legend-item { display:flex; align-items:center; min-width:0; gap:7px; padding:5px 6px; border:1px solid rgba(157,255,205,.12); border-radius:5px; background:rgba(0,0,0,.12); color:#d8eee3; font:500 9px/1.25 'DM Sans',sans-serif; }
.pcb-legend-glyph { position:relative; display:inline-grid; flex:0 0 31px; width:31px; height:18px; place-items:center; color:#ff594c; font:700 7px/1 'DM Mono',monospace; }
.pcb-legend-glyph--outlined-orange-rectangle::before,.pcb-legend-glyph--outlined-red-rectangle::before,.pcb-legend-glyph--outlined-blue-rectangle::before,.pcb-legend-glyph--dark-keylined-orange-rectangle::before { content:''; width:25px; height:12px; border:2px solid #ffae3d; border-radius:2px; }
.pcb-legend-glyph--outlined-red-rectangle::before { border-color:#ff594c; }
.pcb-legend-glyph--outlined-blue-rectangle::before { border-color:#4d85ff; }
.pcb-legend-glyph--dark-keylined-orange-rectangle::before { width:27px; height:14px; border-color:#05110d; box-shadow:inset 0 0 0 2px #ffae3d; }
.pcb-legend-glyph--outlined-red-circle::before,.pcb-legend-glyph--outlined-orange-circle::before { content:''; width:15px; height:15px; border:2px solid #ff594c; border-radius:50%; }
.pcb-legend-glyph--outlined-orange-circle::before { border-color:#ffae3d; }
.pcb-legend-glyph--solid-red-line::before,.pcb-legend-glyph--solid-blue-line::before { content:''; width:27px; height:3px; border-radius:99px; background:#ff594c; }
.pcb-legend-glyph--solid-blue-line::before { background:#4d85ff; }
.pcb-legend-glyph--red-text-12-slash-10 { color:#ff594c; letter-spacing:-.06em; }
.pcb-legend-note { padding-top:8px; border-top:1px solid rgba(157,255,205,.1); color:#86a999!important; font-size:10px!important; }
.pcb-legend-link { margin:1px 0 3px; }

.first-visit-panel { position:fixed; z-index:45; right:clamp(16px,3vw,44px); bottom:24px; width:min(340px,calc(100vw - 32px)); padding:16px; border:1px solid rgba(0,255,188,.34); border-radius:12px; background:linear-gradient(145deg,rgba(7,42,30,.98),rgba(2,17,12,.98)); box-shadow:0 18px 42px rgba(0,0,0,.38),0 0 24px rgba(0,255,188,.1); }
.first-visit-panel>span { color:var(--mint); font:600 9px 'DM Mono',monospace; letter-spacing:.13em; }
.first-visit-panel h2 { margin:7px 0 6px; color:#effff7; font:600 19px/1.1 'Space Grotesk',sans-serif; letter-spacing:-.03em; }
.first-visit-panel h2 i { color:#62dba8; font-style:normal; }
.first-visit-panel p { margin:0; color:#afcabd; font-size:12px; line-height:1.5; }
.first-visit-panel>div { display:flex; align-items:center; justify-content:space-between; gap:9px; margin-top:13px; }
.first-visit-panel a,.first-visit-panel button { border:1px solid rgba(0,255,188,.3); border-radius:6px; background:rgba(0,255,188,.07); color:#dcfff0; cursor:pointer; font:600 9px 'DM Mono',monospace; letter-spacing:.07em; text-decoration:none; }
.first-visit-panel a { padding:8px 9px; }
.first-visit-panel button { padding:8px 11px; }
.first-visit-panel a:hover,.first-visit-panel a:focus-visible,.first-visit-panel button:hover,.first-visit-panel button:focus-visible { border-color:var(--mint); background:rgba(0,255,188,.17); }
@media(max-width:620px){.pcb-legend-items{grid-template-columns:1fr}.first-visit-panel{bottom:16px}.first-visit-panel h2{font-size:17px}}
