/* ═══════════════════════════════════════════════════════
   Einstellungen — Arbeitsplatz-Konfiguration
   Aufbau wie ein Pult: links die feste Tastenreihe mit Suche,
   rechts die Baugruppen. Nichts wandert, nichts springt.
   ═══════════════════════════════════════════════════════ */

.es-layout {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

/* ── Linke Leiste ────────────────────────────────────── */
.es-seite {
    position: sticky; top: 0;
    display: flex; flex-direction: column; gap: 0.6rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.7rem;
    box-shadow: var(--card-shadow);
}

.es-suche { position: relative; }
.es-suche i {
    position: absolute; left: 0.65rem; top: 50%; transform: translateY(-50%);
    font-size: var(--fs-2xs); color: var(--text-dim); pointer-events: none;
}
.es-suche .feld { padding-left: 1.9rem; font-size: var(--fs-xs); }

.es-nav { display: flex; flex-direction: column; gap: 2px; }
.es-nav button {
    display: flex; align-items: center; gap: 0.55rem;
    width: 100%; text-align: left;
    padding: 0.44rem 0.55rem;
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: transparent; color: var(--text-dim);
    font-family: var(--sans); font-size: var(--fs-xs);
    cursor: pointer; transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.es-nav button .nr {
    font-family: var(--mono); font-size: var(--fs-3xs); letter-spacing: 0.06em;
    color: var(--text-dim); opacity: 0.65;
}
.es-nav button i { width: 15px; text-align: center; font-size: var(--fs-xs); }
.es-nav button .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.es-nav button:hover { color: var(--text); background: rgba(255,255,255,0.035); }
.es-nav button.aktiv {
    color: var(--red); background: var(--red-dim);
    border-color: var(--border-red);
}
.es-nav button.aktiv .nr { color: var(--red); opacity: 1; }

.es-fuss {
    border-top: 1px solid var(--linie);
    padding-top: 0.55rem;
    font-family: var(--mono); font-size: var(--fs-2xs); color: var(--text-mid);
}
.es-fuss .modul-kennung { margin-bottom: 0.25rem; }

/* ── Rechte Spalte ───────────────────────────────────── */
.es-inhalt { min-width: 0; }
.es-inhalt .karte:last-child { margin-bottom: 0; }
.karte[hidden] { display: none !important; }

/* ── Eine Einstellung ────────────────────────────────── */
.zeile {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1.2rem; padding: 0.7rem 0.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}
.zeile:hover { background: rgba(255,255,255,0.022); }
.zeile:last-child { border-bottom: none; }
.zeile[hidden] { display: none !important; }
.zeile .beschriftung { flex: 1; min-width: 0; }
.zeile .titel { font-size: var(--fs-sm); font-weight: 600; color: var(--text); }
.zeile .erklaerung { font-size: var(--fs-xs); color: var(--text-dim); margin-top: 0.2rem; line-height: 1.5; max-width: 60ch; }
.zeile .steuerung { flex: none; display: flex; align-items: center; gap: 0.5rem; }
.zeile .steuerung .feld { width: auto; min-width: 170px; }

/* Hinweistext unter einer Einstellung (Stile in css/tabs/admin.css) */
.modul-koerper > .zufuegen-hinweis { padding: 0 0.5rem 0.4rem; margin-top: 0; }

/* ── Tastenwahl ──────────────────────────────────────── */
.tastenfeld {
    font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 0.03em;
    min-width: 140px; text-align: center;
    background: var(--surface3); border: 1px solid var(--linie-stark);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm); color: var(--text);
    padding: 0.5rem 0.9rem; cursor: pointer;
    transition: border-color 0.15s, color 0.15s, transform 0.08s;
}
.tastenfeld:hover  { border-color: var(--red); color: var(--red); }
.tastenfeld:active { transform: translateY(1px); border-bottom-width: 1px; }
.tastenfeld.lauscht {
    border-color: var(--red); color: var(--red); background: var(--red-dim);
    animation: tastePuls 1.1s ease-in-out infinite;
}
@keyframes tastePuls { 0%,100% { opacity: 1; } 50% { opacity: 0.55; } }

/* ── Regler ──────────────────────────────────────────── */
input[type="range"] {
    -webkit-appearance: none; appearance: none;
    width: 160px; height: 4px; border-radius: 999px;
    background: var(--surface3); outline: none;
    border: 1px solid var(--border);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--red); cursor: pointer; border: none;
    box-shadow: 0 0 0 3px rgba(232,25,44,0.15);
}
input[type="range"]::-moz-range-thumb {
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--red); cursor: pointer; border: none;
    box-shadow: 0 0 0 3px rgba(232,25,44,0.15);
}
.reglerwert {
    font-family: var(--mono); font-size: var(--fs-xs); color: var(--text-mid);
    min-width: 52px; text-align: right;
}

/* Schalter: gemeinsame Grundform steht in css/tabs/admin.css —
   hier nur der Fokusrahmen für die Tastaturbedienung. */
.schalter input:focus-visible + .bahn { border-color: var(--red); box-shadow: 0 0 0 2px var(--red-dim); }

/* ── Mobil ───────────────────────────────────────────── */
@media (max-width: 860px) {
    .es-layout { grid-template-columns: 1fr; }
    .es-seite { position: static; padding: 0.6rem; }
    .es-nav { flex-direction: row; flex-wrap: wrap; gap: 4px; }
    .es-nav button { width: auto; padding: 0.3rem 0.65rem; border: 1px solid var(--border); border-radius: 999px; }
    .es-nav button .nr, .es-nav button i { display: none; }
    .es-fuss { display: none; }
}

@media (max-width: 560px) {
    .zeile { flex-direction: column; align-items: stretch; gap: 0.6rem; padding: 0.7rem 0.35rem; }
    .zeile .steuerung { justify-content: space-between; }
    .zeile .steuerung .feld, .tastenfeld { width: 100%; min-width: 0; }
    input[type="range"] { flex: 1; width: auto; }
    .modul-koerper { padding: 0.25rem 0.7rem 0.6rem; }
}

/* ── App (PWA) ── */
#pwaInstallBtn[hidden] { display: none; }
.es-pwa-liste {
    margin: 0; padding-left: 1.3rem;
    display: flex; flex-direction: column; gap: 0.35rem;
    font-size: var(--fs-sm); color: var(--text-mid); line-height: 1.45;
}
.es-pwa-liste li::marker { color: var(--red); font-weight: 700; }
@media (max-width: 560px) {
    #pwaInstallBtn { width: 100%; justify-content: center; }
}
