/* ============================================================
   MediaDrive 2 — Hoshibi design system
   ============================================================ */

:root {
  --bg-0: #07070d;
  --bg-1: #0b0b14;
  --bg-2: #11111d;
  --panel: rgba(255, 255, 255, 0.045);
  --panel-strong: rgba(255, 255, 255, 0.08);
  --panel-solid: #141522;
  --panel-raised: #1a1b2b;

  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --line-hover: rgba(255, 255, 255, 0.26);

  --text: #f3f4ff;
  --text-muted: #9aa3c0;
  --text-faint: #6b7492;

  --accent: #8b5cf6;
  --accent-2: #6366f1;
  --accent-strong: #7c3aed;
  --accent-text: #c4b5fd;
  --accent-soft: rgba(139, 92, 246, 0.14);
  --accent-glow: rgba(124, 58, 237, 0.35);

  --ok: #34d399;
  --ok-soft: rgba(52, 211, 153, 0.14);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.14);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.14);

  /* Dateitypen */
  --c-image: #a78bfa;
  --c-video: #f472b6;
  --c-audio: #34d399;
  --c-document: #60a5fa;
  --c-archive: #fbbf24;
  --c-code: #22d3ee;
  --c-other: #94a3b8;
  --c-folder: #8b5cf6;

  --font-ui: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-display: 'Space Grotesk', 'Segoe UI', system-ui, sans-serif;
  --font-mono: ui-monospace, 'JetBrains Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

  --radius-xl: 22px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 9px;
  --shadow-panel: 0 10px 40px rgba(0, 0, 0, 0.35);
  --shadow-pop: 0 24px 70px rgba(0, 0, 0, 0.55);
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --speed: 0.2s;

  --sidebar-w: 248px;
  --topbar-h: 64px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  font-size: 15px;
  color: var(--text);
  line-height: 1.5;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(ellipse 55% 38% at 12% -8%, rgba(124, 58, 237, 0.16), transparent 70%),
    radial-gradient(ellipse 45% 32% at 96% 4%, rgba(99, 102, 241, 0.13), transparent 70%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(139, 92, 246, 0.45); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -0.02em; font-weight: 600; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.26); background-clip: content-box; }

.icon { width: 1.15em; height: 1.15em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.fill { fill: currentColor; }

/* ---------- Brand ---------- */

.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--text); text-decoration: none !important; }
.brand-mark { width: 2rem; height: 2rem; color: var(--accent); filter: drop-shadow(0 0 10px var(--accent-glow)); flex-shrink: 0; }
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-text small { color: var(--text-faint); font-size: .74rem; }

/* ---------- Panels ---------- */

.panel {
  background: linear-gradient(150deg, rgba(255,255,255,.055), rgba(255,255,255,.02) 70%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: .55rem 1rem;
  font: inherit; font-weight: 600; font-size: .9rem;
  cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed) var(--ease), border-color var(--speed) var(--ease), color var(--speed) var(--ease);
}
.btn:hover:not(:disabled) { background: rgba(255,255,255,.11); border-color: var(--line-hover); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  color: #fff; border-color: transparent;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  box-shadow: 0 4px 18px rgba(124,58,237,.28);
}
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%); filter: brightness(1.08); box-shadow: 0 8px 26px var(--accent-glow); border-color: transparent; }
.btn-danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(251,113,133,.3); }
.btn-danger:hover:not(:disabled) { background: rgba(251,113,133,.22); border-color: rgba(251,113,133,.5); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,.07); border-color: transparent; }
.btn-lg { padding: .8rem 1.4rem; font-size: 1rem; border-radius: var(--radius-md); }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-block { width: 100%; }
.icon-btn {
  display: inline-grid; place-items: center;
  width: 2.25rem; height: 2.25rem; padding: 0;
  border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-muted); cursor: pointer;
  transition: background var(--speed) var(--ease), color var(--speed) var(--ease), border-color var(--speed);
  position: relative;
}
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent-text); }
.icon-btn .icon { width: 1.15rem; height: 1.15rem; }

/* ---------- Forms ---------- */

.field { display: grid; gap: .4rem; }
.field > span, .field-label { font-size: .82rem; font-weight: 500; color: var(--text-muted); }
.field-hint { font-size: .78rem; color: var(--text-faint); }
.field-error { font-size: .8rem; color: var(--danger); min-height: 0; }
.input, .select, .textarea {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(0,0,0,.3);
  color: var(--text);
  font: inherit; font-size: .93rem;
  padding: .62rem .8rem;
  transition: border-color var(--speed) var(--ease), box-shadow var(--speed) var(--ease), background var(--speed);
}
.textarea { resize: vertical; min-height: 4.5rem; }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line-strong); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: rgba(0,0,0,.4); }
.input.invalid { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.select { appearance: none; padding-right: 2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239aa3c0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .6rem center; background-size: 1rem; }
.select option { background: var(--panel-solid); }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .input { padding-right: 2.6rem; }
.input-group .icon-btn { position: absolute; right: .2rem; width: 2rem; height: 2rem; }

.switch { position: relative; display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { width: 2.4rem; height: 1.35rem; border-radius: 999px; background: rgba(255,255,255,.14); position: relative; transition: background var(--speed) var(--ease); flex-shrink: 0; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: #fff; transition: transform var(--speed) var(--ease-out); box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.switch input:checked + .track { background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { transform: translateX(1.05rem); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

.checkbox { appearance: none; width: 1.1rem; height: 1.1rem; border-radius: 5px; border: 1.5px solid var(--line-hover); background: rgba(0,0,0,.35); cursor: pointer; display: inline-grid; place-items: center; transition: all var(--speed) var(--ease); flex-shrink: 0; margin: 0; }
.checkbox:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after { content: ''; width: .55rem; height: .3rem; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }

/* ---------- Badges / chips ---------- */

.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .55rem; border-radius: 999px; font-size: .74rem; font-weight: 600; background: rgba(255,255,255,.08); color: var(--text-muted); white-space: nowrap; }
.badge .icon { width: .85rem; height: .85rem; }
.badge.accent { background: var(--accent-soft); color: var(--accent-text); }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warning { background: var(--warning-soft); color: var(--warning); }

.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .38rem .75rem; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-muted); font: inherit; font-size: .84rem; font-weight: 500; cursor: pointer; white-space: nowrap; transition: all var(--speed) var(--ease); }
.chip:hover { color: var(--text); border-color: var(--line-hover); }
.chip.active { color: #fff; background: var(--accent-soft); border-color: rgba(139,92,246,.5); }
.chip .dot { width: .5rem; height: .5rem; border-radius: 50%; }

kbd { font-family: var(--font-mono); font-size: .72rem; padding: .1rem .38rem; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: rgba(255,255,255,.05); color: var(--text-muted); }

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

.toast-stack { position: fixed; left: 50%; bottom: calc(1.25rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 400; display: grid; gap: .5rem; justify-items: center; pointer-events: none; width: min(92vw, 460px); }
.toast { pointer-events: auto; display: flex; align-items: center; gap: .75rem; padding: .7rem .8rem .7rem 1rem; border-radius: var(--radius-md); background: var(--panel-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: .9rem; animation: toast-in .35s var(--ease-out); max-width: 100%; }
.toast.leaving { animation: toast-out .25s var(--ease) forwards; }
.toast .icon { width: 1.1rem; height: 1.1rem; }
.toast.ok .icon { color: var(--ok); }
.toast.error .icon { color: var(--danger); }
.toast.info .icon { color: var(--accent-text); }
.toast .toast-msg { flex: 1; min-width: 0; }
.toast .btn { padding: .3rem .65rem; font-size: .82rem; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Dialogs ---------- */

.dialog-backdrop { position: fixed; inset: 0; z-index: 300; background: rgba(4,4,10,.66); display: grid; place-items: center; padding: 1rem; animation: fade-in .2s var(--ease); }
.dialog { width: min(100%, 460px); max-height: calc(100vh - 2rem); overflow: auto; background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); animation: pop-in .28s var(--ease-out); }
.dialog.wide { width: min(100%, 640px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1.2rem 1.3rem .4rem; }
.dialog-head h2 { font-size: 1.15rem; }
.dialog-head p { color: var(--text-muted); font-size: .88rem; margin-top: .25rem; }
.dialog-body { padding: .8rem 1.3rem; display: grid; gap: .9rem; }
.dialog-foot { padding: .6rem 1.3rem 1.2rem; display: flex; justify-content: flex-end; gap: .6rem; flex-wrap: wrap; }
@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* ---------- Menus ---------- */

.menu { position: fixed; z-index: 350; min-width: 210px; padding: .35rem; background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-md); box-shadow: var(--shadow-pop); animation: menu-in .14s var(--ease-out); }
.menu button, .menu a { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .5rem .65rem; border: 0; border-radius: 7px; background: transparent; color: var(--text); font: inherit; font-size: .89rem; text-align: left; cursor: pointer; text-decoration: none !important; }
.menu button:hover, .menu a:hover, .menu button.focus { background: rgba(255,255,255,.08); }
.menu .icon { width: 1rem; height: 1rem; color: var(--text-muted); }
.menu .danger, .menu .danger .icon { color: var(--danger); }
.menu .sep { height: 1px; margin: .3rem .2rem; background: var(--line); }
.menu .menu-hint { margin-left: auto; color: var(--text-faint); font-size: .75rem; }
.menu-label { padding: .45rem .65rem .25rem; font-size: .72rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
@keyframes menu-in { from { opacity: 0; transform: scale(.96); } }

/* ---------- Spinner / skeleton ---------- */

.spinner { width: 1.1rem; height: 1.1rem; border-radius: 50%; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.08) 50%, rgba(255,255,255,.04) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

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

/* ============================================================
   Auth & Landing & Share (öffentliche Seiten)
   ============================================================ */

.public-shell { width: min(1120px, calc(100% - 2rem)); margin: 0 auto; padding: 1.4rem 0 3rem; }
.public-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .3rem 0 1rem; }
.public-top nav { display: flex; gap: .5rem; }

.auth-wrap { min-height: calc(100vh - 7rem); display: grid; place-items: center; padding: 1rem 0; }
.auth-card { width: min(100%, 420px); padding: 1.8rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-card .lead { color: var(--text-muted); margin: .35rem 0 1.4rem; font-size: .95rem; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem; padding: .3rem; border-radius: var(--radius-md); background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-bottom: 1.4rem; }
.auth-tabs a { text-align: center; padding: .5rem; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 600; font-size: .9rem; text-decoration: none; }
.auth-tabs a.active { background: var(--panel-strong); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.auth-form { display: grid; gap: 1rem; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; font-size: .88rem; color: var(--text-muted); }
.form-alert { padding: .65rem .85rem; border-radius: var(--radius-sm); font-size: .88rem; background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(251,113,133,.25); }
.form-alert.info { background: var(--accent-soft); color: var(--accent-text); border-color: rgba(139,92,246,.3); }
.pw-meter { height: 4px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.pw-meter span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .3s var(--ease), background .3s; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3rem; align-items: center; padding: 4rem 0 3rem; }
.hero-eyebrow { display: inline-flex; align-items: center; gap: .5rem; padding: .3rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); font-size: .82rem; font-weight: 600; border: 1px solid rgba(139,92,246,.3); }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); line-height: 1.05; margin: 1rem 0; letter-spacing: -0.035em; }
.hero h1 .grad { background: linear-gradient(135deg, #c4b5fd, var(--accent) 45%, var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-muted); font-size: 1.12rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .75rem; margin-top: 1.8rem; flex-wrap: wrap; }
.hero-visual { position: relative; padding: 1rem; }
.mock { padding: 1rem; border-radius: var(--radius-xl); }
.mock-top { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.mock-dot { width: .6rem; height: .6rem; border-radius: 50%; background: rgba(255,255,255,.15); }
.mock-search { flex: 1; height: 2rem; border-radius: var(--radius-sm); background: rgba(0,0,0,.3); border: 1px solid var(--line); margin-left: .5rem; display: flex; align-items: center; padding: 0 .7rem; color: var(--text-faint); font-size: .8rem; gap: .4rem; }
.mock-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.mock-tile { aspect-ratio: 1 / .9; border-radius: var(--radius-md); background: rgba(255,255,255,.04); border: 1px solid var(--line); display: grid; place-items: center; position: relative; overflow: hidden; }
.mock-tile .icon { width: 1.8rem; height: 1.8rem; }
.mock-tile span { position: absolute; left: .5rem; bottom: .4rem; font-size: .7rem; color: var(--text-muted); }
.mock-float { position: absolute; padding: .7rem .9rem; border-radius: var(--radius-md); background: var(--panel-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); font-size: .82rem; display: flex; align-items: center; gap: .6rem; }
.mock-float.a { right: -1rem; top: 2.5rem; }
.mock-float.b { left: -1.2rem; bottom: 1.5rem; }
.mock-progress { width: 7rem; height: 4px; border-radius: 999px; background: rgba(255,255,255,.1); overflow: hidden; }
.mock-progress span { display: block; height: 100%; width: 68%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1.5rem; }
.feature { padding: 1.3rem; }
.feature .f-icon { width: 2.6rem; height: 2.6rem; border-radius: var(--radius-md); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: .9rem; }
.feature h3 { font-size: 1.02rem; margin-bottom: .35rem; }
.feature p { color: var(--text-muted); font-size: .92rem; }
.site-foot { margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line); color: var(--text-faint); font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* Share page */
.share-wrap { display: grid; place-items: center; min-height: calc(100vh - 8rem); padding: 1rem 0; }
.share-card { width: min(100%, 760px); overflow: hidden; }
.share-preview { background: rgba(0,0,0,.35); display: grid; place-items: center; min-height: 220px; max-height: 62vh; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.share-preview img, .share-preview video { max-width: 100%; max-height: 62vh; object-fit: contain; }
.share-preview audio { width: min(90%, 480px); margin: 3rem 0; }
.share-preview iframe { width: 100%; height: 62vh; border: 0; background: #fff; }
.share-preview pre { width: 100%; max-height: 62vh; margin: 0; overflow: auto; padding: 1.2rem; font-family: var(--font-mono); font-size: .82rem; line-height: 1.6; color: #d6d9f0; text-align: left; white-space: pre; }
.share-preview .type-hero { width: 6rem; height: 6rem; border-radius: 26px; display: grid; place-items: center; }
.share-preview .type-hero .icon { width: 2.8rem; height: 2.8rem; }
.share-body { padding: 1.4rem 1.5rem 1.5rem; display: grid; gap: 1.1rem; }
.share-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.share-title h1 { font-size: 1.35rem; word-break: break-word; }
.share-meta { display: flex; gap: .5rem 1.2rem; flex-wrap: wrap; color: var(--text-muted); font-size: .88rem; margin-top: .35rem; }
.share-meta span { display: inline-flex; align-items: center; gap: .35rem; }
.share-meta .icon { width: .95rem; height: .95rem; }
.share-desc { color: var(--text-muted); white-space: pre-wrap; }
.share-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.lock-box { display: grid; gap: .8rem; padding: 1.2rem; border-radius: var(--radius-md); background: rgba(0,0,0,.25); border: 1px solid var(--line); }
.lock-box form { display: flex; gap: .6rem; flex-wrap: wrap; }
.lock-box .input { flex: 1; min-width: 12rem; }
.state-card { width: min(100%, 440px); padding: 2.2rem 1.8rem; text-align: center; display: grid; gap: .8rem; justify-items: center; }
.state-card .state-icon { width: 4rem; height: 4rem; border-radius: 20px; display: grid; place-items: center; background: var(--danger-soft); color: var(--danger); }
.state-card .state-icon .icon { width: 1.8rem; height: 1.8rem; }
.state-card p { color: var(--text-muted); }

/* ============================================================
   App (Drive)
   ============================================================ */

.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.inspector-open { grid-template-columns: var(--sidebar-w) minmax(0, 1fr) 380px; }
.app { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
/* In der App sitzen Toasts unten links, damit sie die Auswahlleiste nicht verdecken. */
.has-app .toast-stack { left: calc(var(--sidebar-w) + 1.4rem); transform: none; justify-items: start; }

/* Sidebar */
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem .9rem; border-right: 1px solid var(--line); background: rgba(8,8,14,.55); overflow-y: auto; }
.sidebar .brand { padding: .2rem .45rem .4rem; }
.new-btn { width: 100%; justify-content: flex-start; padding: .75rem 1rem; border-radius: var(--radius-md); font-size: .95rem; }
.new-btn .icon { width: 1.2rem; height: 1.2rem; }
.new-btn kbd { margin-left: auto; background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.25); color: #fff; }
.nav { display: grid; gap: .15rem; }
.nav-title { padding: .8rem .7rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--text-faint); }
.nav a { display: flex; align-items: center; gap: .75rem; padding: .55rem .7rem; border-radius: var(--radius-sm); color: var(--text-muted); font-weight: 500; font-size: .92rem; text-decoration: none; transition: background var(--speed) var(--ease), color var(--speed) var(--ease); position: relative; }
.nav a:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: #fff; }
.nav a.active::before { content: ''; position: absolute; left: -.9rem; top: 22%; bottom: 22%; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.nav a .icon { width: 1.1rem; height: 1.1rem; }
.nav a.active .icon { color: var(--accent-text); }
.nav a .count { margin-left: auto; font-size: .74rem; color: var(--text-faint); }
.nav a.drop-target { background: var(--accent-soft); outline: 1.5px dashed var(--accent); }

.storage { margin-top: auto; padding: .95rem; border-radius: var(--radius-md); background: rgba(255,255,255,.035); border: 1px solid var(--line); display: grid; gap: .55rem; }
.storage-head { display: flex; align-items: center; justify-content: space-between; font-size: .84rem; }
.storage-head strong { font-weight: 600; }
.storage-head span { color: var(--text-faint); font-size: .78rem; }
.storage-bar { height: 7px; border-radius: 999px; background: rgba(255,255,255,.08); display: flex; overflow: hidden; gap: 2px; }
.storage-bar span { height: 100%; transition: width .6s var(--ease-out); min-width: 0; }
.storage-legend { display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .72rem; color: var(--text-faint); }
.storage-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.storage-legend i { width: .45rem; height: .45rem; border-radius: 50%; display: inline-block; }
.storage.warn .storage-head span { color: var(--warning); }

/* Main column */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 50; height: var(--topbar-h); display: flex; align-items: center; gap: .75rem; padding: 0 1.4rem; background: rgba(9,9,16,.82); border-bottom: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.topbar .menu-toggle { display: none; }
.search { position: relative; flex: 1; max-width: 560px; }
.search .icon.lead { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.search .input { padding-left: 2.5rem; padding-right: 4.4rem; background: rgba(255,255,255,.05); border-radius: var(--radius-md); height: 2.6rem; }
.search .search-kbd { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); display: flex; gap: .2rem; pointer-events: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .3rem; }
.dot-badge { position: absolute; top: .3rem; right: .3rem; min-width: 1rem; height: 1rem; padding: 0 .25rem; border-radius: 999px; background: var(--danger); color: #fff; font-size: .62rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg-1); }
.avatar { width: 2.1rem; height: 2.1rem; border-radius: 50%; object-fit: cover; background: linear-gradient(135deg, var(--accent), var(--accent-2)); display: inline-grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; flex-shrink: 0; overflow: hidden; }
.avatar.sm { width: 1.7rem; height: 1.7rem; font-size: .72rem; }
.avatar.lg { width: 4.5rem; height: 4.5rem; font-size: 1.5rem; }
.avatar-btn { padding: 0; border: 2px solid transparent; border-radius: 50%; background: none; cursor: pointer; margin-left: .3rem; transition: border-color var(--speed); }
.avatar-btn:hover { border-color: var(--accent); }

.content { padding: 1.3rem 1.4rem 6rem; flex: 1; min-width: 0; }
.view-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.view-head h1 { font-size: 1.55rem; }
.view-sub { color: var(--text-muted); font-size: .9rem; margin-top: .2rem; }
.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .15rem; font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; }
.crumbs a, .crumbs span { color: var(--text-muted); text-decoration: none; padding: .1rem .35rem; border-radius: 8px; }
.crumbs a:hover { color: var(--text); background: rgba(255,255,255,.06); }
.crumbs a.drop-target { background: var(--accent-soft); outline: 1.5px dashed var(--accent); }
.crumbs .current { color: var(--text); }
.crumbs .icon { width: 1.1rem; height: 1.1rem; color: var(--text-faint); }
.view-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: .2rem; gap: .15rem; border-radius: var(--radius-sm); background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.segmented .icon-btn { width: 2rem; height: 2rem; }
.filters { display: flex; gap: .45rem; overflow-x: auto; padding-bottom: .2rem; margin-bottom: 1.1rem; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }

.section-label { display: flex; align-items: center; justify-content: space-between; margin: 1.2rem 0 .7rem; font-size: .78rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); }
.section-label:first-child { margin-top: 0; }

/* Folders */
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .7rem; }
.folder-card { display: flex; align-items: center; gap: .8rem; padding: .8rem .9rem; border-radius: var(--radius-md); background: rgba(255,255,255,.04); border: 1px solid var(--line); cursor: pointer; user-select: none; transition: background var(--speed) var(--ease), border-color var(--speed) var(--ease), transform var(--speed) var(--ease); position: relative; }
.folder-card:hover { background: rgba(255,255,255,.07); border-color: var(--line-strong); }
.folder-card.drop-target { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.02); }
.folder-card .f-ico { width: 2.4rem; height: 2.4rem; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--fc, var(--c-folder)) 18%, transparent); color: var(--fc, var(--c-folder)); flex-shrink: 0; }
.folder-card .f-ico .icon { width: 1.25rem; height: 1.25rem; }
.folder-card .f-name { font-weight: 600; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.folder-card .f-meta { font-size: .78rem; color: var(--text-faint); }
.folder-card .f-text { min-width: 0; flex: 1; }
.folder-card .icon-btn { width: 1.9rem; height: 1.9rem; opacity: 0; }
.folder-card:hover .icon-btn, .folder-card:focus-within .icon-btn { opacity: 1; }

/* File grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .85rem; }
.file-card { position: relative; display: flex; flex-direction: column; border-radius: var(--radius-md); background: rgba(255,255,255,.035); border: 1px solid var(--line); cursor: pointer; user-select: none; overflow: hidden; transition: border-color var(--speed) var(--ease), background var(--speed) var(--ease), transform var(--speed) var(--ease), box-shadow var(--speed) var(--ease); content-visibility: auto; contain-intrinsic-size: 220px; }
.file-card:hover { border-color: var(--line-strong); background: rgba(255,255,255,.06); transform: translateY(-2px); box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.file-card.selected { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.file-card.dragging { opacity: .45; }
.thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; position: relative; background: rgba(0,0,0,.25); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s var(--ease); }
.thumb img.loaded { opacity: 1; }
.thumb .type-icon { width: 3.2rem; height: 3.2rem; border-radius: 14px; display: grid; place-items: center; }
.thumb .type-icon .icon { width: 1.6rem; height: 1.6rem; }
.thumb .ext { position: absolute; bottom: .5rem; right: .5rem; font-size: .66rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; padding: .12rem .4rem; border-radius: 5px; background: rgba(0,0,0,.55); color: var(--text-muted); }
.thumb .play { position: absolute; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: rgba(0,0,0,.55); display: grid; place-items: center; color: #fff; backdrop-filter: blur(4px); }
.file-card .card-check { position: absolute; top: .55rem; left: .55rem; z-index: 2; opacity: 0; transition: opacity var(--speed); }
.file-card:hover .card-check, .file-card.selected .card-check, .selecting .file-card .card-check { opacity: 1; }
.file-card .card-fav { position: absolute; top: .45rem; right: .45rem; z-index: 2; color: var(--warning); filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.file-card .card-fav .icon { width: 1.05rem; height: 1.05rem; }
.card-info { display: flex; align-items: center; gap: .45rem; padding: .65rem .55rem .65rem .8rem; min-width: 0; }
.card-text { min-width: 0; flex: 1; }
.card-name { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-meta { font-size: .76rem; color: var(--text-faint); display: flex; gap: .4rem; align-items: center; overflow: hidden; white-space: nowrap; }
.card-meta .icon { width: .8rem; height: .8rem; }
.card-info .icon-btn { width: 1.9rem; height: 1.9rem; flex-shrink: 0; }

/* Type colours */
.t-image { background: color-mix(in srgb, var(--c-image) 16%, transparent); color: var(--c-image); }
.t-video { background: color-mix(in srgb, var(--c-video) 16%, transparent); color: var(--c-video); }
.t-audio { background: color-mix(in srgb, var(--c-audio) 16%, transparent); color: var(--c-audio); }
.t-document { background: color-mix(in srgb, var(--c-document) 16%, transparent); color: var(--c-document); }
.t-archive { background: color-mix(in srgb, var(--c-archive) 16%, transparent); color: var(--c-archive); }
.t-code { background: color-mix(in srgb, var(--c-code) 16%, transparent); color: var(--c-code); }
.t-other { background: color-mix(in srgb, var(--c-other) 16%, transparent); color: var(--c-other); }

/* File list */
.file-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; }
.file-table th { background: rgba(255,255,255,.02); text-align: left; font-size: .75rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--text-faint); padding: .65rem .75rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.file-table th button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: .3rem; }
.file-table th button:hover { color: var(--text); }
.file-table th .icon { width: .85rem; height: .85rem; }
.file-table td { padding: .55rem .75rem; border-bottom: 1px solid rgba(255,255,255,.05); white-space: nowrap; color: var(--text-muted); }
.file-table tbody tr { cursor: pointer; transition: background var(--speed); }
.file-table tbody tr:hover { background: rgba(255,255,255,.04); }
.file-table tbody tr.selected { background: var(--accent-soft); }
.file-table .col-check { width: 2.4rem; }
.file-table .col-name { width: 100%; max-width: 0; color: var(--text); }
.file-table .name-cell { display: flex; align-items: center; gap: .7rem; min-width: 0; }
.file-table .name-cell .mini { width: 2.1rem; height: 2.1rem; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; overflow: hidden; }
.file-table .name-cell .mini img { width: 100%; height: 100%; object-fit: cover; }
.file-table .name-cell .mini .icon { width: 1.05rem; height: 1.05rem; }
.file-table .name-cell .nm { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.file-table .name-cell .fav { color: var(--warning); }
.file-table .name-cell .fav .icon { width: .9rem; height: .9rem; }
.file-table .col-actions { width: 3rem; text-align: right; }
.file-table .icon-btn { width: 1.9rem; height: 1.9rem; }
.table-wrap { overflow-x: auto; border-radius: var(--radius-md); }

/* Empty state */
.empty { display: grid; justify-items: center; text-align: center; gap: .6rem; padding: 4rem 1rem; color: var(--text-muted); }
.empty-art { width: 7rem; height: 7rem; border-radius: 34px; display: grid; place-items: center; background: radial-gradient(circle at 30% 25%, rgba(139,92,246,.35), rgba(99,102,241,.08) 70%); border: 1px solid rgba(139,92,246,.25); color: var(--accent-text); margin-bottom: .6rem; box-shadow: 0 20px 60px rgba(124,58,237,.18); }
.empty-art .icon { width: 2.8rem; height: 2.8rem; stroke-width: 1.6; }
.empty h2 { font-size: 1.2rem; color: var(--text); }
.empty p { max-width: 26rem; font-size: .93rem; }
.empty .btn { margin-top: .6rem; }

.load-more { display: flex; justify-content: center; margin-top: 1.5rem; }

/* Selection bar */
.selection-bar { position: fixed; left: calc(50% + var(--sidebar-w) / 2); bottom: calc(1.3rem + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 120; display: flex; align-items: center; gap: .35rem; padding: .45rem .45rem .45rem 1rem; border-radius: 16px; background: var(--panel-raised); border: 1px solid var(--line-strong); box-shadow: var(--shadow-pop); animation: bar-in .3s var(--ease-out); max-width: calc(100vw - 2rem); }
.selection-bar .sel-count { font-weight: 600; font-size: .9rem; margin-right: .5rem; white-space: nowrap; }
.selection-bar .btn { padding: .45rem .75rem; font-size: .85rem; }
.selection-bar .divider { width: 1px; height: 1.4rem; background: var(--line-strong); margin: 0 .2rem; }
@keyframes bar-in { from { opacity: 0; transform: translate(-50%, 14px); } }

/* Drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; background: rgba(10,6,24,.72); backdrop-filter: blur(3px); animation: fade-in .15s; pointer-events: none; }
.drop-zone { width: min(560px, 88vw); padding: 3rem 2rem; border-radius: 28px; border: 2px dashed rgba(167,139,250,.7); background: rgba(139,92,246,.1); display: grid; justify-items: center; gap: .8rem; text-align: center; animation: drop-pulse 1.6s ease-in-out infinite; }
.drop-zone .icon { width: 3rem; height: 3rem; color: var(--accent-text); }
.drop-zone h2 { font-size: 1.4rem; }
.drop-zone p { color: var(--text-muted); }
@keyframes drop-pulse { 50% { border-color: rgba(167,139,250,1); box-shadow: 0 0 60px rgba(139,92,246,.3); } }

/* Upload tray */
.upload-tray { position: fixed; right: 1.2rem; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); z-index: 150; width: min(370px, calc(100vw - 2rem)); background: var(--panel-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-in .3s var(--ease-out); }
.tray-head { display: flex; align-items: center; gap: .6rem; padding: .8rem .8rem .8rem 1rem; border-bottom: 1px solid var(--line); }
.tray-head strong { flex: 1; font-size: .92rem; }
.tray-head .icon-btn { width: 1.9rem; height: 1.9rem; }
.tray-total { height: 3px; background: rgba(255,255,255,.06); }
.tray-total span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .25s; }
.tray-list { max-height: 280px; overflow-y: auto; padding: .35rem; }
.tray-list.collapsed { display: none; }
.tray-item { display: grid; grid-template-columns: auto 1fr auto; gap: .3rem .7rem; align-items: center; padding: .55rem .6rem; border-radius: var(--radius-sm); }
.tray-item .mini { width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; grid-row: span 2; }
.tray-item .mini .icon { width: 1rem; height: 1rem; }
.tray-item .tn { font-size: .85rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tray-item .ts { font-size: .74rem; color: var(--text-faint); grid-column: 2; }
.tray-item .ts.err { color: var(--danger); }
.tray-item .tstate { grid-row: span 2; grid-column: 3; display: grid; place-items: center; }
.tray-item .tstate .icon { width: 1.1rem; height: 1.1rem; }
.tray-item .bar { grid-column: 2; height: 3px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.tray-item .bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .2s; }
.tray-item.done .tstate { color: var(--ok); }
.tray-item.error .tstate { color: var(--danger); }

/* Inspector */
.inspector { position: sticky; top: 0; height: 100vh; overflow-y: auto; overflow-x: hidden; min-width: 0; border-left: 1px solid var(--line); background: rgba(10,10,18,.7); display: flex; flex-direction: column; animation: slide-in .3s var(--ease-out); }
@keyframes slide-in { from { opacity: 0; transform: translateX(24px); } }
.inspector > * { flex-shrink: 0; }
.insp-body, .insp-section { grid-template-columns: minmax(0, 1fr); }
.insp-body > *, .insp-section > * { min-width: 0; }
.insp-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: 0 .8rem 0 1.1rem; height: var(--topbar-h); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.insp-head h2 { font-size: .95rem; }
.insp-preview { margin: 1rem 1.1rem 0; border-radius: var(--radius-md); overflow: hidden; background: rgba(0,0,0,.3); aspect-ratio: 16 / 10; display: grid; place-items: center; border: 1px solid var(--line); cursor: zoom-in; }
.insp-preview img { width: 100%; height: 100%; object-fit: contain; }
.insp-preview .type-icon { width: 4rem; height: 4rem; border-radius: 18px; display: grid; place-items: center; }
.insp-preview .type-icon .icon { width: 2rem; height: 2rem; }
.insp-body { padding: 1rem 1.1rem 2rem; display: grid; gap: 1.2rem; }
.insp-name { font-family: var(--font-display); font-size: 1.1rem; font-weight: 600; word-break: break-word; border-radius: 6px; padding: .1rem .3rem; margin: 0 -.3rem; outline: none; }
.insp-name[contenteditable="true"]:hover { background: rgba(255,255,255,.05); }
.insp-name[contenteditable="true"]:focus { background: rgba(0,0,0,.3); box-shadow: 0 0 0 2px var(--accent-soft); }
.insp-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: .45rem; }
.insp-actions button { display: grid; justify-items: center; gap: .3rem; padding: .65rem .3rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text-muted); font: inherit; font-size: .74rem; font-weight: 500; cursor: pointer; transition: all var(--speed); }
.insp-actions button:hover { color: var(--text); background: rgba(255,255,255,.08); border-color: var(--line-strong); }
.insp-actions button.on { color: var(--warning); }
.insp-actions .icon { width: 1.1rem; height: 1.1rem; }
.insp-section { display: grid; gap: .65rem; }
.insp-section h3 { font-size: .74rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-ui); display: flex; align-items: center; justify-content: space-between; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .86rem; }
.kv dt { color: var(--text-faint); }
.kv dd { margin: 0; text-align: right; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-box { display: flex; align-items: center; gap: .4rem; padding: .3rem .3rem .3rem .75rem; border-radius: var(--radius-sm); background: rgba(0,0,0,.3); border: 1px solid var(--line); }
.link-box code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-mono); font-size: .78rem; color: var(--text-muted); }
.link-box .icon-btn { width: 1.9rem; height: 1.9rem; }
.share-opts { display: grid; gap: .7rem; padding: .85rem; border-radius: var(--radius-md); background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.share-opts .row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; font-size: .88rem; }
.share-opts .row > span { display: inline-flex; align-items: center; gap: .5rem; color: var(--text-muted); }
.share-opts .row .icon { width: 1rem; height: 1rem; }
.share-opts .input { padding: .45rem .6rem; font-size: .85rem; }
.share-opts .sub { display: grid; gap: .5rem; padding-left: 1.5rem; }
.people { display: grid; gap: .4rem; }
.person { display: flex; align-items: center; gap: .6rem; font-size: .88rem; }
.person > span:not(.avatar) { flex: 1; }
.person .avatar { flex: none; }
.person .icon-btn { width: 1.8rem; height: 1.8rem; }
.suggest { position: relative; }
.suggest-list { position: absolute; left: 0; right: 0; top: calc(100% + .3rem); z-index: 10; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 46px; }
.spark span { flex: 1; min-height: 2px; border-radius: 2px 2px 0 0; background: rgba(139,92,246,.35); transition: background var(--speed); }
.spark span.has { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.spark span:hover { background: var(--accent-text); }

/* Preview lightbox */
.lightbox { position: fixed; inset: 0; z-index: 280; background: rgba(3,3,8,.94); display: grid; grid-template-rows: auto 1fr; animation: fade-in .2s; }
.lb-top { display: flex; align-items: center; gap: .8rem; padding: .8rem 1rem; }
.lb-top .lb-title { flex: 1; min-width: 0; }
.lb-top .lb-title strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-top .lb-title small { color: var(--text-faint); }
.lb-stage { position: relative; display: grid; place-items: center; min-height: 0; padding: 0 4.5rem 1.5rem; }
.lb-stage img, .lb-stage video { max-width: 100%; max-height: calc(100vh - 6rem); object-fit: contain; border-radius: 8px; box-shadow: 0 30px 80px rgba(0,0,0,.6); animation: pop-in .25s var(--ease-out); }
.lb-stage audio { width: min(520px, 90vw); }
.lb-stage iframe { width: min(1100px, 100%); height: calc(100vh - 6rem); border: 0; border-radius: 8px; background: #fff; }
.lb-stage pre { width: min(1100px, 100%); max-height: calc(100vh - 6rem); overflow: auto; margin: 0; padding: 1.3rem; border-radius: var(--radius-md); background: #0d0d16; border: 1px solid var(--line); font-family: var(--font-mono); font-size: .84rem; line-height: 1.65; color: #d6d9f0; white-space: pre; tab-size: 4; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 3rem; height: 3rem; border-radius: 50%; border: 1px solid var(--line-strong); background: rgba(255,255,255,.06); color: var(--text); display: grid; place-items: center; cursor: pointer; transition: background var(--speed); }
.lb-nav:hover { background: rgba(255,255,255,.14); }
.lb-nav.prev { left: 1rem; }
.lb-nav.next { right: 1rem; }
.lb-fallback { display: grid; justify-items: center; gap: 1rem; text-align: center; color: var(--text-muted); }
.lb-fallback .type-icon { width: 6rem; height: 6rem; border-radius: 26px; display: grid; place-items: center; }
.lb-fallback .type-icon .icon { width: 2.8rem; height: 2.8rem; }

/* Command palette */
.palette-backdrop { position: fixed; inset: 0; z-index: 320; background: rgba(4,4,10,.6); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 1rem 1rem; animation: fade-in .15s; }
.palette { width: min(620px, 100%); background: var(--panel-solid); border: 1px solid var(--line-strong); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop), 0 0 0 1px rgba(139,92,246,.15); overflow: hidden; animation: pop-in .2s var(--ease-out); }
.palette-input { display: flex; align-items: center; gap: .75rem; padding: 1rem 1.15rem; border-bottom: 1px solid var(--line); }
.palette-input .icon { color: var(--accent-text); width: 1.25rem; height: 1.25rem; }
.palette-input input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 1.05rem; }
.palette-list { max-height: 52vh; overflow-y: auto; padding: .4rem; }
.palette-item { display: flex; align-items: center; gap: .75rem; padding: .6rem .75rem; border-radius: var(--radius-sm); cursor: pointer; font-size: .92rem; }
.palette-item.active { background: var(--accent-soft); }
.palette-item .p-ico { width: 2rem; height: 2rem; border-radius: 8px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: var(--text-muted); flex-shrink: 0; }
.palette-item .p-ico .icon { width: 1rem; height: 1rem; }
.palette-item .p-text { flex: 1; min-width: 0; }
.palette-item .p-text div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.palette-item .p-text small { color: var(--text-faint); font-size: .78rem; }
.palette-item kbd { margin-left: auto; }
.palette-group { padding: .6rem .75rem .3rem; font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--text-faint); }
.palette-foot { display: flex; gap: 1rem; padding: .6rem 1rem; border-top: 1px solid var(--line); font-size: .75rem; color: var(--text-faint); }
.palette-foot span { display: inline-flex; gap: .35rem; align-items: center; }

/* Notifications */
.notif-panel { width: 360px; max-width: calc(100vw - 1.5rem); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem; border-bottom: 1px solid var(--line); }
.notif-head strong { font-size: .95rem; }
.notif-list { max-height: 400px; overflow-y: auto; padding: .35rem; }
.notif { display: flex; gap: .75rem; padding: .65rem .7rem; border-radius: var(--radius-sm); cursor: pointer; position: relative; }
.notif:hover { background: rgba(255,255,255,.05); }
.notif.unread::after { content: ''; position: absolute; right: .7rem; top: 1rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); }
.notif p { font-size: .87rem; padding-right: 1rem; }
.notif small { color: var(--text-faint); font-size: .76rem; }
.notif-empty { padding: 2rem 1rem; text-align: center; color: var(--text-faint); font-size: .9rem; }

/* Settings & Admin */
.page-narrow { max-width: 760px; }
.card { padding: 1.3rem 1.4rem; margin-bottom: 1rem; }
.card h2 { font-size: 1.05rem; margin-bottom: .25rem; }
.card > p.sub { color: var(--text-muted); font-size: .88rem; margin-bottom: 1rem; }
.card-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.card-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1rem; }
.profile-row { display: flex; align-items: center; gap: 1.2rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.danger-zone { border-color: rgba(251,113,133,.3); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.stat { padding: 1rem 1.1rem; display: grid; gap: .2rem; align-content: start; }
.stat .s-label { font-size: .78rem; color: var(--text-faint); display: flex; align-items: center; gap: .4rem; }
.stat .s-label .icon { width: .95rem; height: .95rem; }
.stat .s-value { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; letter-spacing: -0.02em; }
.stat .s-sub { font-size: .78rem; color: var(--text-muted); }
.chart { display: grid; grid-template-columns: repeat(14, 1fr); gap: .35rem; align-items: end; height: 150px; padding-top: .5rem; }
.chart .col { display: grid; gap: 2px; align-items: end; height: 100%; grid-template-rows: 1fr auto; position: relative; }
.chart .bars { display: flex; gap: 2px; align-items: flex-end; height: 100%; }
.chart .bars span { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; }
.chart .bars .u { background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.chart .bars .d { background: rgba(52,211,153,.6); }
.chart .lbl { font-size: .66rem; color: var(--text-faint); text-align: center; }
.legend { display: flex; gap: 1rem; font-size: .8rem; color: var(--text-muted); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .6rem; height: .6rem; border-radius: 3px; display: inline-block; }
.tabs { display: flex; gap: .3rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--text-muted); font: inherit; font-weight: 600; font-size: .9rem; padding: .6rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); }
.user-cell { display: flex; align-items: center; gap: .65rem; }
.user-cell div { display: grid; line-height: 1.3; }
.user-cell small { color: var(--text-faint); font-size: .78rem; }
.usage-mini { width: 110px; height: 5px; border-radius: 999px; background: rgba(255,255,255,.08); overflow: hidden; }
.usage-mini span { display: block; height: 100%; background: var(--accent); }

.shortcut-grid { display: grid; grid-template-columns: 1fr auto; gap: .55rem 1.5rem; font-size: .9rem; }
.shortcut-grid span:nth-child(odd) { color: var(--text-muted); }
.shortcut-grid span:nth-child(even) { display: flex; gap: .25rem; justify-content: flex-end; }

.qr-box { display: grid; justify-items: center; gap: .8rem; }
.qr-box img { width: 220px; height: 220px; border-radius: var(--radius-md); background: #fff; padding: .3rem; }

/* Mobile */
.fab { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 1200px) {
  .app.inspector-open { grid-template-columns: var(--sidebar-w) 1fr; }
  .app.inspector-open .inspector { position: fixed; right: 0; top: 0; bottom: 0; width: min(400px, 100vw); z-index: 200; box-shadow: var(--shadow-pop); background: var(--panel-solid); }
}

@media (max-width: 860px) {
  :root { --topbar-h: 58px; }
  .app, .app.inspector-open { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(290px, 86vw); z-index: 220; transform: translateX(-102%); transition: transform .3s var(--ease-out); background: var(--panel-solid); }
  .app.nav-open .sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .app.nav-open .sidebar-backdrop { display: block; position: fixed; inset: 0; z-index: 210; background: rgba(0,0,0,.5); animation: fade-in .2s; }
  .topbar { padding: 0 .8rem; gap: .4rem; }
  .topbar .menu-toggle { display: inline-grid; }
  .search .search-kbd { display: none; }
  .search .input { padding-right: .8rem; }
  .content { padding: 1rem .9rem 7rem; }
  .crumbs { font-size: 1.25rem; }
  .view-head h1 { font-size: 1.3rem; }
  .file-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
  .folder-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .folder-card .icon-btn { opacity: 1; }
  .folder-card { padding: .65rem .7rem; gap: .6rem; }
  .folder-card .f-ico { width: 2.1rem; height: 2.1rem; }
  .file-card .card-check { opacity: 1; }
  .file-table .col-hide-sm { display: none; }
  .selection-bar { left: 50%; bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)); padding-left: .8rem; overflow-x: auto; }
  .selection-bar .btn span { display: none; }
  .fab { display: grid; place-items: center; position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 110; width: 3.6rem; height: 3.6rem; border-radius: 18px; border: 0; color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px var(--accent-glow); cursor: pointer; }
  .fab .icon { width: 1.5rem; height: 1.5rem; }
  .upload-tray { right: .5rem; left: .5rem; width: auto; bottom: calc(5.2rem + env(safe-area-inset-bottom, 0px)); }
  .lb-stage { padding: 0 .5rem 1rem; }
  .lb-nav { display: none; }
  .hero { grid-template-columns: 1fr; padding-top: 2rem; gap: 2rem; }
  .hero-visual { display: none; }
  .features { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .topbar-right .hide-sm { display: none; }
  .toast-stack, .has-app .toast-stack { left: 50%; transform: translateX(-50%); justify-items: center; bottom: calc(5.4rem + env(safe-area-inset-bottom, 0px)); }
}

@media (min-width: 861px) and (max-width: 1100px) {
  .features { grid-template-columns: 1fr 1fr; }
}
.insp-section h3 .badge { text-transform: none; letter-spacing: 0; }

@media (max-width: 520px) {
  .folder-grid { grid-template-columns: 1fr; gap: .5rem; }
}
.share-opts .note { padding-left: 1.5rem; font-size: .8rem; color: var(--text-faint); }
