/* Aufmaß Pro v1.0.0 – iPad / Apple Pencil first */
#measurement .mp-root{--mp-yellow:#ffd500;--mp-ink:#141414;--mp-blue:#173f67;--mp-red:#c62026;--mp-green:#137a4b;--mp-line:#dfe4e8;--mp-soft:#f6f8fa;margin:0 0 22px}
#measurement .mp-shell{background:#eef2f5;border:1px solid #dbe2e8;border-radius:20px;overflow:hidden;box-shadow:0 18px 55px rgba(18,35,52,.12)}
#measurement .mp-projectbar{display:grid;grid-template-columns:minmax(210px,1.2fr) minmax(170px,1fr) minmax(170px,1fr) minmax(150px,.8fr) auto;gap:10px;padding:14px;background:#fff;border-bottom:1px solid var(--mp-line);align-items:end}
#measurement .mp-projectbar label{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#5e6b75;font-weight:900;margin:0}
#measurement .mp-projectbar input,#measurement .mp-projectbar select{margin-top:5px;min-height:42px;border-radius:11px;border:1px solid #cfd7de;background:#fff;font-size:14px;padding:9px 10px;width:100%}
#measurement .mp-project-actions{display:flex;gap:7px;align-items:center;justify-content:flex-end;flex-wrap:wrap}
#measurement .mp-btn{border:0;border-radius:11px;background:var(--mp-ink);color:#fff;min-height:42px;padding:9px 13px;font-weight:900;cursor:pointer;white-space:nowrap}
#measurement .mp-btn:hover{filter:brightness(1.06)}
#measurement .mp-btn.mp-primary{background:var(--mp-yellow);color:#111}
#measurement .mp-btn.mp-secondary{background:#fff;color:#111;border:1px solid #ccd5dc}
#measurement .mp-btn.mp-danger{background:#fff0f0;color:#a3171b;border:1px solid #efc5c7}
#measurement .mp-btn:disabled{opacity:.45;cursor:not-allowed}
#measurement .mp-btn-icon{width:42px;padding:0;display:inline-grid;place-items:center;font-size:18px}
#measurement .mp-statusline{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 14px;background:#fffdf0;border-bottom:1px solid #efe2a1;color:#665600;font-size:12px;font-weight:800}
#measurement .mp-statusline .mp-dot{width:8px;height:8px;border-radius:99px;background:var(--mp-green);display:inline-block;margin-right:7px}
#measurement .mp-sheetbar{display:flex;align-items:center;gap:7px;padding:9px 12px;background:#17212b;overflow-x:auto;min-height:54px}
#measurement .mp-sheettab{border:1px solid rgba(255,255,255,.18);background:#25313c;color:#f8fafc;border-radius:10px;padding:8px 12px;font-weight:850;white-space:nowrap;cursor:pointer}
#measurement .mp-sheettab.active{background:var(--mp-yellow);color:#111;border-color:var(--mp-yellow)}
#measurement .mp-sheetbar .mp-spacer{flex:1}
#measurement .mp-workspace{display:grid;grid-template-columns:84px minmax(0,1fr) 340px;min-height:640px;max-height:calc(100vh - 220px)}
#measurement .mp-tools{background:#fff;border-right:1px solid var(--mp-line);padding:10px 8px;display:flex;flex-direction:column;gap:7px;overflow-y:auto}
#measurement .mp-tool{border:1px solid transparent;border-radius:13px;background:#f4f6f8;color:#1d2933;min-height:62px;padding:6px 4px;font-weight:900;font-size:11px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;cursor:pointer;touch-action:manipulation}
#measurement .mp-tool .ico{font-size:22px;line-height:1}
#measurement .mp-tool.active{background:#fff7c4;border-color:#e8ca38;box-shadow:inset 4px 0 0 var(--mp-yellow)}
#measurement .mp-tool.mp-tool-danger{margin-top:auto;color:#a3171b}
#measurement .mp-stagewrap{position:relative;overflow:hidden;background:#cfd6dc;min-width:0;touch-action:none}
#measurement .mp-canvas{position:absolute;inset:0;width:100%;height:100%;background:#fafafa;touch-action:none;user-select:none;-webkit-user-select:none}
#measurement .mp-floating{position:absolute;z-index:8;display:flex;gap:6px;align-items:center}
#measurement .mp-floating.mp-top-left{left:12px;top:12px}
#measurement .mp-floating.mp-top-right{right:12px;top:12px}
#measurement .mp-floatbtn{border:1px solid #cbd5dc;background:rgba(255,255,255,.94);color:#15222d;border-radius:10px;min-width:40px;height:40px;padding:0 10px;font-weight:900;box-shadow:0 3px 12px rgba(20,35,50,.12);cursor:pointer}
#measurement .mp-floatbtn.active{background:#fff3a5;border-color:#e3c53b}
#measurement .mp-helpchip{background:rgba(20,29,36,.88);color:#fff;padding:8px 11px;border-radius:999px;font-size:12px;font-weight:800;pointer-events:none;max-width:60vw;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#measurement .mp-inspector{background:#fff;border-left:1px solid var(--mp-line);padding:13px;overflow:auto}
#measurement .mp-inspector h3{margin:0 0 4px;font-size:18px}
#measurement .mp-inspector p{margin:0;color:#66727d;font-size:12px}
#measurement .mp-inspector-section{border-top:1px solid #e5e9ec;margin-top:13px;padding-top:13px}
#measurement .mp-inspector-section:first-child{border-top:0;margin-top:0;padding-top:0}
#measurement .mp-grid2{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#measurement .mp-field{display:block;font-size:11px;font-weight:900;color:#5d6973;margin:0 0 9px}
#measurement .mp-field input,#measurement .mp-field select,#measurement .mp-field textarea{display:block;width:100%;margin-top:4px;border:1px solid #cfd7de;border-radius:10px;min-height:39px;padding:8px 9px;background:#fff;color:#141414;font-size:14px;text-transform:none;letter-spacing:normal;font-weight:650}
#measurement .mp-field textarea{min-height:70px;resize:vertical}
#measurement .mp-checks{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:7px}
#measurement .mp-check{display:flex;align-items:center;gap:7px;border:1px solid #dfe5e9;background:#f8fafb;padding:8px;border-radius:10px;font-size:12px;font-weight:800}
#measurement .mp-check input{width:auto;margin:0}
#measurement .mp-inline-actions{display:flex;gap:7px;flex-wrap:wrap;margin-top:9px}
#measurement .mp-mini{min-height:36px;padding:7px 10px;border-radius:9px;font-size:12px}
#measurement .mp-summary{display:grid;grid-template-columns:repeat(7,minmax(110px,1fr));gap:1px;background:#dbe1e5;border-top:1px solid #d3d9dd}
#measurement .mp-kpi{background:#fff;padding:10px 12px;min-width:0}
#measurement .mp-kpi span{display:block;color:#687681;font-size:10px;text-transform:uppercase;letter-spacing:.04em;font-weight:900;white-space:nowrap}
#measurement .mp-kpi strong{display:block;margin-top:3px;font-size:17px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#measurement .mp-kpi.net{background:#fff9d8}
#measurement .mp-kpi.total{background:#ebf7f0}
#measurement .mp-kpi.minus strong{color:#a3171b}
#measurement .mp-empty{padding:18px;border:1px dashed #cbd5dc;border-radius:13px;background:#fbfcfd;color:#66727d;text-align:center;font-size:13px}
#measurement .mp-object-title{display:flex;align-items:center;gap:8px;margin-bottom:10px}
#measurement .mp-typebadge{display:inline-flex;border-radius:999px;padding:4px 8px;background:#edf2f6;color:#33424f;font-size:10px;font-weight:950;text-transform:uppercase;letter-spacing:.05em}
#measurement .mp-photo-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:7px;margin-top:8px}
#measurement .mp-photo{aspect-ratio:4/3;border-radius:10px;overflow:hidden;border:1px solid #dce2e6;background:#eef2f5;position:relative}
#measurement .mp-photo img{width:100%;height:100%;object-fit:cover;display:block}
#measurement .mp-photo button{position:absolute;right:5px;top:5px;width:27px;height:27px;border:0;border-radius:99px;background:rgba(0,0,0,.68);color:#fff;font-weight:900}
#measurement .mp-background-panel{padding:9px;border-radius:11px;background:#f5f8fa;border:1px solid #dfe6eb}
#measurement .mp-modal-backdrop{position:fixed;inset:0;background:rgba(11,19,25,.55);z-index:99990;display:grid;place-items:center;padding:18px}
#measurement .mp-modal{width:min(720px,96vw);max-height:88vh;overflow:auto;background:#fff;border-radius:18px;box-shadow:0 25px 70px rgba(0,0,0,.3);padding:18px}
#measurement .mp-modal h3{margin:0 0 4px}
#measurement .mp-modal-head{display:flex;justify-content:space-between;gap:10px;align-items:start}
#measurement .mp-project-list{display:grid;gap:8px;margin-top:14px}
#measurement .mp-project-item{display:flex;justify-content:space-between;gap:10px;align-items:center;border:1px solid #dfe5e9;border-radius:12px;padding:11px}
#measurement .mp-project-item strong{display:block}
#measurement .mp-project-item small{color:#66727d}
#measurement .mp-laser-value{font-size:28px!important;font-weight:950!important;text-align:center;min-height:58px!important}
#measurement .mp-toast{position:fixed;z-index:99999;left:50%;bottom:24px;transform:translateX(-50%);background:#17212b;color:#fff;padding:10px 14px;border-radius:999px;font-size:13px;font-weight:850;box-shadow:0 8px 30px rgba(0,0,0,.24);pointer-events:none}
#measurement .mp-legacy-switch{margin:14px 0 0;display:flex;justify-content:flex-end}
#measurement .mp-pro-badge{display:inline-flex;align-items:center;gap:6px;background:#111;color:#fff;border-radius:999px;padding:5px 9px;font-size:11px;font-weight:900;margin-left:9px;vertical-align:middle}
#measurement .mp-pro-badge b{color:#ffd500}
#measurement .mp-svg-surface{fill:rgba(255,213,0,.15);stroke:#111;stroke-width:.035;vector-effect:non-scaling-stroke}
#measurement .mp-svg-opening{fill:rgba(198,32,38,.10);stroke:#c62026;stroke-width:.035;stroke-dasharray:.12 .07;vector-effect:non-scaling-stroke}
#measurement .mp-svg-gable{fill:rgba(255,213,0,.15);stroke:#111;stroke-width:.035;vector-effect:non-scaling-stroke}
#measurement .mp-svg-length{stroke:#173f67;stroke-width:.045;vector-effect:non-scaling-stroke}
#measurement .mp-svg-freehand{fill:none;stroke:#222;stroke-width:.055;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
#measurement .mp-svg-object{cursor:pointer}
#measurement .mp-svg-object.selected>*:first-child{filter:url(#mpGlow)}
#measurement .mp-svg-label{font-size:.22px;font-family:Arial,sans-serif;fill:#111;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:.06px;stroke-linejoin:round}
#measurement .mp-svg-dim{font-size:.18px;font-family:Arial,sans-serif;fill:#173f67;font-weight:700;paint-order:stroke;stroke:#fff;stroke-width:.05px}
#measurement .mp-svg-handle{fill:#fff;stroke:#111;stroke-width:.025;vector-effect:non-scaling-stroke}
#measurement .mp-crosshair{stroke:#173f67;stroke-width:.025;stroke-dasharray:.08 .06;opacity:.55;vector-effect:non-scaling-stroke;pointer-events:none}
#measurement .mp-preview-shape{fill:rgba(23,63,103,.08);stroke:#173f67;stroke-width:.03;stroke-dasharray:.1 .06;vector-effect:non-scaling-stroke;pointer-events:none}
#measurement .mp-watermark{font-size:.16px;fill:#73808a;font-family:Arial,sans-serif;pointer-events:none}
@media(max-width:1180px){
  #measurement .mp-projectbar{grid-template-columns:1fr 1fr 1fr}
  #measurement .mp-project-actions{grid-column:1/-1;justify-content:flex-start}
  #measurement .mp-workspace{grid-template-columns:78px minmax(0,1fr) 300px}
  #measurement .mp-summary{grid-template-columns:repeat(4,1fr)}
}
@media(max-width:850px){
  #measurement .mp-projectbar{grid-template-columns:1fr 1fr}
  #measurement .mp-workspace{grid-template-columns:68px minmax(0,1fr);min-height:560px;max-height:none}
  #measurement .mp-inspector{grid-column:1/-1;border-left:0;border-top:1px solid var(--mp-line);max-height:none}
  #measurement .mp-stagewrap{min-height:520px}
  #measurement .mp-tool{min-height:55px;font-size:10px}
  #measurement .mp-tool .ico{font-size:20px}
  #measurement .mp-summary{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:620px){
  #measurement .mp-projectbar{grid-template-columns:1fr}
  #measurement .mp-workspace{grid-template-columns:1fr;display:block}
  #measurement .mp-tools{flex-direction:row;overflow-x:auto;border-right:0;border-bottom:1px solid var(--mp-line);padding:6px;position:sticky;top:0;z-index:12}
  #measurement .mp-tool{min-width:62px;min-height:52px}
  #measurement .mp-tool.mp-tool-danger{margin-top:0;margin-left:auto}
  #measurement .mp-stagewrap{min-height:440px}
  #measurement .mp-inspector{padding:11px}
  #measurement .mp-summary{grid-template-columns:1fr 1fr}
}
@media print{#measurement .mp-root{display:none!important}}

/* Standalone-App */
body{margin:0;background:#e9edf0;color:#111;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif}
.app-topbar{height:58px;background:#111820;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 18px;box-sizing:border-box;border-bottom:4px solid #ffd500;position:sticky;top:0;z-index:1000}
.app-brand{display:flex;align-items:center;gap:11px;font-weight:950;letter-spacing:.01em}.app-brand img{width:36px;height:36px;border-radius:9px}.app-brand small{display:block;color:#aeb8c1;font-size:10px;font-weight:700;margin-top:1px}
.app-topbar .app-status{font-size:11px;color:#cbd3da;font-weight:750}.app-main{padding:12px;max-width:1800px;margin:0 auto}.section-head{display:flex;justify-content:space-between;align-items:end;gap:18px;padding:9px 3px 12px}.section-head h2{margin:0;font-size:24px}.section-head p{margin:4px 0 0;color:#5d6973;font-size:13px}
#measurement .mp-root{margin:0}#measurement .mp-projectbar{grid-template-columns:minmax(180px,1.15fr) minmax(160px,1fr) minmax(180px,1fr) minmax(220px,1.25fr) 140px auto}
@media(max-width:1300px){#measurement .mp-projectbar{grid-template-columns:1fr 1fr 1fr}.app-topbar .app-status{display:none}}
@media(max-width:850px){.app-main{padding:6px}.app-topbar{padding:0 10px}.section-head{padding:8px 5px}.section-head p{display:none}#measurement .mp-projectbar{grid-template-columns:1fr 1fr}}
@media(max-width:620px){#measurement .mp-projectbar{grid-template-columns:1fr}}
