/* Scoped mobile workspace, forms and print reader. */
#bs-plotting-studio .pp-top h2{min-width:0}
#bs-plotting-studio .pp-top button{flex-shrink:0}
#bs-plotting-studio #pp-focus[aria-pressed=true]{background:#fff0da;border-color:#e99132}
body.bs-plot-focus .bs-free-tool-page{top:0!important;bottom:0!important;z-index:10020;padding-top:env(safe-area-inset-top)!important;padding-bottom:env(safe-area-inset-bottom)!important}
body.bs-plot-focus .pp-stage{background:#f6faff}
#pp-professional[open]{display:flex;flex-direction:column;overflow:hidden;max-height:calc(var(--pp-vh,100dvh) - 20px)}
#pp-professional>.pp-panel-head{flex:none}
.pp-prof-content{min-height:0;overflow:auto;overscroll-behavior:contain;scroll-padding-top:68px;scroll-padding-bottom:84px}
.pp-prof-tabs{position:sticky;top:-16px;z-index:3;background:#fff;padding:8px 0;border-bottom:1px solid #e0e9f2}
.pp-prof-content details{border:1px solid #d2e1ee;border-radius:12px;background:#fbfdff;padding:0 12px;min-width:0}
.pp-prof-content summary{cursor:pointer;padding:13px 0;font-size:14px;font-weight:700;min-height:48px;list-style-position:inside;color:#17558a}
.pp-prof-content details[open]>.pp-field-grid{padding:4px 0 14px}
.pp-prof-content .pp-action-grid{position:sticky;bottom:-16px;z-index:2;background:white;padding:12px 0;margin-top:0;box-shadow:0 -5px 12px #1b456511}
.pp-prof-content input[type=number]{appearance:textfield}
.pp-prof-content input[type=number]::-webkit-inner-spin-button{appearance:none}
#pp-prof-error:not(:empty){position:sticky;top:46px;z-index:4;background:#fff1e5;padding:10px;border-radius:8px}
#pp-print-dialog[open]{display:grid;grid-template-rows:auto auto minmax(0,1fr) auto;height:min(880px,calc(var(--pp-vh,100dvh) - 20px));max-height:calc(var(--pp-vh,100dvh) - 20px);overflow:hidden;padding-bottom:12px}
#pp-preview{min-height:0;overflow:auto;overscroll-behavior:contain;background:#e9f0f6;touch-action:pan-x pan-y pinch-zoom}
#pp-preview .pp-paper-preview{margin:0;min-width:0;box-shadow:0 2px 8px #133a621a}
#pp-preview .pp-paper-preview[hidden]{display:none!important}
#pp-preview.pp-reader-zoom .pp-paper-preview{width:200%;max-width:none}
#pp-print-controls{display:flex;gap:6px;align-items:center;justify-content:center;padding:7px 10px;background:#fff;border-bottom:1px solid #d4e1ed}
#pp-print-controls output{min-width:68px;text-align:center;font-size:13px;font-weight:700}
#bs-plotting-studio #pp-print-confirm{position:static;flex:none;min-height:46px;box-shadow:none;margin:10px auto 0}
#bs-plotting-studio #pp-print-controls button{min-width:44px;min-height:44px}
#pp-panel-body form>button[type=submit]{position:sticky;bottom:0;z-index:2;box-shadow:0 0 0 6px white}
.pp-drawing-boundary #pp-bound-controls{position:static;order:-1;flex-shrink:0;margin:0 0 5px;padding:5px}
.pp-drawing-boundary #pp-hint{display:none}
#pp-bound-controls span{line-height:1.4}
@media(max-width:700px),(max-height:500px){
 #bs-plotting-studio button,#bs-plotting-studio .pp-top>a{min-height:44px;min-width:44px}
 #bs-plotting-studio.pp-ready{grid-template-rows:52px 50px auto minmax(0,1fr) 58px}
 .pp-top{gap:4px;padding:4px 6px}.pp-top h2{font-size:14px;line-height:1.25}.pp-top #pp-help{display:none}.pp-top #pp-save-state{width:12px;flex-shrink:0}
 #bs-plotting-studio .pp-toolbar{gap:4px;padding:3px 4px;justify-content:center}
 #bs-plotting-studio .pp-toolbar button{padding:6px!important;min-width:44px;height:44px}
 #bs-plotting-studio #pp-snap{font-size:22px}
 .pp-summary{font-size:10px;line-height:1.5;padding:3px 5px}.pp-stage #pp-hint{font-size:10px}
 #pp-panel{display:flex;flex-direction:column;overflow:hidden;max-height:100%;border-radius:16px 16px 0 0}
 #pp-panel>.pp-panel-head{flex:none;position:static}#pp-panel-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:10px 12px 14px;scroll-padding-bottom:70px}
 #pp-panel-body input,#pp-panel-body select{height:46px;font-size:16px}
 .pp-prof-content input,.pp-prof-content select{min-height:46px;line-height:1.4}
 #pp-professional{width:calc(100% - 12px);max-width:680px;max-height:calc(var(--pp-vh,100dvh) - 12px);border-radius:16px;margin:6px auto;top:var(--pp-vv-top,0px);bottom:auto}
 #pp-professional>.pp-panel-head h3{font-size:15px}#pp-professional .pp-panel-head{padding:7px 10px}
 .pp-prof-content{padding:12px}.pp-prof-content>.pp-guide{margin-top:0;font-size:11px;padding:7px}
 .pp-prof-tabs{top:-12px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;padding:8px 0}
 #bs-plotting-studio .pp-prof-tabs button{padding:7px 4px!important;font-size:12px!important;line-height:1.4;white-space:normal}
 .pp-prof-content .pp-action-grid{bottom:-12px;padding:10px 0}
 #pp-print-dialog{width:calc(100% - 12px);max-width:680px;top:var(--pp-vv-top,0px);bottom:auto;margin:6px auto;border-radius:14px}
 #pp-print-dialog[open]{height:calc(var(--pp-vh,100dvh) - 12px);max-height:calc(var(--pp-vh,100dvh) - 12px)}
 #pp-print-dialog>.pp-panel-head{padding:7px 10px}#pp-print-dialog h3{font-size:15px}
 #pp-preview{padding:6px}#pp-print-controls{padding:6px;gap:4px}
 .pp-file-actions{grid-template-columns:1fr 1fr}.pp-file-actions button{font-size:13px!important;line-height:1.5;white-space:normal}
 .pp-file-actions #pp-print,.pp-file-actions #pp-png{min-height:54px}
 body.pp-keyboard-open #pp-panel{position:fixed;z-index:10030;top:calc(var(--pp-vv-top,0px) + 4px);left:4px;right:4px;bottom:auto;height:calc(var(--pp-vh,100dvh) - 8px);max-height:calc(var(--pp-vh,100dvh) - 8px);border-radius:12px}
}
@media(max-width:400px){.pp-toolbar #pp-zoom{display:none}.pp-prof-content .pp-field-grid{gap:10px}.pp-prof-content label{font-size:12px;line-height:1.5}.pp-prof-content details .pp-field-grid{grid-template-columns:1fr}.pp-prof-content #pp-estate-form .pp-field-grid{grid-template-columns:1fr 1fr}.pp-top h2{font-size:13px}}
@media(max-width:340px){#pp-panel-body .pp-field-grid{grid-template-columns:1fr}.pp-prof-content #pp-estate-form .pp-field-grid{grid-template-columns:1fr}.pp-prof-tabs{gap:3px}.pp-top h2{font-size:12px}#bs-plotting-studio .pp-top button{padding:6px}.pp-top>a{padding:6px!important}}
@media(max-height:500px) and (min-width:600px){#bs-plotting-studio.pp-ready{grid-template-columns:minmax(0,1fr) 132px;grid-template-rows:48px 48px minmax(0,1fr)}.pp-top{grid-column:1/3;grid-row:1}.pp-toolbar{grid-column:1;grid-row:2}.pp-summary{display:none}.pp-work{grid-column:1;grid-row:3}.pp-tools{grid-column:2;grid-row:2/4;grid-template-columns:repeat(2,minmax(0,1fr));grid-template-rows:repeat(2,minmax(44px,1fr));height:100%;width:auto;padding:4px;gap:4px}.pp-tools button{font-size:11px!important;padding:3px!important;min-height:44px!important}.pp-stage #pp-hint{display:none}.pp-panel-open .pp-work{grid-template-columns:1fr}#pp-panel{position:absolute;inset:0;max-height:100%}}
@media print{body.bs-plot-focus .bs-free-tool-page{padding:0!important}#pp-print-controls{display:none!important}#pp-print-dialog[open]{display:none!important}}

/* Keep form feedback in the panel that triggered it, including on small screens. */
#pp-panel-body>#pp-status{margin:0 0 10px;padding:9px 10px;border:1px solid #f0ce9f;border-radius:8px;background:#fff8ec;color:#915514;font-size:13px;line-height:1.6;overflow-wrap:anywhere;scroll-margin-top:8px}
#pp-panel-body>#pp-status:empty{display:none}
#bs-plotting-studio .pp-primary:hover{background:#115793;border-color:#115793;color:#fff}
