/* © 2026 Martin Scherer · Fachwerte (https://www.fachwerte.de) · Alle Rechte vorbehalten.
   Steckdosenplaner — Original: https://www.fachwerte.de/tools/steckdosenplaner/
   Stile zu Teil 57 (präzise Eingabe). Kennung FWSP-2026-09-01 */

/* ─── Live-Maß an der Wand ─────────────────────────────────────────────────
   Liegt über dem Plan in Bildschirmkoordinaten (gleich groß bei jedem Zoom),
   unter der senkrechten Leiste. Nur die Zahlen nehmen Klicks an. */
.ep-cad-mass {
    position: absolute;
    inset: 0;
    z-index: 20;
    overflow: hidden;
    pointer-events: none;
}
.ep-cad-mass[hidden] { display: none; }
.ep-cad-mass > svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}
.ep-cad-chip {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: baseline;
    gap: .3em;
    margin: 0;
    padding: 3px 8px;
    border: 1.5px solid #fff;
    border-radius: 999px;
    background: #0057b8;
    color: #fff;
    font: 600 12px/1.1 Inter, system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    box-shadow: 0 1px 4px rgba(15, 30, 60, .3);
    pointer-events: none;
}
button.ep-cad-chip { pointer-events: auto; cursor: text; }
button.ep-cad-chip:hover { background: #00468f; }
button.ep-cad-chip:focus-visible { outline: 2px solid #0057b8; outline-offset: 2px; }
.ep-cad-chip small { font-size: 10px; font-weight: 500; opacity: .85; }
.ep-cad-chip.ist-aktiv,
button.ep-cad-chip.ist-aktiv:hover {
    background: #fff;
    color: #0057b8;
    border-color: #0057b8;
    box-shadow: 0 0 0 3px rgba(0, 87, 184, .25);
}
.ep-cad-chip.ist-warnung { background: #b45309; }
.ep-cad-chip.ist-messung { background: #1f2937; }
.ist-touch .ep-cad-chip { padding: 6px 11px; font-size: 14px; }
.ist-touch .ep-cad-chip small { font-size: 11px; }

/* ─── Feld „Abstand ab … [cm]“ ──────────────────────────────────────────── */
.ep-cad-eingabe {
    position: absolute;
    z-index: 28;
    box-sizing: border-box;
    width: max-content;
    max-width: calc(100% - 12px);
    padding: .5rem .6rem .45rem;
    border: 1px solid var(--ep-linie, #c9d3e0);
    border-radius: 10px;
    background: var(--fw-bg, #fff);
    color: var(--fw-text, #14283f);
    box-shadow: var(--ep-schatten-schwebe, 0 10px 28px rgba(20, 40, 63, .22));
    font-size: .8rem;
    pointer-events: auto;
}
.ep-cad-titel { display: block; margin: 0 0 .3rem; font-weight: 600; font-size: .78rem; }
.ep-cad-zeile { display: flex; align-items: center; gap: .3rem; }
.ep-cad-zeile .ep-cad-wert {
    width: 6.2rem;
    min-width: 0;
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.ep-cad-einheit { color: var(--fw-muted, #5b6b80); margin-right: .2rem; }
.ep-cad-zeile .ep-cad-kn { min-width: 2.1rem; padding-left: .5rem; padding-right: .5rem; }
.ep-cad-fehler { margin: .35rem 0 0; color: #b45309; font-size: .75rem; max-width: 17rem; }
.ep-cad-fehler[hidden] { display: none; }
.ep-cad-tipp { margin: .3rem 0 0; color: var(--fw-muted, #5b6b80); font-size: .7rem; }
.ist-touch .ep-cad-tipp { display: none; }
.ist-touch .ep-cad-zeile .ep-cad-wert { width: 5.5rem; font-size: 16px; }   /* kein Zoom am iPhone */

/* ─── Mehrfach-Eigenschaften und Knopfreihen im Feld „Eigenschaften" ──── */
.ep-cad-mehr { margin-top: .4rem; padding-top: .55rem; border-top: 1px solid var(--fw-border, #dfe5ee); }
.ep-cad-mehr .ep-input::placeholder { font-style: italic; }
.ep-cad-knopfreihe { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .6rem; }

/* ─── Vorschau „Positionsnummern neu vergeben" ─────────────────────────── */
.ep-cad-nummern-vorschau { margin-top: .6rem; }
.ep-cad-vorschau-summe { margin: 0 0 .35rem; font-size: .82rem; font-weight: 600; }
.ep-cad-vorschau-rolle {
    max-height: min(38vh, 18rem);
    overflow: auto;
    border: 1px solid var(--fw-border, #dfe5ee);
    border-radius: 8px;
}
.ep-cad-vorschau { width: 100%; border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; }
.ep-cad-vorschau th,
.ep-cad-vorschau td { padding: .22rem .45rem; text-align: left; border-bottom: 1px solid var(--fw-border, #eef1f6); }
.ep-cad-vorschau th {
    position: sticky;
    top: 0;
    background: var(--fw-bg, #fff);
    font-weight: 600;
    color: var(--fw-muted, #5b6b80);
}
.ep-cad-vorschau td:nth-last-child(-n+2) { color: var(--fw-muted, #5b6b80); }
.ep-cad-vorschau td[aria-hidden] { width: 1.2rem; padding-left: 0; padding-right: 0; color: var(--fw-muted, #5b6b80); }

@media print {
    .ep-cad-mass, .ep-cad-eingabe { display: none !important; }
}
