:root {
  color-scheme: light dark;
  --bg: #eef1f8;
  --glass: rgba(255, 255, 255, 0.62);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --separator: rgba(60, 60, 67, 0.16);
  --label: #111114;
  --secondary: #6b6b73;
  --fill: rgba(118, 118, 128, 0.14);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --shadow: 0 1px 2px rgba(20, 24, 60, 0.05), 0 12px 36px rgba(20, 24, 60, 0.10);
  --blob1: #a9c7ff; --blob2: #ffc2d6; --blob3: #b9f0e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0c12;
    --glass: rgba(38, 39, 50, 0.62);
    --glass-edge: rgba(255, 255, 255, 0.09);
    --separator: rgba(235, 235, 245, 0.14);
    --label: #f5f5f7;
    --secondary: #9d9da8;
    --fill: rgba(118, 118, 128, 0.28);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
    --blob1: #1c3a7a; --blob2: #5a1f47; --blob3: #10443d;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; min-height: 100vh; background: var(--bg); color: var(--label);
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* weicher Farbverlauf im Hintergrund */
.wallpaper { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none; }
.wallpaper i { position: absolute; display: block; width: 90vmax; height: 90vmax; border-radius: 50%; opacity: 0.75; }
.wallpaper i:nth-child(1) { top: -45vmax; left: -30vmax; background: radial-gradient(closest-side, var(--blob1), transparent); }
.wallpaper i:nth-child(2) { top: 5vmax; right: -50vmax; background: radial-gradient(closest-side, var(--blob2), transparent); }
.wallpaper i:nth-child(3) { bottom: -50vmax; left: -20vmax; background: radial-gradient(closest-side, var(--blob3), transparent); }

main { max-width: 560px; margin: 0 auto; padding: calc(28px + env(safe-area-inset-top)) 20px calc(48px + env(safe-area-inset-bottom)); }
section:not(.hidden) { animation: rise 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.hidden { display: none !important; }

.glass {
  background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 28px; box-shadow: var(--shadow);
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
}

/* Typografie */
h1, h2, p { margin: 0; }
h1 { font-size: 2.15rem; line-height: 1.12; font-weight: 700; letter-spacing: -0.022em; }
.eyebrow { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary); }
.secondary-text { color: var(--secondary); font-size: 0.88rem; }
.error { color: var(--red); font-size: 0.9rem; text-align: center; margin-top: 12px; }
.error:empty { display: none; }

/* Knöpfe */
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.primary, .tinted, .pill {
  border-radius: 999px; padding: 11px 20px; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.15s ease, opacity 0.15s ease;
}
.primary { background: var(--blue); color: #fff; }
.tinted { background: var(--fill); color: var(--label); }
.pill { background: var(--fill); color: var(--blue); padding: 8px 16px; font-size: 0.85rem; white-space: nowrap; }
.primary:active, .tinted:active, .pill:active { transform: scale(0.96); }
.primary:disabled { opacity: 0.5; }
.wide { width: 100%; padding: 14px; font-size: 1.02rem; }
.textbtn { color: var(--blue); font-size: 1.02rem; text-decoration: none; background: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; min-height: 32px; margin-bottom: 14px; }

/* Startseite */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 14px 4px 24px; }
.hero .eyebrow { margin-bottom: 4px; }

.widget { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 20px; margin-bottom: 16px; text-align: left; border-radius: 24px; }
.widget-text { flex: 1; display: flex; flex-direction: column; }
.widget small { color: var(--secondary); font-size: 0.84rem; }
.dot { width: 12px; height: 12px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 6px rgba(52, 199, 89, 0.18); margin: 0 4px; }
.dot.alert { background: var(--red); box-shadow: 0 0 0 6px rgba(255, 59, 48, 0.18); }
.chevron { color: var(--secondary); font-size: 1.6rem; line-height: 1; }

.panel { padding: 20px 14px 22px; }
.panel > .eyebrow { padding: 0 8px 18px; }
.apps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px 6px; }
.app { display: flex; flex-direction: column; align-items: center; text-align: center; text-decoration: none; color: var(--label); }
.iconwrap { position: relative; display: block; margin-bottom: 9px; transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.4); }
a.app:hover .iconwrap { transform: translateY(-3px) scale(1.04); }
a.app:active .iconwrap { transform: scale(0.92); }
.squircle {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 76px; height: 76px; border-radius: 23%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 8px 18px rgba(20, 24, 60, 0.20);
}
.squircle svg { width: 62%; height: 62%; }
.photo { background: linear-gradient(160deg, #ff9f43 0%, #ff3d77 55%, #c33bd6 100%); }
.receipt { background: linear-gradient(160deg, #6ee7a0 0%, #14b87a 55%, #078a74 100%); }
.clock { background: linear-gradient(160deg, #6fc3ff 0%, #3478f6 55%, #4f46c8 100%); }
.brand { background: linear-gradient(160deg, #7aa8ff 0%, #3567e8 55%, #3b2fa8 100%); }
.app .name { font-size: 0.86rem; font-weight: 500; }
.app small { font-size: 0.72rem; color: var(--secondary); margin-top: 1px; }
.app.off .iconwrap { filter: grayscale(0.7); opacity: 0.5; }
.app.off .name { color: var(--secondary); }
.badge {
  position: absolute; top: -8px; right: -9px; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  background: var(--red); color: #fff; font-size: 0.86rem; font-weight: 700; box-shadow: 0 2px 6px rgba(255, 59, 48, 0.45);
}
footer { text-align: center; margin-top: 36px; display: flex; flex-direction: column; align-items: center; gap: 14px; }

/* Anmeldung */
.sheet { max-width: 360px; margin: 7vh auto 0; padding: 34px 24px 26px; text-align: center; }
.sheet .squircle { margin: 0 auto 16px; }
.sheet-title { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.fields { margin: 22px 0 16px; background: var(--fill); border-radius: 16px; overflow: hidden; }
input { width: 100%; padding: 15px 16px; border: 0; background: transparent; color: var(--label); font: inherit; }
input + input { border-top: 1px solid var(--separator); }
input::placeholder { color: var(--secondary); }
.fields input:focus-visible { outline-offset: -3px; border-radius: 16px; }

/* Listen im iOS-Stil */
.page-title { margin: 0 4px 8px; }
.group-title { font-size: 0.74rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--secondary); margin: 24px 18px 8px; }
.group { border-radius: 22px; overflow: hidden; }
.group > p { padding: 16px 18px; font-size: 0.95rem; }
.group > p.error { margin: 0; text-align: left; }
.muted { color: var(--secondary); }
.small { font-size: 0.82rem; }
.card { position: relative; padding: 14px 18px 14px 70px; min-height: 66px; }
.card + .card::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; height: 1px; background: var(--separator); }
.card::after {
  content: attr(data-initial); position: absolute; left: 18px; top: 15px; width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 600; text-transform: uppercase;
  background: linear-gradient(160deg, #aab4c8, #7b859c);
}
.card strong { font-weight: 600; overflow-wrap: anywhere; }
.line { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.link { color: var(--blue); font-size: 0.86rem; }
.row { display: flex; gap: 10px; margin-top: 12px; }
.row button { flex: 1; }
.url { display: block; margin-top: 4px; color: var(--blue); font-size: 0.82rem; text-decoration: none; overflow-wrap: anywhere; }
.note { margin: 12px 18px 0; font-size: 0.8rem; }

@media (max-width: 340px) {
  .squircle { width: 64px; height: 64px; }
  h1 { font-size: 1.8rem; }
}
.actions { display: flex; gap: 14px; flex-wrap: wrap; }
.link.danger { color: var(--red); }
