/* =========================================================================
   Tarko – Oberfläche
   Ruhig und fotografisch: Das Hintergrundbild (gerenderte Alpenlandschaft)
   ist das Einzige, das laut sein darf. Alles andere ist Material und Schrift.
   - Chrom (Leiste, Dock, Widgets, Seitenleisten): durchscheinend
   - Inhalt (Fenster, Dialoge): fast deckend, damit man gut liest
   - Akzent: Bergsee-Blau, sparsam
   ========================================================================= */

@font-face {
  font-family: "Inter Tarko";
  src: url("/fonts/inter.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter Tarko", "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter Tarko", "Segoe UI Variable Display", "Segoe UI", Roboto, sans-serif;

  /* Inhalt */
  --bg: #ffffff;
  --bg-2: #f4f4f6;
  --bg-3: #ebebef;
  --side: rgba(238, 238, 242, .74);
  --label: rgba(0, 0, 0, .87);
  --label-2: rgba(60, 60, 67, .68);
  --label-3: rgba(60, 60, 67, .40);
  --sep: rgba(60, 60, 67, .13);
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .07);
  --hover: rgba(0, 0, 0, .045);
  --tint: #0a6cdb;
  --tint-text: #ffffff;
  --tint-weak: rgba(10, 108, 219, .12);
  --danger: #dc3a30;
  --ok: #2a9b51;
  --warn: #c98100;
  --shadow-win: 0 0 0 .5px rgba(0, 0, 0, .18), 0 22px 70px rgba(0, 0, 0, .32), 0 6px 18px rgba(0, 0, 0, .12);
  --shadow-pop: 0 0 0 .5px rgba(0, 0, 0, .14), 0 12px 40px rgba(0, 0, 0, .22);

  /* Kategorien in der Speicheranzeige */
  --c-photos: #f2a33a;
  --c-videos: #9a5de2;
  --c-documents: #0a6cdb;
  --c-music: #e2456f;
  --c-other: #8e9198;
  --c-trash: #c7c8cd;
  --c-system: #5e6168;

  /* Material auf dem Hintergrundbild (dunkle Bilder) */
  --on-wall: #fff;
  --on-wall-2: rgba(255, 255, 255, .74);
  --on-wall-3: rgba(255, 255, 255, .5);
  --chrome: rgba(22, 24, 34, .32);
  --chrome-line: rgba(255, 255, 255, .16);
  --widget: rgba(24, 26, 38, .38);
  --widget-line: rgba(255, 255, 255, .14);

  --r-win: 16px;
  --r-widget: 24px;
  --r-ctl: 8px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.3, .4, 1);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1d1d20;
    --bg-2: #161618;
    --bg-3: #29292d;
    --side: rgba(36, 36, 40, .72);
    --label: rgba(255, 255, 255, .92);
    --label-2: rgba(235, 235, 245, .62);
    --label-3: rgba(235, 235, 245, .34);
    --sep: rgba(255, 255, 255, .1);
    --fill: rgba(118, 118, 128, .26);
    --fill-2: rgba(118, 118, 128, .15);
    --hover: rgba(255, 255, 255, .06);
    --tint: #3b8bff;
    --tint-weak: rgba(59, 139, 255, .2);
    --danger: #ff5a4f;
    --ok: #3ccb6c;
    --warn: #f0a92d;
    --c-documents: #3b8bff;
    --c-trash: #55565c;
    --c-system: #8a8d94;
    --shadow-win: 0 0 0 .5px rgba(255, 255, 255, .12), 0 22px 70px rgba(0, 0, 0, .55), 0 6px 18px rgba(0, 0, 0, .3);
    --shadow-pop: 0 0 0 .5px rgba(255, 255, 255, .14), 0 12px 40px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

/* Helle Hintergrundbilder (Nebelmeer): dunkle Schrift auf hellem Glas */
body[data-tone="light"] {
  --on-wall: rgba(0, 0, 0, .86);
  --on-wall-2: rgba(0, 0, 0, .6);
  --on-wall-3: rgba(0, 0, 0, .4);
  --chrome: rgba(255, 255, 255, .42);
  --chrome-line: rgba(255, 255, 255, .6);
  --widget: rgba(255, 255, 255, .5);
  --widget-line: rgba(255, 255, 255, .7);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.38;
  color: var(--on-wall);
  background: #1b2236;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: default; }
a { color: var(--tint); }
img, svg, video { display: block; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 1px; }
.num { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
::selection { background: color-mix(in srgb, var(--tint) 35%, transparent); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* ---------- Hintergrundbild ---------- */

#wall { position: fixed; inset: 0; z-index: 0; background: #1b2236 center / cover no-repeat; }
#wall .ph { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(24px); transform: scale(1.04); }
#wall img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s var(--ease); }
#wall img.on { opacity: 1; }
#wall::after { /* leichte Abdunklung oben, damit die Leiste lesbar bleibt */
  content: ""; position: absolute; inset: 0 0 auto; height: 160px;
  background: linear-gradient(rgba(0, 0, 0, .16), transparent);
  pointer-events: none;
}
body[data-tone="light"] #wall::after { background: linear-gradient(rgba(255, 255, 255, .2), transparent); }
#app { position: fixed; inset: 0; z-index: 1; }
#overlays { position: fixed; inset: 0; z-index: 100; pointer-events: none; }
#overlays > * { pointer-events: auto; }

/* ---------- Grundbausteine ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 30px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--fill); color: var(--label);
  font-size: 13px; font-weight: 500; white-space: nowrap;
  transition: background .15s, transform .15s var(--ease), opacity .15s;
}
.btn svg { width: 16px; height: 16px; margin-left: -2px; }
.btn:hover { background: color-mix(in srgb, var(--fill) 100%, var(--label) 6%); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; transform: none; }
.btn.primary { background: var(--tint); color: var(--tint-text); }
.btn.primary:hover { background: color-mix(in srgb, var(--tint) 88%, #000); }
.btn.danger { color: var(--danger); }
.btn.danger.solid { background: var(--danger); color: #fff; }
.btn.plain { background: transparent; color: var(--tint); padding: 0 8px; }
.btn.plain:hover { background: var(--tint-weak); }
.btn.lg { height: 44px; padding: 0 26px; font-size: 15px; font-weight: 600; }
.btn.block { width: 100%; }

.ibtn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; border: 0;
  background: transparent; color: var(--label-2); flex: none;
}
.ibtn svg { width: 18px; height: 18px; }
.ibtn:hover { background: var(--hover); color: var(--label); }
.ibtn:disabled { opacity: .35; background: transparent; }
.ibtn.on { background: var(--fill); color: var(--label); }

.tf {
  width: 100%; height: 32px; padding: 0 10px; border-radius: 8px;
  border: .5px solid var(--sep); background: var(--bg); color: var(--label);
  box-shadow: inset 0 .5px 1px rgba(0, 0, 0, .04);
}
.tf::placeholder { color: var(--label-3); }
.tf:focus { border-color: transparent; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tint) 45%, transparent); }
.tf.lg { height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; background: var(--fill-2); border-color: transparent; }
.tf.code { font-size: 26px; height: 56px; text-align: center; letter-spacing: .35em; font-variant-numeric: tabular-nums; font-weight: 500; }
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; font-weight: 500; color: var(--label-2); }
.pw { position: relative; }
.pw .tf { padding-right: 40px; }
.pw .eye { position: absolute; right: 4px; top: 50%; translate: 0 -50%; }
.form-error { color: var(--danger); font-size: 12.5px; min-height: 1px; }
.form-error:empty { display: none; }
.hint { color: var(--label-2); font-size: 12px; margin: 8px 4px 0; }

.seg { display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 26px; padding: 0 12px; border-radius: 7px;
  color: var(--label); font-weight: 500; font-size: 12.5px;
}
.seg button.on { background: var(--bg); box-shadow: 0 1px 3px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .05); }
.seg.icons button { padding: 0 8px; display: grid; place-items: center; }
.seg.icons svg { width: 17px; height: 17px; }

.switch { position: relative; width: 40px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; }
.switch i { position: absolute; inset: 0; border-radius: 99px; background: var(--fill); transition: background .2s; pointer-events: none; }
.switch i::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: translate .22s var(--spring);
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { translate: 16px 0; }
.switch input:focus-visible + i { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); }

.bar { position: relative; height: 6px; border-radius: 99px; background: var(--fill); overflow: hidden; display: flex; }
.bar > i { display: block; height: 100%; background: var(--tint); transition: width .5s var(--ease); }
.bar > i + i { box-shadow: -1px 0 0 var(--bg); }
.bar.indet > i { width: 30% !important; animation: indet 1.3s ease-in-out infinite; border-radius: 99px; }
@keyframes indet { from { translate: -100% 0; } to { translate: 340% 0; } }

.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--label-2); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { rotate: 360deg; } }

.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--fill); color: var(--label-2); white-space: nowrap; }
.badge.ok { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.badge.warn { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); }
.badge.bad { background: color-mix(in srgb, var(--danger) 15%, transparent); color: var(--danger); }
.badge.tint { background: var(--tint-weak); color: var(--tint); }

.avatar {
  display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; flex: none;
  font-size: 11.5px; font-weight: 600; color: #fff; letter-spacing: .02em;
  background: linear-gradient(180deg, #9aa0ab, #6e737d);
}
.avatar.c1 { background: linear-gradient(180deg, #6fb2ff, #2f74e0); }
.avatar.c2 { background: linear-gradient(180deg, #ffb36b, #e8772e); }
.avatar.c3 { background: linear-gradient(180deg, #7bd88f, #2f9e55); }
.avatar.c4 { background: linear-gradient(180deg, #c99bff, #8051d6); }
.avatar.lg { width: 56px; height: 56px; font-size: 21px; }
.avatar.xl { width: 72px; height: 72px; font-size: 26px; }

.empty { display: grid; place-items: center; align-content: center; gap: 6px; padding: 48px 24px; text-align: center; height: 100%; color: var(--label-2); }
.empty svg { width: 44px; height: 44px; color: var(--label-3); margin-bottom: 6px; stroke-width: 1.3; }
.empty h3 { margin: 0; font-size: 17px; font-weight: 600; color: var(--label); letter-spacing: -.01em; }
.empty p { margin: 0 0 10px; max-width: 34ch; }

/* ---------- Toasts ---------- */

#toasts { position: fixed; left: 50%; bottom: 104px; translate: -50% 0; z-index: 200; display: grid; gap: 8px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 12px; min-height: 40px; padding: 8px 10px 8px 16px; border-radius: 14px;
  background: rgba(30, 30, 34, .9); color: #fff; font-weight: 500; pointer-events: auto;
  backdrop-filter: blur(20px) saturate(1.6); -webkit-backdrop-filter: blur(20px) saturate(1.6);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .3); max-width: min(560px, 92vw);
  animation: toastIn .35s var(--spring);
}
.toast:not(:has(button)):not(:has(.bar)) { padding-right: 16px; }
.toast.err { background: rgba(150, 30, 28, .92); }
.toast button { border: 0; background: rgba(255, 255, 255, .16); color: #fff; height: 26px; padding: 0 12px; border-radius: 8px; font-weight: 600; }
.toast button:hover { background: rgba(255, 255, 255, .26); }
.toast .bar { width: 120px; background: rgba(255, 255, 255, .2); }
.toast .bar i { background: #fff; }
.toast .pct { width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; opacity: .8; }
.toast.out { opacity: 0; translate: 0 6px; transition: .2s; }
@keyframes toastIn { from { opacity: 0; translate: 0 12px; scale: .96; } }

/* ---------- Dialoge ---------- */

.scrim {
  position: fixed; inset: 0; display: grid; place-items: center; padding: 20px;
  background: rgba(0, 0, 0, .28); animation: fade .2s;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: min(440px, 100%); max-height: calc(100vh - 40px); overflow: auto;
  background: var(--bg); color: var(--label); border-radius: 18px; padding: 22px;
  box-shadow: var(--shadow-win); animation: sheetIn .32s var(--spring);
}
.sheet.wide { width: min(560px, 100%); }
@keyframes sheetIn { from { opacity: 0; scale: .94; } }
.sheet > .sicon { width: 56px; height: 56px; margin: 4px auto 14px; }
.sheet > .sicon svg { width: 56px; height: 56px; }
.sheet h2 { margin: 0 0 6px; font-size: 17px; font-weight: 650; letter-spacing: -.012em; text-align: center; }
.sheet > p { margin: 0 0 16px; color: var(--label-2); text-align: center; }
.sheet .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.sheet .acts .btn { min-width: 92px; }
.sheet.center .acts { justify-content: center; }
.sheet .body { display: grid; gap: 12px; }

/* ---------- Menüs ---------- */

.menu {
  position: fixed; min-width: 200px; padding: 5px; border-radius: 11px; z-index: 300;
  background: color-mix(in srgb, var(--bg) 82%, transparent); color: var(--label);
  backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: var(--shadow-pop); animation: menuIn .14s var(--ease);
}
@keyframes menuIn { from { opacity: 0; scale: .97; } }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
  background: transparent; text-align: left; font-size: 13px; white-space: nowrap;
}
.menu-item svg { width: 16px; height: 16px; color: var(--label-2); }
.menu-item:hover, .menu-item:focus-visible { background: var(--tint); color: #fff; outline: 0; }
.menu-item:hover svg, .menu-item:focus-visible svg { color: #fff; }
.menu-item.danger { color: var(--danger); }
.menu-item.danger svg { color: var(--danger); }
.menu-item.danger:hover { background: var(--danger); color: #fff; }
.menu-sep { height: 1px; margin: 5px 8px; background: var(--sep); }
.menu .who { padding: 8px 10px 10px; display: grid; gap: 1px; }
.menu .who b { font-size: 13px; font-weight: 600; }
.menu .who small { color: var(--label-2); font-size: 12px; }

/* =========================================================================
   Ersteinrichtung, Anmeldung, Einladung
   ========================================================================= */

.onb { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; overflow: auto; }
.onb-mark { position: fixed; top: 22px; left: 26px; display: flex; align-items: center; gap: 9px; color: var(--on-wall); opacity: 0; transition: opacity .6s; z-index: 2; }
.onb-mark.show { opacity: 1; }
.onb-mark svg { width: 22px; height: 22px; }
.onb-mark b { font-family: var(--font-display); font-size: 17px; font-weight: 700; letter-spacing: -.02em; }

/* Begrüssung */
.hello { display: grid; justify-items: center; gap: 44px; text-align: center; }
.hello-word {
  font-family: var(--font-display); font-size: clamp(64px, 11vw, 148px); font-weight: 600; letter-spacing: -.045em; line-height: 1;
  color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, .25); min-height: 1.2em; white-space: nowrap;
}
.hello .btn { opacity: 0; translate: 0 8px; transition: opacity .6s, translate .6s var(--ease); pointer-events: none; }
.hello .btn.show { opacity: 1; translate: 0; pointer-events: auto; }
.btn.glass {
  background: rgba(255, 255, 255, .2); color: #fff; border: .5px solid rgba(255, 255, 255, .4);
  backdrop-filter: blur(24px) saturate(1.6); -webkit-backdrop-filter: blur(24px) saturate(1.6);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 30px rgba(0, 0, 0, .18);
}
.btn.glass:hover { background: rgba(255, 255, 255, .3); }
.hello-skip { position: fixed; right: 24px; bottom: 22px; border: 0; background: none; color: rgba(255, 255, 255, .7); font-size: 13px; padding: 6px 8px; border-radius: 8px; }
.hello-skip:hover { color: #fff; background: rgba(255, 255, 255, .12); }

/* Karte für die Schritte */
.panel {
  width: min(520px, 100%); padding: 36px 40px 32px; border-radius: 28px; color: var(--label);
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: 0 0 0 .5px rgba(255, 255, 255, .3), 0 30px 90px rgba(0, 0, 0, .3);
  display: grid; gap: 22px;
}
.panel.step-enter { animation: stepIn .55s var(--ease) both; }
.panel.step-leave { animation: stepOut .3s ease-in both; }
@keyframes stepIn { from { opacity: 0; translate: 0 18px; scale: .985; } }
@keyframes stepOut { to { opacity: 0; translate: 0 -10px; scale: .99; } }
.panel .head { display: grid; gap: 8px; text-align: center; justify-items: center; }
.panel h1 { margin: 0; font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -.025em; line-height: 1.15; }
.panel .lead { margin: 0; color: var(--label-2); font-size: 15px; max-width: 38ch; line-height: 1.45; }
.panel > .lead { text-align: center; margin: 0 auto; }
.panel form { display: grid; gap: 14px; }
.panel .acts { display: flex; gap: 10px; justify-content: flex-end; align-items: center; margin-top: 4px; }
.panel .acts .grow { flex: 1; }
.panel .foot { text-align: center; color: var(--label-3); font-size: 12px; }
.progress-dots { display: flex; gap: 6px; justify-content: center; }
.progress-dots i { width: 22px; height: 4px; border-radius: 2px; background: var(--fill); transition: background .3s; }
.progress-dots i.done { background: color-mix(in srgb, var(--tint) 45%, transparent); }
.progress-dots i.on { background: var(--tint); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 0; height: 28px; padding: 0 12px; border-radius: 99px; background: var(--fill-2); color: var(--label); font-size: 12.5px; font-weight: 500; }
.chip:hover { background: var(--fill); }

/* Das Gerät als Produktbild */
.device { width: 220px; height: 170px; margin: -8px auto -6px; }
.device svg { width: 100%; height: 100%; overflow: visible; }
.device.sm { width: 140px; height: 108px; margin: -10px auto -12px; }
.device .led { animation: ledBreath 3.2s ease-in-out infinite; }
@keyframes ledBreath { 50% { opacity: .45; } }
.device-rise { animation: rise 1.1s var(--ease) both; }
@keyframes rise { from { opacity: 0; translate: 0 26px; } }

/* Daten mitbringen */
.sources { display: grid; gap: 8px; }
.source {
  display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px;
  border: 0; background: var(--fill-2); text-align: left; color: var(--label); width: 100%;
}
.source:hover { background: var(--fill); }
.logo { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; }
.logo svg { width: 24px; height: 24px; }
.cell .logo { width: 30px; height: 30px; border-radius: 8px; }
.cell .logo svg { width: 18px; height: 18px; }
.sheet > .sicon .logo { width: 56px; height: 56px; border-radius: 14px; }
.sheet > .sicon .logo svg { width: 32px; height: 32px; stroke-width: 1.7; }
.source b { display: block; font-size: 14px; font-weight: 600; }
.source small { display: block; color: var(--label-2); font-size: 12.5px; }
.source .state { color: var(--label-2); font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.source .state svg { width: 16px; height: 16px; }
.source .state.ok { color: var(--ok); }
.source[aria-disabled="true"] { opacity: .55; }

.steps-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; counter-reset: s; }
.steps-list li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; counter-increment: s; color: var(--label); }
.steps-list li::before {
  content: counter(s); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--fill); font-size: 12px; font-weight: 650; color: var(--label-2);
}
.steps-list small { display: block; color: var(--label-2); }
.devcode {
  font-size: 30px; font-weight: 650; letter-spacing: .12em; text-align: center; padding: 14px; border-radius: 14px;
  background: var(--fill-2); font-variant-numeric: tabular-nums; user-select: all;
}
.waiting { display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--label-2); }

.drop {
  display: grid; place-items: center; gap: 6px; padding: 22px; border-radius: 14px; text-align: center;
  border: 1.5px dashed var(--sep); color: var(--label-2);
}
.drop.over { border-color: var(--tint); background: var(--tint-weak); color: var(--tint); }
.drop svg { width: 28px; height: 28px; }
.zips { display: grid; gap: 4px; max-height: 180px; overflow: auto; }
.zip-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; }
.zip-row:hover { background: var(--hover); }
.zip-row span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zip-row small { color: var(--label-2); }

.done-mark { width: 84px; height: 84px; margin: 0 auto; }
.done-mark circle { fill: none; stroke: var(--ok); stroke-width: 3; stroke-dasharray: 260; stroke-dashoffset: 260; animation: draw 1s var(--ease) .1s forwards; }
.done-mark path { fill: none; stroke: var(--ok); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; animation: draw .5s var(--ease) .8s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* =========================================================================
   Schreibtisch
   ========================================================================= */

.desk { position: absolute; inset: 0; }

/* Obere Leiste */
.menubar {
  position: absolute; inset: 0 0 auto; height: 32px; z-index: 50; display: flex; align-items: center; gap: 4px; padding: 0 10px 0 14px;
  background: var(--chrome); color: var(--on-wall);
  backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  border-bottom: .5px solid var(--chrome-line);
  font-weight: 500;
}
.menubar .dev { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-right: auto; min-width: 0; }
.menubar .dev svg { width: 18px; height: 18px; flex: none; }
.menubar .dev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mb-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px; border-radius: 6px; border: 0;
  background: transparent; color: inherit; font-weight: 500; white-space: nowrap;
}
.mb-btn:hover, .mb-btn[aria-expanded="true"] { background: rgba(255, 255, 255, .16); }
body[data-tone="light"] .mb-btn:hover { background: rgba(0, 0, 0, .07); }
.mb-btn svg { width: 16px; height: 16px; }
.mb-btn .avatar { width: 22px; height: 22px; font-size: 9.5px; }
.mb-btn.status svg { width: 17px; height: 17px; }
.mb-btn .ring { width: 15px; height: 15px; }
.clock { font-variant-numeric: tabular-nums; }

/* Widgets */
.widgets {
  position: absolute; top: 56px; left: 28px; z-index: 2;
  display: grid; grid-template-columns: repeat(2, 170px); grid-auto-rows: 170px; gap: 16px;
}
.wg {
  position: relative; overflow: hidden; border-radius: var(--r-widget); padding: 16px; border: 0; text-align: left;
  background: var(--widget); color: var(--on-wall);
  backdrop-filter: blur(40px) saturate(1.7); -webkit-backdrop-filter: blur(40px) saturate(1.7);
  box-shadow: inset 0 0 0 .5px var(--widget-line), 0 8px 30px rgba(0, 0, 0, .12);
  display: flex; flex-direction: column; animation: wgIn .7s var(--ease) both;
  transition: transform .2s var(--ease);
}
.wg:active { transform: scale(.98); }
.wg.wide { grid-column: span 2; }
.wg:nth-child(2) { animation-delay: .06s; }
.wg:nth-child(3) { animation-delay: .12s; }
.wg:nth-child(4) { animation-delay: .18s; }
@keyframes wgIn { from { opacity: 0; translate: 0 10px; } }
.wg-top { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--on-wall-2); }
.wg-top svg { width: 15px; height: 15px; }
.wg-big { font-family: var(--font-display); font-size: 30px; font-weight: 650; letter-spacing: -.03em; line-height: 1.05; margin-top: auto; font-variant-numeric: tabular-nums; }
.wg-big small { font-size: 15px; font-weight: 600; letter-spacing: -.01em; margin-left: 3px; color: var(--on-wall-2); }
.wg-sub { font-size: 12px; color: var(--on-wall-2); margin-top: 2px; }
.wg .bar { height: 8px; margin-top: 12px; background: rgba(255, 255, 255, .18); }
body[data-tone="light"] .wg .bar { background: rgba(0, 0, 0, .08); }
.wg .bar > i + i { box-shadow: -1.5px 0 0 rgba(0, 0, 0, .25); }
.wg-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 9px; font-size: 11.5px; color: var(--on-wall-2); }
.wg-legend span { display: inline-flex; align-items: center; gap: 5px; }
.wg-legend i { width: 7px; height: 7px; border-radius: 50%; }

.wg.photo { padding: 0; }
.wg.photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.wg.photo::after { content: ""; position: absolute; inset: auto 0 0; height: 60%; background: linear-gradient(transparent, rgba(0, 0, 0, .5)); }
.wg.photo .cap { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1; color: #fff; }
.wg.photo .cap b { display: block; font-size: 14px; font-weight: 650; letter-spacing: -.01em; }
.wg.photo .cap small { font-size: 11.5px; opacity: .85; }
.wg.photo.empty-ph { padding: 16px; }
.wg.photo.empty-ph::after { display: none; }

.wg-state { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.wg-state .ico { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex: none; }
.wg-state .ico svg { width: 19px; height: 19px; }
.wg-state .ico.ok { background: #2a9b51; color: #fff; }
.wg-state .ico.warn { background: #e19a12; color: #fff; }
.wg-state .ico.bad { background: #dc3a30; color: #fff; }
.wg-state b { font-size: 15px; font-weight: 650; letter-spacing: -.01em; line-height: 1.15; }
.wg-lines { display: grid; gap: 3px; margin-top: 10px; font-size: 11.5px; color: var(--on-wall-2); }
.wg-lines span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wg .bar.thin { height: 5px; margin-top: 8px; }
.wg .bar > i.light { background: #fff; }
body[data-tone="light"] .wg .bar > i.light { background: var(--tint); }

/* Dock */
.dock {
  position: absolute; left: 50%; bottom: 10px; translate: -50% 0; z-index: 60;
  display: flex; gap: 6px; padding: 7px; border-radius: 24px;
  background: var(--chrome);
  backdrop-filter: blur(30px) saturate(1.8); -webkit-backdrop-filter: blur(30px) saturate(1.8);
  box-shadow: inset 0 0 0 .5px var(--chrome-line), 0 10px 40px rgba(0, 0, 0, .2);
}
.dock-app { position: relative; border: 0; background: none; padding: 0; width: 56px; height: 56px; border-radius: 14px; transition: translate .25s var(--spring); }
.dock-app:hover { translate: 0 -4px; }
.dock-app:active { scale: .94; }
.dock-app .appicon { width: 56px; height: 56px; }
.dock-app .tip {
  position: absolute; left: 50%; bottom: calc(100% + 14px); translate: -50% 4px; opacity: 0; pointer-events: none;
  padding: 4px 10px; border-radius: 7px; background: rgba(30, 30, 34, .82); color: #fff; font-size: 12px; font-weight: 500; white-space: nowrap;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); transition: .15s;
}
.dock-app:hover .tip, .dock-app:focus-visible .tip { opacity: 1; translate: -50% 0; }
.dock-app .run { position: absolute; left: 50%; bottom: -5px; translate: -50% 0; width: 4px; height: 4px; border-radius: 50%; background: var(--on-wall); opacity: 0; }
.dock-app.running .run { opacity: .85; }
.dock-app .lock { position: absolute; right: -3px; top: -3px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: rgba(40, 40, 46, .85); color: #fff; }
.dock-app .lock svg { width: 11px; height: 11px; }
.dock-app.locked .appicon { filter: saturate(.3) brightness(.9); }
.dock-sep { width: 1px; margin: 8px 3px; background: var(--chrome-line); }

.appicon { display: block; border-radius: 22.5%; overflow: hidden; box-shadow: 0 1px 2px rgba(0, 0, 0, .18), 0 4px 10px rgba(0, 0, 0, .14); }
.appicon svg { width: 100%; height: 100%; }
.appicon.sm { width: 18px; height: 18px; box-shadow: 0 .5px 1px rgba(0, 0, 0, .2); }
.appicon.md { width: 40px; height: 40px; }
.appicon.lg { width: 72px; height: 72px; }

/* Wartungsmodus */
.maint {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px;
  background: rgba(10, 12, 20, .35); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
}
.maint .panel { text-align: center; }
.maint .panel .bar { height: 8px; }

/* =========================================================================
   Fenster
   ========================================================================= */

.windows { position: absolute; inset: 0; z-index: 30; pointer-events: none; }
.win {
  position: absolute; display: flex; flex-direction: column; pointer-events: auto;
  border-radius: var(--r-win); overflow: hidden; background: var(--bg); color: var(--label);
  box-shadow: var(--shadow-win);
}
.win.inactive { box-shadow: 0 0 0 .5px rgba(0, 0, 0, .14), 0 14px 40px rgba(0, 0, 0, .2); }
.win.win-open { animation: winOpen .42s var(--spring); }
.win.win-close { animation: winClose .2s ease-in forwards; }
@keyframes winOpen { from { opacity: 0; transform: translate(var(--fx, 0), var(--fy, 40px)) scale(.6); } }
@keyframes winClose { to { opacity: 0; scale: .94; } }
.win-body { flex: 1; min-height: 0; display: flex; }
.win-body > * { flex: 1; min-width: 0; }
.win-ctl { position: absolute; top: 18px; left: 18px; z-index: 5; display: flex; gap: 8px; }
.win-ctl button {
  width: 13px; height: 13px; border-radius: 50%; border: 0; padding: 0; display: grid; place-items: center;
  background: var(--fill); box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1);
}
.win:not(.inactive) .win-ctl .close { background: #ff5f57; }
.win:not(.inactive) .win-ctl .zoom { background: #28c840; }
.win-ctl svg { width: 9px; height: 9px; opacity: 0; color: rgba(0, 0, 0, .6); stroke-width: 2.6; }
.win-ctl:hover svg { opacity: 1; }
.win-grip { position: absolute; right: 0; bottom: 0; width: 18px; height: 18px; cursor: nwse-resize; z-index: 6; }
.drag { user-select: none; -webkit-user-select: none; }

/* Gemeinsame Teile der Apps */
.sidebar {
  width: 216px; flex: none; display: flex; flex-direction: column; padding: 52px 10px 10px; gap: 1px; overflow: auto;
  background: var(--side);
  backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);
  border-right: .5px solid var(--sep);
}
.sb-group { font-size: 11px; font-weight: 650; color: var(--label-3); padding: 14px 10px 4px; }
.sb-item {
  display: flex; align-items: center; gap: 9px; width: 100%; height: 30px; padding: 0 10px; border-radius: 7px; border: 0;
  background: transparent; color: var(--label); text-align: left; font-size: 13px; white-space: nowrap;
}
.sb-item svg { width: 17px; height: 17px; color: var(--tint); flex: none; }
.sb-item:hover { background: var(--hover); }
.sb-item.on { background: var(--fill); font-weight: 600; }
.sb-item .count { margin-left: auto; color: var(--label-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.sb-item.drop-over { background: var(--tint); color: #fff; }
.sb-item.drop-over svg { color: #fff; }
.sb-foot { margin-top: auto; padding: 12px 10px 4px; display: grid; gap: 7px; font-size: 11.5px; color: var(--label-2); }
.sb-foot .bar { height: 5px; }

.toolbar {
  height: 52px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 14px;
  border-bottom: .5px solid var(--sep); background: var(--bg);
}
.toolbar.inset { padding-left: 82px; }
.toolbar .title { font-size: 15px; font-weight: 650; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.toolbar .title small { display: block; font-size: 11.5px; font-weight: 500; color: var(--label-2); letter-spacing: 0; }
.toolbar .spacer { flex: 1; min-width: 8px; }
.toolbar .tsep { width: 1px; height: 20px; background: var(--sep); margin: 0 4px; }
.search { position: relative; width: 180px; flex: 0 1 180px; min-width: 90px; }
.search svg { position: absolute; left: 8px; top: 50%; translate: 0 -50%; width: 15px; height: 15px; color: var(--label-3); pointer-events: none; }
.search .tf { height: 28px; padding-left: 28px; background: var(--fill-2); border-color: transparent; box-shadow: none; }
.statusbar { height: 28px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 11.5px; color: var(--label-2); border-top: .5px solid var(--sep); }

/* ---------- Dateien ---------- */

.finder { display: flex; height: 100%; }
.f-main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.f-content { flex: 1; min-height: 0; overflow: auto; position: relative; }
.f-content.dragging { box-shadow: inset 0 0 0 3px var(--tint); background: var(--tint-weak); }
.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 4px; padding: 14px; }
.f-cell { display: grid; justify-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 10px; }
.f-cell .thumb { width: 72px; height: 64px; display: grid; place-items: center; position: relative; }
.f-cell .thumb > svg { width: 64px; height: 64px; filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, .12)); }
.f-cell .thumb img { max-width: 76px; max-height: 64px; border-radius: 4px; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .1), 0 2px 6px rgba(0, 0, 0, .16); background: var(--fill); }
.f-cell .thumb .play { position: absolute; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: rgba(0, 0, 0, .5); color: #fff; }
.f-cell .thumb .play svg { width: 12px; height: 12px; }
.f-cell .name { font-size: 12px; text-align: center; line-height: 1.25; padding: 1px 5px; border-radius: 4px; max-width: 100%; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.f-cell.sel { background: var(--fill-2); }
.f-cell.sel .name { background: var(--tint); color: #fff; }
.f-cell.drop-over { background: var(--tint-weak); box-shadow: inset 0 0 0 2px var(--tint); }

.f-list { width: 100%; border-collapse: collapse; font-size: 13px; }
.f-list th { position: sticky; top: 0; z-index: 1; text-align: left; font-weight: 500; font-size: 11.5px; color: var(--label-2); padding: 6px 12px; background: var(--bg); border-bottom: .5px solid var(--sep); }
.f-list td { padding: 0 12px; height: 28px; white-space: nowrap; color: var(--label-2); }
.f-list td:first-child { color: var(--label); width: 55%; max-width: 0; }
.f-list tr.lrow:nth-child(even) td { background: var(--fill-2); }
.f-list tr.lrow.sel td { background: var(--tint); color: #fff; }
.f-list tr.lrow.drop-over td { background: var(--tint-weak); }
.f-list .ln { display: flex; align-items: center; gap: 8px; min-width: 0; }
.f-list .ln svg { width: 20px; height: 20px; flex: none; }
.f-list .ln span { overflow: hidden; text-overflow: ellipsis; }
.f-list td.num { font-variant-numeric: tabular-nums; }

/* Frühere Stände: Leiste über dem Inhalt */
.timebar {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px; flex: none;
  background: color-mix(in srgb, var(--tint) 10%, var(--bg)); border-bottom: .5px solid var(--sep);
}
.timebar svg.clk { width: 18px; height: 18px; color: var(--tint); flex: none; }
.timebar .when { font-weight: 600; }
.timebar select { height: 28px; border-radius: 7px; border: .5px solid var(--sep); background: var(--bg); padding: 0 8px; max-width: 260px; }
.timebar .spacer { flex: 1; }

.trash-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; color: var(--label-2); border-bottom: .5px solid var(--sep); }
.trash-head span { flex: 1; }
.trash-row { display: grid; grid-template-columns: 32px 1fr auto auto; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: .5px solid var(--sep); }
.trash-row svg { width: 30px; height: 30px; }
.trash-row b { display: block; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trash-row small { color: var(--label-2); font-size: 12px; }
.trash-row .size { color: var(--label-2); font-variant-numeric: tabular-nums; }

/* Schnellansicht */
.ql { position: absolute; inset: 0; z-index: 10; display: flex; flex-direction: column; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); animation: fade .18s; }
.ql-bar { height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 12px 0 82px; border-bottom: .5px solid var(--sep); }
.ql-bar .t { flex: 1; min-width: 0; font-weight: 650; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ql-body { flex: 1; min-height: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; padding: 20px; position: relative; }
.ql-body img, .ql-body video { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; box-shadow: 0 6px 30px rgba(0, 0, 0, .2); }
.ql-body iframe { width: 100%; height: 100%; border: 0; border-radius: 6px; background: #fff; }
.ql-body pre { width: 100%; height: 100%; margin: 0; overflow: auto; padding: 18px; border-radius: 8px; background: var(--bg); box-shadow: 0 0 0 .5px var(--sep); font: 12.5px/1.55 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; }
.ql-none { display: grid; justify-items: center; gap: 8px; text-align: center; color: var(--label-2); }
.ql-none svg { width: 96px; height: 96px; }
.ql-none b { color: var(--label); font-size: 15px; }
.ql-nav { position: absolute; top: 50%; translate: 0 -50%; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 80%, transparent); box-shadow: var(--shadow-pop); color: var(--label); }
.ql-nav svg { width: 18px; height: 18px; }
.ql-nav.prev { left: 14px; }
.ql-nav.next { right: 14px; }

/* Versionen-Dialog */
.versions { display: grid; gap: 2px; max-height: 320px; overflow: auto; margin: 0 -8px; }
.ver { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 8px; border-radius: 8px; }
.ver:hover { background: var(--hover); }
.ver b { font-weight: 600; }
.ver small { color: var(--label-2); grid-column: 1; }
.ver .acts2 { grid-row: span 2; display: flex; gap: 6px; }

/* ---------- Fotos ---------- */

.photos { display: flex; flex-direction: column; height: 100%; background: var(--bg); }
.p-scroll { flex: 1; min-height: 0; overflow: auto; --tile: 150px; }
.p-scroll.dragging { box-shadow: inset 0 0 0 3px var(--tint); }
.p-month { padding: 0 3px 18px; }
.p-month h3 {
  position: sticky; top: 0; z-index: 1; margin: 0; padding: 14px 14px 10px; font-family: var(--font-display);
  font-size: 22px; font-weight: 700; letter-spacing: -.02em;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.p-month h3 small { font-family: var(--font); font-size: 12.5px; font-weight: 500; color: var(--label-2); margin-left: 8px; letter-spacing: 0; }
.p-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--tile), 1fr)); gap: 3px; }
.p-tile { position: relative; aspect-ratio: 1; border: 0; padding: 0; background: var(--fill-2); overflow: hidden; }
.p-tile img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.p-tile img.ok { opacity: 1; }
.p-tile:hover img { filter: brightness(.94); }
.p-tile .vid { position: absolute; right: 6px; bottom: 5px; display: flex; align-items: center; gap: 3px; color: #fff; font-size: 11px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }
.p-tile .vid svg { width: 11px; height: 11px; }
.p-tile .fallback { position: absolute; inset: 0; display: grid; place-items: center; color: var(--label-3); font-weight: 650; font-size: 12px; }
.p-tile:focus-visible { outline-offset: -3px; }

.lb { position: fixed; inset: 0; z-index: 120; background: #000; color: #fff; animation: fade .2s; }
.lb-bg { position: absolute; inset: -60px; background: center / cover; filter: blur(60px) brightness(.4) saturate(1.3); opacity: .9; }
.lb-bar { position: absolute; inset: 0 0 auto; z-index: 2; height: 60px; display: flex; align-items: center; gap: 6px; padding: 0 16px; background: linear-gradient(rgba(0, 0, 0, .5), transparent); }
.lb-bar .meta { flex: 1; min-width: 0; }
.lb-bar .meta b { display: block; font-size: 14px; font-weight: 650; }
.lb-bar .meta small { color: rgba(255, 255, 255, .7); font-size: 12px; }
.lb .ibtn { color: rgba(255, 255, 255, .85); }
.lb .ibtn:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.lb-stage { position: absolute; inset: 60px 60px 30px; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.lb-nav { position: absolute; top: 50%; translate: 0 -50%; z-index: 2; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; background: rgba(255, 255, 255, .12); color: #fff; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.lb-nav:hover { background: rgba(255, 255, 255, .22); }
.lb-nav svg { width: 20px; height: 20px; }
.lb-nav.prev { left: 12px; }
.lb-nav.next { right: 12px; }

/* ---------- Einstellungen ---------- */

.settings { display: flex; height: 100%; }
.st-side { width: 230px; }
.st-me { display: flex; align-items: center; gap: 10px; padding: 6px 10px 12px; border: 0; background: none; width: 100%; text-align: left; border-radius: 10px; color: var(--label); }
.st-me:hover { background: var(--hover); }
.st-me.on { background: var(--fill); }
.st-me b { display: block; font-size: 13px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-me small { display: block; font-size: 11.5px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sq { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: #fff; flex: none; }
.sq svg { width: 15px; height: 15px; color: #fff !important; stroke-width: 1.9; }
.sq.gray { background: linear-gradient(#a1a4ab, #7d8088); }
.sq.blue { background: linear-gradient(#4aa0ff, #0a6cdb); }
.sq.green { background: linear-gradient(#55d27b, #2a9b51); }
.sq.orange { background: linear-gradient(#ffb04a, #f08a12); }
.sq.teal { background: linear-gradient(#4fd0d6, #1797a3); }
.sq.red { background: linear-gradient(#ff7a6e, #dc3a30); }
.sq.indigo { background: linear-gradient(#8a87ff, #5b55e0); }
.sq.lg { width: 30px; height: 30px; border-radius: 8px; }
.sq.lg svg { width: 19px; height: 19px; }
.st-side .sb-item { height: 32px; }
.st-side .sb-item.on { background: var(--tint); color: #fff; font-weight: 500; }

.st-main { flex: 1; min-width: 0; overflow: auto; background: var(--bg-2); }
.st-head { position: sticky; top: 0; z-index: 3; height: 52px; display: flex; align-items: center; padding: 0 24px; background: color-mix(in srgb, var(--bg-2) 85%, transparent); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
.st-head h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.st-body { padding: 4px 24px 32px; max-width: 680px; margin: 0 auto; display: grid; gap: 22px; }
.st-hero { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 10px 0 2px; }
.st-hero h3 { margin: 6px 0 0; font-family: var(--font-display); font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.st-hero p { margin: 0; color: var(--label-2); max-width: 46ch; }

.group { display: grid; gap: 6px; }
.group > h4 { margin: 0 12px; font-size: 13px; font-weight: 650; color: var(--label); }
.group > .gnote { margin: 0 12px; color: var(--label-2); font-size: 12px; }
.list { background: var(--bg); border-radius: 12px; box-shadow: 0 0 0 .5px var(--sep); overflow: hidden; }
.cell { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 8px 14px; position: relative; }
.cell + .cell::before { content: ""; position: absolute; top: 0; left: 14px; right: 0; height: .5px; background: var(--sep); }
.cell.has-icon + .cell::before, .cell + .cell.has-icon::before { left: 50px; }
.cell .grow { flex: 1; min-width: 0; }
.cell .lbl { display: block; color: var(--label); }
.cell .sub { display: block; color: var(--label-2); font-size: 12px; margin-top: 1px; }
.cell .val { color: var(--label-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell button.cell-btn { all: unset; }
.cell.click { cursor: default; }
.cell.click:hover { background: var(--hover); }
.cell .chev { width: 14px; height: 14px; color: var(--label-3); }
.cell .tf { max-width: 260px; }
.cell.col { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px; }
.cell .ico { width: 24px; height: 24px; color: var(--label-2); flex: none; }
.cell .ico svg { width: 24px; height: 24px; stroke-width: 1.5; }

/* Speicheranzeige wie beim Telefon */
.usage { display: grid; gap: 10px; padding: 16px; }
.usage .top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.usage .top b { font-size: 15px; font-weight: 650; }
.usage .top span { color: var(--label-2); }
.usage .bar { height: 12px; border-radius: 4px; }
.usage .bar > i + i { box-shadow: -1.5px 0 0 var(--bg); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--label-2); font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; }

/* Laufwerke */
.disk-ico { width: 34px; height: 34px; flex: none; }
.disk-ico svg { width: 34px; height: 34px; }
.pool-card { display: grid; gap: 14px; padding: 18px; }
.pool-state { display: flex; align-items: center; gap: 14px; }
.pool-state .big { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.pool-state .big svg { width: 26px; height: 26px; stroke-width: 1.8; }
.pool-state .big.ok { background: var(--ok); }
.pool-state .big.warn { background: var(--warn); }
.pool-state .big.bad { background: var(--danger); }
.pool-state .big.none { background: var(--c-other); }
.pool-state b { display: block; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.pool-state span { color: var(--label-2); }
.disk-pick { display: grid; gap: 6px; }
.disk-opt { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); }
.disk-opt input { width: 18px; height: 18px; accent-color: var(--tint); }
.disk-opt .grow { flex: 1; min-width: 0; }
.disk-opt small { display: block; color: var(--label-2); }
.warnbox { display: flex; gap: 10px; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 13%, transparent); color: var(--label); font-size: 12.5px; }
.warnbox svg { width: 18px; height: 18px; color: var(--warn); flex: none; }
.warnbox.bad { background: color-mix(in srgb, var(--danger) 11%, transparent); }
.warnbox.bad svg { color: var(--danger); }

.walls { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 14px; }
.wall-pick { border: 0; background: none; padding: 0; display: grid; gap: 7px; color: var(--label); font-size: 12px; text-align: center; }
.wall-pick img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; box-shadow: 0 0 0 .5px var(--sep); transition: box-shadow .15s; }
.wall-pick.on img { box-shadow: 0 0 0 3px var(--tint); }
.wall-pick.on { font-weight: 600; }

.qr { width: 184px; height: 184px; margin: 0 auto; padding: 10px; background: #fff; border-radius: 12px; box-shadow: 0 0 0 .5px var(--sep); }
.qr svg { width: 100%; height: 100%; }
.secret { font: 500 13px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; color: var(--label-2); word-break: break-all; user-select: all; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; padding: 14px; border-radius: 12px; background: var(--fill-2); font: 500 14px/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; text-align: center; user-select: all; }
.link-box { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--fill-2); min-width: 0; }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 12.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.act-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 2px 10px; align-items: center; }
.act-row .ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--fill-2); color: var(--label-2); grid-row: span 2; }
.act-row .ico svg { width: 15px; height: 15px; }
.act-row .ico.bad { color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.act-row small { color: var(--label-2); grid-column: 2 / 4; }
.act-row time { color: var(--label-3); font-size: 12px; white-space: nowrap; }
.radio { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--fill-2); }
.radio input { margin-top: 2px; accent-color: var(--tint); }
.radio small { display: block; color: var(--label-2); }
.release-notes { white-space: pre-wrap; color: var(--label-2); }
.update-hero { display: grid; justify-items: center; text-align: center; gap: 4px; padding: 20px 16px 18px; }
.update-hero .appicon { margin-bottom: 8px; }
.update-hero b { font-size: 17px; font-weight: 700; letter-spacing: -.015em; }
.update-hero span { color: var(--label-2); }

.ai-panel { display: grid; place-items: center; text-align: center; padding: 30px; height: 100%; }
.ai-panel h2 { font-family: var(--font-display); font-size: 22px; letter-spacing: -.02em; margin: 14px 0 6px; }
.ai-panel p { color: var(--label-2); max-width: 40ch; margin: 0 auto; }

/* =========================================================================
   Kleine Bildschirme (Handy)
   ========================================================================= */

@media (max-width: 760px) {
  body { font-size: 14px; }
  .menubar { height: 44px; padding-top: env(safe-area-inset-top); }
  .menubar .clock { display: none; }
  .widgets { position: absolute; top: 60px; left: 16px; right: 16px; grid-template-columns: 1fr 1fr; grid-auto-rows: auto; }
  .wg { min-height: 158px; }
  .dock { bottom: max(10px, env(safe-area-inset-bottom)); }
  .dock-app, .dock-app .appicon { width: 54px; height: 54px; }
  .windows { z-index: 70; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; box-shadow: none; }
  .win-grip { display: none; }
  .win-ctl { top: 16px; left: 14px; }
  .win-ctl .zoom { display: none; }
  .win-ctl button { width: 26px; height: 26px; }
  .win-ctl svg { width: 12px; height: 12px; opacity: 1; }
  .sidebar { display: none; }
  .finder .sidebar.show { display: flex; position: absolute; z-index: 20; inset: 0 auto 0 0; box-shadow: var(--shadow-win); }
  .toolbar { padding-left: 52px; }
  .toolbar.inset { padding-left: 52px; }
  .search { display: none; }
  .ql-bar { padding-left: 52px; }
  .settings .st-side.show-mobile { display: flex; width: 100%; border: 0; }
  .st-body { padding: 4px 14px 28px; }
  .st-head { padding-left: 52px; }
  .lb-stage { inset: 60px 0 20px; }
  .panel { padding: 28px 22px 24px; border-radius: 22px; }
  .hello-word { font-size: 64px; }
  #toasts { bottom: 96px; }
}

@media (max-width: 760px) {
  .finder .toolbar .seg, .finder .toolbar [aria-label="Neuer Ordner"] { display: none; }
  .toolbar .btn.primary { font-size: 0; gap: 0; padding: 0 9px; }
  .toolbar .btn.primary svg { margin: 0; width: 18px; height: 18px; }
  .toolbar .title { flex: 1 1 auto; }
  .timebar { flex-wrap: wrap; }
  .timebar select { max-width: 170px; }
}
