:root {
  --bg: #07070d;
  --bg-2: #0d0d18;
  --panel: rgba(22, 22, 38, 0.62);
  --panel-solid: #15151f;
  --panel-hover: rgba(40, 40, 64, 0.55);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #ecebf5;
  --muted: #9a98b3;
  --faint: #66647e;
  --accent: #7c5cff;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --grad: linear-gradient(135deg, var(--accent) 0%, #a855f7 45%, var(--accent-2) 100%);
  --danger: #ff5d7a;
  --success: #34d399;
  --warn: #fbbf24;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.7);
  --glow: 0 0 0 1px rgba(124, 92, 255, 0.4), 0 10px 40px -10px rgba(124, 92, 255, 0.55);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --font: "Inter", "SF Pro Display", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f3fb;
  --bg-2: #ebe9f7;
  --panel: rgba(255, 255, 255, 0.7);
  --panel-solid: #ffffff;
  --panel-hover: rgba(124, 92, 255, 0.08);
  --border: rgba(20, 16, 60, 0.08);
  --border-strong: rgba(20, 16, 60, 0.16);
  --text: #17152b;
  --muted: #5d5a78;
  --faint: #9592ad;
  --shadow: 0 20px 50px -24px rgba(40, 30, 120, 0.35);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(124, 92, 255, 0.4); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(140, 130, 200, 0.25); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(140, 130, 200, 0.45); }
svg.i { width: 18px; height: 18px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Animated background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.45;
  animation: float 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 46vw; height: 46vw; background: #6d4aff; top: -14vw; left: -10vw; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; background: #0ea5e9; bottom: -14vw; right: -8vw; animation-duration: 32s; animation-delay: -6s; }
.aurora span:nth-child(3) { width: 30vw; height: 30vw; background: #db2777; top: 40%; left: 45%; opacity: 0.22; animation-duration: 38s; animation-delay: -12s; }
:root[data-theme="light"] .aurora span { opacity: 0.25; }
.grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.035) 1px, transparent 1px);
  background-size: 3px 3px;
}
@keyframes float {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(8vw, 6vh) scale(1.15) rotate(40deg); }
  100% { transform: translate(-6vw, 10vh) scale(0.92) rotate(-30deg); }
}

/* ---------- Generic UI ---------- */
.glass {
  background: var(--panel);
  backdrop-filter: blur(22px) saturate(160%);
  -webkit-backdrop-filter: blur(22px) saturate(160%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel-hover); cursor: pointer;
  font-weight: 560; white-space: nowrap;
  transition: transform .25s var(--spring), background .2s, border-color .2s, box-shadow .3s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.btn:active { transform: translateY(0) scale(0.97); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.primary { background: var(--grad); background-size: 200% 200%; border-color: transparent; color: #fff; box-shadow: var(--glow); animation: gradmove 6s ease infinite; }
.btn.primary:hover { box-shadow: 0 0 0 1px rgba(124,92,255,.6), 0 14px 46px -8px rgba(124,92,255,.75); }
.btn.danger { background: rgba(255, 93, 122, 0.12); border-color: rgba(255, 93, 122, 0.35); color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-hover); }
.btn.icon { width: 40px; padding: 0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.sm.icon { width: 32px; padding: 0; }
.btn .ripple { position: absolute; border-radius: 50%; background: rgba(255,255,255,.35); transform: scale(0); animation: ripple .6s var(--ease); pointer-events: none; }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes gradmove { 0%,100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border); outline: none;
  transition: border-color .2s, box-shadow .25s, background .2s;
}
:root[data-theme="light"] .input { background: rgba(255,255,255,.8); }
textarea.input { height: auto; min-height: 80px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(124, 92, 255, 0.18); background: rgba(124,92,255,0.06); }
select.input { appearance: none; cursor: pointer; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 36px; }
select.input option { background: var(--panel-solid); }
label.field { display: grid; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 500; }
.row { display: flex; gap: 12px; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.grow { flex: 1; }
.hidden { display: none !important; }
.gradient-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: rgba(140,140,170,.3); cursor: pointer; transition: background .3s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .35s var(--spring); box-shadow: 0 2px 6px rgba(0,0,0,.3); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: rgba(124,92,255,.15); color: #b9a8ff; border: 1px solid rgba(124,92,255,.25); }
:root[data-theme="light"] .badge { color: #5b3df0; }
.badge.green { background: rgba(52,211,153,.12); color: var(--success); border-color: rgba(52,211,153,.25); }
.badge.red { background: rgba(255,93,122,.12); color: var(--danger); border-color: rgba(255,93,122,.25); }
.badge.cyan { background: rgba(34,211,238,.12); color: #67e8f9; border-color: rgba(34,211,238,.25); }
.badge.gray { background: rgba(150,150,180,.12); color: var(--muted); border-color: var(--border); }

/* ---------- Login ---------- */
.login-wrap { position: relative; z-index: 1; height: 100%; display: grid; place-items: center; padding: 20px; overflow: auto; }
.login-card { width: min(420px, 100%); padding: 40px 36px 34px; border-radius: 28px; animation: pop .8s var(--spring) both; }
.logo { display: flex; align-items: center; gap: 12px; font-weight: 750; font-size: 19px; letter-spacing: -.02em; }
.logo-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--grad); background-size: 200% 200%; animation: gradmove 5s ease infinite; display: grid; place-items: center; color: #fff; box-shadow: var(--glow); }
.logo-mark svg { width: 22px; height: 22px; }
.login-card h1 { font-size: 30px; letter-spacing: -.03em; margin: 30px 0 6px; line-height: 1.15; }
.login-card form { display: grid; gap: 16px; margin-top: 28px; }
.login-card .btn { height: 48px; font-size: 15px; margin-top: 6px; }
.form-error { color: var(--danger); font-size: 13px; min-height: 18px; text-align: center; }
.shake { animation: shake .45s var(--ease); }
.lock-hint { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; color: var(--faint); font-size: 12px; }
.lock-hint svg { width: 14px; height: 14px; }
@keyframes shake { 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- App shell ---------- */
.shell { position: relative; z-index: 1; display: grid; grid-template-columns: 268px 1fr; height: 100vh; }
.sidebar { margin: 14px 0 14px 14px; border-radius: 24px; padding: 20px 14px; display: flex; flex-direction: column; gap: 6px; overflow: hidden; animation: slideIn .7s var(--ease) both; }
.sidebar .logo { padding: 2px 8px 18px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 16px 12px 6px; font-weight: 650; }
.nav a, .ws-link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 520;
  transition: background .2s, color .2s, transform .25s var(--spring);
}
.nav a:hover, .ws-link:hover { background: var(--panel-hover); color: var(--text); transform: translateX(3px); }
.nav a.active, .ws-link.active { color: var(--text); background: linear-gradient(90deg, rgba(124,92,255,.22), rgba(124,92,255,.04)); }
.nav a.active::before, .ws-link.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--grad); }
.ws-list { overflow-y: auto; flex: 1; margin: 0 -6px; padding: 0 6px; }
.ws-dot { display: inline-block; vertical-align: middle; width: 10px; height: 10px; border-radius: 4px; background: var(--c, var(--accent)); box-shadow: 0 0 12px var(--c, var(--accent)); flex-shrink: 0; }
.ws-link span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.storage-box { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px solid var(--border); font-size: 12.5px; }
.bar { height: 7px; background: rgba(140,140,180,.15); border-radius: 9px; overflow: hidden; margin: 9px 0 6px; }
.bar > i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 9px; transition: width 1.2s var(--ease); }
.bar.warn > i { background: linear-gradient(90deg, var(--warn), var(--danger)); }
.user-box { display: flex; align-items: center; gap: 10px; padding: 10px 6px 0; border-top: 1px solid var(--border); margin-top: 8px; }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; color: #fff; background: var(--grad); flex-shrink: 0; font-size: 14px; }
.avatar.sm { width: 28px; height: 28px; border-radius: 9px; font-size: 12px; }
.user-box .meta { overflow: hidden; flex: 1; line-height: 1.25; }
.user-box .meta b, .user-box .meta small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-box small { color: var(--faint); font-size: 12px; }
@keyframes slideIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }

.main { overflow-y: auto; padding: 28px 36px 60px; position: relative; }
.page { animation: pageIn .55s var(--ease) both; max-width: 1400px; margin: 0 auto; }
@keyframes pageIn { from { opacity: 0; transform: translateY(14px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { margin: 0; font-size: 32px; letter-spacing: -.035em; line-height: 1.1; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.topbar-mobile { display: none; }

.fade-up { opacity: 0; animation: fadeUp .6s var(--ease) forwards; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Cards ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.card { border-radius: var(--radius); padding: 20px; position: relative; overflow: hidden; }
.ws-card { cursor: pointer; transition: transform .45s var(--spring), border-color .3s, box-shadow .4s; min-height: 160px; display: flex; flex-direction: column; }
.ws-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--c, #7c5cff) 22%, transparent), transparent 40%); opacity: 0; transition: opacity .4s; }
.ws-card:hover { transform: translateY(-6px); border-color: color-mix(in srgb, var(--c, #7c5cff) 50%, transparent); box-shadow: 0 24px 60px -24px color-mix(in srgb, var(--c, #7c5cff) 70%, transparent); }
.ws-card:hover::before { opacity: 1; }
.ws-card .ws-icon { width: 48px; height: 48px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, var(--c, #7c5cff), color-mix(in srgb, var(--c, #7c5cff) 45%, #22d3ee)); box-shadow: 0 10px 30px -10px var(--c, #7c5cff); position: relative; }
.ws-card .ws-icon svg { width: 24px; height: 24px; }
.ws-card h3 { margin: 16px 0 2px; font-size: 17px; letter-spacing: -.01em; position: relative; }
.ws-card .meta { color: var(--muted); font-size: 13px; position: relative; display: flex; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 14px; }
.ws-card .meta span { display: inline-flex; gap: 5px; align-items: center; }
.ws-card .meta svg { width: 14px; height: 14px; }
.ws-card .corner { position: absolute; top: 16px; right: 16px; }
.add-card { border: 1.5px dashed var(--border-strong); background: transparent; box-shadow: none; display: grid; place-items: center; color: var(--muted); cursor: pointer; min-height: 160px; transition: all .35s var(--ease); backdrop-filter: none; }
.add-card:hover { color: var(--text); border-color: var(--accent); background: rgba(124,92,255,.07); transform: translateY(-4px); }
.add-card .plus { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(124,92,255,.15); margin: 0 auto 10px; transition: transform .5s var(--spring); }
.add-card:hover .plus { transform: rotate(90deg) scale(1.1); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 38px 0 14px; font-size: 16px; font-weight: 650; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 8px; }
.stat { padding: 18px 20px; border-radius: var(--radius); }
.stat .label { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 8px; }
.stat .value { font-size: 28px; font-weight: 720; letter-spacing: -.03em; margin-top: 6px; }
.stat .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(124,92,255,.15); color: #b9a8ff; }
.stat:nth-child(2) .ico { background: rgba(34,211,238,.13); color: #67e8f9; }
.stat:nth-child(3) .ico { background: rgba(244,114,182,.13); color: #f9a8d4; }
.stat:nth-child(4) .ico { background: rgba(52,211,153,.13); color: #6ee7b7; }

.ring { --p: 0; width: 120px; height: 120px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-2) calc(var(--p) * 1%), rgba(140,140,180,.15) 0); position: relative; transition: --p 1.4s var(--ease); }
.ring::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: var(--panel-solid); }
.ring b { position: relative; z-index: 1; font-size: 22px; }
@property --p { syntax: '<number>'; inherits: false; initial-value: 0; }

/* ---------- File browser ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px; border-radius: 18px; margin-bottom: 16px; position: sticky; top: -28px; z-index: 5; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 40px; height: 40px; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(140,140,180,.1); border: 1px solid var(--border); }
.seg button { border: 0; background: transparent; height: 32px; width: 36px; border-radius: 9px; cursor: pointer; color: var(--muted); display: grid; place-items: center; transition: all .25s var(--ease); }
.seg button.on { background: var(--panel-solid); color: var(--text); box-shadow: 0 2px 10px rgba(0,0,0,.2); }

.crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 18px; font-size: 15px; }
.crumbs a { padding: 5px 10px; border-radius: 9px; color: var(--muted); transition: all .2s; }
.crumbs a:hover { background: var(--panel-hover); color: var(--text); }
.crumbs a:last-child { color: var(--text); font-weight: 650; }
.crumbs a.drop-target { background: rgba(124,92,255,.25); color: var(--text); }
.crumbs svg { width: 14px; height: 14px; color: var(--faint); }

.files.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 14px; }
.file {
  position: relative; border-radius: 16px; padding: 14px; cursor: pointer; user-select: none;
  background: var(--panel); border: 1px solid var(--border); backdrop-filter: blur(14px);
  transition: transform .35s var(--spring), border-color .2s, background .2s, box-shadow .3s;
}
.file:hover { transform: translateY(-4px); border-color: var(--border-strong); box-shadow: 0 16px 40px -18px rgba(0,0,0,.6); }
.file.selected { border-color: var(--accent); background: rgba(124,92,255,.14); box-shadow: var(--glow); }
.file.drop-target { border-color: var(--accent-2); background: rgba(34,211,238,.15); transform: scale(1.04); }
.file.dragging { opacity: .4; }
.file .thumb { height: 110px; border-radius: 12px; display: grid; place-items: center; background: rgba(140,140,180,.07); margin-bottom: 12px; overflow: hidden; position: relative; }
.file .thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .5s, transform .6s var(--ease); }
.file .thumb img.loaded { opacity: 1; }
.file:hover .thumb img { transform: scale(1.06); }
.file .thumb svg { width: 44px; height: 44px; stroke-width: 1.4; transition: transform .45s var(--spring); }
.file:hover .thumb svg { transform: scale(1.12) rotate(-4deg); }
.file .name { font-weight: 560; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sub { font-size: 12px; color: var(--faint); margin-top: 2px; }
.file .check { position: absolute; top: 10px; left: 10px; width: 22px; height: 22px; border-radius: 7px; border: 1.5px solid var(--border-strong); background: rgba(0,0,0,.35); display: grid; place-items: center; opacity: 0; transform: scale(.7); transition: all .25s var(--spring); z-index: 2; color: #fff; }
.file .check svg { width: 14px; height: 14px; stroke-width: 3; opacity: 0; }
.file:hover .check, .file.selected .check, .files.selecting .check { opacity: 1; transform: none; }
.file.selected .check { background: var(--accent); border-color: var(--accent); }
.file.selected .check svg { opacity: 1; }
.file .more { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity .2s; z-index: 2; }
.file:hover .more { opacity: 1; }

.t-folder { color: #a78bfa; } .t-image { color: #f472b6; } .t-video { color: #fb7185; } .t-audio { color: #fbbf24; }
.t-pdf { color: #f87171; } .t-doc { color: #60a5fa; } .t-sheet { color: #34d399; } .t-code { color: #22d3ee; }
.t-archive { color: #fdba74; } .t-file { color: #a1a1c2; }
.file .thumb.t-folder { background: rgba(167,139,250,.1); }

.files.list { display: flex; flex-direction: column; gap: 6px; }
.files.list .file { display: grid; grid-template-columns: 36px 1fr 140px 120px 40px; align-items: center; gap: 14px; padding: 8px 12px 8px 46px; border-radius: 12px; }
.files.list .file:hover { transform: translateX(4px); }
.files.list .file .thumb { height: 36px; width: 36px; margin: 0; border-radius: 10px; }
.files.list .file .thumb svg { width: 20px; height: 20px; }
.files.list .file .check { top: 50%; margin-top: -11px; left: 12px; }
.files.list .file .more { position: static; opacity: 1; }
.files.list .file .sub { margin: 0; }
.files.list .list-head { display: grid; grid-template-columns: 36px 1fr 140px 120px 40px; gap: 14px; padding: 0 12px 4px 46px; font-size: 12px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; }
.files.grid .list-head, .files.grid .col { display: none; }
.files.list .file > .info .sub { display: none; }
.col { font-size: 13px; color: var(--muted); }

.empty { text-align: center; padding: 70px 20px; color: var(--muted); animation: fadeUp .6s var(--ease); }
.empty .big { width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 30px; display: grid; place-items: center; background: rgba(124,92,255,.12); color: #a78bfa; animation: bob 4s ease-in-out infinite; }
.empty .big svg { width: 44px; height: 44px; stroke-width: 1.5; }
.empty h3 { color: var(--text); margin: 0 0 6px; font-size: 19px; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(3deg); } }

.skeleton { border-radius: 16px; height: 170px; background: linear-gradient(100deg, rgba(140,140,180,.06) 20%, rgba(140,140,180,.15) 40%, rgba(140,140,180,.06) 60%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* Selection bar */
.selbar { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, calc(100% + 60px)); visibility: hidden; z-index: 40; display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 20px; border-radius: 18px; transition: transform .5s var(--spring), visibility .5s; }
.selbar.show { transform: translate(-50%, 0); visibility: visible; }
.selbar b { margin-right: 10px; }

/* Drop overlay */
.dropzone { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(7,7,13,.6); backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.dropzone.show { opacity: 1; }
.dropzone .box { width: min(520px, 86vw); padding: 56px 30px; border-radius: 30px; text-align: center; border: 2px dashed var(--accent); background: rgba(124,92,255,.1); transform: scale(.9); transition: transform .4s var(--spring); animation: pulse 1.6s ease-in-out infinite; }
.dropzone.show .box { transform: scale(1); }
.dropzone .box svg { width: 60px; height: 60px; color: #b9a8ff; animation: bob 1.8s ease-in-out infinite; }
.dropzone h2 { margin: 16px 0 4px; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(124,92,255,.08), 0 0 80px rgba(124,92,255,.3); } }

/* Uploads panel */
.uploads { position: fixed; right: 22px; bottom: 22px; width: 360px; max-width: calc(100vw - 44px); z-index: 45; border-radius: 20px; overflow: hidden; transform: translateY(130%); transition: transform .5s var(--spring); }
.uploads.show { transform: none; }
.uploads header { display: flex; align-items: center; padding: 14px 16px; gap: 10px; border-bottom: 1px solid var(--border); font-weight: 650; }
.uploads .list { max-height: 260px; overflow-y: auto; padding: 8px; }
.up-item { padding: 8px 10px; border-radius: 12px; font-size: 13px; animation: fadeUp .4s var(--ease); }
.up-item .row { justify-content: space-between; }
.up-item .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 230px; }
.up-item .bar { margin: 6px 0 0; height: 5px; }
.up-item.done .bar > i { background: var(--success); }
.up-item.err .bar > i { background: var(--danger); width: 100% !important; }

/* Modal */
.modal-bg { position: fixed; inset: 0; z-index: 80; background: rgba(5,5,12,.55); backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; animation: fade .25s var(--ease); }
.modal-bg.closing { animation: fade .2s var(--ease) reverse forwards; }
.modal { width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 24px; padding: 26px; animation: modalIn .45s var(--spring); background: var(--panel-solid); }
.modal-bg.closing .modal { animation: modalOut .2s var(--ease) forwards; }
.modal.wide { width: min(980px, 100%); }
.modal h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.modal .desc { color: var(--muted); margin: 0 0 20px; }
.modal .body { display: grid; gap: 14px; }
.modal .actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
.modal .x { margin-left: auto; }
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(30px) scale(.94); } }
@keyframes modalOut { to { opacity: 0; transform: translateY(14px) scale(.96); } }

.preview-body { display: grid; place-items: center; min-height: 300px; max-height: 72vh; overflow: auto; border-radius: 16px; background: rgba(0,0,0,.25); }
.preview-body img, .preview-body video { max-width: 100%; max-height: 72vh; border-radius: 12px; animation: pop .5s var(--spring); }
.preview-body iframe { width: 100%; height: 72vh; border: 0; border-radius: 12px; background: #fff; }
.preview-body pre { width: 100%; margin: 0; padding: 20px; font: 13px/1.6 ui-monospace, "JetBrains Mono", Menlo, monospace; white-space: pre-wrap; word-break: break-word; align-self: start; }

.members { display: grid; gap: 8px; max-height: 320px; overflow-y: auto; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(140,140,180,.06); animation: fadeUp .4s var(--ease) both; }
.member .who { flex: 1; overflow: hidden; line-height: 1.3; }
.member .who b, .member .who small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member .who small { color: var(--faint); }
.member select.input { width: 120px; height: 34px; font-size: 13px; }

.tree { max-height: 360px; overflow-y: auto; display: grid; gap: 2px; }
.tree button { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: 0; background: transparent; padding: 9px 10px; border-radius: 10px; cursor: pointer; color: var(--muted); }
.tree button:hover { background: var(--panel-hover); color: var(--text); }
.tree button.on { background: rgba(124,92,255,.2); color: var(--text); }
.tree button:disabled { opacity: .35; pointer-events: none; }

.colors { display: flex; gap: 10px; flex-wrap: wrap; }
.colors button { width: 32px; height: 32px; border-radius: 10px; border: 2px solid transparent; background: var(--c); cursor: pointer; transition: transform .3s var(--spring); }
.colors button:hover { transform: scale(1.15); }
.colors button.on { border-color: var(--text); transform: scale(1.12); box-shadow: 0 0 18px var(--c); }

/* Context menu */
.ctx { position: fixed; z-index: 90; min-width: 210px; padding: 6px; border-radius: 16px; animation: ctxIn .2s var(--ease); transform-origin: top left; background: var(--panel-solid); }
.ctx button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; background: transparent; border-radius: 10px; cursor: pointer; text-align: left; font-size: 13.5px; transition: background .15s; }
.ctx button:hover { background: var(--panel-hover); }
.ctx button.danger { color: var(--danger); }
.ctx hr { border: 0; border-top: 1px solid var(--border); margin: 5px 4px; }
@keyframes ctxIn { from { opacity: 0; transform: scale(.92) translateY(-6px); } }

/* Toasts */
.toasts { position: fixed; top: 20px; right: 20px; z-index: 100; display: grid; gap: 10px; }
.toast { display: flex; gap: 12px; align-items: center; padding: 13px 16px; border-radius: 16px; min-width: 260px; max-width: 380px; animation: toastIn .5s var(--spring); background: var(--panel-solid); font-size: 13.5px; }
.toast.out { animation: toastOut .35s var(--ease) forwards; }
.toast .ti { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: rgba(52,211,153,.15); color: var(--success); }
.toast.error .ti { background: rgba(255,93,122,.15); color: var(--danger); }
.toast.info .ti { background: rgba(124,92,255,.15); color: #b9a8ff; }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(60px) scale(.95); } }

/* Tables (admin) */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; margin-bottom: 22px; flex-wrap: wrap; }
.tabs button { position: relative; border: 0; background: transparent; padding: 9px 16px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 560; display: inline-flex; gap: 8px; align-items: center; transition: color .2s, background .25s; }
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--grad); color: #fff; box-shadow: var(--glow); }
.table-wrap { border-radius: var(--radius); overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11.5px; color: var(--faint); text-transform: uppercase; letter-spacing: .08em; font-weight: 600; padding: 14px 16px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .2s; animation: fadeUp .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms); }
tbody tr:hover { background: var(--panel-hover); }
tbody tr:last-child td { border-bottom: 0; }
td .bar { width: 110px; margin: 4px 0 0; }
.who-cell { display: flex; align-items: center; gap: 10px; }
.who-cell b, .who-cell small { display: block; line-height: 1.3; }
.who-cell small { color: var(--faint); }
code.k { font: 12px ui-monospace, monospace; background: rgba(140,140,180,.12); padding: 2px 7px; border-radius: 6px; }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.chart .col-bar { flex: 1; background: var(--grad); border-radius: 6px 6px 3px 3px; min-height: 3px; height: 0; transition: height 1s var(--spring); position: relative; opacity: .85; }
.chart .col-bar:hover { opacity: 1; }
.chart .col-bar::after { content: attr(data-v); position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); opacity: 0; transition: opacity .2s; }
.chart .col-bar:hover::after { opacity: 1; }

.settings-grid { display: grid; gap: 16px; max-width: 760px; }
.setting { display: flex; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--radius); }
.setting .txt { flex: 1; }
.setting .txt b { display: block; }
.setting .txt small { color: var(--muted); }
.setting .input { width: 220px; }

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  body { overflow: auto; }
  .shell { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .sidebar { position: fixed; inset: 10px auto 10px 10px; width: 270px; z-index: 70; transform: translateX(-110%); transition: transform .45s var(--ease); animation: none; margin: 0; }
  .sidebar.open { transform: none; }
  .main { padding: 16px 16px 90px; overflow: visible; }
  .topbar-mobile { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
  .page-head h1 { font-size: 26px; }
  .files.list .file, .files.list .list-head { grid-template-columns: 36px 1fr 40px; }
  .files.list .col { display: none; }
  .files.list .file > .info .sub { display: block; }
  .files.grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
  .setting { flex-wrap: wrap; }
  .setting .input { width: 100%; }
  .toolbar { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Sharing & rights ---------- */
.share-add { display: flex; gap: 10px; flex-wrap: wrap; }
.share-add .input:first-child { min-width: 220px; flex: 1; }
.share-add select.input { width: 160px; }
.member-wrap { border-radius: 14px; background: rgba(140,140,180,.06); border: 1px solid transparent; transition: border-color .25s; }
.member-wrap:hover { border-color: var(--border); }
.member-wrap .member { background: transparent; animation: none; }
.member .who small.caps { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.member select.input { width: 140px; }
.rights { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; padding: 4px 14px 14px 52px; animation: fadeUp .35s var(--ease); }
.rights .right { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.rights .right .switch { transform: scale(.82); transform-origin: left center; margin-right: -6px; }
.pub-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 16px; background: rgba(140,140,180,.06); border: 1px solid var(--border); transition: all .4s var(--ease); flex-wrap: wrap; }
.pub-box.on { background: linear-gradient(135deg, rgba(52,211,153,.12), rgba(34,211,238,.06)); border-color: rgba(52,211,153,.3); }
.pub-box .pub-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(140,140,180,.12); color: var(--muted); transition: all .4s var(--ease); }
.pub-box.on .pub-ico { background: rgba(52,211,153,.18); color: var(--success); animation: spinGlobe 8s linear infinite; }
.pub-box small { display: block; color: var(--muted); font-size: 12.5px; }
.pub-box select.input { width: 170px; height: 36px; font-size: 13px; }
.ws-card .meta .pub-tag { color: var(--success); }
@keyframes spinGlobe { 50% { box-shadow: 0 0 22px rgba(52,211,153,.35); } }
@media (max-width: 880px) { .rights { grid-template-columns: 1fr; padding-left: 14px; } .member { flex-wrap: wrap; } }
.modal.mid { width: min(640px, 100%); }
#shBody { display: grid; gap: 14px; }

/* ---------- Public (anonymous) pages ---------- */
body.pub { overflow: auto; }
.pub-top { position: sticky; top: 14px; z-index: 20; margin: 14px auto 0; max-width: 1400px; width: calc(100% - 28px); border-radius: 20px; padding: 10px 12px 10px 16px; display: flex; align-items: center; gap: 12px; animation: pageIn .6s var(--ease) both; }
.pub-top .logo { font-size: 17px; }
.pub-top .logo-mark { width: 34px; height: 34px; border-radius: 10px; }
.pub-main { position: relative; z-index: 1; padding: 34px 28px 80px; }
.pub-main .toolbar { top: 86px; }
.pub .files.list .file { padding-left: 12px; }
.pub .files.list .list-head { padding-left: 12px; }
.pub .files.grid .file .more { opacity: 0; }
.pub .files.grid .file:hover .more { opacity: 1; }
.pub-hero h1 { font-size: 40px; }
a.ws-card { color: inherit; }
.explore-link { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; padding: 12px; border-radius: 14px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 13.5px; transition: all .3s var(--ease); }
.explore-link:hover { color: var(--text); border-color: var(--success); background: rgba(52,211,153,.07); transform: translateY(-2px); }
.explore-link svg { width: 16px; height: 16px; color: var(--success); }
.web-opts { flex-basis: 100%; display: grid; gap: 12px; padding-top: 6px; animation: fadeUp .35s var(--ease); }
.web-opts .row { flex-wrap: wrap; }
.web-opts .input { height: 38px; font: 12.5px ui-monospace, Menlo, monospace; }
.web-opts .opt { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.web-opts .opt .switch { transform: scale(.82); transform-origin: left center; margin-right: -6px; }
.pub-box.web.on { background: linear-gradient(135deg, rgba(34,211,238,.12), rgba(124,92,255,.08)); border-color: rgba(34,211,238,.35); }
.pub-box.web.on .pub-ico { background: rgba(34,211,238,.18); color: var(--accent-2); }
.ws-card .meta .web-tag { color: var(--accent-2); }
@media (max-width: 880px) { .pub-main { padding: 22px 16px 80px; } .pub-hero h1 { font-size: 30px; } .pub-top .badge { display: none; } }
