/* Handy koppeln (2.6 eingeführt, 2.7 Kopplung v2): Handy-Seiten (/m/koppeln, /m/entsperren, /m/einrichten) und
   PC-Bereich „Handy & Tablet“ in den Einstellungen mit Kopplungsfenster. Keine Unschärfe-Effekte (deckend). */

/* ── Handy-Seiten ─────────────────────────────────────────────────────────── */
/* Deckender Hintergrund (kein Bild, keine Unschärfe) – Texte und Ziffernblock bleiben in hellem und dunklem Thema lesbar */
/* 2.12 (Paket E) – echte Ursache der abgeschnittenen PIN-Tastatur: die Handy-Seiten erbten aus login.css
   html/body { height:100dvh; overflow:hidden } und „.login-page main“ { overflow:hidden; display:grid;
   place-items:center; padding:clamp(80px,12vh,104px) … } (Spezifität höher als .mek). Der Kopplungsschritt
   (Vergleichszahl + Hinweise + 4×3-Ziffernblock mit quadratischen Tasten aus 1fr-Spalten ≈ 92 px hoch) war damit
   höher als der sichtbare Bereich und weder scroll- noch erreichbar. Jetzt: normales Dokument-Scrollen, eigener
   Innenabstand, Tastengröße aus Breite UND sichtbarer Höhe. Schritte bleiben eigene Abschnitte ([data-step]). */
body.mek-page { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; align-items: center;
  justify-content: flex-start; overflow-x: hidden; background: #0b1120 !important; background-image: none !important; color: #e5e7eb; }
html[data-theme="light"] body.mek-page { background: #eef2f7 !important; color: #0f172a; }
body.mek-page .bg-orb { display: none !important; }
body.mek-page::before, body.mek-page::after { display: none !important; }
.mek-card { background: #111a2e !important; border-color: rgba(148, 163, 184, .28) !important; }
html[data-theme="light"] .mek-card { background: #ffffff !important; border-color: rgba(15, 23, 42, .12) !important; }
html[data-theme="light"] .mek-pad button { background: #e2e8f0; }
html[data-theme="light"] .mek-pad button:active { background: #cbd5e1; }
html[data-theme="light"] .mek-pad .mek-pad-fn { background: transparent; }
.mek, .login-page main.mek {
  /* body trägt bereits die Safe-Area (login.css) – hier nur der eigene Abstand */
  width: 100%; max-width: 440px; box-sizing: border-box; flex: 1 0 auto; display: block; margin: 0 auto;
  padding: clamp(12px, 3vh, 22px) 16px clamp(16px, 3vh, 24px);
}
.mek-head { text-align: center; margin-bottom: 16px; }
.mek-logo { width: 56px; height: 56px; border-radius: 14px; }
.mek-head h1 { font-size: 1.35rem; font-weight: 700; margin: 10px 0 4px; }
.mek-sub { opacity: .78; font-size: .92rem; margin: 0; }
.mek-steps { display: flex; justify-content: center; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.mek-steps li { width: 26px; height: 4px; border-radius: 3px; background: rgba(148, 163, 184, .3); }
.mek-steps li.is-on { background: #6366f1; }
.mek-card {
  border-radius: 16px; padding: 18px 16px; margin-bottom: 14px;
  background: rgba(148, 163, 184, .08); border: 1px solid rgba(148, 163, 184, .22);
}
.mek-card h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 8px; }
.mek-card p { font-size: .9rem; line-height: 1.45; opacity: .88; }
.mek-card label { font-size: .85rem; font-weight: 600; margin: 8px 0 4px; display: block; }
.mek-card .form-control { min-height: 48px; font-size: 1rem; }
.mek-btn { min-height: 50px; font-size: 1.02rem; font-weight: 600; }
.mek-link { background: none; border: 0; color: inherit; opacity: .8; text-decoration: underline; padding: 6px 0; font-size: .88rem; }
.mek-code { text-align: center; font: 600 1.25rem/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .1em; min-height: 52px; text-transform: uppercase; }
.mek-scan { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 1 / 1; margin: 6px 0 12px; }
.mek-scan video { width: 100%; height: 100%; object-fit: cover; display: block; }
.mek-scan-frame { position: absolute; inset: 14%; border: 3px solid rgba(255, 255, 255, .92); border-radius: 18px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }
.mek-scan-hint { position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; color: #fff; font-size: .85rem; text-shadow: 0 1px 2px #000; }
.mek-verify {
  font: 700 clamp(1.9rem, 9.5vw, 2.5rem)/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .14em; text-align: center;
  overflow-wrap: anywhere;
  padding: 14px 0; margin: 4px 0 10px; border-radius: 12px; background: rgba(99, 102, 241, .14); color: #c7d2fe;
}
html[data-theme="light"] .mek-verify { color: #3730a3; }
.mek-account { font-weight: 600; margin-bottom: 10px !important; opacity: 1 !important; }
.mek-pc { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: rgba(148, 163, 184, .1); margin-bottom: 12px; font-size: .9rem; }
.mek-pc i { font-size: 1.3rem; opacity: .8; }
.mek-note { font-size: .82rem !important; opacity: .78; }
.mek-msg { margin: 6px 2px 0; font-size: .9rem; padding: 10px 12px; border-radius: 10px; background: rgba(59, 130, 246, .12); }
.mek-msg.is-error { background: rgba(239, 68, 68, .14); color: #fca5a5; }
html[data-theme="light"] .mek-msg.is-error { color: #b91c1c; }
.mek-foot { text-align: center; margin-top: 18px; font-size: .85rem; }
.mek-foot a { color: inherit; opacity: .75; }
.mek-ok { text-align: center; }
.mek-ok i { font-size: 2.6rem; color: #22c55e; }
.mek-progress { height: 6px; border-radius: 4px; background: rgba(148, 163, 184, .25); overflow: hidden; margin: 12px 0; }
.mek-progress span { display: block; height: 100%; width: 30%; background: #6366f1; animation: mek-run 1.2s ease-in-out infinite; }
@keyframes mek-run { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }
@media (prefers-reduced-motion: reduce) { .mek-progress span { animation: none; width: 100%; } }

/* PIN-Punkte + Ziffernblock (Kopplung und Sperrbildschirm) */
.mek-dots { display: flex; justify-content: center; gap: 14px; margin: 14px 0 6px; }
.mek-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(148, 163, 184, .8); }
.mek-dots span.is-on { background: currentColor; border-color: currentColor; }
/* Tastengröße aus Breite UND sichtbarer Höhe (vorher 1fr-Spalten + aspect-ratio 1 → bis ~92 px hohe Tasten) */
.mek-pad { --pad-key: clamp(52px, 18vw, 72px); display: grid; grid-template-columns: repeat(3, var(--pad-key));
  justify-content: center; gap: clamp(8px, 1.6vh, 14px) clamp(16px, 6vw, 28px); margin: 12px auto 6px; }
@supports (height: 1dvh) { .mek-pad { --pad-key: clamp(52px, min(18vw, 9.4dvh), 72px); } }
.mek-pad button { width: var(--pad-key); height: var(--pad-key); min-height: 44px; border-radius: 50%; border: 0;
  font-size: calc(var(--pad-key) * .4); font-weight: 500; padding: 0;
  background: rgba(148, 163, 184, .16); color: inherit; touch-action: manipulation; }
.mek-pad button:active { background: rgba(148, 163, 184, .34); }
.mek-pad button:focus-visible { outline: 3px solid #6366f1; outline-offset: 2px; }
.mek-pad .mek-pad-fn { background: transparent; font-size: 1.15rem; }
.mek-shake { animation: mek-shake .35s; }
@keyframes mek-shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Sperrbildschirm */
.mlk { text-align: center; }
.mlk-avatar { width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 8px; display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; font-weight: 700; background: #4f46e5; color: #fff; }
.mlk-name { font-size: 1.15rem; font-weight: 700; }
.mlk-sub { opacity: .75; font-size: .9rem; }
.mlk-bio { margin-top: 10px; }

/* ── PC: Einstellungen › Handy & Tablet ───────────────────────────────────── */
.mep-hero { display: flex; gap: 22px; flex-wrap: wrap; align-items: flex-start; margin: 4px 0 14px; }
.mep-hero-text { flex: 1 1 320px; min-width: 0; }
.mep-open { font-weight: 600; padding: 10px 18px; }
.mep-steps { flex: 1 1 260px; margin: 0; padding-left: 1.2rem; font-size: .88rem; opacity: .85; line-height: 1.6; }
.mep-list-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 6px; }
.mep-list { list-style: none; padding: 0; margin: 8px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.mep-dev { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(148, 163, 184, .25); }
.mep-dev.is-empty { opacity: .7; justify-content: center; }
.mep-dev-ico { width: 34px; text-align: center; font-size: 1.3rem; opacity: .8; }
.mep-dev-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.mep-dev-main small { opacity: .72; }
.mep-dev-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mep-badge { display: inline-block; font-size: .72rem; padding: 1px 7px; border-radius: 999px; background: rgba(99, 102, 241, .18); margin-left: 4px; vertical-align: 1px; }
.mep-badge.is-warn { background: rgba(245, 158, 11, .25); }
.mep-badge.is-muted { background: rgba(148, 163, 184, .2); }

body.mep-dialog-open { overflow: hidden; }
.mep-dialog { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center;
  background: rgba(2, 6, 23, .72); padding: 16px; }
.mep-dialog[hidden] { display: none; }
.mep-dialog-card { width: 100%; max-width: 680px; max-height: calc(100dvh - 32px); overflow: auto; border-radius: 18px;
  background: #111827; color: #e5e7eb; padding: 20px 22px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
html[data-theme="light"] .mep-dialog-card { background: #fff; color: #0f172a; }
.mep-dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.mep-dialog-head h3 { font-size: 1.2rem; font-weight: 700; margin: 0; }
.mep-x { background: none; border: 0; color: inherit; font-size: 1.2rem; opacity: .7; padding: 6px 8px; }
.mep-qr-wrap { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
.mep-qr { width: 260px; height: 260px; border-radius: 14px; background: #fff; padding: 6px; box-sizing: border-box; flex: 0 0 auto; }
.mep-qr svg { width: 100%; height: 100%; display: block; }
.mep-qr-side { flex: 1 1 240px; min-width: 0; }
.mep-howto { padding-left: 1.2rem; font-size: .92rem; line-height: 1.6; margin-bottom: 10px; }
.mep-code-label { font-size: .82rem; opacity: .75; margin: 0 0 2px; }
.mep-code { font: 700 1.45rem/1.3 ui-monospace, Consolas, monospace; letter-spacing: .1em; user-select: all; }
.mep-bar { height: 5px; border-radius: 4px; background: rgba(148, 163, 184, .25); overflow: hidden; margin: 10px 0 4px; }
.mep-bar span { display: block; height: 100%; width: 100%; background: #6366f1; transition: width 1s linear; }
.mep-count { font-size: .82rem; opacity: .75; }
.mep-devcard { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: rgba(148, 163, 184, .12); margin-bottom: 12px; }
.mep-devcard > i { font-size: 1.6rem; opacity: .85; }
.mep-net { font-size: .82rem; opacity: .8; }
.mep-net.is-ext { color: #f59e0b; opacity: 1; }
.mep-verify { font: 700 2.4rem/1 ui-monospace, Consolas, monospace; letter-spacing: .16em; margin: 6px 0 14px; padding: 12px 0;
  text-align: center; border-radius: 12px; background: rgba(99, 102, 241, .14); }
.mep-e2ee { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .08); margin-bottom: 14px; cursor: pointer; }
.mep-e2ee[hidden] { display: none; }
.mep-e2ee input { margin-top: 4px; width: 18px; height: 18px; flex: 0 0 auto; }
.mep-e2ee small { display: block; opacity: .8; margin-top: 2px; }
.mep-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; margin-top: 8px; }
.mep-center { text-align: center; padding: 16px 0; }
.mep-ok > i { font-size: 2.6rem; color: #22c55e; }
.mep-center > .fa-ban { font-size: 2rem; opacity: .7; }
.mep-spin { display: inline-block; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(148, 163, 184, .3);
  border-top-color: #6366f1; animation: mep-spin 0.9s linear infinite; }
@keyframes mep-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .mep-spin { animation: none; } .mep-bar span { transition: none; } }
.mep-note { font-size: .85rem; opacity: .8; }
.mep-otp { max-width: 180px; letter-spacing: .3em; }
.mep-msg { margin-top: 10px; font-size: .9rem; }
.mep-msg.is-error { color: #f87171; }
html[data-theme="light"] .mep-msg.is-error { color: #b91c1c; }
@media (max-width: 560px) { .mep-qr { width: 220px; height: 220px; margin: 0 auto; } .mep-verify { font-size: 2rem; } }

/* 2.12 (Paket E): niedrige Fenster (iPhone SE, Querformat, Tastatur) – Kopf kompakter, Schritt bleibt vollständig */
@media (max-height: 700px) {
  .mek-logo { width: 44px; height: 44px; border-radius: 12px; }
  .mek-head { margin-bottom: 10px; }
  .mek-head h1 { font-size: 1.2rem; margin: 6px 0 2px; }
  .mek-card { padding: 14px 14px; margin-bottom: 10px; }
  .mek-verify { padding: 10px 0; margin: 2px 0 8px; }
  .mlk-avatar { width: 56px; height: 56px; font-size: 1.4rem; margin: 2px auto 6px; }
}
@media (max-height: 480px) {
  .mek-sub { display: none; }
  .mek-head { display: flex; align-items: center; gap: 10px; text-align: left; }
  .mek-head h1 { margin: 0; }
  .mek-steps { margin: 0 0 0 auto; }
}
/* Tap-Ziele ≥ 44 px auch für Textknöpfe */
.mek-link { min-height: 44px; }
.mek-foot a, .mek-foot .mek-link { display: inline-flex; align-items: center; min-height: 44px; }
.mek-card { overflow-wrap: anywhere; }
