/* STAGE A adapter only. The approved template's complete original CSS loads first. */
:root { --stage-ink:#111; --stage-blue:#142BFF; --stage-yellow:#FFF000; }
html{scroll-padding-top:98px}
body{background:#fff;color:#111}
.stage-brand .brand-text small{font-size:9px}
.stage-brand .brand-mark{background:#FFF000;border:2px solid #111}
.site-header .nav-links a:not(.button){text-decoration:none}
.stage-header-nav{gap:16px}
.stage-preview-flag{font-size:11px;letter-spacing:.08em;font-weight:900;background:#FFF000;color:#111;border-bottom:2px solid #111;padding:9px max(4%,calc((100vw - 1190px)/2));text-transform:uppercase}
.stage-hero{background:#fff;padding:50px 0 40px;border-bottom:4px solid #111}
.stage-hero h1{font-weight:950;line-height:1.03;letter-spacing:-.055em;font-size:clamp(2.3rem,4.5vw,4.8rem);margin:12px 0 20px;max-width:920px}
.stage-hero p:not(.eyebrow){max-width:810px;font-size:16px;line-height:1.6;color:#333}
.stage-hero .eyebrow{color:#142BFF}
.stage-chip{display:inline-block;border:2px solid #111;padding:5px 9px;background:#fff;font-size:11px;font-weight:900;letter-spacing:.06em;text-transform:uppercase}
.stage-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.stage-index{padding:42px 0 90px}
.stage-index h2{font-size:clamp(1.8rem,3vw,2.8rem);font-weight:950;letter-spacing:-.04em}
.stage-category{font-size:13px;font-weight:900;letter-spacing:.05em;text-transform:uppercase;border-bottom:3px solid #111;padding-bottom:12px;margin:42px 0 17px}
.stage-card-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.stage-card{display:flex;flex-direction:column;gap:12px;padding:22px;background:#fff;border:2px solid #111;box-shadow:5px 5px 0 #142BFF;text-decoration:none;color:#111;min-height:178px}
.stage-card:hover,.stage-card:focus-visible{background:#FFF000;transform:translate(-2px,-2px)}
.stage-card strong{font-size:19px;line-height:1.2;letter-spacing:-.02em}
.stage-card p{font-size:13px;color:#444;margin:0;line-height:1.5}
.stage-card small{font-size:11px;color:#142BFF;font-weight:900}
.stage-meta{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-bottom:16px}
.stage-lab{background:#fff;border-top:6px solid #142BFF;padding:55px 0 60px}
.stage-lab .engineering-heading h2{max-width:890px}
.stage-lab .lab-layout{grid-template-columns:minmax(0,1.8fr) minmax(260px,.8fr)}
.stage-lab .lab-canvas{min-width:0;border:2px solid #111;background:#fff;box-shadow:7px 7px 0 #142BFF}
.stage-lab .lab-canvas-top{background:#fff;border-bottom:2px solid #111}
.stage-lab .facility-drawing{padding:20px 10px;overflow-x:auto;background:#fff;min-height:320px}
.stage-lab .diagram-svg{display:block;width:100%;min-width:720px;max-height:510px}
.stage-lab .diagram-node{cursor:pointer;outline:0}
.stage-lab .diagram-node:focus-visible rect:nth-child(2){stroke:#ff242a;stroke-width:6px}
.stage-lab .diagram-node:hover rect:nth-child(2),.stage-lab .diagram-node.is-selected rect:nth-child(2){fill:#FFF000;stroke:#111}
.stage-lab .lab-detail{border:2px solid #111;box-shadow:6px 6px 0 #FFF000;background:#fff;padding:22px;display:flex;flex-direction:column;min-height:100%}
.stage-lab .lab-detail-count{font-weight:950;font-size:48px;line-height:1.1;color:#142BFF}
.stage-lab .lab-detail-tag{font-weight:900;font-size:12px;letter-spacing:.07em;color:#142BFF;text-transform:uppercase}
.stage-lab .lab-detail h3{font-size:clamp(1.2rem,2vw,1.65rem);font-weight:950;margin:14px 0}
.stage-lab .lab-detail p{font-size:14px;line-height:1.55}
.stage-lab .lab-detail ul{margin:12px 0 0;padding-left:20px;font-size:13px;line-height:1.5}
.stage-tool{padding:64px 0;background:#FFF000;color:#111;border-top:4px solid #111;border-bottom:4px solid #111}
.stage-tool .tool-head{display:flex;justify-content:space-between;align-items:start;gap:20px;margin-bottom:24px}
.stage-tool .tool-head h2{font-size:clamp(2rem,3.4vw,3.5rem);letter-spacing:-.055em;line-height:1.1;font-weight:950;max-width:920px;margin:10px 0 16px}
.stage-tool .tool-head p:not(.eyebrow){font-size:15px;line-height:1.7;max-width:780px}
.stage-tool .tool-asterisk{font-size:88px;line-height:1}
.stage-tool .scope-tool-grid{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,.95fr);gap:20px;align-items:start}
.stage-tool .stage-input-panel,.stage-tool .stage-output-panel{background:#fff;border:2px solid #111;box-shadow:7px 7px 0 #142BFF;padding:24px;min-width:0}
.stage-tool .stage-input-panel h3,.stage-tool .stage-output-panel h3{font-size:19px;font-weight:950;margin:0 0 16px}
.stage-output-panel{min-height:270px}
.stage-output-panel .output-meta{display:flex;justify-content:space-between;border-bottom:2px solid #111;padding-bottom:10px;font-size:10px;font-weight:900;letter-spacing:.06em}
.stage-result{font-size:14px;line-height:1.55;overflow-wrap:anywhere;margin-top:20px}
.stage-result h4{font-size:20px;line-height:1.3;font-weight:950;margin:10px 0}
.stage-result ul,.stage-result ol{padding-left:22px}
.stage-result li{margin:7px 0}
.stage-result .stage-number{font-weight:950;color:#142BFF;font-size:24px}
.stage-result table{border-collapse:collapse;width:100%;font-size:12px}
.stage-result td,.stage-result th{border:1px solid #111;padding:7px;text-align:left}
.stage-result th{background:#FFF000}
.stage-field{display:flex;flex-direction:column;gap:7px;margin:0 0 15px;min-width:0}
.stage-field label,.stage-field legend{font-size:13px;line-height:1.45;font-weight:850;color:#111}
.stage-field input:not([type=checkbox]):not([type=radio]),.stage-field select,.stage-field textarea{width:100%;padding:12px 10px;border:2px solid #111;border-radius:0;background:#fff;color:#111;font:inherit;font-size:15px;min-height:44px;max-width:100%}
.stage-field select{appearance:auto}
.stage-field select:focus,.stage-field input:focus,.stage-field textarea:focus{outline:3px solid #142BFF;outline-offset:2px}
.stage-field .field-note{font-size:11px;color:#555;line-height:1.4}
.stage-field-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
.stage-field input[type=checkbox]{accent-color:#142BFF;width:18px;height:18px}
.stage-button-row{display:flex;gap:9px;flex-wrap:wrap;margin-top:16px}
.stage-button-row .button,.stage-button-row button{font-weight:900}
.stage-button-row .stage-secondary{background:#fff;border:2px solid #111;color:#111;padding:10px 14px;cursor:pointer}
.stage-button-row .stage-secondary:hover{background:#eee}
.stage-tool .button.button--primary{background:#142BFF!important;color:#fff!important;border:2px solid #111!important;padding:12px 16px!important;cursor:pointer}
.stage-tool .button.button--primary:hover{background:#111!important}
.stage-msg{padding:12px;margin:12px 0;border:2px solid #111;background:#F6F6F6;font-size:13px;line-height:1.55}
.stage-msg--warning{border-color:#FF242A}
.stage-splitline{height:2px;background:#111;margin:17px 0}
.stage-checkrow{display:grid;grid-template-columns:1fr 95px 95px 95px;gap:2px;align-items:center;margin:7px 0;border-bottom:1px solid #999;padding:8px 0}
.stage-checkrow label{font-size:12px;font-weight:750}
.stage-checkrow select{font-size:12px;border:2px solid #111;padding:5px;max-width:100%}
.stage-rowgroup{border:2px solid #111;padding:15px;margin-bottom:12px;background:#fafafa}
.stage-rowgroup .rowtitle{font-size:13px;font-weight:900;margin-bottom:9px}
.stage-steps{display:flex;gap:7px;flex-wrap:wrap;list-style:none;padding:0;margin:8px 0 20px}
.stage-steps li{border:2px solid #111;background:#fff;padding:8px 12px;font-size:11px;font-weight:900}
.stage-steps li[aria-current=step]{background:#142BFF;color:#fff}
.stage-actions-bottom{padding:36px 0;background:#fff}
.stage-actions-bottom p{font-size:13px}
.site-footer .footer-grid .stage-footer-links{display:flex;flex-direction:column;gap:7px}
.stage-hidden{display:none!important}
.stage-sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
@media(max-width:950px){.stage-card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.stage-lab .lab-layout{grid-template-columns:1fr}.stage-lab .lab-detail{min-height:0}}
@media(max-width:760px){.stage-tool .scope-tool-grid{grid-template-columns:1fr}.stage-tool .tool-asterisk{font-size:56px}.stage-card-grid{grid-template-columns:1fr}.stage-hero{padding:35px 0}.stage-lab{padding:40px 0}.stage-tool{padding:40px 0}.stage-lab .diagram-svg{min-width:680px}.stage-field-row{grid-template-columns:1fr}.stage-preview-flag{font-size:10px}.stage-header-nav{display:none}}
@media(max-width:470px){.stage-tool .stage-input-panel,.stage-tool .stage-output-panel{padding:15px}.stage-checkrow{grid-template-columns:1fr 64px 64px 64px;gap:3px}.stage-checkrow select{font-size:10px;padding:4px}.stage-tool .tool-head h2{font-size:1.9rem}}
@media(prefers-reduced-motion:reduce){.stage-card:hover,.stage-card:focus-visible{transform:none}html{scroll-behavior:auto}}

/* Stage A v1.1: show the entire diagram at desktop size; a readable,
   selectable relationship map replaces tiny/clipped SVG at narrow widths. */
.stage-lab .facility-drawing{min-height:0;overflow:visible;padding:14px 10px;background:#fff}
.stage-lab .diagram-svg{display:block;width:100%;min-width:0;max-width:100%;max-height:none;height:auto;overflow:visible}
.stage-lab .lab-canvas{min-width:0;overflow:visible}
.stage-lab .lab-layout > *{min-width:0}
.stage-mobile-map{display:none}
.stage-result{overflow-x:auto;max-width:100%}
.stage-result table{min-width:430px;width:100%}
@media(max-width:1150px){.stage-lab .lab-layout{grid-template-columns:minmax(0,1fr)}.stage-lab .lab-detail{min-height:0}}
@media(max-width:760px){
 .stage-lab .facility-drawing{display:none}
 .stage-mobile-map{display:block;padding:15px 12px 22px;background:#fff}
 .stage-mobile-map-title{font-size:11px;font-weight:900;letter-spacing:.06em;border-bottom:2px solid #111;padding-bottom:12px;margin:0 0 15px}
 .stage-mobile-map-items{display:grid;grid-template-columns:1fr;gap:13px}
 .stage-mobile-node{display:block;position:relative;width:100%;min-width:0;text-align:left;color:#111;background:#fff;border:2px solid #111;padding:12px 13px;box-shadow:4px 4px 0 #142BFF;font:inherit;cursor:pointer;overflow-wrap:anywhere}
 .stage-mobile-node strong{display:block;font-size:14px;line-height:1.3;font-weight:900}
 .stage-mobile-node small{display:block;font-size:11px;line-height:1.5;margin-top:6px;color:#333}
 .stage-mobile-node small span{font-weight:850;color:#142BFF}
 .stage-mobile-node.is-selected{background:#FFF000;box-shadow:4px 4px 0 #142BFF}
 .stage-mobile-node:focus-visible{outline:3px solid #142BFF;outline-offset:3px}
 .stage-lab .lab-canvas-top{gap:8px;flex-wrap:wrap;font-size:10px}
 .stage-lab .drawing-legend{font-size:12px}
 .stage-result table{min-width:420px}
}

/* Stage A v1.1: show the entire diagram at desktop size; a readable,
   selectable relationship map replaces tiny/clipped SVG at narrow widths. */
.stage-lab .facility-drawing{min-height:0;overflow:visible;padding:14px 10px;background:#fff}
.stage-lab .diagram-svg{display:block;width:100%;min-width:0;max-width:100%;max-height:none;height:auto;overflow:visible}
.stage-lab .lab-canvas{min-width:0;overflow:visible}
.stage-lab .lab-layout > *{min-width:0}
.stage-mobile-map{display:none}
.stage-result{overflow-x:auto;max-width:100%}
.stage-result table{min-width:430px;width:100%}
@media(max-width:1150px){.stage-lab .lab-layout{grid-template-columns:minmax(0,1fr)}.stage-lab .lab-detail{min-height:0}}
@media(max-width:760px){
 .stage-lab .facility-drawing{display:none}
 .stage-mobile-map{display:block;padding:15px 12px 22px;background:#fff}
 .stage-mobile-map-title{font-size:11px;font-weight:900;letter-spacing:.06em;border-bottom:2px solid #111;padding-bottom:12px;margin:0 0 15px}
 .stage-mobile-map-items{display:grid;grid-template-columns:1fr;gap:13px}
 .stage-mobile-node{display:block;position:relative;width:100%;min-width:0;text-align:left;color:#111;background:#fff;border:2px solid #111;padding:12px 13px;box-shadow:4px 4px 0 #142BFF;font:inherit;cursor:pointer;overflow-wrap:anywhere}
 .stage-mobile-node strong{display:block;font-size:14px;line-height:1.3;font-weight:900}
 .stage-mobile-node small{display:block;font-size:11px;line-height:1.5;margin-top:6px;color:#333}
 .stage-mobile-node small span{font-weight:850;color:#142BFF}
 .stage-mobile-node.is-selected{background:#FFF000;box-shadow:4px 4px 0 #142BFF}
 .stage-mobile-node:focus-visible{outline:3px solid #142BFF;outline-offset:3px}
 .stage-lab .lab-canvas-top{gap:8px;flex-wrap:wrap;font-size:10px}
 .stage-lab .drawing-legend{font-size:12px}
 .stage-result table{min-width:420px}
}
.stage-lab .lab-layout{align-items:start}
.stage-lab .lab-canvas-top{background:#142BFF;color:#fff}
.stage-lab .lab-canvas .drawing-legend{display:block;line-height:1.5;color:#333;background:#fff;padding:12px 14px}
