@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/vendor/fonts/nunito-latin-wght-normal.woff2') format('woff2-variations');
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url('/vendor/fonts/nunito-latin-ext-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --bg: #f6f4ff;
  --ink: #1e2250;
  --ink-2: #3c4175;
  --muted: #6e7399;
  --card: #ffffff;
  --line: #e9e6fb;
  --primary: #6c5ce7;
  --primary-600: #5848d6;
  --primary-50: #efecff;
  --sky: #3fa9f5;
  --mint: #1fc9a0;
  --sun: #ffbe2e;
  --coral: #ff6b81;
  --pink: #f783ac;
  --orange: #ff922b;
  --grad: linear-gradient(135deg, #6c5ce7 0%, #3fa9f5 100%);
  --grad-warm: linear-gradient(135deg, #ff6b81 0%, #ffbe2e 100%);
  --grad-mint: linear-gradient(135deg, #1fc9a0 0%, #3fa9f5 100%);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 2px 8px rgba(76, 61, 180, 0.07);
  --shadow: 0 10px 30px rgba(76, 61, 180, 0.10);
  --shadow-lg: 0 24px 60px rgba(76, 61, 180, 0.18);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 268px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 500px at 8% -10%, #e5defe 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 0%, #d8f0ff 0%, transparent 55%),
    radial-gradient(900px 600px at 50% 120%, #ffe9ef 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
a { color: var(--primary); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid rgba(108, 92, 231, .45); outline-offset: 2px; border-radius: 10px; }

/* ---------- animated background ---------- */
.blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blobs i { position: absolute; border-radius: 50%; filter: blur(50px); opacity: .55; animation: float 22s ease-in-out infinite; }
.blobs i:nth-child(1) { width: 380px; height: 380px; background: #c9bcff; top: -80px; left: -60px; }
.blobs i:nth-child(2) { width: 320px; height: 320px; background: #a5dcff; top: 30%; right: -80px; animation-delay: -6s; animation-duration: 26s; }
.blobs i:nth-child(3) { width: 300px; height: 300px; background: #ffd0dc; bottom: -80px; left: 25%; animation-delay: -12s; }
.blobs i:nth-child(4) { width: 220px; height: 220px; background: #fff0b3; top: 55%; left: -60px; animation-delay: -3s; animation-duration: 30s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, 30px) scale(1.08); }
  66% { transform: translate(-30px, 50px) scale(.94); }
}

/* ---------- buttons ---------- */
.btn {
  --h: 44px;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--h); padding: 0 1.15rem;
  border: 0; border-radius: 14px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: .95rem; color: var(--ink);
  background: #fff; box-shadow: inset 0 0 0 2px var(--line);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s, opacity .18s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 2px #d7d2fa, var(--shadow-sm); }
.btn:active { transform: translateY(0) scale(.98); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { color: #fff; background: var(--grad); box-shadow: 0 8px 20px rgba(88, 72, 214, .32); }
.btn-primary:hover { box-shadow: 0 12px 26px rgba(88, 72, 214, .42); }
.btn-soft { background: var(--primary-50); color: var(--primary-600); box-shadow: none; }
.btn-soft:hover { background: #e4dfff; box-shadow: none; }
.btn-danger { background: #fff1f3; color: #d6336c; box-shadow: none; }
.btn-danger:hover { background: #ffe0e6; box-shadow: none; }
.btn-danger-solid { color: #fff; background: linear-gradient(135deg, #ff6b81, #f03e6e); box-shadow: 0 8px 20px rgba(240, 62, 110, .3); }
.btn-lg { --h: 52px; padding: 0 1.6rem; font-size: 1.05rem; border-radius: 16px; }
.btn-sm { --h: 36px; padding: 0 .85rem; font-size: .85rem; border-radius: 11px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0;
  border: 0; border-radius: 12px; cursor: pointer; color: var(--ink-2); background: transparent;
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--primary-50); color: var(--primary-600); transform: translateY(-1px); }
.icon-btn.danger:hover { background: #fff1f3; color: #d6336c; }
.icon-btn.active { background: var(--primary-50); color: var(--primary-600); }

/* ---------- forms ---------- */
.field { display: grid; gap: .4rem; margin-bottom: 1rem; }
.field > label, .field > .label { font-weight: 800; font-size: .88rem; color: var(--ink-2); }
.input, .select, textarea.input {
  width: 100%; min-height: 46px; padding: 0 1rem;
  font: inherit; font-weight: 600; color: var(--ink);
  background: #fbfaff; border: 2px solid var(--line); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input::placeholder { color: #aaa9c9; font-weight: 500; }
.input:hover, .select:hover { border-color: #d7d2fa; }
.input:focus, .select:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(108, 92, 231, .14); }
.select { appearance: none; padding-right: 2.4rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236e7399' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .9rem center; }
.input-group { position: relative; display: flex; gap: .5rem; align-items: center; }
.input-group .input { flex: 1; min-width: 0; }
.input-group .icon-btn { flex: none; }
.input-icon { position: relative; }
.input-icon > svg { position: absolute; left: 14px; top: 50%; width: 19px; height: 19px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon .input { padding-left: 2.7rem; }
.hint { font-size: .82rem; color: var(--muted); }
.error-text { color: #d6336c; font-weight: 700; font-size: .9rem; min-height: 1.3em; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .7rem; cursor: pointer; font-weight: 700; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 46px; height: 28px; border-radius: 99px; background: #d9d6f2; position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .25s var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid rgba(108, 92, 231, .45); outline-offset: 2px; }
.chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.chip { border: 2px solid var(--line); background: #fff; padding: .25rem .8rem; border-radius: 99px; font: inherit; font-weight: 800; font-size: .85rem; color: var(--ink-2); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- cards / pills ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; border: 1px solid rgba(233, 230, 251, .8); }
.pill { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .65rem; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--primary-50); color: var(--primary-600); white-space: nowrap; }
.pill svg { width: 13px; height: 13px; }
.pill.green { background: #dcfaf0; color: #0b8f6c; }
.pill.red { background: #ffe6eb; color: #d6336c; }
.pill.yellow { background: #fff3cf; color: #a66a00; }
.pill.gray { background: #eceaf6; color: #6e7399; }
.pill.sky { background: #e0f2ff; color: #1c7ed6; }

/* ---------- auth / centered pages ---------- */
.center-page { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.auth-card { width: min(440px, 100%); padding: 2.4rem 2rem 2rem; text-align: center; animation: pop .6s var(--ease) both; }
.auth-card form { text-align: left; margin-top: 1.5rem; }
.auth-card h1 { margin-top: 1rem; }
.auth-card .tagline { margin-top: .35rem; }
.big-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .5rem; animation: bob 3s ease-in-out infinite; }
.logo-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 20px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 14px 30px rgba(88, 72, 214, .35); animation: bob 3.5s ease-in-out infinite; }
.logo-mark svg { width: 32px; height: 32px; }
.logo-mark.sm { width: 42px; height: 42px; border-radius: 14px; animation: none; box-shadow: 0 8px 18px rgba(88, 72, 214, .3); }
.logo-mark.sm svg { width: 22px; height: 22px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-7px) rotate(2deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(20px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.doodles { position: fixed; inset: 0; z-index: -1; pointer-events: none; }
.doodles span { position: absolute; font-size: 2rem; opacity: .85; animation: bob 5s ease-in-out infinite; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; padding: 1.25rem 1rem; display: flex; flex-direction: column; gap: 1.25rem;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-right: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .75rem; padding: .25rem .5rem; font-weight: 900; font-size: 1.2rem; letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav { display: grid; gap: .3rem; }
.nav-title { margin: .8rem .75rem .2rem; font-size: .72rem; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #a3a1c6; }
.nav a {
  display: flex; align-items: center; gap: .75rem; padding: .7rem .9rem; border-radius: 14px;
  color: var(--ink-2); font-weight: 800; text-decoration: none; transition: background .15s, color .15s, transform .15s var(--ease);
}
.nav a svg { width: 20px; height: 20px; }
.nav a:hover { background: var(--primary-50); color: var(--primary-600); transform: translateX(3px); }
.nav a.active { background: var(--grad); color: #fff; box-shadow: 0 8px 18px rgba(88, 72, 214, .3); }
.sidebar .spacer { flex: 1; }
.user-chip { display: flex; align-items: center; gap: .7rem; padding: .6rem; border-radius: 16px; background: #fff; box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.user-chip .who { min-width: 0; flex: 1; line-height: 1.2; }
.user-chip .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .who small { display: block; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { --c: var(--primary); width: 40px; height: 40px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 900; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
.avatar.sm { width: 34px; height: 34px; border-radius: 11px; font-size: .85rem; }
.main { padding: 2rem clamp(1rem, 3vw, 2.75rem) 7rem; min-width: 0; max-width: 1280px; width: 100%; margin: 0 auto; }
.mobile-bar { display: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; animation: rise .5s var(--ease) both; }
.page-head p { margin-top: .3rem; }
.wave { display: inline-block; transform-origin: 70% 70%; animation: wave 2.4s ease-in-out infinite; }
@keyframes wave { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(14deg); } 20% { transform: rotate(-8deg); } 40% { transform: rotate(-4deg); } 50% { transform: rotate(10deg); } }

/* ---------- dropzone ---------- */
.dropzone {
  position: relative; display: grid; place-items: center; text-align: center; gap: .35rem;
  padding: 2.2rem 1.5rem; margin-bottom: 1.5rem; cursor: pointer; overflow: hidden;
  border-radius: 28px; border: 3px dashed #c4baf7;
  background: linear-gradient(135deg, rgba(239, 236, 255, .9), rgba(224, 242, 255, .9));
  transition: transform .25s var(--ease), border-color .2s, box-shadow .25s, background .25s;
  animation: rise .55s var(--ease) both;
}
.dropzone:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.dropzone.over { border-color: var(--primary); border-style: solid; transform: scale(1.015); box-shadow: 0 0 0 8px rgba(108, 92, 231, .16), var(--shadow-lg); background: linear-gradient(135deg, #e6e0ff, #d2ecff); }
.dropzone .dz-icon { width: 76px; height: 76px; border-radius: 26px; display: grid; place-items: center; color: #fff; background: var(--grad); box-shadow: 0 14px 28px rgba(88, 72, 214, .3); animation: bob 3.2s ease-in-out infinite; }
.dropzone.over .dz-icon { animation: none; transform: scale(1.15) rotate(-6deg); transition: transform .25s var(--ease); }
.dropzone .dz-icon svg { width: 38px; height: 38px; }
.dropzone h2 { margin-top: .5rem; }
.dropzone .sprinkle { position: absolute; font-size: 1.4rem; opacity: .7; animation: bob 4s ease-in-out infinite; pointer-events: none; }

/* ---------- toolbar ---------- */
.toolbar { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.1rem; }
.toolbar .search { flex: 1; min-width: 200px; max-width: 420px; }
.seg { display: inline-flex; padding: 4px; background: #fff; border-radius: 14px; border: 1px solid var(--line); }
.seg button { border: 0; background: transparent; width: 38px; height: 34px; border-radius: 10px; cursor: pointer; color: var(--muted); display: grid; place-items: center; transition: all .15s; }
.seg button svg { width: 18px; height: 18px; }
.seg button.on { background: var(--primary-50); color: var(--primary-600); }

/* ---------- files ---------- */
.files { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.file-card {
  --i: 0; position: relative; display: flex; flex-direction: column; gap: .75rem; padding: 1.1rem;
  background: #fff; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
  animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 35ms);
}
.file-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.file-card.fresh { animation: pop .6s var(--ease) both, glow 1.8s ease-out; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(108, 92, 231, .6); } 100% { box-shadow: 0 0 0 22px rgba(108, 92, 231, 0); } }
.file-icon { --c: #6c5ce7; --bgc: #efecff; width: 54px; height: 54px; border-radius: 18px; display: grid; place-items: center; color: var(--c); background: var(--bgc); flex: none; transition: transform .25s var(--ease); }
.file-card:hover .file-icon { transform: rotate(-6deg) scale(1.08); }
.file-icon svg { width: 26px; height: 26px; }
.file-icon.c-image { --c: #e64980; --bgc: #ffe3ee; }
.file-icon.c-video { --c: #f03e3e; --bgc: #ffe3e3; }
.file-icon.c-audio { --c: #e08a00; --bgc: #fff1cf; }
.file-icon.c-doc { --c: #1c7ed6; --bgc: #dcefff; }
.file-icon.c-sheet { --c: #0b9a73; --bgc: #d9f7ec; }
.file-icon.c-slide { --c: #e8590c; --bgc: #ffe8d6; }
.file-icon.c-archive { --c: #7048e8; --bgc: #ece5ff; }
.file-icon.c-code { --c: #3b5bdb; --bgc: #e0e7ff; }
.file-icon.c-other { --c: #5c6190; --bgc: #eceefb; }
.file-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .5rem; }
.file-info { min-width: 0; flex: 1; }
.file-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: .82rem; color: var(--muted); font-weight: 600; display: flex; flex-wrap: wrap; gap: .1rem .6rem; }
.file-actions { display: flex; gap: .15rem; margin: 0 -.35rem -.35rem; flex-wrap: wrap; }
.file-actions .btn { margin-right: auto; }
.files.list { grid-template-columns: 1fr; gap: .6rem; }
.files.list .file-card { flex-direction: row; align-items: center; padding: .7rem 1rem; border-radius: 18px; gap: 1rem; }
.files.list .file-top { flex: 1; min-width: 0; align-items: center; gap: 1rem; }
.files.list .file-icon { width: 44px; height: 44px; border-radius: 14px; }
.files.list .file-icon svg { width: 22px; height: 22px; }
.files.list .file-actions { margin: 0; flex-wrap: nowrap; }
.files.list .file-actions .btn { margin-right: .35rem; }
.files.list .file-card:hover { transform: translateX(3px); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); animation: rise .5s var(--ease) both; }
.empty .big-emoji { font-size: 4rem; }
.empty h3 { color: var(--ink); margin-bottom: .3rem; }
.skeleton { height: 150px; border-radius: 22px; background: linear-gradient(90deg, #efecff 25%, #f8f6ff 50%, #efecff 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- upload tray ---------- */
.tray { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 40; width: min(380px, calc(100vw - 2rem)); background: #fff; border-radius: 22px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); overflow: hidden; animation: pop .45s var(--ease) both; }
.tray-head { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem; background: var(--grad); color: #fff; font-weight: 900; }
.tray-head > svg { width: 22px; height: 22px; flex: none; }
.tray-head span { flex: 1; min-width: 0; }
.tray-head .icon-btn { color: #fff; width: 32px; height: 32px; }
.tray-head .icon-btn:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.tray-list { max-height: 320px; overflow: auto; padding: .4rem; }
.tray.collapsed .tray-list { display: none; }
.up-item { display: grid; grid-template-columns: 40px 1fr auto; gap: .2rem .7rem; align-items: center; padding: .6rem; border-radius: 14px; }
.up-item + .up-item { border-top: 1px dashed var(--line); }
.up-item .file-icon { width: 40px; height: 40px; border-radius: 13px; grid-row: span 2; }
.up-item .file-icon svg { width: 20px; height: 20px; }
.up-name { font-weight: 800; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-status { font-size: .78rem; font-weight: 700; color: var(--muted); grid-column: 2 / 3; }
.up-item.err .up-status { color: #d6336c; }
.up-item.ok .up-status { color: #0b8f6c; }
.progress { height: 10px; border-radius: 99px; background: #ece9fb; overflow: hidden; grid-column: 2 / 4; }
.progress > i { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--grad); transition: width .25s linear;
  background-image: linear-gradient(135deg, rgba(255,255,255,.28) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.28) 50%, rgba(255,255,255,.28) 75%, transparent 75%), var(--grad);
  background-size: 22px 22px, 100% 100%; animation: stripes 1s linear infinite; }
.up-item.ok .progress > i { background: var(--grad-mint); animation: none; background-image: var(--grad-mint); }
.up-item.err .progress > i { background: var(--grad-warm); animation: none; background-image: var(--grad-warm); }
@keyframes stripes { to { background-position: 22px 0, 0 0; } }
.up-actions { display: flex; }
.up-actions .icon-btn { width: 30px; height: 30px; }
.up-actions .icon-btn svg { width: 16px; height: 16px; }

/* ---------- modal / toast ---------- */
.backdrop { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(30, 34, 80, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: fade .2s ease both; overflow: auto; }
.backdrop.closing { animation: fade .15s ease reverse both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(520px, 100%); max-height: calc(100vh - 2rem); overflow: auto; background: #fff; border-radius: 26px; box-shadow: var(--shadow-lg); padding: 1.6rem; animation: pop .35s var(--ease) both; }
.modal.wide { width: min(640px, 100%); }
.modal-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.1rem; }
.modal-head h2 { flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.2rem; flex-wrap: wrap; }
.toasts { position: fixed; top: 1rem; left: 50%; transform: translateX(-50%); z-index: 90; display: grid; gap: .5rem; justify-items: center; pointer-events: none; width: min(460px, calc(100vw - 2rem)); }
.toast { display: flex; align-items: center; gap: .6rem; padding: .75rem 1.1rem; border-radius: 16px; background: var(--ink); color: #fff; font-weight: 700; box-shadow: var(--shadow-lg); animation: toast-in .4s var(--ease) both; pointer-events: auto; }
.toast svg { width: 20px; height: 20px; flex: none; }
.toast.ok svg { color: #63e6be; }
.toast.err { background: #c2255c; }
.toast.out { animation: toast-in .25s ease reverse both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-14px) scale(.95); } }
canvas.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 100; pointer-events: none; }

/* ---------- share modal ---------- */
.link-box { display: flex; gap: .5rem; align-items: center; padding: .5rem .5rem .5rem 1rem; background: #f1fff9; border: 2px solid #b8f0dc; border-radius: 16px; margin-top: .5rem; }
.link-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 700; color: #0b6e53; outline: none; }
.section-title { font-weight: 900; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: #a3a1c6; margin: 1.3rem 0 .5rem; }
.share-row { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-radius: 14px; background: #faf9ff; border: 1px solid var(--line); margin-bottom: .5rem; }
.share-row .grow { min-width: 0; }
.share-row .tags { display: flex; gap: .3rem; flex-wrap: wrap; margin-top: .15rem; }
.share-card { display: grid; grid-template-columns: auto 1fr auto; gap: .5rem 1rem; align-items: center; padding: 1rem 1.2rem; margin-bottom: .75rem; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.share-card .tags { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .3rem; }
.share-card .link-line { font-size: .85rem; color: var(--primary-600); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- admin ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1rem; }
.stat { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.stat .file-icon { width: 56px; height: 56px; border-radius: 18px; }
.stat b { display: block; font-size: 1.7rem; font-weight: 900; line-height: 1.1; }
.stat span { color: var(--muted); font-weight: 700; font-size: .88rem; }
.table-wrap { overflow-x: auto; padding: .5rem; }
table.table { width: 100%; border-collapse: collapse; min-width: 720px; }
.table th { text-align: left; font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: #a3a1c6; padding: .8rem 1rem; font-weight: 900; }
.table td { padding: .75rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: #faf9ff; }
.table .user-cell { display: flex; align-items: center; gap: .75rem; }
.table .user-cell b { display: block; line-height: 1.2; }
.table .actions { display: flex; justify-content: flex-end; }
.settings-grid { display: grid; gap: 1.25rem; max-width: 760px; }
.limit-preview { display: inline-flex; align-items: center; gap: .5rem; margin-top: .4rem; }
.note { display: flex; gap: .7rem; padding: .9rem 1rem; border-radius: 16px; background: #fff8e1; color: #7a5200; font-size: .9rem; font-weight: 600; }
.note svg { width: 20px; height: 20px; flex: none; margin-top: 2px; }
.admin-tab-note { margin-bottom: 1rem; }

/* ---------- public share page ---------- */
.share-card-page { width: min(520px, 100%); text-align: center; padding: 2.4rem 2rem; animation: pop .6s var(--ease) both; }
.share-card-page .file-icon { width: 96px; height: 96px; border-radius: 30px; margin: 0 auto 1.2rem; animation: bob 3.4s ease-in-out infinite; }
.share-card-page .file-icon svg { width: 46px; height: 46px; }
.share-card-page h1 { word-break: break-word; font-size: 1.5rem; }
.share-card-page .meta { margin: .6rem 0 1.5rem; display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.share-card-page form { text-align: left; margin-top: 1.2rem; }
.powered { margin-top: 1.5rem; font-size: .82rem; color: var(--muted); font-weight: 700; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 50; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); transform: translateX(-105%); transition: transform .3s var(--ease); background: rgba(255,255,255,.96); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; z-index: 45; background: rgba(30, 34, 80, .35); backdrop-filter: blur(3px); animation: fade .2s both; }
  .mobile-bar { display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 30; padding: .6rem 1rem; background: rgba(255,255,255,.8); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
  .mobile-bar .brand { padding: 0; font-size: 1.05rem; }
  .main { padding-top: 1.25rem; }
  .grid-2 { grid-template-columns: 1fr; }
  .share-card { grid-template-columns: auto 1fr; }
  .share-card .actions { grid-column: 1 / -1; justify-content: flex-end; }
  .files.list .file-card { flex-wrap: wrap; }
  .files.list .file-actions { width: 100%; justify-content: flex-end; }
  .tray { right: .5rem; bottom: .5rem; }
}

@media (max-width: 600px) {
  .dropzone .sprinkle { display: none; }
}

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