/* Calculator-only layout: the header and actions stay outside the scrolling fields. */
body:has(#mo.on #mc.material-calculator) #ios-install-banner{display:none!important;}
#mc.material-calculator{display:flex;flex-direction:column;overflow:hidden;padding:0;width:520px;max-height:calc(100% - 24px);}
#mc.material-calculator .material-calc-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 18px 12px;flex-shrink:0;}
#mc.material-calculator h2{margin:0;font-size:24px;line-height:1.15;}
#mc.material-calculator .material-calc-close{width:44px;height:44px;min-width:44px;flex-shrink:0;}
#mc.material-calculator .material-calc-scroll{min-height:0;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 18px 18px;scroll-padding:12px;}
#mc.material-calculator .material-calc-intro{font-size:13px;line-height:1.45;color:var(--muted);margin-bottom:16px;}
#mc.material-calculator .material-calc-actions{position:static;flex-shrink:0;margin:0;padding:12px 18px max(12px,env(safe-area-inset-bottom,0px));background:var(--surf);border-top:1px solid var(--bdr);gap:8px;}
#mc.material-calculator .material-calc-actions .btn{min-height:44px;justify-content:center;white-space:normal;flex:1;}
#mc.material-calculator .material-calc-actions .calc-clear{flex:0 1 auto;}
#mc.material-calculator .material-calc-actions .btn:disabled{opacity:.45;cursor:default;}
#mc.material-calculator input,#mc.material-calculator select{min-height:44px;font-size:16px;font-family:'Barlow',sans-serif;}
#mc.material-calculator select{-webkit-appearance:none;appearance:none;background-color:var(--surf2);color:var(--txt);border:1px solid var(--bdr);border-radius:8px;padding-right:36px;}
#mc.material-calculator .calc-preset-row{position:relative;}
#mc.material-calculator .calc-preset-row::after{content:"";position:absolute;pointer-events:none;right:16px;bottom:20px;width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);}
#mc.material-calculator input[type=number]{-moz-appearance:textfield;appearance:textfield;}
#mc.material-calculator input[type=number]::-webkit-inner-spin-button,#mc.material-calculator input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0;}
#mc.material-calculator .mrow2>div{min-width:0;}
#mc.material-calculator .mlbl{display:block;line-height:1.4;letter-spacing:.04em;}
#mc.material-calculator .calc-tabs{gap:6px;border:0;flex-wrap:wrap;overflow:visible;}
#mc.material-calculator .calc-quick-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
#mc.material-calculator .ctab-btn{min-height:44px;white-space:normal;border:1px solid var(--bdr);border-radius:8px;padding:9px 12px;font-size:13px;line-height:1.2;flex:1 1 auto;}
#mc.material-calculator .ctab-btn.on{border-color:var(--acc);background:rgba(249,115,22,.1);}
#mc.material-calculator .preset-btn{min-height:44px;white-space:normal;}
#mc.material-calculator .cost-row{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,1fr);gap:8px;}
#mc.material-calculator .cost-row label{white-space:normal;line-height:1.4;font-size:12px;}
#mc.material-calculator .cost-total{grid-column:1/-1;text-align:right;white-space:normal;}
#mc.material-calculator .cr-row,#mc.material-calculator .cr-total{gap:12px;align-items:baseline;}
#mc.material-calculator .cr-val{text-align:right;overflow-wrap:anywhere;font-size:14px;}
#mc.material-calculator .cr-total .cr-val{font-size:21px;}
#mc.material-calculator .calc-error{color:var(--red,#ef7777);font-size:13px;line-height:1.4;margin:10px 0;}
#mc.material-calculator [aria-invalid=true]{border-color:var(--red,#ef7777)!important;}
#mc.material-calculator [hidden]{display:none!important;}
#mo.calculator-keyboard-compact #mc.material-calculator .material-calc-header{display:none;}
#mo.calculator-keyboard-compact #mc.material-calculator .material-calc-actions{padding-top:6px;padding-bottom:6px;}
@media(max-width:640px){
  #mc.material-calculator{width:100%;max-width:100%;max-height:calc(100% - max(8px,env(safe-area-inset-top,0px)));border-radius:20px 20px 0 0;}
  #mc.material-calculator .material-calc-header{padding:12px max(16px,env(safe-area-inset-right,0px)) 8px max(16px,env(safe-area-inset-left,0px));}
  #mc.material-calculator h2{font-size:22px;}
  #mc.material-calculator .material-calc-scroll{padding:0 max(16px,env(safe-area-inset-right,0px)) 16px max(16px,env(safe-area-inset-left,0px));}
  #mc.material-calculator .material-calc-actions{padding-left:max(16px,env(safe-area-inset-left,0px));padding-right:max(16px,env(safe-area-inset-right,0px));}
}
@media(max-width:360px){
  #mc.material-calculator .mrow2{flex-direction:column;gap:0;}
  #mc.material-calculator .material-calc-actions{flex-wrap:wrap;}
  #mc.material-calculator .material-calc-actions .calc-clear{order:3;flex-basis:100%;}
}
