/* =====================================================================
   apple.css — Authentischer Apple-/iOS-Look als Ergänzungs-Layer.
   Wird nach app.css geladen und verfeinert Systemkomponenten:
   SF-Typografie, echte iOS-Schalter, Systemblau, Sheets mit Detents,
   Passcode-/Face-ID-Login und Apple-Wallet-Pass.
   ===================================================================== */

:root {
  /* Apple-Systemfarben (Dark) */
  --sys-blue: #0a84ff;
  --sys-green: #30d158;
  --sys-red: #ff453a;
  --sys-orange: #ff9f0a;
  --sys-gray: #8e8e93;
  --sys-gray2: #636366;
  --sys-fill: rgba(120, 120, 128, 0.36);
  --sys-fill-2: rgba(120, 120, 128, 0.24);

  /* Materialien (Vibrancy) */
  --mat-thick: rgba(30, 30, 32, 0.86);
  --mat-regular: rgba(40, 40, 44, 0.72);
  --mat-thin: rgba(58, 58, 62, 0.55);

  /* SF Pro Text/Display, sonst System */
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "SF Pro", "Helvetica Neue", "Segoe UI", Inter, Roboto, system-ui, sans-serif;
  --font-rounded: "SF Pro Rounded", -apple-system, BlinkMacSystemFont, "SF Pro Display", var(--font-ui);
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* Große Titel im SF-Display-Stil */
h1, .page-title { letter-spacing: -0.022em; font-weight: 700; }
h2 { letter-spacing: -0.02em; }

/* ---------- iOS-Schalter (echter Toggle) ---------- */
.ios-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 51px;
  height: 31px;
  flex: none;
  margin: 0;
  border-radius: 16px;
  background: var(--sys-fill);
  transition: background 0.25s ease;
  cursor: pointer;
}
.ios-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.24), 0 1px 1px rgba(0, 0, 0, 0.16);
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
.ios-switch:checked { background: var(--sys-green); }
.ios-switch:checked::after { transform: translateX(20px); }
.ios-switch.blue:checked { background: var(--sys-blue); }
.ios-switch:focus-visible { outline: 2px solid var(--sys-blue); outline-offset: 2px; }

/* ---------- Buttons im iOS-Stil ---------- */
.btn {
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 14px;
  transition: transform 0.12s var(--ease), opacity 0.15s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.96); }
.btn-block { border-radius: 14px; min-height: 50px; font-size: 1.02rem; }

/* Gefüllter Systemknopf (Apple-typisch: Vollfläche, klare Ecke) */
.btn-accent {
  background: linear-gradient(155deg, var(--accent), #e06a1f);
  box-shadow: 0 8px 22px rgba(255, 138, 61, 0.28);
}
.btn-accent:active { filter: brightness(0.94); }

/* Optionaler Systemblau-Knopf */
.btn-system {
  background: var(--sys-blue);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 8px 22px rgba(10, 132, 255, 0.28);
}

/* „Plain“-Textknopf wie in iOS-Navigationsleisten */
.btn-plain {
  background: none;
  border: 0;
  color: var(--sys-blue);
  font-weight: 600;
  box-shadow: none;
  padding: 10px 6px;
}
.btn-plain:hover { background: none; }

/* ---------- Eingabefelder ---------- */
.input, textarea.input, select.input {
  border-radius: 12px;
  background: var(--sys-fill-2);
  border: 1px solid transparent;
  font-size: 1.02rem;
  padding: 14px 15px;
}
.input:focus, textarea.input:focus, select.input:focus {
  border-color: var(--sys-blue);
  background: rgba(120, 120, 128, 0.3);
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.25);
}

/* ---------- Materialien für Sheets/Alerts/Nav ---------- */
.sheet {
  background: var(--mat-thick);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border-radius: 22px 22px 0 0;
  border: 0;
  border-top: 0.5px solid rgba(255, 255, 255, 0.08);
}
.sheet-handle { width: 36px; height: 5px; background: rgba(235, 235, 245, 0.3); }
.ios-alert {
  background: var(--mat-thick);
  backdrop-filter: blur(40px) saturate(1.8);
  -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border: 0.5px solid rgba(255, 255, 255, 0.1);
}
.ios-alert-btn { color: var(--sys-blue); font-size: 1.05rem; }
.ios-alert-actions { border-top: 0.5px solid rgba(255, 255, 255, 0.12); }
.ios-alert-btn + .ios-alert-btn { border-left: 0.5px solid rgba(255, 255, 255, 0.12); }

.bottom-nav {
  background: rgba(18, 18, 20, 0.7);
  backdrop-filter: blur(30px) saturate(1.8);
  -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-top: 0.5px solid rgba(255, 255, 255, 0.1);
}

/* Grouped-List-Trennlinien hauchdünn wie iOS (0.5px) */
.ios-list { border: 0; background: var(--surface); border-radius: 12px; }
.ios-list-item + .ios-list-item::before { border-top: 0.5px solid rgba(255, 255, 255, 0.1); }
.ios-list-item .ios-chev { color: rgba(235, 235, 245, 0.3); }

/* Segmented control exakt iOS */
.ios-segmented { background: var(--sys-fill-2); border-radius: 9px; }
.ios-segmented button.selected { box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28), 0 0.5px 0 rgba(255, 255, 255, 0.1); }

/* ---------- iOS-Statusleiste (dekorativ, oben auf App-Seiten) ---------- */
.ios-statusbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: calc(20px + var(--safe-t));
  padding: var(--safe-t) 24px 0;
  font-size: 0.82rem;
  font-weight: 600;
  pointer-events: none;
  color: var(--text-0);
}
.ios-statusbar .sb-icons { display: flex; align-items: center; gap: 6px; }
.ios-statusbar svg { display: block; }

/* ---------- Passcode / Face ID Login ---------- */
.lock-screen {
  position: fixed;
  inset: 0;
  z-index: 6000;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 8vh) 24px calc(env(safe-area-inset-bottom, 0px) + 28px);
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 138, 61, 0.16), transparent 60%),
    radial-gradient(circle at 85% 88%, rgba(255, 138, 61, 0.08), transparent 55%),
    linear-gradient(165deg, #0b0b0d 0%, #17140f 55%, #0b0b0d 100%);
  animation: lock-in 0.4s var(--ease);
}
.lock-screen.closing { opacity: 0; transform: scale(1.04); transition: opacity 0.35s ease, transform 0.35s ease; }
@keyframes lock-in { from { opacity: 0; } }

.lock-top { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.lock-glyph {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: 18px;
  background: linear-gradient(155deg, var(--accent), #d9601a);
  color: var(--accent-ink);
  font-weight: 800; font-size: 1.3rem;
  box-shadow: 0 12px 30px rgba(255, 138, 61, 0.3);
}
.lock-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.lock-sub { color: var(--text-2); font-size: 0.92rem; text-align: center; max-width: 260px; margin-top: -6px; }

/* Passcode-Punkte */
.passcode-dots { display: flex; gap: 20px; margin: 30px 0 8px; }
.passcode-dots span {
  width: 13px; height: 13px; border-radius: 50%;
  border: 1.5px solid rgba(235, 235, 245, 0.7);
  transition: background 0.15s ease, transform 0.15s ease;
}
.passcode-dots span.filled { background: #fff; border-color: #fff; }
.lock-screen.shake .passcode-dots { animation: pc-shake 0.4s; }
@keyframes pc-shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(6px); }
  50% { transform: translateX(-8px); }
}
.passcode-error { color: var(--sys-red); font-size: 0.86rem; min-height: 1.2em; }

/* Ziffernblock */
.keypad {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(3, 78px);
  gap: 16px 26px;
  justify-content: center;
}
.keypad-key {
  width: 78px; height: 78px;
  border-radius: 50%;
  border: 0;
  background: rgba(120, 120, 128, 0.28);
  backdrop-filter: blur(6px);
  color: #fff;
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: background 0.12s ease, transform 0.08s ease;
  -webkit-tap-highlight-color: transparent;
}
.keypad-key:active { background: rgba(235, 235, 245, 0.85); color: #000; transform: scale(0.95); }
.keypad-key .kp-num { font-size: 2rem; font-weight: 400; line-height: 1; }
.keypad-key .kp-abc { font-size: 0.6rem; font-weight: 600; letter-spacing: 0.14em; margin-top: 3px; color: rgba(235, 235, 245, 0.7); }
.keypad-key:active .kp-abc { color: rgba(0, 0, 0, 0.55); }
.keypad-key.text-key { background: none; font-size: 1.05rem; font-weight: 400; }
.keypad-key.text-key:active { background: none; color: #fff; transform: none; opacity: 0.5; }
.keypad-key.faceid .kp-num { font-size: 1.7rem; }

/* Face-ID-Scan-Moment (Vollbild) */
.faceid-scan {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  margin: auto 0;
}
.faceid-icon {
  width: 78px; height: 78px;
  border: 4px solid var(--accent);
  border-radius: 22px;
  position: relative;
  animation: faceid-pulse 1.1s ease-in-out infinite;
}
.faceid-icon::before { content: ""; position: absolute; inset: 20px 18px 30px; border-left: 4px solid var(--accent); border-right: 4px solid var(--accent); }
.faceid-icon::after { content: ""; position: absolute; left: 20px; right: 20px; bottom: 16px; height: 9px; border-bottom: 4px solid var(--accent); border-radius: 0 0 12px 12px; }
@keyframes faceid-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.9); opacity: 0.7; } }
.faceid-icon.done { border-color: var(--sys-green); animation: none; }
.faceid-icon.done::before, .faceid-icon.done::after { border-color: var(--sys-green); }
.faceid-check { width: 78px; height: 78px; border-radius: 50%; background: var(--sys-green); display: grid; place-items: center; color: #fff; font-size: 2.4rem; animation: auth-done-in 0.35s var(--ease); }
.faceid-label { color: var(--text-1); font-size: 0.95rem; }

@media (prefers-reduced-motion: reduce) {
  .faceid-icon, .lock-screen { animation: none; }
}

@media (max-height: 680px) {
  .keypad { grid-template-columns: repeat(3, 66px); gap: 12px 22px; }
  .keypad-key { width: 66px; height: 66px; }
  .keypad-key .kp-num { font-size: 1.7rem; }
  .lock-glyph { width: 54px; height: 54px; }
}

/* ---------- Lock-Login Formteil ---------- */
.lock-mid { display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 34px 0 auto; width: 100%; }
.faceid-mini { display: grid; place-items: center; cursor: pointer; }
.faceid-mini .faceid-icon { border-width: 3px; }
.faceid-mini .faceid-icon::before { border-width: 3px; inset: 13px 12px 20px; }
.faceid-mini .faceid-icon::after { border-width: 3px; left: 13px; right: 13px; bottom: 11px; height: 7px; }
.lock-form { display: flex; align-items: center; gap: 8px; width: min(300px, 82vw); }
.lock-input {
  flex: 1; min-width: 0;
  padding: 13px 16px;
  border-radius: 14px;
  border: 0;
  background: rgba(120, 120, 128, 0.3);
  color: #fff;
  font-size: 1.05rem;
  text-align: center;
  letter-spacing: 0.06em;
  outline: none;
  backdrop-filter: blur(8px);
}
.lock-input::placeholder { color: rgba(235, 235, 245, 0.45); letter-spacing: 0; }
.lock-input:focus { background: rgba(120, 120, 128, 0.42); box-shadow: 0 0 0 3px rgba(255, 138, 61, 0.35); }
.lock-go {
  flex: none;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.3rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s var(--ease), filter 0.15s ease;
}
.lock-go:active { transform: scale(0.92); filter: brightness(0.94); }
.lock-hint { color: var(--text-2); font-size: 0.85rem; text-align: center; padding-top: 16px; }
.lock-screen.shake .lock-form { animation: pc-shake 0.4s; }

/* ---------- Tab-Bar-Icons (SF-Symbols-Stil) ---------- */
.nav-item .nav-icon { display: grid; place-items: center; height: 26px; }
.nav-item .nav-icon svg { width: 26px; height: 26px; transition: transform 0.15s var(--ease); }
.nav-item { gap: 4px; }
.nav-item span:last-child { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.01em; }
.nav-item.active .nav-icon svg { transform: translateY(-1px); }
.nav-item:active .nav-icon svg { transform: scale(0.88); }
.sidebar-item .nav-icon { display: inline-grid; place-items: center; }
.sidebar-item .nav-icon svg { width: 22px; height: 22px; }

/* Lyrics-Umschalter im iOS-Stil */
.lyrics-toggle { font-weight: 600 !important; letter-spacing: -0.01em; }

/* ---------- Sheet-Schließen & Feinschliff ---------- */
.sheet-close { background: var(--sys-fill); color: var(--text-1); font-size: 0.95rem; }
.sheet-close:active { background: rgba(120,120,128,0.5); }
.sheet-head h3 { font-weight: 700; letter-spacing: -0.01em; }

/* iOS-typische aktive Zustände (kein Hover auf Touch) */
@media (hover: hover) and (pointer: fine) {
  .add-wallet-btn:hover { background: #141414; }
  .lock-go:hover { filter: brightness(1.05); }
}

/* Fokus-Ringe systemkonform */
:focus-visible { outline: 2px solid var(--sys-blue); outline-offset: 2px; }
.btn:focus-visible, .lock-go:focus-visible { outline-offset: 3px; }

/* =====================================================================
   100% iOS: native Navigationsleiste, gruppierte Listen, Abschnitte
   ===================================================================== */

/* App-Shell: iOS-Seitenränder & Abstand unter der Tab-Bar */
.app-shell {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-top: 0;
  padding-bottom: calc(var(--nav-h) + 40px + var(--safe-b));
}
@media (min-width: 900px) {
  .app-shell { padding-left: calc(240px + 40px); padding-right: 40px; }
}

/* ---------- iOS-Navigationsleiste mit großem Titel ---------- */
.ios-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  margin: 0 calc(-1 * max(16px, env(safe-area-inset-left))) 8px;
  padding: 0 max(16px, env(safe-area-inset-left));
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
  background: transparent;
  transition: background 0.25s ease;
}
.ios-navbar.collapsed {
  background: rgba(18, 18, 20, 0.72);
  backdrop-filter: saturate(1.8) blur(22px);
  -webkit-backdrop-filter: saturate(1.8) blur(22px);
  box-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.08);
}
.ios-navbar-bar {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.ios-navbar-lead { min-width: 40px; }
.ios-navbar-trail { min-width: 40px; display: flex; justify-content: flex-end; }
.ios-navbar-compact {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.02rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}
.ios-navbar.collapsed .ios-navbar-compact { opacity: 1; }
.ios-largetitle {
  padding: 2px 0 6px;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease, transform 0.25s ease;
  max-height: 60px;
}
.ios-navbar.collapsed .ios-largetitle {
  max-height: 0;
  opacity: 0;
  transform: translateY(-6px);
}
.ios-largetitle h1 {
  font-size: 2.15rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.live-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.16);
  color: #ff6b61;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
}
.live-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: #ff453a; animation: pulse-dot 1.6s infinite; }

/* ---------- iOS-Abschnittsüberschriften (statt .section-head/.eyebrow) ---------- */
.section-head { margin: 26px 4px 8px; align-items: center; }
.section-head .eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  color: var(--text-2);
}
.section-head a, .section-head .dim { color: var(--sys-blue) !important; font-size: 0.9rem !important; font-weight: 500; }
.view > .section-head:first-child { margin-top: 8px; }

/* ---------- Karten: iOS-gruppierte Optik ---------- */
.card {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  backdrop-filter: none;
  box-shadow: none;
}
.card-glow-accent { border: 0; box-shadow: 0 8px 24px rgba(255, 138, 61, 0.16); }

/* ---------- Schnellzugriff-Kacheln (iOS-Icon-Kacheln) ---------- */
.quick-grid { gap: 12px; }
.quick-tile {
  background: var(--surface);
  border: 0;
  border-radius: 16px;
  padding: 16px;
  gap: 12px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.quick-tile:hover { border: 0; }
.qt-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--qt, var(--accent));
  display: grid; place-items: center;
  box-shadow: 0 4px 10px color-mix(in srgb, var(--qt, var(--accent)) 35%, transparent);
}
.qt-icon svg { width: 22px; height: 22px; }

/* ---------- Eingaben in iOS-Listenoptik ---------- */
.request-row { display: flex; gap: 10px; }
.request-row .input { flex: 1; }

/* ---------- Footer dezent ---------- */
.app-footer { margin-top: 32px; text-align: center; }
.app-footer a { color: var(--sys-blue); text-decoration: none; }

/* ---------- View-Übergang wie iOS (sanftes Einblenden) ---------- */
.view.active { animation: ios-view-in 0.3s var(--ease); }
@keyframes ios-view-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Tab-Bar exakt iOS ---------- */
.bottom-nav { padding-top: 8px; }
.nav-item.active { color: var(--accent-strong); }

/* Desktop-Sidebar an iOS angelehnt */
@media (min-width: 900px) {
  .ios-navbar { position: sticky; }
  .sidebar { background: rgba(12, 12, 14, 0.6); backdrop-filter: blur(22px) saturate(1.6); }
}

/* =====================================================================
   Native iOS-Oberfläche (Statusleiste + Navigation + Layout)
   ===================================================================== */

:root {
  --ios-status-h: 44px;
  --ios-nav-h: 44px;
}

/* Grund-Layout: die Seite IST das iOS-Fenster */
html, body { height: 100%; }
body {
  background: #000;
  color: var(--text-0, #fff);
}

/* ---------- Statusleiste ---------- */
.ios-status {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 900;
  height: calc(var(--ios-status-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 22px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #fff;
  pointer-events: none;
}
.ios-time { font-variant-numeric: tabular-nums; min-width: 54px; }
.ios-notch { flex: 1; }
.ios-status-icons { display: flex; align-items: center; gap: 6px; }
.ios-status-icons svg { fill: #fff; display: block; }
.ios-batt { display: inline-flex; align-items: center; }
.ios-batt-shell {
  position: relative;
  width: 25px; height: 13px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 4px;
  padding: 1.5px;
  display: flex; align-items: center;
}
.ios-batt-level { height: 100%; width: 86%; background: #fff; border-radius: 2px; transition: width 0.4s ease, background 0.3s ease; }
.ios-batt-level.low { background: #ff453a; }
.ios-batt-level.charging { background: #30d158; }
.ios-batt-cap { width: 1.5px; height: 5px; background: rgba(255,255,255,0.55); border-radius: 0 1px 1px 0; margin-left: 1px; }

/* Helle Statusleiste über hellem Grund (z. B. Wallet-Barcode) */
body.ios-status-dark .ios-status { color: #000; }
body.ios-status-dark .ios-status-icons svg { fill: #000; }
body.ios-status-dark .ios-batt-shell { border-color: rgba(0,0,0,0.5); }
body.ios-status-dark .ios-batt-level { background: #000; }

/* Inhalt beginnt unter der Statusleiste */
body.has-ios-status { padding-top: 0; }

/* ---------- Navigationsleiste mit großem Titel ---------- */
.ios-nav {
  position: sticky;
  top: 0;
  z-index: 800;
  background: transparent;
  transition: background 0.25s ease;
}
.ios-nav-bar {
  position: relative;
  height: var(--ios-nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.ios-nav.collapsed {
  background: rgba(18,18,20,0.72);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  box-shadow: 0 0.5px 0 rgba(255,255,255,0.1);
}
.ios-nav-leading, .ios-nav-trailing { display: flex; align-items: center; gap: 4px; min-width: 44px; }
.ios-nav-trailing { justify-content: flex-end; }
.ios-nav-title-compact {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  opacity: 0;
  transition: opacity 0.2s ease;
  white-space: nowrap;
  max-width: 60%;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.ios-nav.collapsed .ios-nav-title-compact { opacity: 1; }
.ios-nav-large {
  padding: 2px 16px 8px;
  transition: opacity 0.15s ease;
  transform-origin: left center;
}
.ios-nav-large h1 {
  margin: 0;
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.026em;
  line-height: 1.1;
}
.ios-nav-back, .ios-nav-action {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 0;
  background: none;
  color: var(--sys-blue);
  font-size: 1.05rem;
  font-weight: 400;
  cursor: pointer;
  padding: 6px 2px;
  text-decoration: none;
}
.ios-nav-action { font-weight: 600; }
.ios-nav-back svg { display: block; }
.ios-nav-back:active, .ios-nav-action:active { opacity: 0.4; }

/* ---------- iOS-Scrollbereich ---------- */
.ios-scroll {
  height: calc(100dvh - var(--ios-status-h) - env(safe-area-inset-top, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* ---------- Gruppierte Listen (Inset Grouped) ---------- */
.ios-group {
  margin: 0 16px 30px;
}
.ios-group-header {
  padding: 6px 16px 7px;
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(235,235,245,0.6);
}
.ios-card {
  background: #1c1c1e;
  border-radius: 12px;
  overflow: hidden;
}
.ios-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 11px 16px;
  position: relative;
  color: #fff;
}
.ios-row + .ios-row::before {
  content: "";
  position: absolute;
  top: 0; left: 16px; right: 0;
  border-top: 0.5px solid rgba(255,255,255,0.1);
}
.ios-row .row-title { flex: 1; min-width: 0; font-size: 1.02rem; }
.ios-row .row-value { color: rgba(235,235,245,0.6); font-size: 1.02rem; }
.ios-row .row-chevron { color: rgba(235,235,245,0.3); }

/* section-head aus dem Bestand → iOS-Gruppenkopf */
body.ios-native .section-head {
  padding: 4px 4px 8px;
  margin-top: 8px;
}
body.ios-native .section-head .eyebrow {
  font-size: 0.8rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: rgba(235,235,245,0.6);
}

/* Karten wie iOS-Zellen */
body.ios-native .card {
  background: #1c1c1e;
  border: 0;
  border-radius: 14px;
}

/* Alte App-Kopfzeile ausblenden (wird durch iOS-Nav ersetzt) */
body.ios-native .app-header { display: none; }

/* Live-Pill als iOS-Nav-Action */
.ios-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,69,58,0.16);
  color: #ff453a;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.ios-live-pill .dot { width: 7px; height: 7px; border-radius: 50%; background: #ff453a; animation: pulse-dot 1.6s infinite; }

/* Bottom-Tab-Bar an iOS anpassen */
body.ios-native .bottom-nav {
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
}

@media (prefers-reduced-motion: reduce) {
  .ios-live-pill .dot { animation: none; }
}

/* Auf breiten Screens die Oberfläche wie ein iPhone zentrieren */
@media (min-width: 720px) {
  body.ios-native #app-root, body.ios-frame-host { max-width: none; }
}

/* =====================================================================
   Statusleiste zusammen mit bestehender iOS-Navigation
   ===================================================================== */

/* App-Shell beginnt direkt oben; Statusleiste liegt darüber */
body.has-ios-status .app-shell {
  padding-top: 0;
}
/* Bestehende Navbar rückt unter die Statusleiste */
body.has-ios-status .ios-navbar {
  top: calc(var(--ios-status-h) + env(safe-area-inset-top, 0px));
  margin-top: 0;
  padding-top: 8px;
}
/* Wenn eingeklappt, füllt die Navbar auch hinter der Statusleiste */
body.has-ios-status .ios-navbar.collapsed::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: calc(-1 * (var(--ios-status-h) + env(safe-area-inset-top, 0px)));
  height: calc(var(--ios-status-h) + env(safe-area-inset-top, 0px));
  background: rgba(18,18,20,0.72);
  backdrop-filter: saturate(1.8) blur(22px);
  -webkit-backdrop-filter: saturate(1.8) blur(22px);
}

/* Die eigenständige Statusleiste (Uhr etc.) sitzt immer über der Navbar */
.ios-status { z-index: 900; }

/* live-pill im iOS-Stil in der Navbar */
.ios-navbar-trail .live-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255,69,58,0.16);
  color: #ff453a;
  font-size: 0.74rem;
  font-weight: 700;
}

/* Login-/Lock-Screens brauchen keine Extra-Statusleiste, aber sie darf ruhig sichtbar sein */
body.has-ios-status .lock-screen,
body.has-ios-status .ticket-wrap { padding-top: calc(var(--ios-status-h) + env(safe-area-inset-top, 0px) + 4vh); }

/* =====================================================================
   Obere Tabs (Home / Wallet, Login / Wallet) — iOS-Segmented-Control
   ===================================================================== */
.ios-toptabs {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  margin: 4px 16px 10px;
  background: rgba(120,120,128,0.24);
  border-radius: 10px;
}
.ios-toptabs button {
  border: 0;
  background: none;
  color: var(--text-1, rgba(235,235,245,.78));
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  padding: 7px 22px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.ios-toptabs button.on {
  background: #636366;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.28), 0 0.5px 0 rgba(255,255,255,0.1);
}
/* Zentriert im Lock-Screen */
.lock-toptabs { align-self: center; margin-top: -6px; margin-bottom: 20px; }

/* Wallet-Kopfzeile (stellt die Wallet-App nach) */
.wallet-chrome {
  text-align: left;
  padding: 4px 4px 16px;
}
.wallet-chrome-title {
  display: block;
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.05;
}
.wallet-chrome-sub {
  display: block;
  color: var(--text-2, rgba(235,235,245,.6));
  font-size: 0.9rem;
  margin-top: 2px;
}

/* Wallet-Ansicht in der App */
#view-wallet .wallet-stage { max-width: 400px; margin: 0 auto; }
.wallet-empty {
  text-align: center;
  padding: 40px 24px;
  background: #1c1c1e;
  border-radius: 18px;
}
.wallet-empty-glyph { font-size: 2.4rem; }
.wallet-empty h3 { margin: 12px 0 6px; }

/* Wallet-Ansicht direkt auf dem Login-Screen */
.lock-wallet {
  width: 100%;
  max-width: 420px;
  margin: 8px auto 0;
  overflow-y: auto;
  padding-bottom: 24px;
}
.lock-wallet .wallet-stage { max-width: 400px; margin: 0 auto; }

/* Login-Screen im Wallet-Modus: normaler Fluss statt zentriert */
.lock-screen.wallet-mode {
  justify-content: flex-start;
  padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
}
.lock-screen.wallet-mode .lock-toptabs { margin: 0 auto 18px; }


/* ===== Apple-Wallet-Pass (global, auch in der Party-App) ===== */
/* ---------- Apple-Wallet-Pass ---------- */
.wallet-pass {
  position: relative;
  border-radius: 20px;
  padding: 20px 20px 0;
  color: #fff;
  background: linear-gradient(158deg, #2a2a2e 0%, #1c1c1e 60%, #161618 100%);
  box-shadow:
    0 1px 0 rgba(255,255,255,0.06) inset,
    0 26px 60px rgba(0,0,0,0.6),
    0 2px 6px rgba(0,0,0,0.4);
  overflow: hidden;
  isolation: isolate;
}
/* farbiger Kopfbalken wie bei echten Wallet-Pässen */
.wallet-pass::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 132px;
  background: linear-gradient(155deg, var(--accent) 0%, #d9601a 100%);
  z-index: -1;
}

.wallet-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  color: var(--accent-ink);
}
.wallet-logo { display: flex; align-items: center; gap: 9px; }
.wallet-logo-mark {
  width: 30px; height: 30px;
  border-radius: 8px;
  background: rgba(26,15,6,0.18);
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
}
.wallet-logo-name { font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; }
.wallet-top-field { text-align: right; }

.wallet-lbl {
  display: block;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.7;
}
.wallet-val { font-size: 0.9rem; font-weight: 600; }

.wallet-primary { margin: 22px 0 20px; color: var(--accent-ink); }
.wallet-primary .wallet-lbl { opacity: 0.7; margin-bottom: 2px; }
.wallet-primary-name { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }

.wallet-secondary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
}
.wallet-field { min-width: 0; }
.wallet-field-end { text-align: right; }
.wallet-field .wallet-lbl { color: var(--text-2); margin-bottom: 3px; }
.wallet-field .wallet-val { color: var(--text-0); font-weight: 650; overflow-wrap: anywhere; }

.wallet-status-row { padding-bottom: 20px; }
.wallet-chip {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--sys-fill-2);
  color: var(--text-1);
  font-size: 0.8rem;
  font-weight: 650;
}
.wallet-chip.valid { background: rgba(48,209,88,0.16); color: var(--sys-green); }
.wallet-chip-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  animation: pulse-dot 1.6s infinite;
}
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Perforation mit ausgestanzten Kreisen */
.wallet-notch {
  position: relative;
  height: 0;
  border-top: 2px dashed rgba(120,120,128,0.45);
  margin: 0 -20px;
}
.wallet-notch::before, .wallet-notch::after {
  content: "";
  position: absolute; top: -12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: #0b0b0d;
}
.wallet-notch::before { left: -12px; }
.wallet-notch::after { right: -12px; }

/* Barcode-Bereich (heller „Papier“-Streifen wie im echten Pass) */
.wallet-barcode {
  margin: 0 -20px;
  padding: 22px 20px 24px;
  background: #f5f5f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.wallet-qr {
  padding: 10px;
  background: #fff;
  border-radius: 12px;
}
.wallet-qr canvas { display: block; width: 150px; height: 150px; }
.wallet-code {
  font-family: "SF Mono", ui-monospace, "Menlo", monospace;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  color: #1c1c1e;
  font-weight: 600;
}

/* ---------- Aktionen ---------- */
.wallet-actions { display: flex; flex-direction: column; gap: 12px; }

/* „Zu Apple Wallet hinzufügen“-Knopf (Systemschwarz) */
.add-wallet-btn {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 12px;
  background: #000;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset, 0 8px 22px rgba(0,0,0,0.5);
  transition: transform 0.12s var(--ease), background 0.15s ease;
}
.add-wallet-btn:active { transform: scale(0.97); background: #111; }
.add-wallet-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.add-wallet-text small { font-size: 0.62rem; font-weight: 500; letter-spacing: 0.02em; opacity: 0.85; }
.add-wallet-text strong { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }

.ticket-waiting {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
  border-radius: 999px;
  background: var(--sys-fill-2);
  color: var(--text-1);
  font-size: 0.84rem;
  font-weight: 600;
}
.ticket-waiting-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: pulse-dot 1.6s infinite; }

.ticket-checkedin-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: rgba(48,209,88,0.14); color: var(--sys-green);
  font-size: 0.8rem; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .wallet-chip-dot, .ticket-waiting-dot { animation: none; }
}
