/* FEAT-009 Measure mode */
body[data-task=measure] .task-cuts{display:none!important}
body[data-task=measure] .task-trace:not(.task-measure){display:none!important}
body:not([data-task=measure]) .task-measure-only{display:none!important}
#measurePanel{position:static;width:auto;max-width:none;overflow:visible;background:#fff;border:1px solid #c5d0dc;border-radius:8px;padding:6px 8px 8px;font:13px/1.35 system-ui,sans-serif;color:#1b2e44}
#measurePanel[hidden]{display:none}
#measurePanel button{min-height:34px;padding:4px 10px;font-size:13px;border-radius:6px;touch-action:manipulation}
#measurePanel button.primary{background:#1a7f37;color:#fff;border:1px solid #145c28;font-weight:600}
#measurePanel button:disabled{opacity:.45}
#measurePanel input{font-size:15px;padding:4px 6px;border:1px solid #9ab;border-radius:5px}
#measurePanel input[inputmode=decimal]{width:76px}
#measurePanel .msName{width:150px}
.msHead{display:flex;flex-wrap:wrap;align-items:center;gap:6px;border-bottom:1px solid #dde4ea;padding-bottom:6px;margin-bottom:6px}
.msHead strong{font-size:14px;margin-right:auto}
.msLaserState{font-size:12px;color:#555}.msLaserState.on{color:#166534;font-weight:600}.msLaserState.lost{color:#b45309;font-weight:600}
.msTolLbl input{width:52px!important}
.msRow{margin:4px 0;display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.msOff input{width:62px!important}
.msWall{display:flex;gap:8px;align-items:flex-start;margin:6px 0}
.msPad{display:grid;grid-template-columns:repeat(3,40px);grid-template-rows:repeat(3,40px);gap:3px;flex:none}
.msPad button{min-height:0!important;padding:0!important;font-size:20px!important;background:#f1f5f9;border:1px solid #b8c4d0}
.msPad button.on{background:#ea580c;color:#fff;border-color:#c2410c}
.msPadMid{display:flex;align-items:center;justify-content:center;text-align:center;font-size:10px;color:#64748b;line-height:1.1}
.msLenBox{display:flex;flex-direction:column;gap:5px;min-width:0}
.msLenLbl input{width:96px!important;font-size:18px!important;font-weight:600}
.msAutoLbl,.msTurnRow small{font-size:11px;color:#555}
.msTurnRow input{width:52px!important}
.msTri summary{cursor:pointer;color:#1d4ed8;font-size:12px}.msTri div{padding:4px 0;font-size:12px}
.msWalls{margin:4px 0;padding-left:26px;max-height:180px;overflow:auto}
.msWalls li{margin:2px 0}.msWalls input{width:80px!important;font-size:13px!important;padding:2px 4px!important}
.msWalls small{color:#64748b}.msArrow{display:inline-block;width:22px;text-align:center;font-weight:700;color:#ea580c}
.msBtns{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.msMsg{margin-top:6px;font-size:12px;color:#1e3a5f;min-height:1em}
.msCkTable{border-collapse:collapse;width:100%;font-size:12px;margin:4px 0}
.msCkTable td,.msCkTable th{padding:3px 4px;border-bottom:1px solid #e2e8f0;text-align:left}
.msCkTable tr.good td:last-child,#msCheck p.good{color:#166534;font-weight:600}
.msCkTable tr.bad td:last-child,#msCheck p.bad{color:#b91c1c;font-weight:600}
.msVerdict{margin:6px 0;padding:6px 8px;border-radius:6px;font-weight:600}
.msVerdict.good{background:#dcfce7;color:#166534}.msVerdict.bad{background:#fee2e2;color:#991b1b}.msVerdict.todo{background:#f1f5f9;color:#334155}
.msFoot{border-top:1px solid #dde4ea;margin-top:8px;padding-top:6px;font-size:12px}
.msSummary{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin-bottom:6px}
.msChip{min-height:26px!important;padding:2px 7px!important;font-size:12px!important;border:1px solid #cbd5e1;background:#f8fafc}
.msChip.pass{background:#dcfce7;border-color:#86efac;color:#166534}.msChip.fail{background:#fee2e2;border-color:#fca5a5;color:#991b1b}
.msFolderRow{display:flex;flex-wrap:wrap;gap:5px;align-items:center}
#msFolder{font-weight:600}
.msFold{min-height:28px!important;padding:2px 8px!important}
#measurePanel.folded #msBody{display:none}
#measurePanel.folded{width:auto}
.msStGrid{display:grid;grid-template-columns:1fr 1fr;gap:6px 10px;margin:6px 0}.msStGrid input{width:64px!important}
.msStNote{font-size:11px;color:#555;margin:4px 0}
.msSeg{display:inline-flex;border:1px solid #9ab;border-radius:7px;overflow:hidden}.msSeg button{border:0!important;border-radius:0!important;background:#f1f5f9}
.msSeg button.on{background:#2563eb;color:#fff;font-weight:600}#msModeDraw.on{background:#16a34a}
/* FEAT-011: Measure is full screen. Drawing controls live in the toolbar row; the panel is a fold-out (Details). */
body[data-task=measure] #viewRail{display:none!important}
body[data-task=measure] .planTools [data-mode=rect],body[data-task=measure] .planTools [data-mode=split],body[data-task=measure] .planTools [data-mode=add-to]{display:none!important}
/* Measure layout: one slim top row (file info, task switch, Fit, Checks pill) + a right sidebar with every drawing control. */
body[data-task=measure] .planTools,body[data-task=measure] #planMeta{display:none!important}
body[data-task=measure] header .bar-row{flex-wrap:nowrap}
#msTopGrp{display:inline-flex;align-items:center;gap:6px}
#msSide{flex:none;width:196px;display:flex;flex-direction:column;gap:5px;padding:6px;background:#f8fafc;border-left:1px solid #c5d0dc;overflow-y:auto;overflow-x:visible;box-sizing:border-box}
body:not([data-task=measure]) #msSide{display:none!important}
#msSide button{min-height:34px;padding:3px 6px;font-size:13px;border-radius:6px;touch-action:manipulation;white-space:nowrap}
#msSide button:disabled{opacity:.45}
#msSide button.on{background:#2563eb;color:#fff;border-color:#1d4ed8}
.msSideRow{display:flex;gap:4px;align-items:center}.msSideRow>button,.msSideRow>.msSeg{flex:1}
.msSideRow .msSeg button{flex:1}
#msSide .msWide{width:100%}
#msSideTools button,#msSideWalls button,#msSideHist button{display:inline-block!important}
.msLaserState{font-size:12px;white-space:nowrap}
.msNameBox{display:flex}.msNameBox .msName{flex:1;min-width:0;font-size:15px;padding:4px 6px;border:1px solid #9ab;border-radius:6px 0 0 6px}
.msNameBox #msNameBtn{border-radius:0 6px 6px 0;min-width:34px}
.msCloseList{display:grid;grid-template-columns:1fr 1fr;gap:4px}.msCloseList button{white-space:normal!important;line-height:1.1}
#msDone{background:#1a7f37;color:#fff;border:1px solid #145c28;font-weight:600}
.msSideMsg{font-size:12px;line-height:1.3;color:#334155;min-height:30px;max-height:64px;overflow:auto}
.msKeyBox{margin-top:auto;display:flex;flex-direction:column;gap:4px;border-top:1px solid #c5d0dc;padding-top:5px}
.msLenRow{display:flex;align-items:center;gap:4px}
#msLen{flex:1;min-width:0;width:100%;font-size:19px;font-weight:600;padding:4px 6px;border:1px solid #9ab;border-radius:6px}
#msLen.pending{border-color:#ea580c;box-shadow:0 0 0 2px rgba(234,88,12,.25)}
#msLenHost{flex:1;display:flex}
.msKeys{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}.msKeys button{min-height:38px!important;font-size:17px!important;font-weight:600}
#msAdd{background:#1a7f37;color:#fff;border:1px solid #145c28;font-weight:600}
.msBarDir{display:inline-block;min-width:26px;text-align:center;font:700 22px/1 system-ui;color:#94a3b8}.msBarDir.live{color:#ea580c}
.msPop{position:relative}
.msPopMenu{position:absolute;right:0;top:calc(100% + 4px);z-index:60;background:#fff;border:1px solid #c5d0dc;border-radius:6px;box-shadow:0 8px 20px rgba(0,0,0,.16);padding:5px;display:flex;flex-direction:column;gap:4px;min-width:180px}
.msPopMenu[hidden]{display:none}.msPopMenu button{text-align:left}
.msNamePop{left:0;right:0;max-height:60vh;overflow:auto}
.msNameList{display:grid;grid-template-columns:1fr 1fr;gap:3px}.msNameList button{min-height:30px!important;font-size:12px!important;white-space:normal!important}
.msNameItem{display:flex;gap:3px;align-items:center}.msNameItem span{flex:1;font-size:13px}.msNameItem button{min-height:28px!important;padding:2px 6px!important}.msNameItem input{flex:1;min-width:0}
.msNameFoot{display:flex;gap:4px;justify-content:space-between}
.msMatPop{position:static;width:auto;max-height:none;box-shadow:none}
.msMatHead{font-size:11px;color:#64748b;margin:2px 0}
.msMatItem{width:100%;white-space:normal!important}.msMatItem.on{background:#dcfce7}
#msChecksPill{min-height:30px;padding:3px 12px;border-radius:16px;font-weight:600;border:1px solid #16a34a;background:#dcfce7;color:#14532d}
#msChecksPill.bad{border-color:#dc2626;background:#fee2e2;color:#7f1d1d}
#checks{position:relative}
#msChecksMenu{background:#fff;border:1px solid #c5d0dc;border-radius:8px;padding:8px;display:flex;flex-direction:column;gap:6px;font-size:13px}
#msChecksMenu[hidden]{display:none!important}
.msCkBad{display:flex;flex-direction:column;gap:3px;border-bottom:1px solid #eee;padding-bottom:5px}.msCkBad small{color:#7f1d1d}
#msMarker{position:absolute;width:40px;height:40px;pointer-events:none;z-index:6}
#msMarker[hidden]{display:none}
.msDoorHint{font-size:11px;color:#64748b}
body[data-task=measure] #roomInfo{display:none!important}
body[data-task=measure] #checksBtn,body[data-task=measure] #checksMenu{display:none!important}
#msMatHost .productPicker{display:block!important;width:100%}#msMatHost .productPickerPanel{position:static!important;width:auto!important;box-shadow:none!important;margin-top:4px}#msMatHost summary{max-width:none!important}
#msMatBtn{overflow:hidden;text-overflow:ellipsis;max-width:100%}.msCkBad b{color:#991b1b}
#msKeypad{position:fixed;z-index:90;width:236px;box-sizing:border-box;background:#fff;border:1px solid #9ab;border-radius:10px;box-shadow:0 10px 28px rgba(0,0,0,.25);padding:8px;display:flex;flex-direction:column;gap:6px}
#msKeypad[hidden]{display:none!important}
#msKeypad button{min-height:46px;font-size:19px;font-weight:600;border-radius:8px;touch-action:manipulation}
.msKpHead{display:flex;justify-content:space-between;align-items:center;font-size:13px;color:#334155}.msKpHead button{min-height:32px!important;font-size:14px!important;padding:2px 10px}
.msKpShow{font:700 22px/1.2 system-ui;text-align:right;padding:4px 8px;border:1px solid #cbd5e1;border-radius:6px;background:#f8fafc;min-height:30px}
.msKpFoot{display:grid;grid-template-columns:1fr 1.4fr;gap:6px}.msKpFoot .primary{background:#1a7f37;color:#fff;border:1px solid #145c28}
/* FEAT-015: tools, Out/In + From A/B, fixed prompt line; things open inside the side bar (wider while open), never over the plan */
#msSide.wide{width:340px}
#msSideBody{display:flex;flex-direction:column;gap:5px}
#msSideBody:empty{display:none}
.msTools button{flex:1}
#msOptRow[hidden],#msProjSeg[hidden],#msSideClose[hidden]{display:none!important}
.msFromLbl{flex:none!important;font-size:12px;color:#475569}
.msPrompt{font:600 14px/1.25 system-ui,sans-serif;color:#9a3412;background:#fff7ed;border:1px solid #fdba74;border-radius:6px;padding:5px 7px;min-height:20px}
.msCkHead{display:flex;justify-content:space-between;align-items:center}.msCkHead button{min-height:28px!important}
#msSide #bMeasureWalls{display:none!important}
.msKeyBox{position:sticky;bottom:-6px;background:#f8fafc;padding-bottom:6px;z-index:2}
#measurePanel.msDoorOnly .msFoot,#measurePanel.msDoorOnly .msTolLbl{display:none}
#msSide{scroll-padding-bottom:150px}

/* t644: number pad on/off toggle beside the length box */
#msSide .msKpToggle{flex:0 0 auto;min-width:40px;height:36px;margin-left:6px;border:1px solid #cbd5e1;border-radius:8px;background:#f1f5f9;color:#64748b;font-size:18px;line-height:1}
#msSide .msKpToggle.on{background:#1b2e44;color:#fff;border-color:#1b2e44}
/* t645: Materials dropdown like Room (recent + search); Connect laser on the top bar */
.msMatBox #msMatBtn{border-radius:0 6px 6px 0;min-width:34px}
.msMatBox .msName{cursor:pointer;text-overflow:ellipsis}
#msSide .msMatPop{position:absolute;left:0;right:0;top:calc(100% + 4px);max-height:60vh;overflow:auto;box-shadow:0 4px 14px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:3px}
#msSide .msMatPop[hidden]{display:none}
.msMatSearch{width:100%;box-sizing:border-box;font-size:15px;padding:5px 7px;border:1px solid #9ab;border-radius:6px}
.msMatHead{font-size:11px;color:#64748b;margin:3px 0 1px}
#msSide .msMatItem{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;background:#fff;border:1px solid #e2e8f0}
#msSide .msMatItem.on{background:#dbeafe;color:#1e3a8a;border-color:#93c5fd}
.msLaserGrp{display:inline-flex;align-items:center;gap:4px}
/* t646: number pad docked at the bottom of the side bar, always on; Angle wall row */
#msSide #msKeypad.msKpDock{position:static;width:auto;box-shadow:none;border:0;padding:0;margin-top:6px;background:transparent;gap:4px}
#msSide #msKeypad.msKpDock .msKeys{display:grid;grid-template-columns:repeat(3,1fr);gap:4px}
#msSide #msKeypad .msKpHead[hidden]{display:none}
.msAngle{display:flex;flex-direction:column;gap:3px;width:100%}
.msAngleLbl{font-size:12px;font-weight:600;color:#334155}
.msAngleRow{display:flex;gap:6px;align-items:center}
.msAngleRow button{flex:1}
.msAngleRow input{width:70px!important;flex:0 0 70px;text-align:center;font-size:16px;padding:4px}
#msSide 
/* t647: disabled side bar buttons still show their hover description (app.css turns pointer events off on disabled buttons; disabled buttons still ignore clicks). */
#msSide button:disabled,#msSide button[disabled]{pointer-events:auto}
/* t647: buttons and boxes sized to the screen height so the whole Measure side bar fits without scrolling (1366x768 up to 1920x1080, 100-125%); width unchanged.
   The Details part (wall list, room check, triangle) takes what is left and scrolls on its own if a room has many walls. */
#msSide{--msBH:clamp(16px,calc((100vh - 350px) / 17),34px);gap:3px}#msSide .msKeyBox{gap:3px}
#msSide>*{flex-shrink:0}#msSide>#msSideBody{flex:0 1 auto;min-height:34px;overflow-y:auto}
#msSide button,#msSide input:not([type=checkbox]):not([type=search]){min-height:0!important;height:var(--msBH)!important;padding-top:0!important;padding-bottom:0!important;box-sizing:border-box}
#msSide button{font-size:clamp(11px,calc(var(--msBH) * .45),14px)!important;line-height:1.05}
#msSide input:not([type=checkbox]):not([type=search]){font-size:clamp(12px,calc(var(--msBH) * .5),15px)!important}
#msSide #msKeypad button{font-size:clamp(13px,calc(var(--msBH) * .6),19px)!important}
#msSide .msCloseList button{font-size:clamp(10px,calc(var(--msBH) * .4),13px)!important;line-height:1}
/* t647: entry boxes the same rounded corners as the side bar buttons (the joined Room / Materials boxes keep their ▾ join). */
#msSide input:not(.msNameBox .msName):not([type=checkbox]):not([type=search]){border-radius:6px!important}
/* t647: small group headings (same style as "Angle wall") */
#msSide .msGrpLbl{line-height:1.1;margin-bottom:-2px}#msSide .msGrpLbl[hidden]{display:none}
#msSideWalls>button,#msSideHist>button{flex:1}
/* t647: 4-column number pad: 7 8 9 ⌫ / 4 5 6 Clear / 1 2 3 Enter / 0 . */
#msSide #msKeypad.msKpDock .msKeys{grid-template-columns:repeat(4,1fr);gap:3px}
#msSide #msKeypad .msKpFoot[hidden]{display:none}
#msSide #msKeypad [data-kp="⌫"]{grid-area:1/4}#msSide #msKeypad [data-kp="clear"]{grid-area:2/4}
#msSide #msKeypad [data-kp="enter"]{grid-area:3/4/5/5;height:auto!important;background:#1a7f37;color:#fff;border:1px solid #145c28}
#msSide #msKeypad [data-kp="0"]{grid-area:4/1/5/3}#msSide #msKeypad [data-kp="."]{grid-area:4/3}
#msSide #msKeypad [data-kp="clear"],#msSide #msKeypad [data-kp="enter"]{font-size:clamp(10px,calc(var(--msBH) * .42),13px)!important}
/* t647: Delete (🗑) sits on the room name row */
#msSide .msNameBox #msDelBtn{flex:none;width:30px;margin-left:3px;padding:0!important}
#msSide>#msSideMsg{flex-shrink:1} /* t647: a long message scrolls in its own box before the side bar would */
/* t648 (FEAT-027): Site Draw style side bar */
#msSide{--msBH:clamp(16px,calc((100vh - 360px) / 18),34px)}
#msSide .msIconRow>button{flex:1;min-width:0;padding:0!important;font-size:clamp(13px,calc(var(--msBH) * .6),18px)!important}
#msSideView>button,#msSideRoom>button,#msSideWall>button,#msSideTools>button,#msSideSeg>button{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding-left:2px!important;padding-right:2px!important}
#msSideSeg>.msSeg{flex:2}
#msSide #msAngLaser{flex:none;width:30px;padding:0!important}
#msSide .msAngleRow{display:flex;gap:4px}
#msSide button.on{background:#06c;color:#fff;border-color:#05a}
#msSide #msKeypad.msKpDock .msKeys{grid-template-columns:repeat(3,1fr);gap:3px}
#msSide #msKeypad .msKeys [data-kp],#msSide #msKeypad .msKpFoot4 [data-kp]{grid-area:auto!important}
#msSide #msKeypad .msKpFoot4{display:grid!important;grid-template-columns:.9fr 1.3fr 1fr 1fr;gap:3px;margin-top:3px}
#msSide #msKeypad .msKpFoot4 [data-kp="enter"]{height:var(--msBH)!important;background:#1a7f37;color:#fff;border:1px solid #145c28}
#msSide #msKeypad .msKpFoot4 #msCloseRoom,#msSide #msKeypad .msKpFoot4 #msCloseAng{background:#1b2e44;color:#fff;border:1px solid #1b2e44;font-size:clamp(9px,calc(var(--msBH) * .38),13px)!important;white-space:normal;line-height:1.1;padding:0 2px!important}
#msSide #msKeypad .msKpFoot4 #msCloseRoom:disabled,#msSide #msKeypad .msKpFoot4 #msCloseAng:disabled{opacity:.45}
#msSideHidden[hidden]{display:none!important}

/* t648: door prompt shows the kept width and drop; tap one to measure it again */
.msDoorVals{display:flex;gap:4px;margin:3px 0}.msDoorVals button{flex:1;min-width:0;padding:4px 2px;font-size:13px}.msDoorVals button.on{background:#dbeafe;border-color:#2563eb}
/* t648: one simple column + keypad; slide-outs dock against the side bar (between plan and side bar), never over the plan */
#msSide{width:var(--msSideW,200px)!important}
#msSide .msActive{font-size:13px;font-weight:700;color:#0f172a;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:2px 2px 0}
#msSide #msSideView{display:grid;grid-template-columns:repeat(5,1fr);gap:3px}
#msSide #msSideView>button{min-width:0;padding:0!important;font-size:16px!important;height:var(--msBH)}
#msSide .msSideCol{display:flex;flex-direction:column;gap:4px}
#msSide .msSideCol>button,#msSide .msSideCol .msSideRow{width:100%}
#msSide .msSideCol>button{height:var(--msBH);font-size:clamp(13px,calc(var(--msBH)*.42),16px)!important}
#msSide #msSideSeg2 .msSeg{display:flex;width:100%}#msSide #msSideSeg2 .msSeg>button{flex:1;height:var(--msBH)}
#msDock{flex:none;width:260px;background:#eef2f7;border-left:1px solid #c5d0dc;box-sizing:border-box;padding:6px;overflow-y:auto;position:relative}
#msDock[hidden]{display:none!important}
body:not([data-task=measure]) #msDock{display:none!important}
#msDock.msSlide .msDockIn{animation:msSlideIn .18s ease-out}
@keyframes msSlideIn{from{transform:translateX(40px);opacity:0}to{transform:none;opacity:1}}
#msDock .msDockIn{background:#fff;border:1px solid #cbd5e1;border-radius:10px;padding:8px;display:flex;flex-direction:column;gap:6px;box-shadow:0 2px 8px rgba(0,0,0,.08)}
#msDock .msPopHead{display:flex;align-items:center;gap:6px;font-size:15px}#msDock .msPopHead b{flex:1;min-width:0}
#msDock #msPopX{width:40px;height:40px;flex:none;font-size:18px}
#msDock .msPopNote{margin:0;font-size:13px;color:#334155}
#msDock .msPopField{display:grid;grid-template-columns:72px 1fr 30px;align-items:center;gap:6px;font-size:15px}
#msDock .msPopField[hidden]{display:none}
#msDock .msPopField input{height:44px;font-size:18px;padding:0 8px;min-width:0;border:1px solid #94a3b8;border-radius:8px}
#msDock .msPopField em{font-style:normal;color:#475569}
#msDock .msPopBtns{display:flex;flex-direction:column;gap:6px}
#msDock .msPopBtns>button,#msDock .msPopOkRow>button{min-height:46px;font-size:16px;text-align:left;padding:0 12px}
#msDock .msPopOkRow{display:flex;gap:6px}#msDock .msPopOkRow:empty{display:none}#msDock .msPopOkRow>button{flex:1;text-align:center}
#msDock .msLink{border:0;background:none;color:#2563eb;text-decoration:underline;padding:0;min-height:0;font-size:13px}
#msDock .msPopKind{display:flex;gap:12px;font-size:15px}#msDock .msPopKind input{width:20px;height:20px}
#msDock #msNudge{display:grid;grid-template-columns:repeat(3,52px);grid-template-rows:repeat(3,52px);gap:4px;justify-content:center}
#msDock #msNudge button{font-size:20px;padding:0}
#msDock #msNudge [data-nudge="270"]{grid-area:1/2}#msDock #msNudge [data-nudge="180"]{grid-area:2/1}#msDock #msNudge [data-nudge="0"]{grid-area:2/3}#msDock #msNudge [data-nudge="90"]{grid-area:3/2}
#msDock .msNameBox,#msDock .msMatBox{display:flex;position:relative}#msDock .msNameBox input{height:44px;font-size:16px;flex:1;min-width:0}#msDock .msNameBox>button{width:44px}
#msDock #msCheck{display:block}
/* t648 slim side bar sizes: big-finger rows, square keypad keys, Close room full width under the pad */
#msSide{--msSideW:184px;--msBH:clamp(30px,calc((100vh - 250px) / 11),48px)!important}
#msSide #msSideAdd{display:none!important}
#msSide #msKeypad.msKpDock,#msSide #msKeypad.msKpDock .msKeys,#msSide #msKeypad .msKpFoot4{width:100%;box-sizing:border-box}
#msSide #msKeypad.msKpDock .msKeys{grid-template-columns:repeat(3,1fr)!important;justify-content:stretch;gap:4px!important}
#msSide #msKeypad .msKeys button{width:auto;min-width:0;height:var(--msBH)!important;min-height:0!important;padding:0!important;font-size:clamp(15px,calc(var(--msBH)*.45),20px)!important}
#msSide #msKeypad .msKpFoot4{display:grid!important;grid-template-columns:repeat(6,1fr)!important;gap:4px!important;width:100%;box-sizing:border-box}
#msSide #msKeypad .msKpFoot4 [data-kp]{height:var(--msBH)!important;padding:0!important;min-height:0!important;min-width:0;width:auto}
#msSide #msKeypad .msKpFoot4 [data-kp="⌫"]{grid-column:1 / span 2!important}
#msSide #msKeypad .msKpFoot4 [data-kp="enter"]{grid-column:3 / span 4!important}
#msSide #msKeypad .msKpFoot4 #msCloseRoom,#msSide #msKeypad .msKpFoot4 #msCloseAng{grid-column:span 3;height:var(--msBH)!important;font-size:clamp(8px,calc(var(--msBH)*.32),13px)!important;white-space:normal;line-height:1.05;letter-spacing:-.2px;padding:0 2px!important;display:flex;align-items:center;justify-content:center;text-align:center}
#msSide .msPrompt{font-size:12px}
#msSide .msSideMsg{height:34px;max-height:34px;overflow:hidden;font-size:12px;line-height:1.35}
#msSide #msKeypad .msKeys button[data-kp="clear"]{font-size:12px!important;padding:0!important;letter-spacing:-.2px}
#msSide .msPair{display:grid;grid-template-columns:1fr 1fr;gap:4px}
#msSide .msPair>button{min-width:0;padding-left:2px;padding-right:2px}
/* t650 FEAT-028/031/037: one column; Undo|Redo and Zoom out|Zoom in pairs; every button always shown, dimmed when it can't be used (a press says why) */
#msSide{--msLblH:0px;--msBH:clamp(20px,calc((100vh - 270px - var(--msLblH)) / 18),48px)!important}
#msSide.msLbls{--msLblH:34px}
#msSide #msSideView.msSideCol{display:flex;flex-direction:column;gap:4px}
#msSide #msSideView .msPair>button{height:var(--msBH)!important;padding:0!important;font-size:clamp(16px,calc(var(--msBH)*.6),22px)!important;display:flex;align-items:center;justify-content:center}
#msSide .msPairLbl{display:none;font-size:11px;font-weight:700;color:#475569;line-height:1;margin:1px 0 -2px 2px}
#msSide.msLbls .msPairLbl{display:block}
#msSide #msFitSlot>button{width:100%}
#msSide .msSideCol>button,#msSide #msFitSlot>button{font-size:clamp(14px,calc(var(--msBH)*.47),17px)!important;text-align:left;padding-left:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#msSide #msFitSlot>button{text-align:center;padding-left:0!important}
#msSide button.msDim{opacity:.38;cursor:not-allowed}
#msSide button.msDim.on{opacity:.55}
.zoomIco{display:block;margin:auto;pointer-events:none}
#msSide .zoomIco{width:calc(var(--msBH)*.72);height:calc(var(--msBH)*.72)}
#msWhy{position:fixed;z-index:200;max-width:230px;background:#1e293b;color:#fff;font:600 14px/1.3 system-ui,sans-serif;padding:8px 11px;border-radius:8px;box-shadow:0 6px 18px rgba(0,0,0,.25)}
#msWhy[hidden]{display:none}
#msWhy::after{content:'';position:absolute;right:-7px;top:50%;margin-top:-7px;border:7px solid transparent;border-right:0;border-left-color:#1e293b}
/* t650: Justin's colours (mock-up pairs.png): dark side bar #1b2e44, buttons #3a5674, white text and line icons */
#msSide{background:#1b2e44!important;border-left-color:#0f1c2b!important}
#msSide .msActive,#msSide .msPairLbl{color:#e2e8f0}
#msSide #msSideView button,#msSide #msSideMain>button,#msSide #msKeypad button{background:#3a5674;color:#fff;border:1px solid #4d6b8c;border-radius:8px}
#msSide #msSideView button:hover:not(.msDim),#msSide #msSideMain>button:hover:not(.msDim),#msSide #msKeypad button:hover{background:#4a6a8c}
#msSide #msSideView button.on,#msSide #msSideMain>button.on{background:#06c;border-color:#3b82f6}
#msSide #msKeypad .msKpFoot4 [data-kp="enter"]{background:#1a7f37;border-color:#22a04a}
#msSide #msKeypad .msKpFoot4 #msCloseRoom,#msSide #msKeypad .msKpFoot4 #msCloseAng{background:#3a5674;border:1px solid #9fb4cc}
#msSide #msLen{background:#fff}
#msSide .msSideMsg{color:#e2e8f0}
#msSide .msKeyBox,#msSide #msKeypad{background:transparent!important;border-color:transparent!important;box-shadow:none!important}
/* t650 FEAT-033: the slide-out is just the box, beside its button, tall and narrow (covers as little plan as possible) */
#msDock{position:fixed!important;width:212px!important;background:transparent!important;border:0!important;padding:0!important;overflow-y:auto;z-index:70;top:60px}
#msDock .msDockIn{box-shadow:0 8px 24px rgba(15,23,42,.28);border:1px solid #94a3b8}
#msDock.msSlide .msDockIn{animation:msSlideIn2 .18s ease-out}
@keyframes msSlideIn2{from{transform:translateX(30px);opacity:0}to{transform:none;opacity:1}}
#msDock .msPopField{grid-template-columns:1fr 34px;row-gap:2px}
#msDock .msPopField>span{grid-column:1/-1;font-weight:600;font-size:14px}
#msDock .msPopField input{height:46px}
#msDock .msPopHead{font-size:14px}#msDock .msPopHead b{overflow-wrap:anywhere}
#msDock .msPopBtns>button,#msDock .msPopOkRow>button{min-height:48px;font-size:16px}
/* t650: entry boxes match the dark buttons (radius 8); keypad / Close room text fits the small 1366x657 buttons */
#msSide input:not(.msNameBox .msName):not([type=checkbox]):not([type=search]){border-radius:8px!important}
#msSide #msKeypad .msKeys button{font-size:clamp(12px,calc(var(--msBH)*.5),20px)!important}
#msSide #msKeypad .msKeys button[data-kp="clear"],#msSide #msKeypad button[data-kp="enter"]{font-size:clamp(8px,calc(var(--msBH)*.38),14px)!important;letter-spacing:-.3px}
#msSide #msKeypad .msKpFoot4 #msCloseRoom,#msSide #msKeypad .msKpFoot4 #msCloseAng{font-size:clamp(8px,calc(var(--msBH)*.32),13px)!important}
/* t656 (Justin, Surface Pro: "make the buttons a bit bigger inc the keypad" / "make sure they still fit" / "a couple columns"):
   the tool buttons sit in two columns (fewer rows), so every side bar button and keypad key can be taller; the side bar stays 184 px. No scrolling at 1366x768 and up. */
#msSide #msSideMain{display:grid!important;grid-template-columns:1fr 1fr;gap:4px}
#msSide #msSideMain>button{width:auto!important;min-width:0;height:var(--msTH)!important;white-space:normal!important;text-align:center!important;padding:0 3px!important;line-height:1.12;font-size:clamp(12px,calc(var(--msTH)*.3),15px)!important;text-overflow:clip!important}
#msSide{--msBH:clamp(20px,calc((100vh - 430px) / 10),48px)!important;--msTH:calc(var(--msBH) + 8px)}
/* t656 fix (Justin 2026-11-22): 🗑 Delete goes across both columns */
#msSide #msSideMain>button.msFullW{grid-column:1/-1}
/* t658 (Justin 2026-11-22): Trim ▾ list in the wall / doorway tool bars, check measurement result, Connect laser on the side bar (green when connected) */
#msDock .msPopBtns>button.on{background:#06c;color:#fff;border-color:#05a}
#msDock .msTrimList{display:flex;flex-direction:column;gap:4px;padding:4px;border:1px solid #cbd5e1;border-radius:8px;background:#f8fafc;max-height:46vh;overflow-y:auto}
#msDock .msTrimList>button{min-height:46px;font-size:15px;text-align:left;padding:0 10px;display:flex;align-items:center;gap:4px}
#msDock .msTrimList>button em{margin-left:auto;font-style:normal;color:#64748b;font-size:13px}
#msDock .msCmRes{width:100%;border-collapse:collapse;font-size:15px}#msDock .msCmRes td{padding:3px 2px}#msDock .msCmRes td+td{text-align:right}
#msSide .msLaserSlot{display:flex;align-items:center;gap:4px}
#msSide .msLaserSlot>#msConnect{flex:1;min-width:0;height:var(--msBH)!important;background:#3a5674;color:#fff;border:1px solid #4d6b8c;border-radius:8px;font-size:clamp(13px,calc(var(--msBH)*.4),16px)!important}
#msSide .msLaserSlot>#msConnect.msLaserOn{background:#16a34a!important;border-color:#22c55e!important;color:#fff!important}
#msSide .msLaserSlot>.msLaserState{color:#e2e8f0;font-size:12px}#msSide .msLaserSlot>.msLaserState:empty{display:none}
#msDock #msCmFixAng,#msDock #msCmFixWall{white-space:normal;height:auto;min-height:46px;line-height:1.2;padding-top:6px;padding-bottom:6px}
