/* © 2026 Martin Scherer · Fachwerte (https://www.fachwerte.de) · Alle Rechte vorbehalten.
   Steckdosenplaner — Original: https://www.fachwerte.de/tools/steckdosenplaner/
   Die Nutzung des Werkzeugs im Browser ist frei. Vervielfältigung, Bearbeitung,
   Umbenennung oder Veröffentlichung dieses Quelltexts, auch in Teilen, nur mit
   schriftlicher Zustimmung des Urhebers (§§ 69a ff. UrhG). Kennung FWSP-2026-09-01 */
/* Steckdosenplaner — Komfort-Stile (Teil 25/42): Kontextmenü, Speicherstatus,
   PDF-Seitenwahl. */

/* ─── Menüs: Kontextmenü und „Ausgabe ▾" ───────────────────────────────── */
.ep-kmenue {
    position: fixed;
    z-index: 1000;
    min-width: 13.5rem;
    max-width: min(22rem, calc(100vw - 12px));
    max-height: calc(100vh - 12px);
    overflow-y: auto;
    padding: .3rem;
    background: var(--fw-bg);
    color: var(--fw-text);
    border: 1px solid var(--fw-border-str);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16), 0 2px 6px rgba(0, 0, 0, .06);
    font-family: var(--fw-font);
    font-size: .82rem;
}
.ep-kmenue-titel {
    padding: .35rem .6rem .3rem;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--fw-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ep-kmenue-eintrag {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    min-height: 2rem;
    padding: .3rem .6rem;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.ep-kmenue-eintrag:hover:not(:disabled),
.ep-kmenue-eintrag:focus-visible { background: var(--fw-accent-sf); color: var(--fw-accent-dk); outline: none; }
.ep-kmenue-eintrag:focus-visible { box-shadow: inset 0 0 0 2px var(--fw-accent); }
.ep-kmenue-eintrag:disabled { opacity: .45; cursor: default; }
.ep-kmenue-eintrag.ist-gefahr { color: #b3261e; }
.ep-kmenue-eintrag.ist-gefahr:hover:not(:disabled),
.ep-kmenue-eintrag.ist-gefahr:focus-visible { background: #fdecea; color: #8c1d18; }
.ep-kmenue-text { flex: 1 1 auto; min-width: 0; }
.ep-kmenue-taste {
    flex: 0 0 auto;
    padding: .05rem .35rem;
    border: 1px solid var(--fw-border);
    border-radius: 4px;
    background: var(--fw-surface);
    color: var(--fw-muted);
    font-family: var(--fw-font);
    font-size: .68rem;
    line-height: 1.4;
}
.ep-kmenue-strich { height: 1px; margin: .3rem .4rem; background: var(--fw-border); }
.ep-kmenue.ist-touch .ep-kmenue-eintrag { min-height: 2.75rem; }

/* Knopf „Ausgabe ▾" neben „Drucken" */
.ep-btn-ausgabe { gap: .3rem; }
.ep-btn-ausgabe-pfeil { font-size: .7rem; color: var(--fw-muted); line-height: 1; }
.ep-btn-ausgabe[aria-expanded="true"] { background: var(--fw-surface); border-color: var(--fw-accent); }

/* ─── Speicherstand in der Statuszeile ─────────────────────────────────── */
.ep-speicherstand {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-left: auto;
    padding: .1rem .45rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--fw-text-2);
    font: inherit;
    font-size: .74rem;
    white-space: nowrap;
    cursor: pointer;
}
.ep-speicherstand:hover { border-color: var(--fw-border-str); background: var(--fw-bg); }
.ep-speicherstand-punkt { width: .5rem; height: .5rem; border-radius: 50%; background: #1b7a3e; flex: 0 0 auto; }
.ep-speicherstand.ist-laeuft .ep-speicherstand-punkt { background: var(--fw-muted); animation: ep-speicher-puls 1s ease-in-out infinite; }
.ep-speicherstand.ist-warn { color: #9a5200; font-weight: 600; }
.ep-speicherstand.ist-warn .ep-speicherstand-punkt { background: #b3261e; }
@keyframes ep-speicher-puls { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) {
    .ep-speicherstand.ist-laeuft .ep-speicherstand-punkt { animation: none; }
}

/* ─── Hinweis: anderer Tab hat gespeichert ─────────────────────────────── */
.ep-tabhinweis {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .6rem 1rem;
    margin: .5rem 1rem;
    padding: .7rem .9rem;
    border: 1px solid #e0a54a;
    border-left-width: 4px;
    border-radius: 10px;
    background: var(--fw-proto-sf);
    color: var(--fw-text);
    font-size: .82rem;
    line-height: 1.5;
}
.ep-tabhinweis[hidden] { display: none; }
.ep-tabhinweis-text { flex: 1 1 22rem; display: flex; flex-direction: column; gap: .15rem; }
.ep-tabhinweis-text strong { font-size: .9rem; }
.ep-tabhinweis-text span { color: var(--fw-text-2); }
.ep-tabhinweis-knoepfe { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ─── Kurzer Hinweis unten im Plan (PDF lesen, Bild erzeugen) ───────────── */
.ep-komfort-hinweis {
    position: absolute;
    left: 50%;
    bottom: .9rem;
    z-index: 60;
    transform: translateX(-50%);
    max-width: calc(100% - 2rem);
    padding: .45rem .9rem;
    border-radius: 999px;
    background: var(--fw-invert-bg);
    color: var(--fw-invert-tx);
    font-size: .8rem;
    font-weight: 500;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
    pointer-events: none;
}
.ep-komfort-hinweis[hidden] { display: none; }

/* ─── PDF-Seitenwahl ────────────────────────────────────────────────────── */
.ep-dialog.ep-pdf-dialog { max-width: 46rem; }
.ep-pdf-seiten {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: .6rem;
    max-height: min(60vh, 34rem);
    overflow-y: auto;
    padding: .2rem;
    margin: 0 -.2rem;
}
.ep-pdf-seite {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    padding: .4rem;
    border: 1px solid var(--fw-border-str);
    border-radius: var(--fw-radius-lg);
    background: var(--fw-bg);
    color: var(--fw-text);
    font: inherit;
    cursor: pointer;
}
.ep-pdf-seite:hover { border-color: var(--fw-accent); background: var(--fw-accent-sf); }
.ep-pdf-seite:focus-visible { outline: 3px solid var(--fw-accent); outline-offset: 2px; }
.ep-pdf-vorschau {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    border-radius: 4px;
    background: repeating-linear-gradient(45deg, var(--fw-surface), var(--fw-surface) 6px, var(--fw-surface-2) 6px, var(--fw-surface-2) 12px);
    overflow: hidden;
}
.ep-pdf-leinwand {
    display: block;
    max-width: 100%;
    max-height: 100%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}
.ep-pdf-nr { font-size: .78rem; font-weight: 600; color: var(--fw-text-2); text-align: center; }

@media print {
    .ep-kmenue, .ep-komfort-hinweis, .ep-tabhinweis { display: none !important; }
}

/* ═══ Stromkreis hervorheben (Teil 42) ════════════════════════════════════ */
@media screen {
.ep-stage .ep-sym.ist-gedimmt { opacity: .16; }
.ep-stage .ep-beschriftung.ist-gedimmt { opacity: .1; }
.ep-stage.ist-kreisfokus-an > svg:not(.ep-kamera-felder) { opacity: .4; }
.ep-stage .ep-sym.ist-kreisfokus { color: var(--ep-kreis, var(--fw-accent)); }
.ep-stage .ep-sym.ist-kreisfokus::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid var(--ep-kreis, var(--fw-accent));
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--ep-kreis, var(--fw-accent)) 18%, transparent);
    pointer-events: none;
}

.ep-kreisfokus {
    --ep-kreis: var(--fw-accent);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 28;
    display: flex;
    align-items: center;
    gap: .45rem;
    max-width: calc(100% - 7rem);
    padding: .35rem .4rem .35rem .45rem;
    background: var(--fw-surface, #fff);
    border: 1px solid var(--fw-border);
    border-left: 4px solid var(--ep-kreis);
    border-radius: 10px;
    box-shadow: 0 6px 22px rgba(15, 23, 42, .14);
    font-size: .8rem;
    color: var(--fw-text);
}
.ep-kreisfokus[hidden] { display: none; }
.ep-kf-punkt { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ep-kreis); flex: none; }
.ep-kf-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.ep-kf-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.ep-kf-text small { color: var(--fw-muted); font-size: .74rem; white-space: nowrap; }
.ep-kf-etagen { display: flex; gap: .25rem; flex-wrap: wrap; }
.ep-kf-etagen button,
.ep-kf-knopf,
.ep-kf-schritt,
.ep-kf-zu {
    font: inherit;
    font-size: .76rem;
    min-height: 1.9rem;
    padding: 0 .55rem;
    border: 1px solid var(--fw-border);
    border-radius: 7px;
    background: var(--fw-bg, #fff);
    color: var(--fw-text);
    cursor: pointer;
}
.ep-kf-etagen button[aria-current="true"] { border-color: var(--ep-kreis); box-shadow: inset 0 0 0 1px var(--ep-kreis); }
.ep-kf-etagen b { font-weight: 700; }
.ep-kf-schritt { padding: 0 .5rem; font-size: 1rem; line-height: 1; }
.ep-kf-zu { border-color: transparent; background: transparent; font-size: 1.1rem; padding: 0 .45rem; }
.ep-kf-etagen button:hover, .ep-kf-knopf:hover, .ep-kf-schritt:hover, .ep-kf-zu:hover { background: var(--fw-accent-sf); }
.ep-kreisfokus button:focus-visible { outline: 2px solid var(--fw-accent); outline-offset: 1px; }
.ep-app.ist-touch .ep-kreisfokus button { min-height: 2.75rem; min-width: 2.75rem; }

.ep-zeile.ist-kreisfokus { background: var(--fw-accent-sf); border-radius: 6px; }
.ep-kreis-auge[aria-pressed="true"] { color: var(--fw-accent); background: var(--fw-accent-sf); }
.ep-punkt--ohne { background: transparent !important; border: 1.5px dashed var(--fw-muted); box-sizing: border-box; }
}
@media print { .ep-kreisfokus { display: none !important; } }

/* ═══ Raumbuch (Teil 53) ══════════════════════════════════════════════════ */
.ep-rb-liste { display: flex; flex-direction: column; gap: .25rem; }
.ep-rb-raum {
    display: grid;
    grid-template-columns: 1fr auto auto 1rem;
    align-items: center;
    gap: .5rem;
    width: 100%;
    padding: .5rem .55rem;
    border: 1px solid var(--fw-border);
    border-radius: 8px;
    background: var(--fw-bg);
    color: var(--fw-text);
    font: inherit;
    font-size: .8rem;
    text-align: left;
    cursor: pointer;
}
.ep-rb-raum:hover { border-color: var(--fw-accent); background: var(--fw-accent-sf); }
.ep-rb-raum:focus-visible { outline: 2px solid var(--fw-accent); outline-offset: 1px; }
.ep-rb-raum-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-rb-raum-info { color: var(--fw-muted); font-size: .75rem; white-space: nowrap; }
.ep-rb-raum svg { width: 1rem; height: 1rem; color: var(--fw-muted); }
.ep-app.ist-touch .ep-rb-raum { min-height: 2.75rem; }

.ep-rb-ampel { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; margin-right: .3rem; vertical-align: .05em; background: #9ca3af; }
.ep-rb-ampel--gruen { background: #1b7a3e; }
.ep-rb-ampel--gelb { background: #c28a00; }
.ep-rb-ampel--rot { background: #b3261e; }

.ep-dialog.ep-rb-dialog { max-width: 46rem; }
.ep-rb-kopf { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.ep-rb-kopf h2 { margin: 0; }
.ep-rb-unter { font-size: .78rem; color: var(--fw-muted); }
.ep-rb-kennwerte { display: grid; grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr)); gap: .4rem; margin-bottom: .7rem; }
.ep-rb-kennwerte > div { border: 1px solid var(--fw-border); border-radius: 8px; padding: .4rem .55rem; display: flex; flex-direction: column; gap: .1rem; }
.ep-rb-kennwerte span { font-size: .7rem; color: var(--fw-muted); text-transform: uppercase; letter-spacing: .04em; }
.ep-rb-kennwerte strong { font-size: .95rem; font-weight: 600; }
.ep-rb-kennwerte small { font-weight: 400; color: var(--fw-muted); }
.ep-rb-dialog .ep-rb-stufe { font-size: .75rem; margin: -.2rem 0 .7rem; }
.ep-rb-dialog .ep-rb-tabelle { width: 100%; border-collapse: collapse; font-size: .8rem; margin-bottom: .7rem; }
.ep-rb-dialog .ep-rb-tabelle th { text-align: left; font-size: .7rem; font-weight: 600; color: var(--fw-muted); text-transform: uppercase; letter-spacing: .04em; padding: .3rem .4rem; border-bottom: 1px solid var(--fw-border); }
.ep-rb-dialog .ep-rb-tabelle td { padding: .3rem .4rem; border-bottom: 1px solid var(--fw-border); vertical-align: middle; }
.ep-rb-dialog .ep-rb-tabelle small { color: var(--fw-muted); }
.ep-rb-dialog .ep-td-nr { text-align: right; }
.ep-rb-dialog .ep-td-sym svg { width: 22px; height: 22px; display: block; }
.ep-rb-zeile { font-size: .8rem; line-height: 1.6; margin: .3rem 0; display: flex; flex-wrap: wrap; gap: .25rem .6rem; align-items: baseline; }
.ep-rb-dialog p.ep-rb-zeile { color: var(--fw-text); margin-bottom: .35rem; }
.ep-rb-zeile > b { font-weight: 600; min-width: 6.5rem; }
.ep-rb-kreis { display: inline-flex; align-items: center; gap: .3rem; }
.ep-rb-kreis i { width: .6rem; height: .6rem; border-radius: 50%; display: inline-block; }
.ep-rb-kreis--ohne { color: var(--fw-muted); }
.ep-rb-offen b { color: #9a5200; }
.ep-rb-leer { font-size: .8rem; color: var(--fw-muted); }
.ep-rb-notizfeld { display: flex; flex-direction: column; gap: .3rem; margin-top: .6rem; font-size: .78rem; font-weight: 600; }
.ep-rb-notizfeld textarea { font: inherit; font-size: .85rem; font-weight: 400; padding: .5rem .6rem; border: 1px solid var(--fw-border-str, var(--fw-border)); border-radius: 8px; background: var(--fw-bg); color: var(--fw-text); resize: vertical; }

/* Druckblatt */
.ep-blatt--raumbuch .ep-rb-h3 small { font-weight: 400; color: #555; margin-left: 2mm; }
.ep-blatt--raumbuch .ep-rb-kennwerte--druck { grid-template-columns: repeat(7, 1fr); gap: 1.5mm; margin: 1mm 0 2mm; }
.ep-blatt--raumbuch .ep-rb-kennwerte--druck > div { border-radius: 1.5mm; padding: 1mm 1.8mm; border-color: #ccc; }
.ep-blatt--raumbuch .ep-rb-kennwerte--druck span { font-size: 6pt; color: #555; }
.ep-blatt--raumbuch .ep-rb-kennwerte--druck strong { font-size: 8.5pt; }
.ep-blatt--raumbuch .ep-rb-zeile { font-size: 7.5pt; margin: 1mm 0; }
.ep-blatt--raumbuch .ep-rb-zeile > b { min-width: 22mm; }
.ep-blatt--raumbuch .ep-rb-uebersicht { margin-bottom: 3mm; }
.ep-blatt--raumbuch .ep-rb-leer { font-size: 7.5pt; }
.ep-blatt--raumbuch .ep-rb-ampel { width: 2mm; height: 2mm; margin-right: 1mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.ep-blatt--raumbuch .ep-rb-kreis i { width: 2mm; height: 2mm; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.ep-rb-dialog .ep-rb-kennwerte { grid-template-columns: repeat(4, 1fr); }
.ep-rb-dialog .ep-rb-kennwerte span { letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep-blatt--raumbuch .ep-rb-uebersicht td, .ep-blatt--raumbuch .ep-rb-uebersicht th { white-space: nowrap; }
.ep-blatt--raumbuch .ep-rb-uebersicht td:nth-child(-n+2) { white-space: normal; }
.ep-blatt--raumbuch .ep-rb-tabelle td, .ep-blatt--raumbuch .ep-rb-uebersicht td { padding-top: .6mm; padding-bottom: .6mm; }
.ep-blatt--raumbuch .ep-rb-tabelle .ep-td-sym svg { width: 5mm; height: 5mm; }
.ep-blatt--raumbuch .ep-rb-kennwerte--druck > div { padding: .6mm 1.6mm; }
.ep-blatt--raumbuch .ep-rb-h3 { margin-top: 3mm; }
