/* Spacre Files - Look wie Deal Finder, Mail und Nova ("Liquid Glass") */
:root {
  --bg: #000; --text: #f5f5f7; --muted: rgba(255,255,255,.58); --faint: rgba(255,255,255,.38);
  --blue: 10,132,255; --green: 48,209,88; --red: 255,69,58; --orange: 255,159,10;
  --glass: rgba(255,255,255,.055); --glass-strong: rgba(28,28,30,.72); --border: rgba(255,255,255,.11);
  --edge: rgba(255,255,255,.18); --shadow: 0 10px 30px -12px rgba(0,0,0,.65);
  --hover: rgba(255,255,255,.06); --active: rgba(255,255,255,.11); --input: rgba(255,255,255,.06);
  --menu: rgba(36,36,40,.97); --blob: .38;
  --ease: cubic-bezier(.32,.72,0,1); --spring: cubic-bezier(.34,1.56,.64,1);
  color-scheme: dark;
}
html.light {
  --bg: #f2f2f7; --text: #1d1d1f; --muted: rgba(0,0,0,.55); --faint: rgba(0,0,0,.38);
  --blue: 0,122,255; --green: 40,167,69; --red: 255,59,48; --orange: 230,126,0;
  --glass: rgba(255,255,255,.62); --glass-strong: rgba(255,255,255,.8); --border: rgba(0,0,0,.07);
  --edge: rgba(255,255,255,.95); --shadow: 0 8px 28px -14px rgba(30,40,80,.22), 0 1px 2px rgba(0,0,0,.04);
  --hover: rgba(0,0,0,.045); --active: rgba(0,0,0,.075); --input: rgba(0,0,0,.045);
  --menu: rgba(255,255,255,.98); --blob: .26;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Inter, Roboto, "Helvetica Neue", system-ui, sans-serif;
  letter-spacing: -0.011em; -webkit-font-smoothing: antialiased;
}
body::before {
  content: ""; position: fixed; inset: -10vmax; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38vmax 38vmax at 12% 14%, rgba(var(--blue), var(--blob)), transparent 70%),
    radial-gradient(34vmax 34vmax at 88% 46%, rgba(94,92,230, var(--blob)), transparent 70%),
    radial-gradient(30vmax 30vmax at 40% 96%, rgba(var(--red), calc(var(--blob) * .5)), transparent 70%);
  filter: blur(40px);
}
[hidden] { display: none !important; }
a { color: rgb(var(--blue)); text-decoration: none; }
a:hover { filter: brightness(1.15); }
::selection { background: rgba(var(--blue), .3); }
* { scrollbar-width: thin; scrollbar-color: rgba(127,127,127,.35) transparent; }
svg { display: block; flex: none; }

/* ---------- Glas ---------- */
.glass, .card, .top {
  background: var(--glass); border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 0 var(--edge), var(--shadow);
  backdrop-filter: blur(28px) saturate(1.8); -webkit-backdrop-filter: blur(28px) saturate(1.8);
}
.card { border-radius: 24px; padding: 22px; }

/* ---------- Kopfleiste ---------- */
.top {
  position: sticky; top: 12px; z-index: 20; margin: 12px auto 0; max-width: 1080px; width: calc(100% - 24px);
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-radius: 22px;
  background: var(--glass-strong);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: -0.02em; color: var(--text); }
.logo {
  width: 32px; height: 32px; border-radius: 28%; display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #8b7dff, #5b4bdb);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 6px 18px -6px rgba(124,108,255,.8);
}
.logo svg { width: 18px; height: 18px; }
.logo.lg { width: 60px; height: 60px; border-radius: 18px; }
.logo.lg svg { width: 30px; height: 30px; }
.top .grow { flex: 1; }
.who { font-size: 13px; color: var(--muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Knoepfe ---------- */
button, .btn {
  font: inherit; color: var(--text); cursor: pointer; border: 1px solid var(--border); background: var(--input);
  border-radius: 999px; padding: 9px 16px; font-weight: 500; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .3s var(--spring), background-color .25s var(--ease), box-shadow .25s var(--ease), filter .2s, opacity .2s;
}
button:hover, .btn:hover { background: var(--active); filter: none; }
button:active, .btn:active { transform: scale(.95); transition-duration: .1s; }
button:disabled { opacity: .45; cursor: default; transform: none; }
button.primary, .btn.primary {
  background: rgb(var(--blue)); color: #fff; border-color: transparent; font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 22px -8px rgba(var(--blue), .75);
}
button.primary:hover, .btn.primary:hover { background: rgb(var(--blue)); filter: brightness(1.1); }
button.danger { color: rgb(var(--red)); background: rgba(var(--red), .1); border-color: rgba(var(--red), .2); }
button.danger:hover { background: rgba(var(--red), .18); }
button.icon { width: 38px; height: 38px; padding: 0; border-radius: 12px; background: transparent; border-color: transparent; color: var(--muted); }
button.icon:hover { background: var(--hover); color: var(--text); }
button.icon svg { width: 18px; height: 18px; }
button.small, .btn.small { padding: 6px 12px; font-size: 13px; }
button.big { padding: 13px 22px; font-size: 15.5px; }
button svg, .btn svg { width: 16px; height: 16px; }

/* ---------- Felder ---------- */
input, select, textarea {
  font: inherit; color: var(--text); width: 100%; background: var(--input); border: 1px solid var(--border);
  border-radius: 14px; padding: 10px 14px; min-height: 42px; outline: none;
  transition: border-color .2s, box-shadow .2s, background-color .2s;
}
input:hover, select:hover, textarea:hover { background: var(--hover); }
input:focus, select:focus, textarea:focus { border-color: rgba(var(--blue), .7); box-shadow: 0 0 0 4px rgba(var(--blue), .18); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 70px; line-height: 1.45; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 19px) 50%, calc(100% - 14px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--menu); color: var(--text); }
label.fld { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; border-radius: 14px; background: var(--hover); font-size: 14px; }
.switch-row small { display: block; color: var(--muted); font-size: 12.5px; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; min-height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--active); transition: background .25s var(--ease); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3); transition: transform .3s var(--spring); }
.switch input:checked + span { background: rgb(var(--blue)); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 4px rgba(var(--blue), .25); }

/* ---------- Seite ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 22px 12px 60px; display: grid; gap: 18px; }
.hero { text-align: center; padding: 18px 0 4px; }
.hero h1 { margin: 0; font-size: clamp(28px, 5vw, 40px); letter-spacing: -0.035em; line-height: 1.1; }
.hero h1 em { font-style: normal; color: rgb(var(--blue)); }
.hero p { margin: 8px 0 0; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
h2 { margin: 0 0 14px; font-size: 18px; letter-spacing: -0.02em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.stack { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row .grow { flex: 1; }

/* ---------- Ablage-Zone ---------- */
.drop {
  border: 2px dashed rgba(var(--blue), .45); border-radius: 22px; padding: 40px 20px; text-align: center; cursor: pointer;
  background: rgba(var(--blue), .05); transition: background-color .3s var(--ease), border-color .3s var(--ease), transform .4s var(--spring);
  display: grid; justify-items: center; gap: 10px;
}
.drop:hover, .drop.over { background: rgba(var(--blue), .12); border-color: rgb(var(--blue)); }
.drop.over { transform: scale(1.015); }
.drop .ic { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; color: #fff; background: rgb(var(--blue)); box-shadow: 0 12px 28px -10px rgba(var(--blue), .8); }
.drop .ic svg { width: 28px; height: 28px; }
.drop b { font-size: 17px; }
.drop span { color: var(--muted); font-size: 13.5px; }
.drop input { display: none; }

/* ---------- Dateiliste ---------- */
.flist { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; }
.fitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--hover); animation: rise .4s var(--ease) both; }
.fitem .fic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--blue), .15); color: rgb(var(--blue)); flex: none; }
.fitem .fic svg { width: 17px; height: 17px; }
.fitem .fn { flex: 1; min-width: 0; }
.fitem .fn b { display: block; font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fitem .fn small { color: var(--muted); font-size: 12.5px; }
.fitem .bar { height: 4px; border-radius: 999px; background: var(--active); margin-top: 6px; overflow: hidden; }
.fitem .bar i { display: block; height: 100%; width: 0; background: rgb(var(--blue)); border-radius: 999px; transition: width .3s var(--ease); }
.fitem.done .bar i { background: rgb(var(--green)); }
.fitem.err .bar i { background: rgb(var(--red)); }
.fitem.err small { color: rgb(var(--red)); }
.total { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 2px 4px; }

/* ---------- Gesamtfortschritt ---------- */
.prog { display: grid; gap: 8px; }
.prog .big-bar { height: 10px; border-radius: 999px; background: var(--active); overflow: hidden; }
.prog .big-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, rgb(var(--blue)), #5e5ce6); transition: width .35s var(--ease); }
.prog .nums { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.prog .pct { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }

/* ---------- Ergebnis ---------- */
.result { text-align: center; display: grid; justify-items: center; gap: 14px; }
.result .ok { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--green), .15); color: rgb(var(--green)); animation: pop .5s var(--spring) both; }
.result .ok svg { width: 30px; height: 30px; }
.linkbox { display: flex; gap: 8px; width: 100%; padding: 6px 6px 6px 14px; border-radius: 999px; background: var(--input); border: 1px solid var(--border); align-items: center; }
.linkbox input { border: 0; background: transparent; padding: 0; min-height: 34px; box-shadow: none !important; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }
.qr { width: 172px; height: 172px; border-radius: 18px; background: #fff; padding: 8px; box-shadow: var(--shadow); }
.qr img { width: 100%; height: 100%; display: block; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--hover); color: var(--muted); display: inline-flex; gap: 5px; align-items: center; }
.tag svg { width: 13px; height: 13px; }
.tag.blue { background: rgba(var(--blue), .15); color: rgb(var(--blue)); }
.tag.green { background: rgba(var(--green), .15); color: rgb(var(--green)); }
.tag.orange { background: rgba(var(--orange), .15); color: rgb(var(--orange)); }
.tag.red { background: rgba(var(--red), .14); color: rgb(var(--red)); }

/* ---------- Listen (Meine Uploads, Admin) ---------- */
.tlist { display: grid; gap: 8px; }
.titem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; padding: 12px 14px; border-radius: 16px; background: var(--hover); transition: background-color .25s var(--ease); }
.titem:hover { background: var(--active); }
.titem .tt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.titem .tm { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px 12px; flex-wrap: wrap; }
.titem .acts { display: flex; gap: 4px; }
.empty { color: var(--muted); font-size: 14px; text-align: center; padding: 18px; }

/* ---------- Download-Seite ---------- */
.dl { max-width: 620px; margin: 0 auto; width: 100%; }
.dl-head { text-align: center; display: grid; justify-items: center; gap: 8px; margin-bottom: 18px; }
.dl-head h1 { margin: 6px 0 0; font-size: 26px; letter-spacing: -0.03em; }
.dl-msg { white-space: pre-wrap; padding: 12px 14px; border-radius: 14px; background: var(--hover); font-size: 14px; text-align: left; width: 100%; }
.dl-file { display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 12px; border-radius: 14px; background: var(--hover); }
.dl-file .fn { flex: 1; min-width: 0; }
.dl-file .fn b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-file .fn small { color: var(--muted); font-size: 12.5px; }

/* ---------- Admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.kpi { padding: 18px; border-radius: 22px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 500; }
.kpi b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi small { color: var(--muted); font-size: 12px; }
.meter { height: 8px; border-radius: 999px; background: var(--active); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; width: 0; background: rgb(var(--blue)); border-radius: 999px; }
.chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.chart .col { flex: 1; height: 100%; display: flex; align-items: flex-end; gap: 2px; position: relative; }
.chart .col i { flex: 1; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .5s var(--ease); }
.chart .col i.u { background: rgb(var(--blue)); }
.chart .col i.d { background: #5e5ce6; opacity: .85; }
.chart .col:hover::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 11.5px; padding: 4px 8px; border-radius: 8px; background: var(--menu); border: 1px solid var(--border); z-index: 5; }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .u { background: rgb(var(--blue)); } .legend .d { background: #5e5ce6; }
.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--hover); border: 1px solid var(--border); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; font-size: 13.5px; color: var(--muted); }
.seg button.on { background: var(--glass-strong); color: var(--text); box-shadow: inset 0 1px 0 var(--edge), 0 4px 12px -6px rgba(0,0,0,.35); }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }

/* ---------- Hinweise ---------- */
.toasts { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 50; width: min(440px, calc(100vw - 24px)); }
.toast { padding: 12px 16px; border-radius: 16px; background: var(--menu); border: 1px solid var(--border); box-shadow: inset 0 1px 0 var(--edge), 0 18px 40px -12px rgba(0,0,0,.5); font-size: 14px; animation: rise .35s var(--ease) both; }
.toast.err { border-color: rgba(var(--red), .45); }
.toast.ok { border-color: rgba(var(--green), .45); }
.notice { padding: 12px 14px; border-radius: 14px; font-size: 14px; background: rgba(var(--orange), .1); border: 1px solid rgba(var(--orange), .25); }
.notice.err { background: rgba(var(--red), .1); border-color: rgba(var(--red), .25); }

@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.fade { animation: rise .5s var(--ease) both; }

@media (max-width: 860px) {
  .grid2 { grid-template-columns: 1fr; }
  .who { display: none; }
}
@media (max-width: 520px) {
  .card { padding: 16px; border-radius: 20px; }
  .top { top: 8px; margin-top: 8px; width: calc(100% - 16px); }
  main { padding: 16px 8px 50px; }
  .drop { padding: 28px 14px; }
  .titem { grid-template-columns: 1fr; }
  .linkbox { border-radius: 16px; flex-wrap: wrap; padding: 8px; }
  .linkbox input { flex-basis: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.m0 { margin: 0 !important; }
.mt12 { margin-top: 12px; }
.full { width: 100%; justify-content: center; }
.center { justify-items: center; text-align: center; }

dialog.qrdlg { border: 1px solid var(--border); border-radius: 26px; background: var(--menu); color: var(--text); padding: 24px; width: min(380px, calc(100vw - 24px));
  box-shadow: inset 0 1px 0 var(--edge), 0 30px 70px -20px rgba(0,0,0,.6); }
dialog.qrdlg[open] { animation: rise .4s var(--ease) both; }
dialog.qrdlg::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(6px); }
svg.inl { display: inline-block; width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.ti { min-width: 0; }
.status-pill { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); }
.status-pill.ready { background: rgba(var(--green), .15); color: rgb(var(--green)); }
.status-pill.deleted, .status-pill.blocked { background: rgba(var(--red), .14); color: rgb(var(--red)); }
.status-pill.expired { background: rgba(var(--orange), .14); color: rgb(var(--orange)); }
.status-pill.uploading { background: rgba(var(--blue), .15); color: rgb(var(--blue)); }
.fic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(var(--blue), .15); color: rgb(var(--blue)); flex: none; }
.fic svg { width: 17px; height: 17px; }
