/*
 * NYXUS Authenticator – Gestaltung
 * Gestaltung und Umsetzung: NYXUS Development
 */

:root {
  --bg: #07090f;
  --bg-2: #0d1120;
  --flaeche: #111626;
  --flaeche-2: #171d31;
  --linie: #20283e;
  --linie-2: #2c3552;
  --text: #eef1f9;
  --text-2: #a3abc2;
  --text-3: #6d7690;
  --code: #f5f7ff;
  --akzent: #8b6cff;
  --akzent-2: #3d8bff;
  --verlauf: linear-gradient(135deg, #8b5cf6 0%, #3d8bff 100%);
  --ok: #2fd08a;
  --warn: #f5b942;
  --gefahr: #ff5d6c;
  --schatten: 0 14px 40px rgba(0, 0, 0, .45);
  --glanz: rgba(139, 92, 246, .16);
  --radius: 18px;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  /* Sichere Ränder: am Handy die echten (Notch, Home-Balken), im Handy-Rahmen am PC nachgebildet */
  --so: env(safe-area-inset-top, 0px);
  --su: env(safe-area-inset-bottom, 0px);
  --aussen: #030409;
  --rahmen: #0b0d14;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f3f5fa;
    --bg-2: #e9edf6;
    --flaeche: #ffffff;
    --flaeche-2: #f5f7fc;
    --linie: #e1e6f0;
    --linie-2: #cdd4e4;
    --text: #0f1424;
    --text-2: #4f5872;
    --text-3: #8790a8;
    --code: #141a36;
    --akzent: #6d4aff;
    --akzent-2: #2f6fe8;
    --schatten: 0 12px 32px rgba(20, 30, 60, .12);
    --glanz: rgba(109, 74, 255, .10);
    --aussen: #dde2ee;
    --rahmen: #161a24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--schrift);
  color: var(--text);
  background: radial-gradient(900px 420px at 50% -160px, var(--glanz), transparent 70%) no-repeat, var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, .karte:focus-visible, summary:focus-visible {
  outline: 2px solid var(--akzent);
  outline-offset: 2px;
}
[hidden] { display: none !important; }
.ohne-js { padding: 40px 20px; text-align: center; }

.ik {
  width: 22px; height: 22px; flex-shrink: 0;
  fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

/* ------------------------------------------------------------ Seiten */

.seite {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 16px calc(var(--su) + 110px);
  min-height: 100dvh;
  animation: einblenden .28s ease-out;
}
.seite.mittig {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--so) + 28px) 20px calc(var(--su) + 28px);
}
.logo-gross { width: 84px; height: 84px; border-radius: 24px; box-shadow: 0 18px 44px rgba(109, 74, 255, .35); }
h1 { font-size: 26px; margin: 18px 0 6px; letter-spacing: -.01em; }
.text { color: var(--text-2); font-size: 15px; line-height: 1.5; margin: 6px 0; }
.text.klein { font-size: 13.5px; }
.verlauf-text { background: var(--verlauf); -webkit-background-clip: text; background-clip: text; color: transparent; }

.merkmale { list-style: none; padding: 0; margin: 24px 0 26px; display: grid; gap: 14px; text-align: left; width: 100%; max-width: 360px; }
.merkmale li { display: flex; align-items: center; gap: 14px; font-size: 15px; line-height: 1.35; }
.merkmale li small { display: block; color: var(--text-2); font-size: 13px; }
.merkmal-ikon {
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--akzent) 15%, transparent); color: var(--akzent);
}
.breit-max { width: 100%; max-width: 360px; }

/* ------------------------------------------------------------ Kopfzeile */

.kopf {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 2px;
  margin: 0 -16px;
  padding: calc(var(--so) + 8px) 8px 8px 16px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.marke { flex: 1; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 600; min-width: 0; white-space: nowrap; }
.marke img { width: 30px; height: 30px; border-radius: 9px; }
.marke b { font-weight: 700; }
.ikonknopf {
  position: relative;
  width: 42px; height: 42px; border-radius: 12px; border: 0;
  display: grid; place-items: center;
  background: transparent; color: var(--text-2); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ikonknopf:hover { background: var(--flaeche-2); color: var(--text); }
.punkt {
  position: absolute; top: 8px; right: 8px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--gefahr); box-shadow: 0 0 0 2px var(--bg);
}

.suchleiste {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0 8px; padding: 0 12px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 14px;
  color: var(--text-3);
}
.suchfeld { flex: 1; border: 0; outline: 0; background: none; color: var(--text); font: inherit; font-size: 16px; padding: 12px 0; }

/* ------------------------------------------------------------ Konten */

.konten { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.karte {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 14px 8px 14px 14px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, border-color .25s, box-shadow .25s;
}
.karte:active { transform: scale(.985); }
.karte.kopiert { border-color: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 22%, transparent); }
.avatar {
  width: 44px; height: 44px; border-radius: 14px; flex-shrink: 0;
  display: grid; place-items: center;
  font-size: 19px; font-weight: 700; color: #fff;
}
.avatar.dunkel { color: #16181f; }
.mitte { min-width: 0; }
.name { display: flex; align-items: baseline; gap: 7px; font-size: 14px; color: var(--text-2); white-space: nowrap; overflow: hidden; }
.name b { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; max-width: 62%; }
.name span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.name b:only-child { max-width: 100%; }
.code {
  margin-top: 2px;
  font-size: 31px; font-weight: 650; line-height: 1.15; letter-spacing: .05em;
  font-variant-numeric: tabular-nums; color: var(--code);
  white-space: nowrap;
}
.karte.knapp .code { color: var(--gefahr); animation: pulsieren 1s ease-in-out infinite; }
.naechster {
  height: 0; opacity: 0; overflow: hidden;
  font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums;
  transition: height .2s, opacity .2s;
}
.karte.bald .naechster { height: 17px; opacity: 1; }
.rechts { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ring-box { position: relative; width: 38px; height: 38px; }
.ring { width: 38px; height: 38px; transform: rotate(-90deg); display: block; }
.ring circle { fill: none; stroke-width: 3.2; }
.ring-hg { stroke: var(--linie-2); }
.ring-vg { stroke: var(--akzent); stroke-linecap: round; stroke-dasharray: 94.25; }
.karte.knapp .ring-vg { stroke: var(--gefahr); }
.sek {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.rechts .mehr { width: 38px; height: 30px; }
.rechts .neu { width: 38px; height: 38px; color: var(--akzent); }

.leer { text-align: center; padding: 44px 8px 10px; }
.leer-bild {
  width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 30px;
  display: grid; place-items: center; color: #fff; background: var(--verlauf);
  box-shadow: 0 18px 44px rgba(109, 74, 255, .35);
}
.leer-bild .ik { width: 40px; height: 40px; stroke-width: 1.6; }
.leer h2 { margin: 0 0 6px; font-size: 21px; }
.leer .knopf-stapel { max-width: 340px; margin: 22px auto 0; }
.knopf-stapel { display: grid; gap: 10px; }

.hinweis {
  display: flex; gap: 10px; align-items: flex-start;
  border-radius: 14px; padding: 12px 14px; margin: 6px 0 10px;
  font-size: 13.5px; line-height: 1.45; text-align: left;
  border: 1px solid color-mix(in srgb, var(--akzent-2) 35%, transparent);
  background: color-mix(in srgb, var(--akzent-2) 11%, transparent);
}
.hinweis.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.hinweis .ik { width: 19px; height: 19px; margin-top: 1px; color: var(--akzent-2); }
.hinweis.warn .ik { color: var(--warn); }
.hinweis .link { padding: 0; font-size: 13.5px; }

.fab {
  position: fixed; z-index: 20;
  right: max(18px, calc(50vw - 262px));
  bottom: calc(var(--su) + 22px);
  width: 62px; height: 62px; border: 0; border-radius: 21px;
  display: grid; place-items: center;
  color: #fff; background: var(--verlauf); cursor: pointer;
  box-shadow: 0 12px 30px rgba(109, 74, 255, .45);
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s;
}
.fab:active { transform: scale(.93); }
.fab .ik { width: 28px; height: 28px; stroke-width: 2.2; }

.fuss { text-align: center; font-size: 12px; color: var(--text-3); margin: 30px 0 0; }

/* ------------------------------------------------------------ Menü */

.menue {
  position: fixed; z-index: 40;
  top: calc(var(--so) + 56px);
  right: max(10px, calc(50vw - 276px));
  width: min(300px, calc(100% - 20px));
  padding: 8px;
  background: var(--flaeche); border: 1px solid var(--linie-2); border-radius: 18px;
  box-shadow: var(--schatten);
  transform-origin: top right;
  animation: aufklappen .16s ease-out;
}
.menue-gruppe + .menue-gruppe { border-top: 1px solid var(--linie); margin-top: 6px; padding-top: 6px; }
.menue-titel { padding: 6px 10px 4px; font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.menue-eintrag {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px; border: 0; border-radius: 12px; background: none;
  font-size: 15px; text-align: left; cursor: pointer;
}
.menue-eintrag:hover { background: var(--flaeche-2); }
.menue-eintrag .ik { color: var(--text-2); }
.menue-eintrag span { display: flex; flex-direction: column; }
.menue-eintrag small { font-size: 12px; color: var(--gefahr); margin-top: 1px; }

/* ------------------------------------------------------------ Knöpfe und Felder */

.knopf {
  appearance: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 12px 18px;
  border: 1px solid var(--linie-2); border-radius: 15px;
  background: var(--flaeche-2); color: var(--text);
  font-size: 15.5px; font-weight: 600; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s, opacity .2s;
}
.knopf:active { transform: scale(.97); }
.knopf:disabled { opacity: .5; cursor: default; transform: none; }
.knopf.haupt { border-color: transparent; color: #fff; background: var(--verlauf); box-shadow: 0 10px 24px rgba(109, 74, 255, .32); }
.knopf.gefahr {
  color: var(--gefahr);
  background: color-mix(in srgb, var(--gefahr) 12%, transparent);
  border-color: color-mix(in srgb, var(--gefahr) 40%, transparent);
}
.knopf.voll { width: 100%; }
.knopf.klein { min-height: 38px; padding: 8px 14px; font-size: 14px; border-radius: 12px; }
.knopf.glas { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .22); color: #fff; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.knopf .ik { width: 20px; height: 20px; }
.knoepfe { display: flex; gap: 10px; margin-top: 18px; }
.knoepfe .knopf { flex: 1; }
.link {
  background: none; border: 0; padding: 10px; cursor: pointer;
  color: var(--akzent); font-size: 14.5px; font-weight: 500;
}

.beschriftung { display: block; margin: 14px 0 6px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.feld {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--linie-2); border-radius: 13px; outline: 0;
  background: var(--bg-2); color: var(--text);
  font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s;
}
.feld:focus { border-color: var(--akzent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--akzent) 22%, transparent); }
.feld::placeholder { color: var(--text-3); }
.mono { font-family: var(--mono); letter-spacing: .03em; }
select.feld {
  appearance: none; -webkit-appearance: none;
  padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238a93ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px;
}
.raster-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.fehlertext { margin: 10px 0 0; font-size: 14px; color: var(--gefahr); line-height: 1.4; }
.fehlertext:empty { display: none; }
.formular .feld + .feld { margin-top: 10px; }

.vorschau {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 16px; padding: 12px 14px;
  border: 1px dashed var(--linie-2); border-radius: 14px; background: var(--bg-2);
}
.vorschau small { color: var(--text-2); font-size: 13px; }
.vorschau b { font-size: 23px; letter-spacing: .05em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vorschau.fehler b { font-size: 14px; font-weight: 500; color: var(--gefahr); letter-spacing: 0; white-space: normal; text-align: right; }
.details-liste { margin: 10px 0 0; font-size: 13px; color: var(--text-2); }

details.aufklapp { margin-top: 12px; }
details.aufklapp summary {
  list-style: none; cursor: pointer;
  padding: 10px 0 4px; font-size: 14px; font-weight: 500; color: var(--text-2);
}
details.aufklapp summary::-webkit-details-marker { display: none; }
details.aufklapp summary::before { content: "▸"; display: inline-block; width: 16px; transition: transform .15s; }
details.aufklapp[open] summary::before { transform: rotate(90deg); }

/* ------------------------------------------------------------ Blatt (Dialog von unten) */

#blatt { position: fixed; inset: 0; z-index: 50; }
.blatt-hinten {
  position: absolute; inset: 0;
  background: rgba(3, 5, 12, .62);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s;
}
.blatt-karte {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 560px; max-height: calc(100% - var(--so) - 12px); margin: 0 auto; overflow: auto; overscroll-behavior: contain;
  padding: 6px 18px calc(var(--su) + 20px);
  background: var(--flaeche);
  border: 1px solid var(--linie); border-bottom: 0; border-radius: 24px 24px 0 0;
  box-shadow: var(--schatten);
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2, .8, .2, 1);
}
#blatt.offen .blatt-hinten { opacity: 1; }
#blatt.offen .blatt-karte { transform: none; }
.blatt-griff { width: 40px; height: 4px; margin: 6px auto 4px; border-radius: 4px; background: var(--linie-2); }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 2px -6px 6px 0; }
.blatt-kopf h2 { margin: 0; font-size: 19px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.optionen { display: grid; gap: 8px; }
.option {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 13px 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--linie); border-radius: 16px; background: var(--flaeche-2);
  -webkit-tap-highlight-color: transparent;
}
.option:active { transform: scale(.985); }
.option-ikon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--akzent) 15%, transparent); color: var(--akzent);
}
.option-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.option-text b { font-size: 15.5px; font-weight: 600; }
.option-text small { font-size: 13px; color: var(--text-2); }
.option.kompakt { padding: 9px 12px; }
.option.kompakt .option-ikon { width: 36px; height: 36px; border-radius: 11px; }
.option.kompakt .ik { width: 20px; height: 20px; }
.option.gefahr { color: var(--gefahr); }
.option.gefahr .option-ikon { background: color-mix(in srgb, var(--gefahr) 13%, transparent); color: var(--gefahr); }

.abschnitt-titel { margin: 20px 2px 4px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.abschnitt-titel:first-child { margin-top: 6px; }
.zeile { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 2px; border-bottom: 1px solid var(--linie); }
.zeile:last-child { border-bottom: 0; }
.zeile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 15px; }
.zeile-text b { font-weight: 600; }
.zeile-text small { font-size: 13px; line-height: 1.35; color: var(--text-2); }
.zeile select.feld { width: auto; padding: 8px 34px 8px 12px; font-size: 15px; flex-shrink: 0; }
.zeile .knopf { flex-shrink: 0; }

.schalter {
  appearance: none; -webkit-appearance: none;
  position: relative; flex-shrink: 0; margin: 0;
  width: 50px; height: 30px; border-radius: 30px;
  background: var(--linie-2); cursor: pointer; transition: background .2s;
}
.schalter::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  transition: transform .2s;
}
.schalter:checked { background: var(--akzent); }
.schalter:checked::after { transform: translateX(20px); }
.schalter:disabled { opacity: .5; }

.auswahl { display: grid; gap: 6px; max-height: 48dvh; overflow: auto; margin: 12px 0 0; }
.auswahl-zeile {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 13px; cursor: pointer;
  background: var(--flaeche-2); border: 1px solid var(--linie);
}
.auswahl-zeile input { width: 20px; height: 20px; accent-color: var(--akzent); flex-shrink: 0; margin: 0; }
.auswahl-zeile .avatar { width: 34px; height: 34px; border-radius: 10px; font-size: 15px; }
.auswahl-text { display: flex; flex-direction: column; min-width: 0; }
.auswahl-text b, .auswahl-text small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auswahl-text small { color: var(--text-2); font-size: 13px; }
.auswahl-text small.doppelt { color: var(--warn); }
.fehlerliste { margin: 10px 0 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }

.qr-bild { width: min(270px, 100%); margin: 14px auto 10px; padding: 12px; border-radius: 18px; background: #fff; }
.qr-bild svg { display: block; width: 100%; height: auto; }
.qr-name { text-align: center; font-size: 14px; color: var(--text-2); }
.schluessel-text {
  display: block; margin: 12px 0 0; padding: 12px;
  border-radius: 12px; background: var(--bg-2);
  font-family: var(--mono); font-size: 15px; letter-spacing: .06em; text-align: center; word-break: break-all;
}
.schritte { margin: 12px 0; padding-left: 22px; line-height: 1.6; color: var(--text); }
.ueber-kopf { text-align: center; margin: 4px 0 8px; }
.ueber-kopf img { width: 72px; height: 72px; border-radius: 20px; }
.ueber-kopf h3 { margin: 12px 0 2px; font-size: 19px; }
.ueber-kopf small { color: var(--text-3); }
.punktliste { margin: 12px 0; padding-left: 20px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.punktliste li + li { margin-top: 6px; }
.impressum { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--linie); text-align: center; font-size: 13px; color: var(--text-3); }

/* ------------------------------------------------------------ PIN-Tastenfeld */

.pin { display: flex; flex-direction: column; align-items: center; gap: 28px; margin-top: 22px; }
.punkte { display: flex; gap: 14px; min-height: 16px; }
.punkte i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--linie-2); transition: background .15s, border-color .15s, transform .15s; }
.punkte i.voll { background: var(--akzent); border-color: var(--akzent); transform: scale(1.08); }
.punkte.wackeln { animation: wackeln .42s; }
.tastenfeld { display: grid; grid-template-columns: repeat(3, 74px); gap: 14px 26px; justify-content: center; transition: opacity .2s; }
.tastenfeld.aus { opacity: .35; pointer-events: none; }
.taste {
  width: 74px; height: 74px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--linie); background: var(--flaeche);
  font-size: 28px; font-weight: 500; cursor: pointer;
  -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none;
  transition: background .1s, transform .08s;
}
.taste:active { background: var(--flaeche-2); transform: scale(.93); }
.taste.leise { border-color: transparent; background: none; color: var(--text-2); }
.taste.ok { border: 0; color: #fff; background: var(--verlauf); }
.taste.ok:disabled { opacity: .3; }
.taste .ik { width: 26px; height: 26px; }
.tastenfeld > span { width: 74px; height: 74px; }
@media (max-height: 700px) {
  .tastenfeld { grid-template-columns: repeat(3, 64px); gap: 10px 24px; }
  .taste, .tastenfeld > span { width: 64px; height: 64px; font-size: 25px; }
  .pin { gap: 20px; margin-top: 14px; }
  .seite.mittig h1 { margin-top: 12px; }
}
.sperre-status { min-height: 21px; margin: 18px 0 0; font-size: 14px; color: var(--text-2); }
.sperre-status.fehler { color: var(--gefahr); }
.sperre .logo-gross { width: 68px; height: 68px; border-radius: 20px; }
.pw-form { width: 100%; max-width: 340px; margin-top: 20px; display: grid; gap: 12px; }
.mittig-block { display: flex; flex-direction: column; align-items: center; text-align: center; }
.mittig-block .formular { width: 100%; }
.mittig-block .pin { margin-top: 10px; }

/* ------------------------------------------------------------ Scanner */

#scanner { position: fixed; inset: 0; z-index: 60; background: #000; color: #fff; overflow: hidden; }
#scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-rahmen {
  position: absolute; left: 50%; top: 44%;
  width: min(72vw, 50vh, 300px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 28px;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .52);
}
.ecke { position: absolute; width: 44px; height: 44px; border: 4px solid #fff; }
.ecke.lo { top: -2px; left: -2px; border-right: 0; border-bottom: 0; border-top-left-radius: 28px; }
.ecke.ro { top: -2px; right: -2px; border-left: 0; border-bottom: 0; border-top-right-radius: 28px; }
.ecke.lu { bottom: -2px; left: -2px; border-right: 0; border-top: 0; border-bottom-left-radius: 28px; }
.ecke.ru { bottom: -2px; right: -2px; border-left: 0; border-top: 0; border-bottom-right-radius: 28px; }
.scan-linie {
  position: absolute; left: 10%; right: 10%; top: 10%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #a78bfa, #60a5fa, transparent);
  box-shadow: 0 0 14px #8b6cff;
  animation: scannen 2.2s ease-in-out infinite alternate;
}
.scan-oben {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--so) + 10px) 12px 24px;
  background: linear-gradient(rgba(0, 0, 0, .65), transparent);
}
.scan-oben .titel { flex: 1; font-size: 17px; font-weight: 600; }
.ikonknopf.rund { border-radius: 50%; color: #fff; background: rgba(255, 255, 255, .15); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.ikonknopf.rund:hover { background: rgba(255, 255, 255, .25); color: #fff; }
.ikonknopf.rund.an { background: #fff; color: #111; }
.scan-unten {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 40px 20px calc(var(--su) + 24px);
  text-align: center;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}
.scan-text { margin: 0; max-width: 360px; font-size: 15px; line-height: 1.45; text-shadow: 0 1px 4px rgba(0, 0, 0, .7); }
.scan-text small { display: block; margin-top: 4px; font-size: 13px; opacity: .75; }
.scan-fehler {
  max-width: 380px; padding: 14px 16px; border-radius: 16px;
  font-size: 14.5px; line-height: 1.45;
  background: rgba(255, 93, 108, .2); border: 1px solid rgba(255, 93, 108, .55);
}
.scan-reihe { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ------------------------------------------------------------ Meldung */

#meldung {
  position: fixed; left: 50%; z-index: 90;
  bottom: calc(var(--su) + 100px);
  max-width: calc(100% - 32px);
  padding: 11px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg);
  font-size: 14.5px; font-weight: 500; text-align: center;
  box-shadow: var(--schatten);
  opacity: 0; pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .22s, transform .22s;
}
#meldung.zeigen { opacity: 1; transform: translate(-50%, 0); }
/* Bei offenem Dialog oben einblenden, damit nichts im Dialog verdeckt wird */
body:has(#blatt.offen) #meldung, body:has(#scanner:not([hidden])) #meldung {
  top: calc(var(--so) + 16px); bottom: auto;
  transform: translate(-50%, -16px);
}
body:has(#blatt.offen) #meldung.zeigen, body:has(#scanner:not([hidden])) #meldung.zeigen { transform: translate(-50%, 0); }
#meldung.fehler { background: var(--gefahr); color: #fff; }

/* ------------------------------------------------------------ Handy-Format am PC
 *
 * Am Rechner erscheint die App als Telefon in der Bildschirmmitte statt als
 * breite Seite. Der Trick ist das transform am Rahmen: Dadurch wird er zum
 * Bezugsrahmen für alles, was sonst am Fenster klebt (Dialoge, Scanner,
 * Menü, Plus-Knopf, Meldungen) – sie bleiben so im Telefon.
 */
@media (min-width: 700px) and (hover: hover) and (pointer: fine) {
  :root { --so: 40px; --su: 16px; }
  body {
    display: flex; align-items: center; justify-content: center;
    padding: 24px 16px;
    background: radial-gradient(1100px 620px at 50% 0%, var(--glanz), transparent 70%) no-repeat, var(--aussen);
  }
  #geraet {
    position: relative; flex-shrink: 0;
    width: 400px; height: min(860px, calc(100dvh - 48px));
    border-radius: 48px; overflow: hidden;
    transform: translateZ(0);
    background: radial-gradient(700px 360px at 50% -140px, var(--glanz), transparent 70%) no-repeat, var(--bg);
    box-shadow: 0 0 0 11px var(--rahmen), 0 0 0 12px var(--linie-2), 0 40px 100px rgba(0, 0, 0, .5);
  }
  /* Kamera-Insel oben und Home-Balken unten */
  #geraet::before, #geraet::after {
    content: ""; position: absolute; z-index: 95; left: 50%;
    transform: translateX(-50%); pointer-events: none;
  }
  #geraet::before { top: 11px; width: 106px; height: 30px; border-radius: 16px; background: #000; }
  #geraet::after { bottom: 8px; width: 128px; height: 5px; border-radius: 3px; background: var(--text); opacity: .3; }
  #app { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }
  #app::-webkit-scrollbar { display: none; }
  .seite, .seite.mittig { min-height: 100%; }
  .fab { right: 18px; }
  .menue { right: 10px; }
}
@media (min-width: 700px) and (hover: hover) and (pointer: fine) and (max-height: 860px) {
  .tastenfeld { grid-template-columns: repeat(3, 64px); gap: 10px 24px; }
  .taste, .tastenfeld > span { width: 64px; height: 64px; font-size: 25px; }
  .pin { gap: 20px; margin-top: 14px; }
  .seite.mittig h1 { margin-top: 12px; }
}

/* ------------------------------------------------------------ Bewegung */

@keyframes einblenden { from { opacity: 0; transform: translateY(8px); } }
@keyframes aufklappen { from { opacity: 0; transform: scale(.95); } }
@keyframes pulsieren { 50% { opacity: .55; } }
@keyframes scannen { to { top: 88%; } }
@keyframes wackeln {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-8px); }
  40%, 60% { transform: translateX(8px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
