:root {
  color-scheme: light;
  --ink: #182033;
  --muted: #6d7890;
  --hairline: rgba(255, 255, 255, 0.58);
  --glass: rgba(255, 255, 255, 0.52);
  --glass-strong: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(54, 73, 112, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.84);
  --blue: #2076f4;
  --purple: #7762f3;
  --coral: #ff756f;
  --mint: #35bd99;
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: #eef4fb;
  color: var(--ink);
  font-family: "SF Pro Text", "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; inset: 0; z-index: -3; overflow: hidden; background: linear-gradient(135deg, #f5f9ff 0%, #e8f1ff 38%, #f7f1ff 72%, #fff8f3 100%); }
.orb { position: absolute; border-radius: 999px; filter: blur(2px); opacity: .62; animation: drift 16s ease-in-out infinite alternate; }
.orb-one { width: 52vw; height: 52vw; left: -14vw; top: -20vw; background: radial-gradient(circle at 55% 55%, rgba(111, 198, 255, .88), rgba(140, 165, 255, .28) 48%, transparent 72%); }
.orb-two { width: 47vw; height: 47vw; right: -12vw; top: 11vh; background: radial-gradient(circle at 45% 45%, rgba(255, 147, 172, .58), rgba(185, 139, 255, .25) 50%, transparent 72%); animation-delay: -6s; }
.orb-three { width: 44vw; height: 44vw; left: 31vw; bottom: -26vw; background: radial-gradient(circle at 50% 35%, rgba(100, 226, 196, .48), rgba(114, 196, 255, .2) 52%, transparent 72%); animation-delay: -10s; }
.grain { position: absolute; inset: 0; opacity: .15; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.16'/%3E%3C/svg%3E"); mix-blend-mode: soft-light; }
@keyframes drift { to { transform: translate3d(4vw, 3vh, 0) scale(1.08); } }

.liquid-card {
  border: 1px solid var(--hairline);
  background: linear-gradient(135deg, rgba(255,255,255,.72), rgba(255,255,255,.34));
  box-shadow: var(--shadow);
  backdrop-filter: blur(32px) saturate(160%);
  -webkit-backdrop-filter: blur(32px) saturate(160%);
}
.login-shell { display: grid; min-height: 100vh; place-items: center; padding: 28px; }
.login-card { position: relative; width: min(540px, 100%); padding: clamp(34px, 6vw, 64px); overflow: hidden; border-radius: 42px; }
.login-card::before { position: absolute; width: 210px; height: 210px; right: -70px; top: -90px; border-radius: 50%; background: radial-gradient(circle at 32% 32%, rgba(255,255,255,.95), rgba(123,198,255,.5) 35%, rgba(154,112,255,.22) 68%, transparent 70%); content: ""; }
.brand-mark { position: relative; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 13px; background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.3)); box-shadow: 0 8px 22px rgba(74,104,172,.2), inset 0 1px 1px white; }
.brand-mark span { position: absolute; border-radius: 50%; background: linear-gradient(135deg, #66c8ff, #8b72ff 55%, #ff8d91); }
.brand-mark span:first-child { width: 18px; height: 18px; left: 7px; top: 6px; }
.brand-mark span:last-child { width: 12px; height: 12px; right: 5px; bottom: 5px; box-shadow: 0 0 0 3px rgba(255,255,255,.58); }
.brand-mark.large { width: 52px; height: 52px; margin-bottom: 38px; border-radius: 18px; }
.brand-mark.large span:first-child { width: 25px; height: 25px; left: 10px; top: 9px; }
.brand-mark.large span:last-child { width: 17px; height: 17px; right: 8px; bottom: 7px; }
.overline { margin: 0 0 11px; color: #60708e; font-size: 11px; font-weight: 750; letter-spacing: .17em; }
.login-card h1 { margin: 0; max-width: 430px; font-size: clamp(34px, 6vw, 52px); line-height: 1.13; letter-spacing: -.04em; }
.login-intro { margin: 20px 0 38px; color: var(--muted); line-height: 1.75; }
.field { display: grid; gap: 8px; margin: 15px 0; }
.field > span { color: #59657b; font-size: 13px; font-weight: 650; }
.field input, .field textarea { width: 100%; border: 1px solid rgba(111,127,157,.16); border-radius: 17px; outline: none; background: rgba(255,255,255,.55); padding: 15px 17px; color: var(--ink); box-shadow: inset 0 1px 2px rgba(77,92,122,.07); transition: .2s ease; resize: vertical; }
.field input:focus, .field textarea:focus { border-color: rgba(50,118,241,.5); background: rgba(255,255,255,.82); box-shadow: 0 0 0 4px rgba(50,118,241,.1); }
.field small { color: var(--muted); }
.primary-button, .upload-button, .secondary-button, .ghost-button { border: 0; cursor: pointer; font-weight: 680; transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease; }
.primary-button { display: flex; width: 100%; align-items: center; justify-content: space-between; margin-top: 20px; padding: 16px 19px; border-radius: 18px; background: linear-gradient(135deg, #267df5, #745ff1); color: white; box-shadow: 0 14px 28px rgba(67,92,220,.28), inset 0 1px rgba(255,255,255,.35); }
.primary-button:hover, .upload-button:hover, .secondary-button:hover { transform: translateY(-2px); }
.primary-button:disabled { cursor: wait; opacity: .58; transform: none; }
.primary-button.compact { width: auto; min-width: 140px; justify-content: center; margin: 0; }
.form-error { min-height: 18px; margin: 8px 0 0; color: #cf3e52; font-size: 13px; }
.privacy-note { margin: 25px 0 0; color: #7b8498; font-size: 12px; text-align: center; }
.lock-icon { margin-right: 5px; color: var(--blue); }

.app-shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 18px; min-height: 100vh; padding: 18px; }
.sidebar { position: sticky; top: 18px; display: flex; height: calc(100vh - 36px); flex-direction: column; padding: 22px 14px; border-radius: 30px; }
.brand-row { display: flex; gap: 12px; align-items: center; padding: 3px 9px 25px; }
.brand-row strong, .brand-row small { display: block; }
.brand-row strong { font-size: 16px; letter-spacing: -.02em; }
.brand-row small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.sidebar nav { display: grid; gap: 5px; }
.nav-item { display: grid; grid-template-columns: 28px 1fr auto; width: 100%; align-items: center; padding: 11px 12px; border: 0; border-radius: 15px; background: transparent; cursor: pointer; color: #647087; text-align: left; transition: .18s ease; }
.nav-item:hover { background: rgba(255,255,255,.46); color: var(--ink); }
.nav-item.active { background: linear-gradient(135deg, rgba(255,255,255,.84), rgba(255,255,255,.5)); color: var(--blue); box-shadow: 0 7px 18px rgba(66,91,145,.1), inset 0 1px white; font-weight: 650; }
.nav-icon { color: currentColor; font-size: 17px; }
.nav-count { min-width: 23px; padding: 3px 7px; border-radius: 99px; background: rgba(39,119,244,.1); font-size: 11px; text-align: center; }
.sidebar-bottom { display: grid; gap: 8px; margin-top: auto; }
.profile-button { display: grid; grid-template-columns: 36px 1fr 10px; gap: 10px; align-items: center; padding: 10px; border: 0; border-top: 1px solid rgba(109,124,151,.12); background: transparent; cursor: pointer; text-align: left; }
.profile-button strong, .profile-button small { display: block; }
.profile-button strong { font-size: 13px; }
.profile-button small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.avatar { display: grid; width: 34px; height: 34px; place-items: center; border-radius: 12px; background: linear-gradient(135deg, #92dcff, #9a7df4); color: white; font-weight: 750; box-shadow: inset 0 1px rgba(255,255,255,.6); }
.chevron { color: var(--muted); }

.workspace { width: min(1280px, 100%); margin-inline: auto; padding: 2px 18px 50px; }
.topbar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: minmax(230px, 530px) auto; gap: 14px; justify-content: space-between; align-items: center; padding: 15px 0 12px; backdrop-filter: blur(18px); }
.search-box { display: flex; height: 48px; align-items: center; gap: 10px; padding: 0 15px; border-radius: 17px; box-shadow: 0 10px 30px rgba(52,69,108,.08), inset 0 1px white; }
.search-box svg { width: 19px; fill: none; stroke: #7d879a; stroke-width: 1.8; }
.search-box input { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: var(--ink); }
.search-box input::placeholder { color: #929bad; }
kbd { padding: 3px 7px; border: 1px solid rgba(108,123,150,.16); border-radius: 7px; background: rgba(255,255,255,.55); color: #8993a7; font: 11px inherit; }
.upload-button { display: inline-flex; height: 48px; align-items: center; gap: 7px; padding: 0 18px; border-radius: 17px; background: linear-gradient(135deg, #287ff7, #7160ee); color: white; box-shadow: 0 13px 25px rgba(67,87,213,.22), inset 0 1px rgba(255,255,255,.35); }
.upload-button span { font-size: 19px; font-weight: 350; }
.mobile-menu { display: none; }
.welcome { display: flex; align-items: flex-end; justify-content: space-between; padding: clamp(44px, 7vw, 92px) 5px 34px; }
.welcome h1 { margin: 0 0 8px; font-size: clamp(38px, 5.4vw, 68px); line-height: 1; letter-spacing: -.055em; }
.welcome > div > p:last-child { margin: 0; color: var(--muted); }
.date-chip { display: grid; min-width: 78px; height: 78px; place-items: center; align-content: center; border-radius: 25px; }
.date-chip span:first-child { font-size: 26px; font-weight: 720; line-height: 1; }
.date-chip span:last-child { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .17em; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 17px; border-radius: 23px; }
.stat-card strong, .stat-card span { display: block; }
.stat-card strong { font-size: 19px; letter-spacing: -.02em; }
.stat-card div span, .stat-card small { color: var(--muted); font-size: 11px; }
.stat-card small { align-self: end; }
.stat-icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 15px; color: white; font-size: 20px; box-shadow: inset 0 1px rgba(255,255,255,.45); }
.stat-icon.blue { background: linear-gradient(135deg, #55b8ff, #5d72ed); }
.stat-icon.coral { background: linear-gradient(135deg, #ffae82, #f66a89); }
.stat-icon.mint { background: linear-gradient(135deg, #62d8bd, #3ca7c7); }
.library-panel { min-height: 440px; padding: clamp(20px, 3vw, 32px); border-radius: 30px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 22px; }
.panel-head h2, .modal h2, .preview-modal h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; }
.view-toggle { display: flex; gap: 3px; padding: 4px; border-radius: 12px; background: rgba(103,119,149,.08); }
.view-toggle button { width: 34px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: #7d879b; cursor: pointer; }
.view-toggle button.active { background: rgba(255,255,255,.85); color: var(--blue); box-shadow: 0 3px 10px rgba(56,72,110,.1); }
.drop-zone { display: grid; min-height: 174px; place-items: center; align-content: center; border: 1px dashed rgba(73,111,178,.28); border-radius: 24px; background: linear-gradient(135deg, rgba(235,247,255,.48), rgba(248,240,255,.38)); cursor: pointer; transition: .2s ease; }
.drop-zone:hover, .drop-zone.dragging { border-color: rgba(41,119,244,.68); background: rgba(244,249,255,.7); transform: translateY(-2px); }
.drop-zone strong { margin-top: 11px; font-size: 14px; }
.drop-zone p { margin: 5px 0 0; color: var(--muted); font-size: 11px; }
.drop-orbit { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(175,215,255,.45)); box-shadow: 0 10px 25px rgba(69,106,173,.16), inset 0 1px white; color: var(--blue); font-size: 22px; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 13px; margin-top: 20px; }
.file-grid.list { grid-template-columns: 1fr; }
.file-card { position: relative; display: grid; min-width: 0; grid-template-columns: 45px 1fr; gap: 13px; align-items: center; padding: 14px; border: 1px solid rgba(255,255,255,.65); border-radius: 19px; background: rgba(255,255,255,.45); box-shadow: 0 10px 25px rgba(61,79,121,.07), inset 0 1px rgba(255,255,255,.9); cursor: pointer; transition: .18s ease; }
.file-card:hover { background: rgba(255,255,255,.72); transform: translateY(-3px); box-shadow: 0 17px 32px rgba(61,79,121,.12), inset 0 1px white; }
.file-icon { display: grid; width: 44px; height: 51px; place-items: center; border-radius: 10px 10px 13px 13px; background: linear-gradient(145deg, #fff, #d9e9ff); color: #367ced; font-size: 11px; font-weight: 800; text-transform: uppercase; box-shadow: 0 8px 15px rgba(65,92,143,.12); }
.file-icon.image { background: linear-gradient(145deg, #fff5ed, #ffd3c0); color: #e76b55; }
.file-icon.pdf { background: linear-gradient(145deg, #fff0f1, #ffc5cb); color: #e44258; }
.file-icon.audio, .file-icon.video { background: linear-gradient(145deg, #f4efff, #d6c8ff); color: #7557dc; }
.file-icon.archive { background: linear-gradient(145deg, #effbf6, #bfead8); color: #299273; }
.file-info { min-width: 0; }
.file-info strong { display: block; overflow: hidden; margin-right: 20px; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: flex; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 10px; }
.file-tags { overflow: hidden; margin-top: 5px; color: #667492; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.file-menu { position: absolute; top: 9px; right: 9px; display: grid; width: 27px; height: 27px; place-items: center; border: 0; border-radius: 9px; background: transparent; cursor: pointer; color: #7e899c; }
.file-menu:hover { background: rgba(108,124,153,.1); }
.empty-state { padding: 72px 20px 45px; text-align: center; }
.empty-state h3 { margin: 15px 0 6px; }
.empty-state p { margin: 0 0 20px; color: var(--muted); }
.empty-orb { display: grid; width: 58px; height: 58px; margin: auto; place-items: center; border-radius: 21px; background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(179,211,255,.5)); box-shadow: 0 14px 30px rgba(69,92,150,.16), inset 0 1px white; color: var(--purple); }
.secondary-button { padding: 11px 16px; border-radius: 13px; background: rgba(255,255,255,.72); color: var(--blue); box-shadow: 0 8px 17px rgba(57,81,135,.1); }

.modal-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 20px; background: rgba(45,55,78,.2); backdrop-filter: blur(14px); }
.modal { position: relative; width: min(520px, 100%); padding: 30px; border-radius: 30px; }
.close-button, .icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 0; border-radius: 50%; background: rgba(112,126,153,.1); color: #68758d; cursor: pointer; font-size: 22px; text-decoration: none; }
.close-button { position: absolute; top: 20px; right: 20px; }
.close-button.inline { position: static; }
.selected-files { display: grid; max-height: 150px; gap: 7px; overflow: auto; margin: 22px 0; }
.selected-file { display: flex; min-width: 0; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.5); font-size: 12px; }
.selected-file span:first-child { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; }
.selected-file span:last-child { color: var(--muted); }
.modal-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 22px; }
.ghost-button { padding: 12px 17px; border-radius: 14px; background: rgba(255,255,255,.46); color: #657188; }
.upload-progress { height: 5px; overflow: hidden; border-radius: 99px; background: rgba(99,115,145,.1); }
.upload-progress span { display: block; width: 35%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #4eafff, #8069f6); animation: loading 1s ease-in-out infinite alternate; }
@keyframes loading { to { transform: translateX(185%); } }
.preview-modal { width: min(1100px, 100%); height: min(82vh, 780px); padding: 22px; border-radius: 30px; }
.preview-modal header { display: flex; align-items: center; justify-content: space-between; padding: 0 4px 18px; }
.preview-modal header > div:last-child { display: flex; gap: 8px; }
.preview-stage { display: grid; height: calc(100% - 65px); place-items: center; overflow: hidden; border-radius: 21px; background: rgba(247,249,253,.72); }
.preview-stage iframe, .preview-stage img, .preview-stage video { width: 100%; height: 100%; border: 0; object-fit: contain; }
.preview-stage audio { width: min(600px, 90%); }
.preview-fallback { padding: 30px; text-align: center; }
.preview-fallback p { color: var(--muted); }
.toast { position: fixed; z-index: 80; right: 24px; bottom: 24px; max-width: 330px; padding: 13px 17px; border: 1px solid rgba(255,255,255,.7); border-radius: 15px; background: rgba(34,45,68,.82); color: white; box-shadow: 0 15px 35px rgba(31,42,67,.2); opacity: 0; pointer-events: none; transform: translateY(15px); backdrop-filter: blur(16px); transition: .25s ease; }
.toast.show { opacity: 1; transform: none; }

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; padding: 12px; }
  .sidebar { position: fixed; z-index: 30; top: 12px; bottom: 12px; left: 12px; width: 252px; height: auto; transform: translateX(calc(-100% - 24px)); transition: transform .25s ease; }
  .sidebar.open { transform: none; }
  .workspace { padding-inline: 5px; }
  .topbar { grid-template-columns: 44px minmax(0,1fr) auto; }
  .mobile-menu { display: grid; width: 44px; height: 44px; place-items: center; border: 1px solid var(--hairline); border-radius: 15px; background: rgba(255,255,255,.5); cursor: pointer; }
  .upload-button { width: 48px; justify-content: center; padding: 0; font-size: 0; }
  .upload-button span { font-size: 22px; }
  .stats-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .app-shell { padding: 8px; }
  .workspace { padding-bottom: 30px; }
  .topbar { grid-template-columns: 42px minmax(0,1fr) 44px; gap: 7px; }
  .search-box { padding-inline: 11px; }
  kbd { display: none; }
  .welcome { align-items: flex-start; padding: 42px 3px 27px; }
  .welcome h1 { font-size: 42px; }
  .welcome > div > p:last-child { max-width: 260px; font-size: 13px; line-height: 1.65; }
  .date-chip { min-width: 64px; height: 64px; border-radius: 21px; }
  .library-panel { padding: 17px; border-radius: 25px; }
  .drop-zone { min-height: 150px; padding: 15px; text-align: center; }
  .file-grid { grid-template-columns: 1fr; }
  .stat-card small { display: none; }
  .modal { padding: 25px 20px; border-radius: 26px; }
  .modal-actions { flex-direction: column-reverse; }
  .modal-actions button { width: 100%; }
  .preview-modal { height: 88vh; padding: 15px; }
  .toast { right: 14px; bottom: 14px; left: 14px; max-width: none; }
}

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