:root {
  --bg: #f2f2f7;
  --card: rgba(255, 255, 255, 0.72);
  --card-solid: #ffffff;
  --text: #000;
  --sub: rgba(60, 60, 67, 0.6);
  --sep: rgba(60, 60, 67, 0.18);
  --blue: #007aff;
  --red: #ff3b30;
  --green: #34c759;
  --glass: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.7);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --card: rgba(28, 28, 30, 0.72);
    --card-solid: #1c1c1e;
    --text: #fff;
    --sub: rgba(235, 235, 245, 0.6);
    --sep: rgba(84, 84, 88, 0.6);
    --blue: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --glass: rgba(40, 40, 44, 0.55);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
/* weiche Farbflächen im Hintergrund, damit das Glas wirkt */
body::before {
  content: ""; position: fixed; inset: -20%; z-index: -1;
  background:
    radial-gradient(40% 35% at 15% 10%, rgba(0, 122, 255, 0.18), transparent 70%),
    radial-gradient(35% 30% at 90% 30%, rgba(175, 82, 222, 0.16), transparent 70%),
    radial-gradient(40% 35% at 50% 100%, rgba(52, 199, 89, 0.12), transparent 70%);
  filter: blur(20px);
}

button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
input { font: inherit; color: inherit; }

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

/* ---------- Login ---------- */
.login-wrap { min-height: 100%; display: grid; place-items: center; padding: 24px; }
.login-card { width: 100%; max-width: 360px; border-radius: 32px; padding: 36px 28px 28px; text-align: center; }
.login-card img { width: 72px; height: 72px; border-radius: 18px; margin-bottom: 14px; }
.login-card h1 { font-size: 26px; font-weight: 700; margin: 0 0 4px; letter-spacing: -0.4px; }
.login-card p { color: var(--sub); margin: 0 0 24px; font-size: 15px; }
.field {
  width: 100%; padding: 15px 16px; border-radius: 14px; border: 0;
  background: var(--card-solid); font-size: 17px; outline: none; margin-bottom: 12px;
}
.field:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 35%, transparent); }
.btn-primary {
  width: 100%; padding: 15px; border-radius: 14px; background: var(--blue); color: #fff;
  font-size: 17px; font-weight: 600; transition: transform .15s, opacity .15s;
}
.btn-primary:active { transform: scale(0.97); opacity: .85; }
.error { color: var(--red); font-size: 14px; min-height: 20px; margin-top: 10px; }

/* ---------- App ---------- */
.app { max-width: 720px; margin: 0 auto; padding: 0 16px calc(110px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: flex-end; padding: calc(14px + env(safe-area-inset-top)) 0 0; }
.round-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; }
.round-btn svg { width: 20px; height: 20px; }
.large-title { font-size: 34px; font-weight: 700; letter-spacing: -0.6px; margin: 6px 4px 18px; }

.view { display: none; animation: fadeUp .35s cubic-bezier(.2, .8, .2, 1); }
.view.active { display: block; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card { background: var(--card); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-radius: 22px; overflow: hidden; margin-bottom: 16px; }
.section-label { font-size: 13px; text-transform: uppercase; color: var(--sub); margin: 22px 16px 8px; letter-spacing: .3px; }

.storage { padding: 18px; display: flex; align-items: center; gap: 14px; }
.storage .icon { width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(135deg, #5ac8fa, #007aff); display: grid; place-items: center; flex: none; }
.storage .icon svg { width: 26px; height: 26px; color: #fff; }
.storage b { display: block; font-size: 17px; }
.storage span { color: var(--sub); font-size: 14px; }
.storage .upload { margin-left: auto; padding: 9px 16px; border-radius: 999px; background: var(--blue); color: #fff; font-weight: 600; font-size: 15px; }

.drop { border: 2px dashed var(--sep); border-radius: 22px; padding: 22px; text-align: center; color: var(--sub); font-size: 15px; margin-bottom: 16px; transition: .2s; }
.drop.over { border-color: var(--blue); color: var(--blue); background: color-mix(in srgb, var(--blue) 8%, transparent); }

.progress { padding: 14px 18px; display: none; }
.progress.show { display: block; }
.progress .bar { height: 6px; border-radius: 3px; background: var(--sep); overflow: hidden; margin-top: 8px; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--blue); transition: width .2s; }
.progress small { color: var(--sub); }

.row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: .5px; background: var(--sep); }
.row .ficon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; flex: none; }
.row .meta { flex: 1; min-width: 0; }
.row .meta b { display: block; font-weight: 500; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta span { color: var(--sub); font-size: 13px; }
.row .act { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: var(--blue); }
.row .act.del { color: var(--red); }
.row .act svg { width: 20px; height: 20px; }
.empty { padding: 36px 20px; text-align: center; color: var(--sub); }

.hero { padding: 28px 22px; }
.hero .emoji { font-size: 44px; }
.hero h2 { margin: 10px 0 6px; font-size: 22px; letter-spacing: -0.3px; }
.hero p { margin: 0; color: var(--sub); line-height: 1.45; }

/* ---------- Tab-Leiste ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex; gap: 4px; padding: 6px; border-radius: 999px; z-index: 10;
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 20px 6px; border-radius: 999px; font-size: 11px; font-weight: 600;
  color: var(--sub); transition: background .25s, color .25s, transform .15s; min-width: 86px; white-space: nowrap;
}
.tab svg { width: 24px; height: 24px; }
.tab:active { transform: scale(0.94); }
.tab.active { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }

/* ---------- Bottom Sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); opacity: 0; pointer-events: none; transition: opacity .25s; z-index: 20; }
.backdrop.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; width: 100%; max-width: 520px;
  transform: translate(-50%, 105%); transition: transform .35s cubic-bezier(.2, .9, .2, 1);
  border-radius: 28px 28px 0 0; padding: 10px 18px calc(24px + env(safe-area-inset-bottom)); z-index: 21;
  background: var(--card-solid);
}
.sheet.show { transform: translate(-50%, 0); }
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--sep); margin: 0 auto 14px; }
.sheet h3 { margin: 4px 4px 14px; font-size: 20px; }
.sheet .list-btn { width: 100%; text-align: left; padding: 15px 16px; border-radius: 14px; background: var(--bg); font-size: 17px; margin-bottom: 8px; }
.sheet .list-btn.danger { color: var(--red); }
.sheet .msg { color: var(--sub); margin: 0 4px 16px; }
.sheet .row-btns { display: flex; gap: 10px; }
.sheet .row-btns button { flex: 1; padding: 14px; border-radius: 14px; font-weight: 600; font-size: 17px; background: var(--bg); }
.sheet .row-btns .danger { background: var(--red); color: #fff; }

.toast { position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 50%; transform: translate(-50%, -150%); padding: 12px 20px; border-radius: 999px; font-weight: 500; font-size: 15px; transition: transform .35s cubic-bezier(.2, .9, .2, 1); z-index: 30; white-space: nowrap; }
.toast.show { transform: translate(-50%, 0); }
