/* =====================================================================
   Aufmaß V4 — Logo + Screen 3 (Detail) + Screen 4 (Messen)
   ===================================================================== */

/* ---- Logo (eingebettetes Schuler-Logo) ---- */
.logo-img      { height: 34px; width: auto; border-radius: 8px; display: block; }
.auth-logo-img { height: 44px; width: auto; border-radius: 8px; display: block; }

/* ================= Detail (Screen 3) ================= */
.pos-chips {
  flex: none; background: var(--surface-1); border-bottom: 1px solid var(--line-light);
  display: flex; align-items: center; gap: 8px; padding: 11px 26px; overflow-x: auto;
}
.pos-chip {
  flex: none; font-size: 13px; font-family: var(--font-mono); font-weight: 600;
  padding: 8px 13px; border-radius: 10px; color: var(--txt2);
  background: var(--surface-4); border: 1px solid var(--surface-4);
}
.pos-chip.active { color: var(--on-accent); background: var(--brand); border-color: var(--brand); }
/* offene Maße (Punkt 17): roter Punkt am Chip — bewusst kein grüner „komplett"-Haken */
.pos-chip { position: relative; }
.pos-chip.open::after { content: ''; position: absolute; top: -3px; right: -3px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); border: 2px solid var(--surface-1); }

.detail-body { flex: 1; display: flex; min-height: 0; }
.detail-left {
  width: 42%; flex: none; border-right: 1px solid var(--line-light); background: var(--panel-bg);
  display: flex; flex-direction: column; align-items: center; padding: 22px 24px; overflow-y: auto;
}
.detail-left .pos-of { align-self: flex-start; font-size: 12px; font-family: var(--font-mono); letter-spacing: .08em; color: var(--muted); }
.detail-left .room-title { align-self: flex-start; font-size: 23px; font-weight: 700; font-family: var(--font-display); margin: 2px 0 10px; }
.detail-left .beschlag { font-size: 13px; color: var(--muted); margin-top: 6px; font-family: var(--font-mono); text-align: center; }

.masse-card {
  margin-top: 18px; width: 100%; max-width: 330px; background: var(--surface-1);
  border: 1px solid var(--line-light); border-radius: 16px; padding: 16px; box-shadow: var(--sh-card); text-align: left;
}
.masse-card .mc-head { display: flex; align-items: center; justify-content: space-between; }
.masse-card .mc-head .lbl { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.masse-card .mc-head .edit { font-size: 12.5px; color: var(--brand); font-weight: 700; }
.masse-card .mc-vals { display: flex; gap: 12px; margin-top: 12px; }
.masse-card .mc-vals .col { flex: 1; }
.masse-card .mc-vals .k { font-size: 11px; color: var(--muted); }
.masse-card .mc-vals .v { font-size: 27px; font-weight: 700; font-family: var(--font-mono); }
.masse-card .mc-fertig { font-size: 12px; font-family: var(--font-mono); color: var(--muted); margin-top: 8px; }

/* ---- Inline-Messen im Detail-Screen (statt Slide-over) ---- */
.im-head { width: 100%; max-width: 330px; margin-top: 20px; display: flex; align-items: baseline; justify-content: space-between; }
.im-head > span:first-child { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.im-hint { font-size: 11px; color: var(--disabled); }
.im { width: 100%; max-width: 330px; margin-top: 10px; display: flex; flex-direction: column; gap: 13px; }
.im-glabel { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.im-row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.im-grp:has(.im-field:only-child) .im-row { grid-template-columns: 1fr; }
.im-field {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 9px 13px; border: 1.5px solid var(--line-light); border-radius: 13px;
  background: var(--surface-1); cursor: pointer; text-align: left; transition: border-color .12s, box-shadow .12s;
}
.im-field:hover { border-color: var(--muted); }
.im-field.active { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(161, 28, 28, .13); }
.im-kbd { position: absolute; top: 7px; right: 8px; display: flex; color: var(--disabled); }
.im-kbd svg { width: 15px; height: 15px; }
.im-field.active .im-kbd { color: var(--brand); }
.im-k { font-size: 10.5px; font-weight: 700; color: var(--txt2, var(--muted)); text-transform: uppercase; letter-spacing: .05em; }
.im-v { font-family: var(--font-mono); font-size: 22px; font-weight: 700; color: var(--ink); display: flex; align-items: baseline; gap: 4px; line-height: 1.1; }
.im-v i { font-size: 11px; font-style: normal; font-weight: 500; color: var(--disabled); }
.im-fertig { font-size: 12px; color: var(--muted); font-family: var(--font-mono); padding-top: 2px; }
.im-fertig span { color: var(--disabled); }

/* unten angedocktes Mess-Keypad (kein Vollbild-Overlay) */
.mkpad { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; justify-content: flex-end;
  padding: 0 24px calc(16px + env(safe-area-inset-bottom, 0px)); pointer-events: none; }   /* rechts angedockt — linke Maßfelder bleiben lesbar */
.mkpad-inner {
  pointer-events: auto; width: 100%; max-width: 440px; background: var(--surface-1);
  border: 1.5px solid var(--line-light); border-radius: 22px; box-shadow: var(--sh-pop, 0 14px 44px rgba(0, 0, 0, .20));
  padding: 15px 15px 16px; animation: mk-up .16s ease;
}
@keyframes mk-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.mkpad-head { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.mkpad-lbl { font-size: 12px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.mkpad-val { margin-left: auto; font-family: var(--font-mono); font-size: 18px; color: var(--ink); }
.mkpad-val span { font-weight: 700; }
.mkpad-close { width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line-light); color: var(--muted); flex: none; background: var(--surface-1); font-size: 14px; cursor: pointer; }
.mkpad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.mk { height: 54px; border: 1.5px solid var(--line-light); border-radius: 14px; background: var(--surface-1); font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--ink); cursor: pointer; transition: background .1s; }
.mk:active { background: var(--surface-4); }
.mk-fn { color: var(--muted); font-size: 18px; }
.mkpad-next { margin-top: 11px; width: 100%; height: 52px; border-radius: 14px; background: var(--brand); color: var(--on-accent); font-size: 15px; font-weight: 700; border: none; cursor: pointer; letter-spacing: .02em; }
.mkpad-next:active { filter: brightness(.94); }

.detail-right { flex: 1; overflow-y: auto; padding: 22px 26px; }
.sec-stack { display: flex; flex-direction: column; gap: 14px; }
.sec-card { background: var(--surface-1); border: 1px solid var(--line-light); border-radius: 16px; padding: 16px 18px; }
.sec-card.row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.sec-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; color: var(--muted); }
.sec-value { font-size: 17px; font-weight: 700; margin-top: 2px; }
.sec-change { font-size: 13px; color: var(--brand); font-weight: 600; cursor: pointer; }
/* Rollladen + Bedienung kombinierte Karte */
.rb-rows { margin-top: 10px; }
.rb-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; }
.rb-row + .rb-row { border-top: 1px solid var(--line-light); }
.rb-k { font-size: 11px; font-weight: 700; letter-spacing: .04em; color: var(--muted); text-transform: uppercase; }
.rb-v { font-size: 14.5px; font-weight: 600; color: var(--ink); margin-top: 3px; }
.room-select { height: 46px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; justify-content: space-between; padding: 0 14px; font-size: 15px; font-weight: 600; margin-top: 11px; }
.room-select .chev { color: var(--disabled); }
.floor-seg { display: flex; gap: 6px; margin-top: 11px; flex-wrap: wrap; }
.seg { font-size: 13px; font-family: var(--font-mono); padding: 8px 13px; border-radius: 9px; color: var(--txt2); background: var(--surface-1); border: 1px solid var(--line); }
.seg.active { color: var(--on-accent); background: var(--brand); border-color: var(--brand); }
.oeff-card { display: flex; align-items: center; gap: 16px; }
.oeff-card .glyph { width: 46px; display: flex; justify-content: center; }
.oeff-card .grow { flex: 1; }

/* Die App endet jetzt an der echten Unterkante (Statusleisten-Modus "default", siehe
   index.html), der Home-Indicator liegt also über der Fußzeile. Hintergrund läuft bis zur
   Kante durch, die Knöpfe bleiben per padding-bottom frei. Ist der Inset 0 (Desktop, Geräte
   ohne Indicator), ist die Regel wirkungslos — dann exakt wie vorher 64 px. */
.detail-foot { height: calc(64px + env(safe-area-inset-bottom, 0px)); flex: none; background: var(--surface-1); border-top: 1px solid var(--line-light); display: flex; align-items: center; gap: 10px; padding: 0 24px env(safe-area-inset-bottom, 0px); }
/* ---- Fertigmaß-Dialog: Abzüge (nur diese Position) + daraus errechnetes Fertigmaß ---- */
.fm-box { max-width: 440px; }
.fm-sec { font: 700 9.5px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .14em; color: var(--brand); margin: 14px 0 7px; }
.fm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.fm-rl { flex: 0 0 58px; font-size: 13px; font-weight: 600; color: var(--txt2); }
.fm-val { flex: 1; min-width: 0; height: 48px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-1); color: var(--ink); font-family: var(--mono, 'IBM Plex Mono', monospace);
  font-size: 19px; font-weight: 700; cursor: pointer; }
.fm-step { flex: none; display: flex; gap: 6px; }
.fm-step button { width: 44px; height: 48px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface-1); color: var(--brand); font-size: 22px; font-weight: 700; cursor: pointer; line-height: 1; }
.fm-step button:active { background: var(--surface-4); }
.fm-fert { display: flex; align-items: center; gap: 10px; }
.fm-fert .fm-val { font-size: 22px; height: 54px; }
.fm-x { color: var(--muted); font-size: 15px; }
.fm-hint { font-size: 11.5px; color: var(--muted); line-height: 1.4; margin-top: 7px; }

/* 47 px = exakt die Höhe von „Messen" und dem Fertigmaß-Chip links → alle Fußzeilen-Knöpfe fluchten. */
.foot-btn-primary { height: 47px; padding: 0 16px; border-radius: 11px; background: var(--brand); color: var(--on-accent); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.foot-btn-ghost { height: 47px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; color: var(--txt2); display: flex; align-items: center; }
.foot-of { margin-left: auto; font-size: 13px; font-family: var(--font-mono); color: var(--muted); }
.foot-nav { width: 44px; height: 42px; border: 1px solid var(--line); border-radius: 11px; display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--txt2); }

/* ================= Messen (Screen 4) ================= */
/* Volle Höhe (bündig), Safe-Area als PADDING — sonst scheint oben/unten der Hintergrund durch. */
.measure { position: fixed; inset: 0; box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--surface-1); z-index: 30; display: flex; flex-direction: column; }
.measure-top { height: 72px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid var(--line-light); }
.measure-top .left { display: flex; align-items: center; gap: 16px; }
.measure-x { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; color: var(--txt2); }
.measure-pill { font-size: 13px; font-family: var(--font-mono); font-weight: 700; color: var(--on-accent); background: var(--brand); padding: 7px 12px; border-radius: 9px; }
.measure-title { font-size: 18px; font-weight: 700; }
.measure-sub { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.measure-done { height: 44px; padding: 0 20px; border-radius: 12px; background: var(--app-bg); display: flex; align-items: center; font-size: 15px; font-weight: 600; }
.measure-progress { height: 5px; flex: none; background: var(--line-light); }
.measure-progress > i { display: block; height: 100%; background: var(--brand); transition: width .3s ease; }

/* ---- Fix-Modus (Einzel-Screen pro Position) ---- */
.im-field.req { border-color: var(--warn-strong); box-shadow: 0 0 0 3px rgba(224, 168, 0, .14); }
.im-optrow { margin-top: 4px; }

/* Fix-Modus Config — geführter Wizard, EINE Frage je Seite (V2-Stil) */
.sm-cfg { width: 100%; max-width: 720px; padding: 22px 24px 0; display: flex; flex-direction: column; min-height: 100%; box-sizing: border-box; }
.sm-cfg-dots { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.sm-dot { font-size: 12px; font-weight: 700; padding: 7px 13px; border-radius: 9px; cursor: pointer; background: var(--surface-1); color: var(--muted); border: 1px solid var(--line); }
.sm-dot.cur { background: var(--brand); color: var(--on-accent); border-color: var(--brand); }
.sm-dot.done { background: var(--success-bg); color: var(--success); border-color: transparent; }
.sm-cfg-q { font-size: 27px; font-weight: 700; font-family: var(--font-display); line-height: 1.1; }
.sm-cfg-hint { font-size: 14px; color: var(--muted); margin-top: 5px; }
.sm-cfg-body { margin-top: 20px; }
.sm-cfg-preview { display: flex; justify-content: center; margin-bottom: 18px; }
.sm-opt-grid { display: grid; gap: 11px; margin-top: 8px; }
.sm-opt-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.sm-opt-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.sm-opt-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 58px; padding: 15px 10px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--surface-1); font-size: 15px; font-weight: 600; color: var(--txt2); cursor: pointer; transition: border-color .12s, box-shadow .12s; text-align: center; }
.sm-opt-card:hover { border-color: var(--muted); }
.sm-opt-card.active { border-color: var(--brand); background: var(--danger-bg); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.sm-opt-card.icon .ic { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; }
.sm-opt-card.icon .ic svg { width: 36px; height: 36px; }
.sm-cfg-fl-lbl { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--muted); margin: 18px 0 4px; text-transform: uppercase; }
.sm-cfg-free { width: 100%; margin-top: 14px; border: 1.5px solid var(--line); border-radius: 12px; padding: 14px 15px; font: inherit; outline: none; box-sizing: border-box; }
.sm-cfg-free:focus { border-color: var(--brand); }
.sm-cfg-actions { display: flex; align-items: center; gap: 12px; margin-top: auto; position: sticky; bottom: 0; z-index: 2; padding: 14px 0 18px; background: var(--surface-1); border-top: 1px solid var(--line-light); }
.sm-cfg-actions button { height: 50px; border-radius: 13px; font-weight: 700; font-size: 15px; cursor: pointer; }
.sm-cfg-actions .sm-back { padding: 0 20px; border: 1px solid var(--line); background: var(--surface-1); color: var(--muted); }
.sm-cfg-actions .sm-back[disabled] { opacity: .4; }
.sm-cfg-actions .sm-weiter { padding: 0 30px; border: none; background: var(--brand); color: var(--on-accent); }

/* Fix-Modus Mess-Phase — laser-geführt, EIN Maß groß, aktive Kante markiert */
.sm-measure { display: flex; width: 100%; min-height: 0; }
.sm-m-left { width: 42%; flex: none; border-right: 1px solid var(--line-light); background: var(--panel-bg); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; overflow: auto; }
.sm-m-diagram { width: 100%; max-width: 300px; display: flex; justify-content: center; }
.sm-m-beschlag { font-size: 13px; color: var(--muted); margin-top: 10px; font-family: var(--font-mono); text-align: center; }
.sm-m-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 28px; overflow: auto; }
.sm-m-count { font-size: 11.5px; font-weight: 700; letter-spacing: .14em; color: var(--disabled); font-family: var(--font-mono); margin-bottom: 16px; }
.sm-m-group { font-size: 13px; font-weight: 800; letter-spacing: .12em; color: var(--brand); text-transform: uppercase; }
.sm-m-label { font-size: 30px; font-weight: 700; margin: 2px 0 24px; font-family: var(--font-display); }
.sm-m-inputwrap { position: relative; display: flex; align-items: center; }
.sm-m-input { width: 340px; max-width: 70vw; font-size: 50px; font-weight: 700; font-family: var(--font-mono); text-align: center; border: 2.5px solid var(--brand); border-radius: 18px; padding: 14px 58px; outline: none; color: var(--ink); background: var(--surface-1); }
.sm-m-input::placeholder { color: var(--placeholder); }
.sm-m-kbd { position: absolute; left: 12px; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-1); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 1; }
.sm-m-unit { position: absolute; right: 18px; font-size: 17px; color: var(--muted); }
.sm-m-prefill { margin-top: 14px; font-size: 13px; color: var(--muted); }
.sm-m-ready { margin-top: 12px; font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.sm-m-last { margin-top: 16px; font-size: 13.5px; color: var(--success); font-family: var(--font-mono); display: flex; align-items: center; gap: 4px; }
.sm-m-last b { font-weight: 700; }
.sm-m-fix { margin-left: 8px; border: 1px solid var(--line); background: var(--surface-1); color: var(--brand); font-weight: 700; font-size: 11px; padding: 4px 10px; border-radius: 8px; cursor: pointer; font-family: var(--font-sans, inherit); }
.sm-m-fix:active { background: var(--surface-4); }
.sm-m-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; width: 100%; max-width: 440px; margin-top: 6px; }
.sm-opt { padding: 16px 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-1); font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--txt2); cursor: pointer; }
.sm-opt.active { border-color: var(--brand); background: var(--brand); color: var(--on-accent); }
.sm-opt-exact { width: 100%; max-width: 440px; margin-top: 10px; padding: 13px 10px; border-radius: 12px; border: 1.5px dashed var(--line); background: var(--surface-1); font-family: var(--font-sans); font-weight: 600; font-size: 14px; color: var(--muted); cursor: pointer; }
.sm-m-actions { display: flex; align-items: center; gap: 12px; margin-top: 32px; width: 100%; max-width: 480px; }
.sm-m-actions button { height: 50px; border-radius: 13px; font-weight: 700; cursor: pointer; font-size: 14.5px; }
.sm-mback, .sm-skip { padding: 0 18px; border: 1px solid var(--line); background: var(--surface-1); color: var(--muted); }
.sm-mnext { padding: 0 30px; border: none; background: var(--brand); color: var(--on-accent); }

.measure-body { flex: 1; display: flex; min-height: 0; }
.measure-diagram { width: 45%; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border-right: 1px solid var(--line-light); background: var(--panel-bg); }
.measure-diagram .beschlag { font-size: 13.5px; color: var(--muted); margin-top: 14px; font-family: var(--font-mono); }
.measure-pad { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.measure-pad .inner { width: 100%; max-width: 470px; }
.measure-seclabel { font-size: 13px; font-weight: 700; letter-spacing: .14em; color: var(--brand); }
.measure-fieldlabel { font-size: 34px; font-weight: 700; margin-top: 1px; }
.measure-value { margin-top: 16px; border: 2px solid var(--brand); border-radius: 16px; height: 104px; display: flex; align-items: baseline; justify-content: flex-end; gap: 12px; padding: 0 26px; }
.measure-value .num { font-size: 62px; font-weight: 700; font-family: var(--font-mono); line-height: 1; }
.measure-value .unit { font-size: 24px; font-weight: 600; color: var(--muted); }
.numpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.numkey { height: 70px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 25px; font-weight: 600; font-family: var(--font-mono); color: var(--ink); user-select: none; }
.numkey.muted { color: var(--muted); }
.numkey.disabled { color: var(--placeholder); }
.measure-actions { display: flex; gap: 10px; margin-top: 16px; }
.measure-actions .prev { width: 70px; height: 58px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--muted); }
.measure-actions .skip { padding: 0 22px; height: 58px; border: 1px solid var(--line); border-radius: 13px; display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: var(--txt2); white-space: nowrap; }
.measure-actions .weiter { flex: 1; height: 58px; border-radius: 13px; background: var(--brand); color: var(--on-accent); font-size: 16.5px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 8px 20px rgba(161,28,28,.26); }

/* Toast */
.toast { position: fixed; top: 46px; left: 50%; transform: translateX(-50%); background: var(--fix-to); color: var(--on-accent); padding: 14px 24px; border-radius: 14px; display: flex; align-items: center; gap: 11px; font-size: 15px; font-weight: 600; box-shadow: var(--sh-pop); z-index: 50; }

/* ===================== Positionsmaske (Design-Handoff 2026-07-17) =====================
   Übersicht zweispaltig, füllt den Screen, NICHTS scrollt (Maß-Raster hat Auto-Fallback). */
.pm-body { flex: 1; display: flex; min-height: 0; overflow: hidden; }
.pm-left { flex: 0 0 56%; min-width: 0; border-right: 1px solid var(--line-light, var(--line)); padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.pm-head { display: flex; align-items: baseline; gap: 10px; flex: none; height: 28px; }
.pm-posno { font: 600 11px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .14em; color: var(--muted); }
.pm-room { font-size: 19px; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-count { margin-left: auto; font: 600 12px var(--mono, 'IBM Plex Mono', monospace); color: var(--open-text); flex: none; }
.pm-count.ok { color: var(--done-text); }
.pm-sketch { flex: 1 1 0; min-height: 110px; background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; }
.pm-sketch .diagram { height: 100%; width: 100%; display: flex; align-items: center; justify-content: center; }
.pm-sketch .diagram svg { height: 100% !important; max-height: 100%; width: auto !important; max-width: 100% !important; }
.pm-mhead { display: flex; align-items: baseline; flex: none; }
.pm-mhead span:first-child { font: 700 10px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .16em; color: var(--brand); }
.pm-mhead .hint { margin-left: auto; font: 500 11px var(--mono, 'IBM Plex Mono', monospace); color: var(--muted); }
/* Die Karten sind nur so breit wie ihr Inhalt (Wert „1985 mm" ≈ 80 px + Rand), NICHT
   auf Spaltenbreite gestreckt. Dadurch stehen mehrere Gruppen nebeneinander in einer
   Zeile — das spart Höhe und die Skizze bleibt groß. Höhe = Inhalt (flex: none),
   gescrollt wird nie; bei Platzmangel gibt die Skizze nach. */
.pm-grid { flex: none; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 9px 14px; min-height: 0; overflow: visible; }
.pm-sec { flex: 0 1 auto; min-width: 0; }
.pm-sec-h { font: 700 9px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; white-space: nowrap; }
.pm-sec-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pm-card { position: relative; flex: 0 0 112px; width: 112px; text-align: left; background: var(--surface-1); border: 1px solid var(--line); border-radius: 11px; padding: 5px 9px; font: inherit; cursor: pointer; min-height: 44px; overflow: hidden; }
.pm-card.empty { border: 2px dashed var(--danger-line); }
.pm-card-l { display: block; font: 600 9px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .06em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.pm-card-v { display: block; font-size: 19px; font-weight: 800; line-height: 1.15; color: var(--ink); font-family: var(--mono, 'IBM Plex Mono', monospace); }
.pm-card.empty .pm-card-v { color: var(--placeholder); }
.pm-card-v i { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); }
.pm-card-k { position: absolute; top: 6px; right: 8px; color: var(--placeholder); }
.pm-empty { grid-column: 1 / -1; font-size: 13px; color: var(--muted); padding: 14px; }
.pm-foot { flex: none; display: flex; gap: 8px; align-items: stretch; }
/* Der Fertigmaß-Chip braucht mehr Platz als der Knopf: Label + Maß + Abzug passten
   bei flex 1.2 : 1 nicht ins Feld und liefen über. */
.pm-messen { flex: 1; background: var(--brand); color: var(--on-accent); border: none; border-radius: 12px; padding: 13px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.pm-fertchip { flex: 1.15; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 6px 12px; display: flex; align-items: center; gap: 9px; font: inherit; cursor: pointer; min-width: 0; }
.pm-fertchip .l { font: 700 9px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .14em; color: var(--muted); flex: none; }
.pm-fertchip b { font-size: 16px; font-family: var(--mono, 'IBM Plex Mono', monospace); white-space: nowrap; flex: none; }
/* Der Abzug-Hinweis ist das Unwichtigste — er darf schrumpfen, statt den Chip zu sprengen. */
.pm-fertchip .s { color: var(--muted); font-size: 11px; margin-left: auto; flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pm-right { flex: 1; min-width: 0; padding: 10px 18px 12px; display: flex; flex-direction: column; gap: 8px; min-height: 0; overflow: hidden; }
.pm-dhead { font: 600 11px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .14em; color: var(--muted); flex: none; height: 28px; display: flex; align-items: center; }   /* gleiche Höhe wie .pm-head → Datenblock startet bündig mit dem Skizzenfeld */
/* Große, gleich hohe Kacheln. Feste Zeilenhöhe statt „Platz aufteilen": sonst bliebe
   bei Haustür-Positionen (nur 2 Zeilen) eine halb leere Karte stehen. Die Karte wächst
   also mit dem Inhalt, den Rest schluckt .pm-spacer. */
.pm-rows { background: var(--surface-1); border: 1px solid var(--line); border-radius: 14px; overflow: hidden auto;
  flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; }
.pm-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 18px;
  flex: none; min-height: 96px;
  border: none; border-bottom: 1px solid var(--line-light, var(--line-light)); background: var(--surface-1); font: inherit; cursor: pointer; }
.pm-row:last-child { border-bottom: none; }
.pm-row .grow { flex: 1; min-width: 0; display: block; }
.pm-row .t { display: block; font: 600 11px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .12em; color: var(--muted); }
.pm-row .s { display: block; font-size: 17px; font-weight: 600; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-row .chev { color: var(--brand); font-size: 22px; flex: none; }
.pm-togglerow { display: flex; gap: 8px; flex: none; }
.pm-toggle { flex: 1; background: var(--surface-1); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; display: flex; align-items: center; gap: 7px; min-width: 0; }
.pm-toggle .l { font: 600 10px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .1em; color: var(--muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.pm-note { background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 12px; padding: 10px 14px; display: flex; gap: 8px; align-items: center; font: inherit; cursor: pointer; text-align: left; color: var(--warn-text); flex: none; }
.pm-note b { font-size: 13px; color: var(--warn-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Restplatz unter den Kategorien — hält Alternativ/Klärung und die Aktionen unten am Rand. */
.pm-spacer { flex: 1 1 auto; min-height: 0; }
.pm-actions { display: flex; gap: 8px; flex: none; }

/* ---- Mess-Overlay: Sheet von rechts, 3 Spalten ---- */
.pm-mov-backdrop { position: fixed; inset: 0; background: rgba(20, 24, 28, .42); z-index: 40; }
/* Mess-Sheet am rechten Rand. Volle Höhe, Safe-Area als Padding (wie .editor-panel). */
.pm-mov { position: fixed; top: 0; right: 0; height: var(--vvh, 100dvh); box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  width: 86%; max-width: 1040px; background: var(--surface-1); border-left: 1px solid var(--line);
  box-shadow: -20px 0 50px rgba(0, 0, 0, .18); display: flex; flex-direction: column; z-index: 41;
  animation: pmSlideIn .22s cubic-bezier(.3,.9,.35,1); }
@keyframes pmSlideIn { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.pm-mov-head { height: 62px; border-bottom: 1px solid var(--line-light, var(--line)); display: flex; align-items: center; gap: 12px; padding: 0 20px; flex: none; }
.pm-mov-head .pill { background: var(--brand); color: var(--on-accent); font-weight: 800; font-size: 13px; border-radius: 9px; padding: 7px 12px; }
.pm-mov-head .ttl { font-size: 18px; font-weight: 700; }
.pm-mov-head .sub { font: 500 11px var(--mono, 'IBM Plex Mono', monospace); color: var(--muted); }
.pm-segs { margin-left: auto; display: flex; gap: 3px; }
.pm-seg { width: 22px; height: 5px; border-radius: 3px; background: var(--line); }
.pm-seg.done { background: var(--success-2); }
.pm-seg.cur { background: var(--brand); }
.pm-x { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-1); color: var(--txt2); cursor: pointer; font: inherit; flex: none; }
.pm-mov-body { flex: 1; display: flex; min-height: 0; }
.pm-mov-list { flex: 0 0 300px; border-right: 1px solid var(--line-light, var(--line-light)); padding: 12px 14px; display: flex; flex-direction: column; gap: 5px; background: var(--surface-2); overflow-y: auto; }
.pm-mrow { border-radius: 10px; padding: 8px 12px; display: flex; align-items: center; gap: 9px; cursor: pointer; flex: none; background: var(--surface-1); border: 1px solid var(--line-light, var(--line-light)); font: inherit; text-align: left; }
.pm-mrow.done { border-color: var(--line); }
.pm-mrow.cur { background: var(--danger-bg); border: 2px solid var(--brand); }
.pm-mrow .ic { font-weight: 800; color: var(--placeholder); flex: none; }
.pm-mrow.done .ic { color: var(--success-2); }
.pm-mrow.cur .ic { color: var(--brand); }
.pm-mrow .lb { flex: 1; font-size: 12.5px; font-weight: 700; color: var(--txt2); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-mrow.cur .lb { color: var(--brand); }
.pm-mrow-v { font-size: 15px; font-family: var(--mono, 'IBM Plex Mono', monospace); color: var(--ink); flex: none; }
.pm-mrow-fert { margin-top: auto; background: var(--inverse-bg); color: var(--on-accent); border-radius: 10px; padding: 9px 12px; display: flex; gap: 9px; align-items: center; flex: none; }
.pm-mrow-fert span { font: 700 9px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .14em; color: var(--disabled); }
.pm-mrow-fert b { font-size: 13px; font-family: var(--mono, 'IBM Plex Mono', monospace); }
.pm-mrow-fert i { font-style: normal; color: var(--disabled); font-size: 11px; margin-left: auto; }
.pm-mov-sketch { flex: 0 0 280px; border-right: 1px solid var(--line-light, var(--line-light)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-width: 0; padding: 10px; }
.pm-mov-sketch .dg { width: 100%; flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.pm-mov-sketch .dg svg { height: 100% !important; max-height: 480px; width: auto !important; max-width: 100% !important; }
.pm-mov-sketch .hint { font: 500 11px var(--mono, 'IBM Plex Mono', monospace); color: var(--muted); text-align: center; line-height: 1.7; max-width: 240px; }
.pm-mov-input { flex: 1; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.pm-disp { background: var(--surface-1); border: 2px solid var(--brand); border-radius: 13px; padding: 9px 15px; flex: none; }
.pm-disp .l { font: 600 10px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .12em; color: var(--brand); }
.pm-disp .v { font-size: 36px; font-weight: 800; color: var(--ink); font-family: var(--mono, 'IBM Plex Mono', monospace); }
.pm-disp .v.stored { color: var(--disabled); }
.pm-disp .v.unplausibel { color: var(--brand); }
.pm-aux-warn { font: 600 13px/1.4 var(--font-sans, -apple-system, sans-serif); color: var(--brand); }
.pm-disp .v i { font-style: normal; font-size: 15px; font-weight: 500; color: var(--muted); }
.pm-aux { flex: none; display: flex; flex-direction: column; gap: 6px; }
.pm-aux:empty { display: none; }
.pm-aux-l { font: 600 9.5px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .12em; color: var(--muted); }
/* Bohrabstand-Pills im Mess-Sheet: kompakter als im Editor, damit alle 7 Werte in eine Zeile passen */
.pm-aux-pills { gap: 5px; }
.pm-aux-pills .ed-pill { height: 38px; padding: 0 8px; font-size: 13px; font-family: var(--font-mono); }
.pm-suggest { border: 1.5px dashed var(--line); background: var(--surface-1); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.pm-keys { flex: 1; display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; min-height: 0; }
.pm-key { border-radius: 11px; display: grid; place-items: center; font: inherit; font-weight: 700; font-size: 22px; cursor: pointer; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); touch-action: manipulation; min-height: 44px; }
.pm-key:active { background: var(--line); }
.pm-key.fn { font-size: 19px; background: var(--line-light); }
.pm-key.wide { grid-column: span 2; }   /* 0 doppelt breit, wo es kein ± gibt */
.pm-next { flex: none; background: var(--brand); color: var(--on-accent); border: none; border-radius: 12px; padding: 14px; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.pm-mov-foot { height: 64px; border-top: 1px solid var(--line-light, var(--line)); display: flex; align-items: center; gap: 10px; padding: 0 20px; flex: none; }
.pm-cancel { flex: 1; border: 1px solid var(--line); border-radius: 11px; padding: 12px; background: var(--surface-1); font: inherit; font-weight: 600; font-size: 15px; color: var(--txt2); cursor: pointer; }
.pm-ok { flex: 2; background: var(--brand); color: var(--on-accent); border: none; border-radius: 11px; padding: 12px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }

/* Mess-Reihenfolge direkt im Messfenster (User 21.10.2026): Kopf über der Checkliste, Sortiermodus mit ziehbaren Gruppen */
.pm-ord-kopf { display: flex; align-items: center; gap: 6px; flex: none; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--line); }
.pm-ord-kopf > span { flex: 1; font: 600 11px var(--mono, 'IBM Plex Mono', monospace); letter-spacing: .08em; color: var(--muted); text-transform: uppercase; }
.pm-ord-kopf button { height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface-1); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.pm-ord-kopf .pm-ord-an { width: 100%; justify-content: center; color: var(--txt2); }
.pm-ord-kopf .pm-ord-ok { background: var(--brand); border-color: var(--brand); color: var(--on-accent); }
.pm-ord-liste { display: flex; flex-direction: column; gap: 5px; }
.pm-mrow.ord { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; position: relative; }
.pm-mrow.ord .lb { white-space: normal; }
.pm-mrow.ord.drag { z-index: 2; border: 2px solid var(--brand); box-shadow: 0 10px 24px rgba(0, 0, 0, .22); cursor: grabbing; }
.pm-ord-grip { color: var(--muted); display: grid; place-items: center; flex: none; }
/* Sonderform-Zusatzmaß: kurze Messhilfe über der Seitenwahl (23.10.2026) */
.pm-aux-sf { font-size: 12.5px; color: var(--txt2); line-height: 1.4; }
/* Positionsansicht mit der Skizze aus Element/Ausstattung/Rollladen (23.10.2026): Tipp-Zonen */
.pd-svg .pd-zone { fill: transparent; stroke: transparent; cursor: pointer; }
.pd-svg .pd-zone:active { fill: var(--brand); fill-opacity: .07; stroke: var(--brand); stroke-width: 2; stroke-dasharray: 7 5; }
.pd-svg .pd-mass { cursor: pointer; }
.pd-svg .el-hit { cursor: default; }
