/* Scope everything to the calculators page. Existing viewer styling is untouched. */
.calc-page{min-width:0;background:#f5f8fb;color:#203147;overflow-x:clip}
.calc-main{max-width:1120px;margin:auto;padding:32px 22px 48px}
.calc-intro{margin-bottom:22px}
.calc-eyebrow{font-size:11px;font-weight:780;letter-spacing:.095em;text-transform:uppercase;color:#51718c}
.calc-intro h1{font-size:clamp(26px,3.5vw,38px);letter-spacing:-.033em;line-height:1.12;margin:10px 0 7px}
.calc-intro p{font-size:14px;color:#587083;margin:0}
.calc-search-wrap{position:relative;display:grid;gap:7px;max-width:680px;margin-bottom:15px}
.calc-search-wrap>label{font-size:12px;color:#3f5871;font-weight:750}
.calc-search-wrap input{width:100%;min-width:0;border:1px solid #cbd9e7;border-radius:10px;background:white;color:#1d344b;font-size:15px;min-height:46px;padding:10px 16px}
.calc-search-wrap input:focus-visible,.calc-page button:focus-visible,.calc-page a:focus-visible,.calc-page input:focus-visible{outline:3px solid #4c9bd5;outline-offset:2px}
.calc-search-status{position:absolute;right:9px;top:3px;font-size:11px;color:#7a8897}
.calc-tool-pills{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:19px}
.calc-tool-pills button,.calc-related-links button{border:1px solid #cfdeec;border-radius:9px;background:white;color:#2f5375;padding:10px 14px;min-height:40px;font-size:13px;font-weight:680;cursor:pointer}
.calc-tool-pills button.active,.calc-tool-pills button[aria-pressed="true"]{background:#e4f0fa;border-color:#79aad0;color:#124d7d}
.calc-tool-pills button[hidden],.calc-related-links button[hidden]{display:none}
.calc-no-results{border:1px solid #d4e1ed;padding:12px;border-radius:9px;background:white;color:#53677a;margin:0 0 15px;font-size:13px}
.calc-grid{display:grid;grid-template-columns:minmax(0,1.8fr) minmax(275px,1fr);align-items:start;gap:17px}
.calc-card,.calc-reference{background:white;border:1px solid #d9e4ee;border-radius:13px;min-width:0;box-shadow:0 4px 14px #153a5b08}
.calc-card{padding:clamp(18px,2.5vw,29px)}
.calc-card-heading{display:flex;justify-content:space-between;gap:12px;align-items:flex-start;margin-bottom:24px}
.calc-card-heading h2{font-size:clamp(21px,2.4vw,27px);line-height:1.2;margin:7px 0 5px;letter-spacing:-.02em}
.calc-card-heading p{font-size:13px;line-height:1.5;color:#61758a;margin:0}
.calc-learn{white-space:nowrap;font-size:12px;color:#226592;text-decoration:none;font-weight:700;margin-top:5px}
.calc-inputs{display:grid;grid-template-columns:minmax(0,1fr) 30px minmax(0,1fr);gap:10px;align-items:end}
.calc-field{display:block;min-width:0}
.calc-field>span{font-size:12px;font-weight:720;color:#3c536c;display:block;margin-bottom:8px}
.calc-number{min-width:0;display:flex;align-items:center;min-height:52px;padding:0 10px;border:1px solid #c8d8e8;border-radius:10px;background:#fff}
.calc-number-result{background:#f3f9fe;border-color:#9bbfdd}
.calc-number input{font:650 clamp(17px,2.2vw,23px)/1.3 ui-sans-serif,system-ui,sans-serif;min-width:0;width:100%;border:0;background:transparent;padding:10px 0;color:#173957;font-variant-numeric:tabular-nums}
.calc-number input:focus{outline:0}
.calc-number:focus-within{outline:2px solid #4c9bd5;outline-offset:2px}
.calc-number>span{color:#678199;font-weight:650;font-size:12px;white-space:nowrap;margin-left:5px}
.calc-reverse{align-self:end;height:52px;display:grid;place-items:center;color:#2c6d9e;font-size:22px}
.calc-hint{font-size:12px;line-height:1.6;color:#677b8b;margin:10px 0 21px}
.calc-error{color:#9f3030;background:#fff3f3;border:1px solid #eab8b8;padding:10px 12px;border-radius:8px;font-size:12px;line-height:1.45}
.calc-formula{border-radius:9px;background:#f0f5fa;border:1px solid #dde9f3;padding:14px;display:flex;gap:7px 18px;align-items:baseline;flex-wrap:wrap}
.calc-formula span{font-size:11px;color:#58708a;font-weight:700}
.calc-formula strong{color:#1c4c70;font-size:clamp(14px,1.65vw,18px);overflow-wrap:anywhere}
.calc-result-explainer{font-size:13px;line-height:1.6;color:#3e5b73;border-left:3px solid #68a0ca;padding:9px 12px;margin-top:12px;background:#f8fbfe}
.calc-extra{font-size:12px;color:#647b8b;margin:10px 0 0}
.calc-actions{display:flex;gap:12px;align-items:center;margin-top:21px}
.calc-actions button{background:#1c5f95;color:white;padding:10px 16px;border:0;border-radius:8px;font-size:12px;font-weight:760;min-height:41px}
.calc-actions button:disabled{background:#91a4b4;cursor:not-allowed}
.calc-actions span{font-size:12px;color:#3d725a}
.calc-reference{padding:20px}
.calc-reference h2{font-size:18px;margin:8px 0 5px}
.calc-reference p{font-size:12px;line-height:1.5;color:#5e7080;margin:0 0 16px}
.calc-table-wrap{overflow-x:auto;max-width:100%}
.calc-reference table{width:100%;border-collapse:collapse;font-variant-numeric:tabular-nums;font-size:12px}
.calc-reference th{text-align:right;background:#edf4fa;color:#2d526f;font-size:11px;padding:8px 9px}
.calc-reference th:first-child,.calc-reference td:first-child{text-align:left}
.calc-reference td{text-align:right;border-bottom:1px solid #e7edf3;padding:8px 9px;color:#44596c}
.calc-reference tbody tr:nth-child(even){background:#f8fbfd}
.calc-table-note{padding-top:13px;font-size:11.5px;line-height:1.55;color:#637688}
.calc-related{padding:22px 1px 8px}
.calc-related h2{font-size:15px;margin:0 0 10px}
.calc-related-links{display:flex;flex-wrap:wrap;gap:8px}
.calc-footer{display:flex;gap:12px 20px;flex-wrap:wrap;padding-top:24px;border-top:1px solid #e0e9f2;margin-top:18px;font-size:12px;color:#6b7f8d}
.calc-footer a{color:#2a638d;font-weight:700}
/* The shared workspace hides its nav below 760px; the calculators page
   must keep its three direct exits visible, including the 256 CSS-px stress case. */
@media(max-width:760px){.calc-page .topbar nav{display:flex;align-items:center;gap:12px;font-size:12px}.calc-page .topbar{gap:12px;padding-inline:12px}}
@media(max-width:850px){.calc-grid{grid-template-columns:minmax(0,1fr)}.calc-reference{padding:18px}.calc-main{padding:24px 16px 35px}}
@media(max-width:650px){.calc-page .topbar{gap:12px;padding:0 12px}.calc-page .topbar .local-pill{display:none}.calc-page .topbar nav{gap:12px}.calc-main{padding:23px 12px 32px}.calc-inputs{grid-template-columns:minmax(0,1fr);gap:4px}.calc-reverse{align-self:center;height:24px}.calc-number input{font-size:22px}.calc-card-heading{flex-wrap:wrap}.calc-tool-pills button{flex:1 1 auto;padding:10px 9px}.calc-search-status{top:5px}.calc-card{padding:20px 15px}}
@media(max-width:370px){.calc-page .topbar .brand b{display:none}.calc-page .topbar nav{gap:8px;font-size:12px}.calc-main{padding-left:9px;padding-right:9px}}
@media(prefers-reduced-motion:reduce){.calc-page *, .calc-page *::before,.calc-page *::after{transition:none!important;animation:none!important}}

/* RF voltage: reuse the primary calculator proportions, keep four fields legible. */
.calc-page [hidden]{display:none!important}
/* Field row contract: every label can wrap independently without shifting the input baseline.
   Both grid items stretch; the first track absorbs the longest label, the second
   keeps both input boxes in the same track, with no fixed-height text clipping. */
.rf-configuration{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:stretch;gap:12px;margin:15px 0 19px}
.rf-configuration>.calc-field{display:grid;grid-template-rows:minmax(0,1fr) auto;min-width:0}
.rf-configuration>.calc-field>span{align-self:end;line-height:1.4;overflow-wrap:anywhere;margin:0 0 8px}
.rf-configuration>.calc-field>.calc-number{align-self:end;box-sizing:border-box;width:100%}
.rf-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin:18px 0 12px}
.rf-metrics>div{background:#f4f8fc;border:1px solid #deebf5;border-radius:9px;padding:13px;min-width:0}
.rf-metrics span,.rf-unit-control span{display:block;font-size:12px;color:#536c80;margin-bottom:7px}
.rf-metrics strong{display:block;font-size:clamp(16px,2vw,21px);line-height:1.35;color:#1b4a70;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.rf-unit-control{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:12px 0 16px;font-weight:700}
.rf-unit-control span{margin:0}
.rf-unit-control select{min-height:41px;padding:8px 12px;max-width:100%;border:1px solid #b8cee0;border-radius:8px;background:white;color:#254661;font:inherit;font-size:13px}
.rf-safety-note{font-size:12px;line-height:1.65;color:#52687b;margin:14px 0 0}
@media(max-width:650px){.rf-configuration,.rf-metrics{grid-template-columns:minmax(0,1fr)}}


/* A descriptive reference link is allowed to wrap naturally at 256 CSS px;
   preserving full wording must not widen the calculator or clip inputs. */
#rfVoltagePanel .calc-learn{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.4}


/* Reflection mode: one active input above concise metrics, aligned labels by grid track. */
.reflect-configuration{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px;margin:14px 0 18px;align-items:stretch}
.reflect-configuration>.calc-field{min-width:0;display:grid;grid-template-rows:minmax(0,1fr) auto}
.reflect-configuration>.calc-field>span{align-self:end;line-height:1.45}
.reflect-configuration select{width:100%;min-width:0;min-height:52px;padding:10px 12px;border:1px solid #c8d8e8;border-radius:10px;background:white;color:#203d58;font:650 14px system-ui,sans-serif}
.reflect-configuration select:focus-visible{outline:3px solid #4c9bd5;outline-offset:2px}
.reflect-metrics{margin-top:12px}
@media(max-width:650px){.reflect-configuration{grid-template-columns:minmax(0,1fr)}}


/* Contextual reference labels can wrap at actual phone/narrow widths. */
#reflectionPanel .calc-learn{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.4}


/* Sixth real tool: velocity factor is one full-width control; result cards
   share the existing two-column contract without artificially sized labels. */
.wave-vf{display:grid;grid-template-rows:auto auto;gap:0;margin:17px 0 12px}
.wave-vf>.calc-number{box-sizing:border-box;max-width:360px}
#wavelengthPanel .calc-learn{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.4}
@media(max-width:650px){.wave-vf>.calc-number{max-width:none}}


/* Seventh real tool: phase-aware impedance/reflection conversion. */
.imp-input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 18px}.imp-input-grid>.calc-field{min-width:0}.imp-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}#impedancePanel .calc-learn{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.4}@media(max-width:650px){.imp-input-grid,.imp-metrics{grid-template-columns:minmax(0,1fr)}}


/* Quick Match: bounded ideal single-frequency L-network candidates. */
.match-input-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:0 0 18px}
.match-input-grid>.calc-field{min-width:0}.match-candidates{display:grid;gap:10px;margin:14px 0 18px}
.match-candidate{border:1px solid #d8e5ef;border-radius:10px;background:#f7fbfe;padding:13px;display:grid;gap:8px}
.match-candidate-head{display:flex;justify-content:space-between;gap:10px;align-items:baseline;flex-wrap:wrap}
.match-candidate-head strong{color:#173f61;font-size:15px}.match-candidate-head span{color:#64798c;font-size:12px}
.match-components{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.match-component{border:1px solid #e0eaf2;border-radius:8px;background:white;padding:10px;min-width:0}
.match-component span{display:block;color:#62788b;font-size:11px;margin-bottom:5px}
.match-component strong{display:block;color:#1b4a70;font-size:15px;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.match-verify{font-size:11px;color:#5c7081}.match-reference-list{display:grid;gap:10px;padding:18px}
.match-reference-list>div{display:grid;gap:4px}.match-reference-list strong{color:#1d4b70}
.match-reference-list span{font-size:12px;line-height:1.55;color:#61768a}
#matchingPanel .calc-learn{white-space:normal;overflow-wrap:anywhere;min-width:0;max-width:100%;line-height:1.4}
@media(max-width:650px){.match-input-grid,.match-components{grid-template-columns:minmax(0,1fr)}}

/* RFCheck category-based discovery; bounded initial 4/3/3 tool choices. */
.calc-category-tabs{display:flex;flex-wrap:wrap;gap:7px;margin:0 0 12px}
.calc-category-tabs button{min-height:38px;padding:8px 13px;border:1px solid #d1deec;background:#fff;color:#476078;font-weight:750;font-size:12px;border-radius:10px}
.calc-category-tabs button.active,.calc-category-tabs button[aria-pressed="true"]{background:#1e568a;border-color:#1e568a;color:#fff}
.calc-tool-browser{padding:15px 16px;margin-bottom:22px;border:1px solid #d8e4f0;border-radius:13px;background:#fafdff}
.calc-tool-browser [data-calc-group][hidden]{display:none!important}
.calc-group-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:6px 15px;margin:0 0 12px}
.calc-group-heading strong{font-size:13px;color:#1d3f5e}.calc-group-heading span{font-size:11px;color:#6e8192}
.calc-tool-browser .calc-tool-pills{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr));gap:9px;margin:0}
.calc-tool-browser .calc-tool-pills button{min-width:0;display:flex;flex-direction:column;align-items:flex-start;gap:6px;text-align:left;padding:13px 15px;min-height:69px;border-color:#d7e4ef;box-shadow:0 1px 3px #153a5b0b}
.calc-tool-browser .calc-tool-pills button:hover{border-color:#79a8d2;background:#f1f7fd}
.calc-tool-browser .calc-tool-pills button.active{background:#e8f2fc;border-color:#4385be;box-shadow:inset 3px 0 #216399}
.calc-tool-title{font-size:13px;line-height:1.35;font-weight:780;color:#234e76}
.calc-tool-browser .calc-tool-pills small{font-size:11px;line-height:1.3;color:#6b8093}
.calc-tool-browser .calc-tool-pills button[hidden]{display:none!important}
@media(max-width:650px){.calc-category-tabs button{flex:1 1 140px;font-size:11px}.calc-tool-browser{padding:11px}.calc-tool-browser .calc-tool-pills{grid-template-columns:repeat(auto-fit,minmax(min(100%,200px),1fr))}}
@media(max-width:370px){.calc-category-tabs{gap:5px}.calc-category-tabs button{min-height:36px;padding:7px}.calc-tool-browser .calc-tool-pills button{min-height:60px;padding:10px 12px}}

/* 256px release stress: preserve all three navigation links without overflow.
   The older 650px calculator header spacing overrides the shared 370px header. */
@media(max-width:319px){
 .calc-page .topbar{gap:6px;padding-inline:7px}
 .calc-page .topbar .site-nav{gap:6px}
}
