/* ============================================================================
   Plan-Messung (Online-Berechnung) - Optik angelehnt an die Aufbau-Bloecke
   des Online-Konfigurators (weisse Box, 1px-Rahmen, natives details/summary).
   Farben: Markenblau #006aac; die Teilflaechen-Farben kommen aus PHP/JS.
   ============================================================================ */

.pm-block { background: #fff; border: 1px solid #ccc; border-radius: 4px; padding: 0 20px; margin-bottom: 20px; }
.pm-block > summary { padding: 15px 0; color: #006aac; font-weight: 600; cursor: pointer; }
.pm-block > summary:hover { color: #00568a; }
.pm-inner { padding: 5px 0 20px; border-top: 1px solid #eee; }
.pm-intro { color: #444; font-size: 0.9rem; margin: 15px 0; }

/* --- Dropzone (Server-Standard fuer Datei-Uploads) --- */
.pm-dropzone { border: 2px dashed #006aac; background: #f8f9fa; border-radius: 4px;
    padding: 1.5rem; text-align: center; cursor: pointer; color: #444; }
.pm-dropzone.dragover { background: #e8f2f9; }
.pm-upload-status { margin-top: 8px; font-size: 0.85rem; color: #444; }
.pm-upload-status .pm-fehler { color: #dc3545; }

/* --- Seitenleiste (Miniaturen aller Seiten) --- */
.pm-seitenleiste { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.pm-seite-kachel { position: relative; border: 1px solid #ccc; border-radius: 4px; background: #fff;
    padding: 4px; cursor: pointer; width: 92px; text-align: center; }
.pm-seite-kachel img { max-width: 82px; max-height: 82px; display: block; margin: 0 auto; }
.pm-seite-kachel.aktiv { border-color: #006aac; box-shadow: 0 0 0 2px rgba(0,106,172,.25); }
.pm-seite-kachel .pm-seite-label { font-size: 0.72rem; color: #444; display: block; margin-top: 3px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-seite-kachel .pm-seite-status { font-size: 0.68rem; display: block; }
.pm-seite-kachel .pm-seite-status.ok { color: #28a745; }
.pm-seite-kachel .pm-seite-status.fehlt { color: #b36b00; }
.pm-seite-loeschen { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px;
    display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ecb2b8;
    border-radius: 4px; background: #fff; color: #dc3545; font-weight: 700; font-size: 12px;
    line-height: 1; cursor: pointer; }
.pm-seite-loeschen:hover { background: #fdf2f3; border-color: #dc3545; }

/* --- Editor --- */
.pm-editor { margin-top: 12px; }
.pm-toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 8px; }
.pm-toolgruppe { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pm-tool { padding: 5px 12px; border: 1px solid #006aac; border-radius: 4px; background: #fff;
    color: #006aac; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.pm-tool:hover { background: #e8f2f9; }
.pm-tool.aktiv { background: #006aac; color: #fff; }
.pm-minibtn { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid #ced4da; border-radius: 4px; background: #fff; color: #444; font-size: 15px;
    font-weight: 700; line-height: 1; cursor: pointer; }
.pm-minibtn:hover { background: #f1f3f5; border-color: #adb5bd; }
.pm-minibtn:disabled { opacity: .4; cursor: default; }
.pm-check { display: inline-flex; align-items: center; gap: 5px; font-size: 0.85rem; color: #444; cursor: pointer; }

/* Ablauf-Art-Wahl (nur sichtbar, wenn das Ablauf-Werkzeug aktiv ist) */
.pm-ablauf-wahl { display: inline-flex; gap: 4px; align-items: center; }
.pm-ablauf-art { display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px;
    border: 1px solid #ced4da; border-radius: 4px; background: #fff; color: #444;
    font-size: 0.8rem; cursor: pointer; }
.pm-ablauf-art:hover { background: #f1f3f5; }
.pm-ablauf-art.aktiv { border-color: #006aac; box-shadow: 0 0 0 2px rgba(0,106,172,.2); }
.pm-punkt { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); display: inline-block; }
.pm-punkt-haupt { background: #46b270; }
.pm-punkt-not { background: #e30613; }
.pm-punkt-kombi { background: linear-gradient(90deg, #46b270 50%, #e30613 50%); }
.pm-check select { padding: 3px 6px; border: 1px solid #ced4da; border-radius: 4px; font-size: 0.85rem; background: #fff; color: #444; }
.pm-status { font-size: 0.82rem; color: #444; margin-left: auto; }
.pm-status .pm-kalib-fehlt { color: #b36b00; font-weight: 600; }
.pm-status .pm-kalib-ok { color: #28a745; }

/* Zeichenflaeche: fixe Hoehe, Canvas fuellt sie; touch-action aus, damit
   Pinch/Pan im Canvas landet statt die Seite zu scrollen. */
.pm-canvas-wrap { position: relative; width: 100%; height: min(72vh, 700px); min-height: 320px;
    border: 1px solid #ccc; border-radius: 4px; overflow: hidden; background: #eef1f4; }
#pm-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block;
    touch-action: none; cursor: default; }
.pm-canvas-wrap.pm-zeichnet #pm-canvas { cursor: crosshair; }
.pm-hinweis { position: absolute; left: 50%; top: 10px; transform: translateX(-50%);
    background: rgba(255,255,255,.95); border: 1px solid #006aac; border-radius: 4px;
    color: #006aac; padding: 4px 12px; font-size: 0.82rem; pointer-events: none; max-width: 92%; }

/* --- Legende --- */
.pm-legende { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 0.86rem; }
.pm-legende-eintrag { display: inline-flex; align-items: center; gap: 6px; color: #444; }
.pm-legende-eintrag .pm-farbchip { width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.25); }
.pm-legende-eintrag b { font-weight: 600; }
.pm-legende-summe { color: #28a745; font-weight: 600; }

/* Farbchip in den Teilflaechen-Karten der Berechnung (nur wenn gemessen) */
.calc-flaeche-farbchip { display: inline-block; width: 14px; height: 14px; border-radius: 3px;
    border: 1px solid rgba(0,0,0,.25); margin-right: 6px; vertical-align: -2px; }

/* --- Mobil --- */
@media (max-width: 600px) {
    .pm-block { padding: 0 12px; }
    .pm-toolbar { gap: 8px; }
    .pm-tool { padding: 5px 9px; font-size: 0.8rem; }
    .pm-status { margin-left: 0; width: 100%; }
    .pm-canvas-wrap { height: 62vh; }
}

/* Ablauf-Arten als direkte Werkzeugknoepfe (v3.1): Punkt + Text im Tool-Stil */
.pm-tool-ablauf { display: inline-flex; align-items: center; gap: 6px; }
.pm-tool-ablauf.aktiv .pm-punkt { box-shadow: 0 0 0 2px rgba(255,255,255,.7); }

/* --- Anmerkungen (v4, 2026-07-28): Inline-Eingabefeld ueber dem Canvas ---
   Bewusst KEIN prompt()/Modal: der Kasten haengt am angeklickten Ankerpunkt,
   damit beim Tippen sichtbar bleibt, wo der Text spaeter im Plan steht.
   Positioniert wird er per JS (left/top) im .pm-canvas-wrap. */
.pm-anmerkung-editor { position: absolute; z-index: 5; display: flex; flex-direction: column;
    gap: 5px; background: #fff; border: 1px solid #095385; border-radius: 4px;
    padding: 7px 8px; box-shadow: 0 2px 8px rgba(0,0,0,.18); max-width: 280px; }
.pm-anmerkung-editor input[type="text"] { width: 250px; max-width: 100%; padding: 4px 7px;
    border: 1px solid #ced4da; border-radius: 4px; font-size: 0.85rem; color: #444; background: #fff; }
.pm-anmerkung-editor input[type="text"]:focus { border-color: #006aac; outline: none;
    box-shadow: 0 0 0 .2rem rgba(0,106,172,.2); }
.pm-anmerkung-zeile { display: flex; align-items: center; gap: 6px; }
.pm-anmerkung-zaehler { font-size: 0.74rem; color: #6c757d; margin-right: auto; }
.pm-anmerkung-ok { padding: 3px 10px; border: 1px solid #006aac; border-radius: 4px;
    background: #006aac; color: #fff; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.pm-anmerkung-ok:hover { background: #00568a; border-color: #00568a; }
.pm-anmerkung-weg { padding: 3px 10px; border: 1px solid #dc3545; border-radius: 4px;
    background: #fff; color: #dc3545; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.pm-anmerkung-weg:hover { background: #fdf2f3; }
