/* Authenticator – ruhiges Werkzeug (Operate): vertraute Muster, Zustände sichtbar, Bewegung nur als Rückmeldung. */
:root {
  --bg:#f3f6f4; --flaeche:#ffffff; --flaeche2:#e8eeea; --rand:#d3dcd7; --text:#14201b; --text2:#52635b;
  --akzent:#0a7a4f; --akzent-text:#ffffff; --warn:#8f5200; --fehler:#b3261e; --schatten:0 6px 18px rgb(20 40 30 / .22);
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg:#0e1513; --flaeche:#151f1b; --flaeche2:#1e2a25; --rand:#2a3832; --text:#e7efeb; --text2:#9aaca3;
  --akzent:#3ddc97; --akzent-text:#04221a; --warn:#ffc857; --fehler:#ff7d76; --schatten:0 6px 18px rgb(0 0 0 / .5); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg:#0e1513; --flaeche:#151f1b; --flaeche2:#1e2a25; --rand:#2a3832; --text:#e7efeb; --text2:#9aaca3;
  --akzent:#3ddc97; --akzent-text:#04221a; --warn:#ffc857; --fehler:#ff7d76; --schatten:0 6px 18px rgb(0 0 0 / .5); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scrollbar-color: var(--rand) transparent; }
body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--text); font: 16px/1.45 var(--schrift); -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
::selection { background: color-mix(in srgb, var(--akzent) 28%, transparent); }
input, select, textarea, button { font: inherit; color: inherit; }
input { caret-color: var(--akzent); }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; border-radius: 6px; }
h1, h2, p { margin: 0; } h1 { font-size: 1.375rem; line-height: 1.2; letter-spacing: -.01em; } h2 { font-size: 1.125rem; line-height: 1.25; }
.text2 { color: var(--text2); } .klein { font-size: .875rem; } .fehler { color: var(--fehler); min-height: 1.4em; }
#app { max-width: 640px; margin: 0 auto; padding: 0 16px 112px; }

/* Schaltflächen: eine Familie */
.btn { min-height: 44px; padding: 0 16px; border: 1px solid transparent; border-radius: 10px; background: var(--flaeche2); font-weight: 500; cursor: pointer; touch-action: manipulation;
  transition: transform 120ms var(--ease), background-color 120ms; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn:hover { background: color-mix(in srgb, var(--flaeche2) 86%, var(--text)); } .btn:active { transform: scale(.97); }
.btn.primar { background: var(--akzent); color: var(--akzent-text); font-weight: 600; } .btn.primar:hover { background: color-mix(in srgb, var(--akzent) 90%, var(--text)); }
.btn.gefahr { background: transparent; color: var(--fehler); border-color: var(--fehler); }
.btn.flach { background: transparent; } .btn.voll { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.ikn { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; cursor: pointer; flex: none; transition: transform 120ms var(--ease), background-color 120ms; }
.ikn:hover { background: var(--flaeche2); } .ikn:active { transform: scale(.93); } .ikn[aria-pressed="true"] { color: var(--akzent); background: color-mix(in srgb, var(--akzent) 14%, transparent); }
.ikn:disabled { opacity: .35; cursor: not-allowed; }
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; display: block; }
.ico .voll { fill: currentColor; stroke: none; }

/* Felder */
.feld { display: grid; gap: 6px; } .feld label { font-size: .875rem; color: var(--text2); }
input, select { width: 100%; min-height: 44px; padding: 0 12px; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; }
input:focus-visible, select:focus-visible { outline-offset: 0; border-color: var(--akzent); }
input[aria-invalid="true"] { border-color: var(--fehler); }
.staerke { height: 4px; border-radius: 2px; background: var(--rand); overflow: hidden; } .staerke i { display: block; height: 100%; width: 0; background: var(--fehler); transition: width 200ms var(--ease), background-color 200ms; }

/* Kopf, Suche, Liste */
.kopf { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); display: flex; align-items: center; gap: 2px; padding: 10px 0 6px; }
.kopf h1 { flex: 1; min-width: 0; }
.suche { position: relative; margin: 4px 0 12px; } .suche .ico { position: absolute; left: 12px; top: 11px; color: var(--text2); pointer-events: none; } .suche input { padding-left: 40px; }
.status { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--akzent); font-size: .875rem; font-weight: 500; }
.liste { margin: 0; padding: 0; list-style: none; background: var(--flaeche); border: 1px solid var(--rand); border-radius: 14px; overflow: hidden; }
.zeile { display: grid; grid-template-columns: 1fr auto auto; align-items: center; column-gap: 4px; padding: 4px 4px 4px 0; }
.zeile + .zeile { border-top: 1px solid var(--rand); }
.zeile-haupt { grid-column: 1; text-align: left; border: 0; background: transparent; padding: 12px 8px 12px 16px; cursor: pointer; display: grid; gap: 1px; min-width: 0; transition: background-color 120ms; border-radius: 0; }
.zeile-haupt:active { background: var(--flaeche2); } .zeile-haupt:disabled { cursor: default; }
.name { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; } .konto { color: var(--text2); font-size: .875rem; overflow-wrap: anywhere; line-height: 1.3; }
.code { font: 600 1.75rem/1.15 var(--mono); letter-spacing: .06em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.code.verdeckt { font-size: 1.375rem; color: var(--text2); letter-spacing: .12em; } .code.knapp { color: var(--warn); }
.ring { width: 36px; height: 36px; position: relative; display: grid; place-items: center; } .ring svg { position: absolute; inset: 0; width: 36px; height: 36px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3; } .ring .spur { stroke: var(--rand); } .ring .wert { stroke: var(--akzent); stroke-linecap: round; transition: stroke-dashoffset 250ms linear; }
.ring.knapp .wert { stroke: var(--warn); } .ring b { font: 600 .75rem/1 var(--schrift); font-variant-numeric: tabular-nums; }
.zeile .ikn { align-self: center; }

.leer { padding: 40px 20px 32px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.leer p { color: var(--text2); max-width: 36ch; } .leer .aktionen { display: grid; gap: 8px; width: min(100%, 320px); }
.fab { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); width: 56px; height: 56px; border-radius: 28px; border: 0;
  background: var(--akzent); color: var(--akzent-text); display: grid; place-items: center; box-shadow: var(--schatten); cursor: pointer; transition: transform 140ms var(--ease); }
.fab:active { transform: scale(.94); } .fab .ico { width: 26px; height: 26px; stroke-width: 2; }

/* Blatt (Dialog) */
dialog.blatt { margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92dvh; padding: 0; border: 0; border-radius: 20px 20px 0 0; background: var(--flaeche); color: var(--text); overflow: auto;
  animation: blatt-auf 240ms var(--ease); padding-bottom: env(safe-area-inset-bottom, 0px); }
dialog.blatt::backdrop { background: rgb(0 0 0 / .5); animation: schleier 200ms ease-out; }
@media (min-width: 640px) { dialog.blatt { margin: auto; border-radius: 20px; } }
@keyframes blatt-auf { from { transform: translateY(28px); opacity: 0; } } @keyframes schleier { from { opacity: 0; } }
.blatt-kopf { display: flex; align-items: center; justify-content: space-between; padding: 12px 8px 4px 20px; position: sticky; top: 0; background: var(--flaeche); }
.blatt-rumpf { padding: 8px 20px 20px; display: grid; gap: 14px; }
.menue { display: grid; margin: 0 -20px; } .menue button { display: grid; grid-template-columns: 24px 1fr; gap: 14px; align-items: center; text-align: left; min-height: 60px; padding: 8px 20px; border: 0; border-top: 1px solid var(--rand); background: transparent; cursor: pointer; transition: background-color 120ms; }
.menue button:first-child { border-top: 0; } .menue button:hover { background: var(--flaeche2); } .menue button:active { background: var(--flaeche2); }
.menue .beschr { color: var(--text2); font-size: .875rem; display: block; } .menue .gefahr { color: var(--fehler); }
.aktionen-zeile { display: flex; gap: 8px; } .aktionen-zeile > * { flex: 1; }
.segment { display: grid; grid-auto-flow: column; gap: 4px; padding: 4px; background: var(--flaeche2); border-radius: 12px; } .segment button { min-height: 40px; border: 0; border-radius: 9px; background: transparent; cursor: pointer; font-weight: 500; }
.segment button[aria-pressed="true"] { background: var(--flaeche); box-shadow: 0 1px 2px rgb(0 0 0 / .18); }
.auswahl { display: grid; margin: 0 -20px; max-height: 38dvh; overflow: auto; } .auswahl label { display: grid; grid-template-columns: 24px 1fr; gap: 12px; align-items: center; min-height: 52px; padding: 6px 20px; border-top: 1px solid var(--rand); cursor: pointer; }
.auswahl input { width: 20px; min-height: 20px; height: 20px; accent-color: var(--akzent); }
video.sucher { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #000; border-radius: 14px; }
.laufend { height: 3px; border-radius: 2px; background: var(--flaeche2); overflow: hidden; } .laufend i { display: block; width: 40%; height: 100%; background: var(--akzent); animation: lauf 1.1s ease-in-out infinite; }
@keyframes lauf { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.hinweis { padding: 10px 12px; border-radius: 10px; background: var(--flaeche2); font-size: .875rem; color: var(--text2); }
.abschnitt { font-size: .75rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text2); margin-top: 6px; }

#toast { position: fixed; left: 50%; bottom: max(88px, calc(env(safe-area-inset-bottom, 0px) + 80px)); transform: translate(-50%, 12px); z-index: 50; max-width: min(92vw, 460px); display: flex; align-items: center; gap: 14px;
  padding: 10px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--schatten); opacity: 0; pointer-events: none; transition: opacity 180ms, transform 220ms var(--ease); }
#toast.zeigen { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { border: 0; background: transparent; color: color-mix(in srgb, var(--bg) 40%, var(--akzent)); font-weight: 700; min-height: 36px; padding: 0 6px; cursor: pointer; }
.zentral { max-width: 420px; margin: 14vh auto 0; display: grid; gap: 14px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
.punkte { margin: 0; padding-left: 1.1rem; display: grid; gap: 2px; }
.rumpf-lose { padding: 0; }
.rumpf-detail { padding: 12px 0 0; }
details summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.auswahl .name, .auswahl .konto { display: inline; }
