:root {
  --ink-950: #0b1020;
  --ink-900: #11182a;
  --ink-800: #1b2539;
  --ink-700: #334057;
  --ink-600: #526078;
  --ink-500: #718096;
  --ink-400: #94a0b2;
  --ink-300: #bdc5d1;
  --ink-200: #dce1e8;
  --ink-150: #e8ebf0;
  --ink-100: #f1f3f6;
  --ink-50: #f7f8fa;
  --paper: #ffffff;
  --accent-700: #214ac9;
  --accent-600: #2f5be7;
  --accent-500: #476ff0;
  --accent-100: #e8edff;
  --accent-50: #f3f6ff;
  --aqua-500: #36c6bb;
  --gold-500: #d8aa5c;
  --danger-600: #ce3d4d;
  --danger-100: #ffeaed;
  --success-600: #198867;
  --success-100: #dcf7ee;
  --shadow-xs: 0 1px 2px rgb(17 24 39 / 5%);
  --shadow-sm: 0 5px 20px rgb(18 29 51 / 7%);
  --shadow-md: 0 18px 48px rgb(18 29 51 / 12%);
  --shadow-lg: 0 30px 80px rgb(5 12 28 / 20%);
  --radius-sm: 9px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --ease: cubic-bezier(.2, .75, .2, 1);
  font-family: "Segoe UI Variable", "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink-900);
  background: var(--ink-50);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body { min-height: 100vh; min-height: 100dvh; overflow: hidden; background: var(--ink-50); }
button, input, select { font: inherit; }
button { color: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
button:not(:disabled), select:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
[hidden] { display: none !important; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-sprite { position: fixed; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

:focus-visible { outline: 3px solid rgb(71 111 240 / 34%); outline-offset: 2px; }
::selection { background: var(--accent-100); color: var(--accent-700); }

.boot-screen {
  position: fixed; inset: 0; z-index: 1000; display: grid; place-content: center; justify-items: center; gap: 20px;
  color: var(--ink-600); background: var(--paper); font-size: 13px; font-weight: 600; letter-spacing: .02em;
}
.boot-mark { width: 58px; height: 58px; display: grid; place-items: center; border-radius: 17px; color: white; background: linear-gradient(145deg, var(--accent-500), #2447be); box-shadow: 0 16px 38px rgb(47 91 231 / 30%); }
.boot-mark svg { width: 31px; height: 31px; stroke-width: 1.8; }
.boot-pulse { position: absolute; width: 78px; height: 78px; margin-top: -37px; border: 1px solid rgb(47 91 231 / 24%); border-radius: 24px; animation: bootPulse 1.7s infinite var(--ease); }
@keyframes bootPulse { 0% { transform: scale(.76); opacity: 0; } 35% { opacity: 1; } 100% { transform: scale(1.2); opacity: 0; } }

/* Authentication */
.auth-screen { position: fixed; inset: 0; z-index: 900; display: grid; grid-template-columns: minmax(420px, 1.18fr) minmax(440px, .82fr); overflow: hidden; background: var(--paper); }
.auth-story { position: relative; display: flex; flex-direction: column; padding: clamp(34px, 5vw, 72px); color: white; overflow: hidden; isolation: isolate; background: linear-gradient(145deg, #0d1528 0%, #15203a 55%, #1c3150 100%); }
.auth-story::before { content: ""; position: absolute; inset: 0; z-index: -2; opacity: .72; background-image: radial-gradient(circle at 70% 30%, rgb(69 115 220 / 26%), transparent 34%), linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px); background-size: auto, 54px 54px, 54px 54px; mask-image: linear-gradient(to bottom right, black, transparent 80%); }
.auth-story::after { content: ""; position: absolute; width: 510px; height: 510px; right: -280px; bottom: -260px; z-index: -1; border: 1px solid rgb(255 255 255 / 10%); border-radius: 50%; box-shadow: 0 0 0 76px rgb(255 255 255 / 2.5%), 0 0 0 152px rgb(255 255 255 / 1.5%); }
.auth-ambient { position: absolute; pointer-events: none; filter: blur(1px); border-radius: 999px; }
.auth-ambient-one { width: 230px; height: 230px; left: 38%; top: -145px; background: rgb(82 130 250 / 20%); box-shadow: 0 0 100px rgb(82 130 250 / 36%); }
.auth-ambient-two { width: 210px; height: 210px; left: 39%; bottom: -155px; z-index: 1; background: rgb(54 198 187 / 13%); box-shadow: 0 0 120px rgb(54 198 187 / 25%); }
.auth-brand, .brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; font-size: 19px; letter-spacing: -.025em; text-decoration: none; }
.auth-brand strong, .brand strong, .mobile-auth-brand strong { font-weight: 750; }
.brand-mark { flex: 0 0 auto; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; color: white; background: linear-gradient(145deg, var(--accent-500), var(--accent-700)); box-shadow: 0 8px 22px rgb(25 60 169 / 32%); }
.brand-mark svg { width: 23px; height: 23px; stroke-width: 1.8; }
.auth-brand .brand-mark { color: var(--ink-900); background: white; box-shadow: 0 10px 35px rgb(0 0 0 / 17%); }
.auth-copy { margin: auto 0; max-width: 640px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; line-height: 1; font-weight: 730; letter-spacing: .14em; text-transform: uppercase; }
.eyebrow svg { width: 15px; height: 15px; }
.auth-copy .eyebrow { color: #a8c2ff; }
.auth-copy h1 { margin: 24px 0 24px; max-width: 650px; font-size: clamp(51px, 6.2vw, 88px); line-height: .97; font-weight: 670; letter-spacing: -.062em; }
.auth-copy h1 em { color: #9fb9ff; font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.auth-copy p { max-width: 480px; margin: 0; color: #aebbd0; font-size: clamp(16px, 1.5vw, 20px); line-height: 1.62; letter-spacing: -.01em; }
.auth-trust { display: flex; align-items: center; gap: 13px; color: #8797ae; font-size: 12px; font-weight: 570; }
.auth-trust span { display: inline-flex; align-items: center; gap: 7px; }
.auth-trust svg { width: 15px; height: 15px; color: #7cd5ca; }
.trust-dot { width: 3px; height: 3px; border-radius: 50%; background: #66758c; }
.auth-panel { display: grid; place-items: center; padding: clamp(28px, 5vw, 80px); background: #fbfbfc; }
.login-card { width: min(100%, 400px); }
.mobile-auth-brand { display: none; align-items: center; gap: 11px; margin-bottom: 42px; font-size: 18px; }
.login-heading { margin-bottom: 34px; }
.login-heading .eyebrow { color: var(--accent-600); }
.login-heading h2 { margin: 13px 0 10px; font-size: clamp(29px, 3vw, 37px); line-height: 1.12; font-weight: 680; letter-spacing: -.045em; }
.login-heading p { margin: 0; color: var(--ink-500); font-size: 15px; line-height: 1.55; }
.field-label { display: block; margin: 0 0 9px; color: var(--ink-700); font-size: 12px; font-weight: 680; }
.password-field { position: relative; }
.password-field input, .text-input { width: 100%; height: 52px; border: 1px solid var(--ink-200); border-radius: 12px; padding: 0 49px 0 15px; color: var(--ink-900); background: white; box-shadow: var(--shadow-xs), inset 0 1px rgb(17 24 39 / 2%); outline: none; transition: border-color .18s, box-shadow .18s; }
.login-input { padding-right: 15px; }
.password-label { margin-top: 17px; }
.password-field input::placeholder, .text-input::placeholder { color: var(--ink-400); }
.password-field input:focus, .text-input:focus { border-color: var(--accent-500); box-shadow: 0 0 0 4px rgb(71 111 240 / 11%); }
.field-action { position: absolute; top: 7px; right: 7px; }
.form-error { margin: 10px 0 0; color: var(--danger-600); font-size: 12px; line-height: 1.45; }
.login-card .button-large { width: 100%; margin-top: 17px; }
.login-note { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 20px 0 0; color: var(--ink-400); font-size: 11px; }
.login-note svg { width: 14px; height: 14px; }

/* Shared controls */
.button { min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 15px; border-radius: 10px; font-size: 13px; font-weight: 650; white-space: nowrap; transition: transform .15s var(--ease), background-color .15s, border-color .15s, box-shadow .15s; }
.button:active:not(:disabled) { transform: translateY(1px); }
.button svg { width: 17px; height: 17px; }
.button.is-busy { position: relative; }
.button.is-busy::before { content: ""; width: 14px; height: 14px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; opacity: .8; animation: spin .65s linear infinite; }
.button.is-busy > svg { display: none; }
.button-primary { color: white; background: linear-gradient(135deg, var(--accent-500), var(--accent-700)); box-shadow: 0 7px 17px rgb(47 91 231 / 20%); }
.button-primary:hover { background: linear-gradient(135deg, #547af2, #2852d2); box-shadow: 0 9px 20px rgb(47 91 231 / 27%); }
.button-secondary { color: var(--ink-700); border: 1px solid var(--ink-200); background: white; box-shadow: var(--shadow-xs); }
.button-secondary:hover { border-color: var(--ink-300); background: var(--ink-50); }
.button-danger { color: white; background: var(--danger-600); box-shadow: 0 7px 17px rgb(206 61 77 / 20%); }
.button-large { min-height: 52px; padding: 0 18px; border-radius: 12px; font-size: 14px; }
.button-large svg { margin-left: auto; }
.icon-button { width: 38px; height: 38px; display: inline-grid; place-items: center; padding: 0; border-radius: 10px; color: var(--ink-500); background: transparent; transition: color .15s, background-color .15s, transform .15s; }
.icon-button:hover { color: var(--ink-800); background: var(--ink-100); }
.icon-button:active { transform: scale(.96); }
.icon-button svg { width: 18px; height: 18px; }

/* Application shell */
.app-shell { width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-columns: 256px minmax(0, 1fr); overflow: hidden; background: var(--ink-50); }
.sidebar { position: relative; z-index: 30; min-width: 0; display: flex; flex-direction: column; gap: 0; padding: 23px 17px 17px; color: #d5dceb; overflow: hidden; background: radial-gradient(circle at 14% 4%, rgb(60 92 162 / 24%), transparent 30%), linear-gradient(165deg, #121b2f 0%, #0e1526 70%); box-shadow: 7px 0 28px rgb(16 23 39 / 6%); }
.sidebar::after { content: ""; position: absolute; width: 260px; height: 260px; left: -170px; bottom: -160px; border: 1px solid rgb(255 255 255 / 5%); border-radius: 50%; box-shadow: 0 0 0 55px rgb(255 255 255 / 1.5%), 0 0 0 110px rgb(255 255 255 / 1%); pointer-events: none; }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px; }
.brand { color: white; font-size: 17px; }
.sidebar-close { display: none; color: #9facbf; }
.button-upload { width: 100%; margin: 31px 0 23px; min-height: 46px; justify-content: flex-start; padding: 0 16px; color: white; background: linear-gradient(135deg, #456fe9, #2b53cc); box-shadow: 0 11px 27px rgb(20 49 132 / 33%); }
.button-upload:hover { background: linear-gradient(135deg, #527af0, #315bda); }
.nav-list { display: grid; gap: 5px; }
.nav-item { position: relative; width: 100%; height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 13px; border-radius: 10px; color: #8998ae; font-size: 13px; font-weight: 590; text-align: left; background: transparent; transition: color .16s, background-color .16s; }
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: #dfe6f1; background: rgb(255 255 255 / 4.5%); }
.nav-item.is-active { color: white; background: rgb(255 255 255 / 8%); box-shadow: inset 0 0 0 1px rgb(255 255 255 / 3%); }
.nav-item.is-active::before { content: ""; position: absolute; left: -17px; width: 3px; height: 22px; border-radius: 0 4px 4px 0; background: #7192ff; box-shadow: 0 0 12px rgb(113 146 255 / 60%); }
.sidebar-spacer { flex: 1; min-height: 20px; }
.storage-card { position: relative; z-index: 1; padding: 14px; border: 1px solid rgb(255 255 255 / 6.5%); border-radius: 14px; background: rgb(255 255 255 / 4%); }
.storage-icon { float: left; width: 34px; height: 34px; display: grid; place-items: center; margin-right: 10px; border-radius: 10px; color: #9cb5ff; background: rgb(102 139 240 / 13%); }
.storage-icon svg { width: 17px; height: 17px; }
.storage-heading { min-width: 0; display: flex; flex-direction: column; }
.storage-heading strong { overflow: hidden; color: #e5eaf3; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.storage-heading span { color: #7f8ca0; font-size: 10px; }
.storage-track { height: 4px; margin: 14px 0 8px; overflow: hidden; border-radius: 4px; background: rgb(255 255 255 / 8%); clear: both; }
.storage-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #587ef1, #75cfc6); transition: width .5s var(--ease); }
.storage-card p { margin: 0; color: #758297; font-size: 9px; }
.sidebar-account { position: relative; z-index: 1; display: grid; grid-template-columns: 34px 1fr 34px; align-items: center; gap: 10px; margin-top: 14px; padding: 11px 8px 4px; border-top: 1px solid rgb(255 255 255 / 6%); }
.avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 11px; color: #f1f4fb; font-size: 12px; font-weight: 750; background: linear-gradient(145deg, #536987, #303f59); }
.account-copy { min-width: 0; display: flex; flex-direction: column; }
.account-copy strong { overflow: hidden; color: #d9e0ec; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.account-copy span { color: #6f7c90; font-size: 9px; }
.sidebar-account .icon-button { width: 34px; height: 34px; color: #78869a; }
.sidebar-account .icon-button:hover { color: white; background: rgb(255 255 255 / 6%); }
.sidebar-scrim { display: none; }

.workspace { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { flex: 0 0 70px; min-width: 0; display: flex; align-items: center; gap: 18px; padding: 0 30px; border-bottom: 1px solid var(--ink-150); background: rgb(255 255 255 / 89%); backdrop-filter: blur(18px); }
.menu-button { display: none; }
.search-wrap { position: relative; width: min(440px, 45vw); height: 40px; display: flex; align-items: center; }
.search-wrap > svg { position: absolute; left: 13px; width: 17px; height: 17px; color: var(--ink-400); pointer-events: none; }
.search-wrap input { width: 100%; height: 100%; padding: 0 58px 0 40px; border: 1px solid transparent; border-radius: 11px; outline: 0; color: var(--ink-800); background: var(--ink-100); transition: background .16s, border-color .16s, box-shadow .16s; }
.search-wrap input::placeholder { color: var(--ink-400); }
.search-wrap input:focus { border-color: var(--accent-500); background: white; box-shadow: 0 0 0 4px rgb(71 111 240 / 9%); }
.search-wrap kbd { position: absolute; right: 9px; min-width: 34px; padding: 3px 5px; border: 1px solid var(--ink-200); border-radius: 6px; color: var(--ink-400); background: white; box-shadow: 0 1px 1px rgb(17 24 39 / 4%); font: 9px/1.2 inherit; text-align: center; pointer-events: none; }
.topbar-actions { display: flex; align-items: center; gap: 15px; margin-left: auto; }
.connection-state { display: inline-flex; align-items: center; gap: 7px; color: var(--ink-500); font-size: 11px; font-weight: 620; }
.connection-state i { width: 6px; height: 6px; border-radius: 50%; background: var(--success-600); box-shadow: 0 0 0 3px var(--success-100); }
.connection-state.is-offline { color: var(--danger-600); }
.connection-state.is-offline i { background: var(--danger-600); box-shadow: 0 0 0 3px var(--danger-100); }
.avatar-button { border: 0; }
.content-shell { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; }
.content-head { min-height: 85px; display: flex; align-items: center; gap: 24px; padding: 18px 32px 14px; }
.breadcrumbs { min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; }
.breadcrumb { min-width: 0; display: inline-flex; align-items: center; gap: 4px; padding: 6px 7px; border-radius: 7px; color: var(--ink-500); font-size: 12px; font-weight: 590; white-space: nowrap; background: transparent; }
.breadcrumb:hover { color: var(--ink-800); background: var(--ink-100); }
.breadcrumb[aria-current="page"] { max-width: 250px; overflow: hidden; color: var(--ink-900); font-weight: 680; text-overflow: ellipsis; pointer-events: none; }
.breadcrumb-separator { flex: 0 0 auto; width: 14px; height: 14px; color: var(--ink-300); }
.content-actions { display: flex; gap: 9px; margin-left: auto; }
.file-section { padding: 0 32px 40px; }
.file-toolbar { min-height: 59px; display: flex; align-items: center; gap: 24px; margin-bottom: 15px; }
.file-toolbar h1 { margin: 0; font-size: 23px; line-height: 1.25; font-weight: 710; letter-spacing: -.035em; }
.file-toolbar p { margin: 4px 0 0; color: var(--ink-500); font-size: 11px; }
.view-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.sort-control { height: 36px; display: flex; align-items: center; padding-left: 10px; border: 1px solid var(--ink-150); border-radius: 9px; background: white; }
.sort-control svg { width: 14px; height: 14px; color: var(--ink-400); }
.sort-control select { height: 100%; padding: 0 26px 0 7px; border: 0; outline: 0; color: var(--ink-600); background: transparent; font-size: 11px; font-weight: 620; }
.segmented { height: 36px; display: flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--ink-150); border-radius: 9px; background: white; }
.segmented button { width: 29px; height: 28px; display: grid; place-items: center; padding: 0; border-radius: 6px; color: var(--ink-400); background: transparent; }
.segmented button:hover { color: var(--ink-700); }
.segmented button.is-active { color: var(--accent-600); background: var(--accent-50); }
.segmented svg { width: 14px; height: 14px; }
.refresh-button { width: 36px; height: 36px; border: 1px solid var(--ink-150); background: white; }
.refresh-button.is-spinning svg { animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.selection-bar { position: sticky; top: 9px; z-index: 10; min-height: 50px; display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 6px 8px 6px 7px; border: 1px solid #cbd6ff; border-radius: 12px; background: rgb(243 246 255 / 96%); box-shadow: var(--shadow-sm); backdrop-filter: blur(14px); animation: selectionIn .2s var(--ease); }
@keyframes selectionIn { from { transform: translateY(-5px); opacity: 0; } }
.selection-bar > strong { color: var(--accent-700); font-size: 12px; }
.selection-spacer { flex: 1; }
.selection-bar > button:not(.icon-button) { display: inline-flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: 8px; color: var(--ink-600); background: transparent; font-size: 11px; font-weight: 650; }
.selection-bar > button:hover { color: var(--ink-900); background: white; }
.selection-bar .danger-action { color: var(--danger-600) !important; }
.selection-bar svg { width: 15px; height: 15px; }

.drop-surface { position: relative; min-height: 350px; }
.loading-state { min-height: 380px; display: grid; align-content: center; justify-items: center; gap: 24px; color: var(--ink-400); font-size: 11px; }
.loading-state p { margin: 0; }
.skeleton-grid { width: min(100%, 880px); display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.skeleton-grid span { height: 130px; border: 1px solid var(--ink-150); border-radius: 14px; background: linear-gradient(100deg, #eef0f4 28%, #f8f9fb 42%, #eef0f4 57%); background-size: 250% 100%; animation: shimmer 1.3s infinite linear; }
@keyframes shimmer { to { background-position-x: -250%; } }
.message-state { min-height: 390px; display: grid; align-content: center; justify-items: center; text-align: center; }
.message-state h2 { margin: 22px 0 8px; font-size: 18px; letter-spacing: -.025em; }
.message-state p { max-width: 360px; margin: 0 0 21px; color: var(--ink-500); font-size: 12px; line-height: 1.55; }
.state-icon { width: 59px; height: 59px; display: grid; place-items: center; border-radius: 19px; font-size: 25px; font-weight: 760; }
.state-icon-error { color: var(--danger-600); background: var(--danger-100); }
.empty-illustration { position: relative; width: 112px; height: 82px; }
.empty-folder { position: absolute; inset: 9px 16px 3px; display: grid; place-items: center; border: 1px solid #d4dcf7; border-radius: 22px; color: #5777da; background: linear-gradient(145deg, #f1f4ff, #e5eaff); transform: rotate(-2deg); box-shadow: 0 14px 28px rgb(53 80 167 / 10%); }
.empty-folder svg { width: 41px; height: 41px; }
.empty-illustration i { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #a9b8e8; }
.empty-illustration i:nth-of-type(1) { left: 2px; top: 35px; }
.empty-illustration i:nth-of-type(2) { right: 0; top: 17px; width: 7px; height: 7px; background: #85c7c0; }
.empty-illustration i:nth-of-type(3) { right: 9px; bottom: 1px; width: 3px; height: 3px; background: #d6aa61; }

/* File views */
.file-view.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 13px; align-items: start; }
.file-card { position: relative; min-width: 0; min-height: 144px; display: grid; grid-template-rows: 1fr auto; padding: 16px 15px 13px; border: 1px solid var(--ink-150); border-radius: 14px; text-align: left; background: white; box-shadow: var(--shadow-xs); user-select: none; transition: border-color .18s, box-shadow .18s, transform .18s var(--ease), background-color .18s; }
.file-card:hover { z-index: 1; border-color: #cbd3df; box-shadow: 0 10px 27px rgb(18 29 51 / 8%); transform: translateY(-2px); }
.file-card.is-selected { border-color: #9eb1f5; background: var(--accent-50); box-shadow: 0 0 0 2px rgb(71 111 240 / 10%); }
.file-card:focus-visible { z-index: 2; }
.file-visual { min-height: 65px; display: flex; align-items: center; justify-content: center; }
.file-icon { width: 57px; height: 57px; display: grid; place-items: center; border-radius: 17px; color: #60708a; background: #edf0f4; }
.file-icon svg { width: 29px; height: 29px; stroke-width: 1.45; }
.file-card[data-type="directory"] .file-icon { color: #4a69cc; background: linear-gradient(145deg, #eef2ff, #dfe6ff); }
.file-card[data-kind="image"] .file-icon { color: #a45985; background: #f8eaf3; }
.file-card[data-kind="video"] .file-icon { color: #8a58b3; background: #f2eafa; }
.file-card[data-kind="audio"] .file-icon { color: #388b84; background: #e5f5f2; }
.file-card[data-kind="pdf"] .file-icon { color: #bf4756; background: #fbe9eb; }
.file-card[data-kind="archive"] .file-icon { color: #a5702d; background: #f8f0df; }
.file-thumb { width: 86px; height: 66px; object-fit: cover; border-radius: 10px; background: var(--ink-100); box-shadow: 0 4px 13px rgb(18 29 51 / 12%); }
.file-copy { min-width: 0; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 6px; }
.file-copy > div { min-width: 0; }
.file-name { display: block; overflow: hidden; color: var(--ink-800); font-size: 12px; line-height: 1.5; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { display: block; overflow: hidden; margin-top: 2px; color: var(--ink-400); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.file-menu { width: 28px; height: 28px; opacity: 0; }
.file-card:hover .file-menu, .file-card:focus-within .file-menu, .file-card.is-selected .file-menu { opacity: 1; }
.file-check { position: absolute; top: 10px; left: 10px; width: 20px; height: 20px; display: grid; place-items: center; padding: 0; border: 1px solid var(--ink-200); border-radius: 7px; color: transparent; background: rgb(255 255 255 / 88%); opacity: 0; box-shadow: 0 2px 7px rgb(17 24 39 / 7%); transition: opacity .15s, color .15s, background .15s, border-color .15s; }
.file-check svg { width: 12px; height: 12px; stroke-width: 2.3; }
.file-card:hover .file-check, .file-card:focus-within .file-check, .file-card.is-selected .file-check { opacity: 1; }
.file-card.is-selected .file-check { border-color: var(--accent-600); color: white; background: var(--accent-600); }

.file-view.list-view { display: block; overflow: hidden; border: 1px solid var(--ink-150); border-radius: 14px; background: white; box-shadow: var(--shadow-xs); }
.list-header { height: 38px; display: grid; grid-template-columns: minmax(230px, 1.5fr) minmax(130px, .65fr) minmax(90px, .4fr) 36px; align-items: center; gap: 14px; padding: 0 14px 0 48px; border-bottom: 1px solid var(--ink-150); color: var(--ink-400); font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.list-view .file-card { min-height: 58px; display: grid; grid-template-columns: 34px minmax(180px, 1.5fr) minmax(130px, .65fr) minmax(90px, .4fr) 30px; grid-template-rows: none; align-items: center; gap: 12px; padding: 8px 13px; border: 0; border-bottom: 1px solid var(--ink-100); border-radius: 0; box-shadow: none; }
.list-view .file-card:last-child { border-bottom: 0; }
.list-view .file-card:hover { background: var(--ink-50); box-shadow: none; transform: none; }
.list-view .file-card.is-selected { background: var(--accent-50); box-shadow: inset 3px 0 var(--accent-500); }
.list-view .file-visual { min-height: 0; }
.list-view .file-icon { width: 34px; height: 34px; border-radius: 10px; }
.list-view .file-icon svg { width: 18px; height: 18px; }
.list-view .file-thumb { width: 34px; height: 34px; border-radius: 8px; box-shadow: none; }
.list-view .file-copy { display: contents; }
.list-view .file-copy > div { min-width: 0; }
.list-view .file-meta { display: none; }
.file-modified, .file-size { overflow: hidden; color: var(--ink-500); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.grid-view .file-modified, .grid-view .file-size { display: none; }
.list-view .file-check { top: 19px; left: 14px; width: 18px; height: 18px; }
.list-view .file-menu { opacity: .4; }

.drop-overlay { position: absolute; inset: -8px; z-index: 20; display: grid; place-items: center; border: 2px dashed #7390ed; border-radius: 18px; color: var(--accent-700); text-align: center; background: rgb(243 246 255 / 94%); backdrop-filter: blur(8px); pointer-events: none; animation: dropIn .18s var(--ease); }
@keyframes dropIn { from { opacity: 0; transform: scale(.99); } }
.drop-overlay > div > span { width: 66px; height: 66px; display: inline-grid; place-items: center; border-radius: 20px; color: white; background: linear-gradient(145deg, var(--accent-500), var(--accent-700)); box-shadow: 0 13px 29px rgb(47 91 231 / 25%); }
.drop-overlay svg { width: 28px; height: 28px; }
.drop-overlay h2 { margin: 17px 0 5px; font-size: 19px; }
.drop-overlay p { margin: 0; color: var(--ink-500); font-size: 11px; }

/* Details */
.details-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 50; width: min(385px, 100vw); overflow: auto; border-left: 1px solid var(--ink-150); background: white; box-shadow: -24px 0 60px rgb(17 24 39 / 11%); transform: translateX(103%); visibility: hidden; transition: transform .28s var(--ease), visibility .28s; }
.details-drawer.is-open { transform: translateX(0); visibility: visible; }
.drawer-head { height: 69px; display: flex; align-items: center; justify-content: space-between; padding: 0 21px; border-bottom: 1px solid var(--ink-150); color: var(--ink-800); font-size: 13px; font-weight: 680; }
.preview-area { min-height: 275px; display: grid; place-items: center; padding: 27px; overflow: hidden; background: linear-gradient(145deg, #f6f7fa, #eef0f5); }
.preview-area img, .preview-area video { max-width: 100%; max-height: 330px; border-radius: 11px; box-shadow: 0 12px 35px rgb(17 24 39 / 16%); }
.preview-area video { width: 100%; }
.preview-area audio { width: 100%; }
.preview-area iframe { width: 100%; height: 330px; border: 0; border-radius: 8px; background: white; }
.preview-placeholder { width: 93px; height: 93px; display: grid; place-items: center; border: 1px solid var(--ink-200); border-radius: 27px; color: var(--ink-500); background: white; box-shadow: var(--shadow-sm); }
.preview-placeholder svg { width: 44px; height: 44px; stroke-width: 1.25; }
.preview-failed { display: grid; justify-items: center; gap: 13px; color: var(--ink-500); font-size: 11px; }
.drawer-body { padding: 23px; }
.drawer-body h2 { overflow-wrap: anywhere; margin: 0; color: var(--ink-900); font-size: 18px; line-height: 1.35; letter-spacing: -.025em; }
.drawer-body > p { margin: 5px 0 20px; color: var(--ink-400); font-size: 10px; }
.drawer-actions { display: grid; grid-template-columns: 1fr 42px; gap: 8px; margin-bottom: 25px; }
.drawer-actions .icon-only { min-width: 42px; padding: 0; }
.details-meta { margin: 0; }
.details-meta > div { display: grid; grid-template-columns: 95px 1fr; gap: 12px; padding: 11px 0; border-top: 1px solid var(--ink-100); }
.details-meta dt { color: var(--ink-400); font-size: 10px; }
.details-meta dd { overflow-wrap: anywhere; margin: 0; color: var(--ink-700); font-size: 10px; text-align: right; }

/* Context menu, dialogs, uploads, notifications */
.context-menu { position: fixed; z-index: 100; width: 188px; padding: 6px; border: 1px solid var(--ink-150); border-radius: 12px; background: rgb(255 255 255 / 97%); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); animation: menuIn .14s var(--ease); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
.context-menu button { width: 100%; height: 36px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 7px; color: var(--ink-700); background: transparent; font-size: 11px; font-weight: 590; }
.context-menu button:hover, .context-menu button:focus { color: var(--ink-900); background: var(--ink-100); outline: none; }
.context-menu button:disabled { color: var(--ink-300); background: transparent; }
.context-menu svg { width: 15px; height: 15px; color: var(--ink-500); }
.context-menu hr { height: 1px; margin: 5px; border: 0; background: var(--ink-150); }
.danger-action { color: var(--danger-600) !important; }
.dialog { width: min(470px, calc(100vw - 28px)); padding: 0; border: 1px solid var(--ink-150); border-radius: 18px; color: var(--ink-900); background: white; box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgb(10 16 30 / 44%); backdrop-filter: blur(4px); }
.dialog[open] { animation: dialogIn .2s var(--ease); }
@keyframes dialogIn { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.dialog form > header { display: grid; grid-template-columns: 43px 1fr 38px; gap: 13px; align-items: start; padding: 22px 22px 17px; }
.dialog-icon { width: 43px; height: 43px; display: grid; place-items: center; border-radius: 13px; color: var(--accent-600); background: var(--accent-100); }
.dialog-icon svg { width: 20px; height: 20px; }
.dialog-icon-danger { color: var(--danger-600); background: var(--danger-100); }
.dialog header h2 { margin: 1px 0 4px; font-size: 17px; letter-spacing: -.025em; }
.dialog header p { margin: 0; color: var(--ink-500); font-size: 11px; line-height: 1.5; }
.dialog-content { padding: 5px 22px 21px; }
.dialog .text-input { height: 46px; padding: 0 13px; }
.dialog footer { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 22px; border-top: 1px solid var(--ink-100); background: var(--ink-50); }
.confirm-dialog form > header { padding-bottom: 23px; }
.confirm-dialog footer { margin-top: 0; }

.upload-panel { position: fixed; right: 22px; bottom: 22px; z-index: 70; width: min(405px, calc(100vw - 28px)); max-height: min(570px, calc(100dvh - 44px)); overflow: hidden; border: 1px solid var(--ink-150); border-radius: 17px; background: white; box-shadow: 0 23px 65px rgb(12 22 42 / 20%); animation: uploadPanelIn .27s var(--ease); }
@keyframes uploadPanelIn { from { opacity: 0; transform: translateY(18px); } }
.upload-panel > header { height: 61px; display: flex; align-items: center; justify-content: space-between; padding: 0 13px 0 18px; color: white; background: linear-gradient(135deg, #17233b, #10182a); }
.upload-panel > header > div:first-child { display: flex; flex-direction: column; }
.upload-panel > header strong { font-size: 12px; }
.upload-panel > header span { margin-top: 2px; color: #8e9cb2; font-size: 9px; }
.upload-panel > header .icon-button { color: #8492a7; }
.upload-panel > header .icon-button:hover { color: white; background: rgb(255 255 255 / 8%); }
.upload-panel.is-collapsed .upload-list { display: none; }
.upload-panel.is-collapsed > header [data-action="toggle-uploads"] svg { transform: rotate(180deg); }
.upload-list { max-height: 460px; overflow: auto; }
.upload-item { display: grid; grid-template-columns: 39px 1fr 32px; align-items: center; gap: 10px; min-height: 77px; padding: 11px 13px; border-bottom: 1px solid var(--ink-100); }
.upload-item:last-child { border-bottom: 0; }
.upload-file-icon { position: relative; width: 39px; height: 39px; display: grid; place-items: center; border-radius: 11px; color: var(--accent-600); background: var(--accent-50); }
.upload-file-icon > svg { width: 19px; height: 19px; }
.upload-state-icon { position: absolute; right: -3px; bottom: -3px; width: 15px; height: 15px; display: none; place-items: center; border: 2px solid white; border-radius: 50%; color: white; background: var(--success-600); }
.upload-state-icon svg { width: 8px; height: 8px; stroke-width: 2.5; }
.upload-item.is-complete .upload-state-icon { display: grid; }
.upload-item.is-error .upload-state-icon { display: grid; background: var(--danger-600); }
.upload-item.is-error .upload-state-icon svg { display: none; }
.upload-copy { min-width: 0; }
.upload-copy strong { display: block; overflow: hidden; color: var(--ink-800); font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.upload-copy small { display: block; overflow: hidden; margin-top: 5px; color: var(--ink-400); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.upload-track { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 4px; background: var(--ink-100); }
.upload-track span { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-500), var(--aqua-500)); transition: width .2s linear; }
.upload-item.is-complete .upload-track span { background: var(--success-600); }
.upload-item.is-error .upload-track span { background: var(--danger-600); }
.upload-item.is-error .upload-copy small { color: var(--danger-600); }

.toast-region { position: fixed; right: 24px; top: 84px; z-index: 200; width: min(360px, calc(100vw - 32px)); display: grid; gap: 9px; pointer-events: none; }
.toast { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 10px; min-height: 52px; padding: 9px 10px; border: 1px solid var(--ink-150); border-radius: 13px; color: var(--ink-700); background: rgb(255 255 255 / 96%); box-shadow: var(--shadow-md); backdrop-filter: blur(14px); pointer-events: auto; animation: toastIn .23s var(--ease); }
@keyframes toastIn { from { opacity: 0; transform: translateX(12px); } }
.toast.is-leaving { animation: toastOut .2s ease forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateX(12px); } }
.toast-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--success-600); background: var(--success-100); }
.toast-error .toast-icon { color: var(--danger-600); background: var(--danger-100); }
.toast-icon svg { width: 15px; height: 15px; }
.toast p { margin: 0; font-size: 10px; line-height: 1.45; }
.toast .icon-button { width: 28px; height: 28px; }

@media (max-width: 1050px) {
  .app-shell { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar { padding-left: 13px; padding-right: 13px; }
  .file-view.grid-view { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .content-head, .file-section { padding-left: 24px; padding-right: 24px; }
}

@media (max-width: 820px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-story { display: none; }
  .mobile-auth-brand { display: flex; }
  .auth-panel { position: relative; overflow: hidden; }
  .auth-panel::before { content: ""; position: absolute; width: 300px; height: 300px; top: -190px; right: -140px; border-radius: 50%; background: #edf1ff; box-shadow: 0 0 0 65px #f6f8ff; }
  .login-card { position: relative; z-index: 1; }
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; transform: translateX(-105%); visibility: hidden; transition: transform .26s var(--ease), visibility .26s; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); visibility: visible; }
  .sidebar-close { display: grid; }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 29; display: block; visibility: hidden; opacity: 0; background: rgb(7 12 22 / 42%); transition: opacity .2s, visibility .2s; }
  .app-shell.sidebar-open .sidebar-scrim { visibility: visible; opacity: 1; }
  .menu-button { display: grid; flex: 0 0 auto; }
  .topbar { padding: 0 18px; }
  .search-wrap { width: min(480px, 100%); }
  .search-wrap kbd, .connection-state { display: none; }
  .search-wrap input { padding-right: 14px; }
  .content-head, .file-section { padding-left: 18px; padding-right: 18px; }
  .content-head { min-height: 78px; }
  .desktop-upload { display: none; }
  .file-view.grid-view { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); }
}

@media (max-width: 560px) {
  .topbar { height: 62px; flex-basis: 62px; gap: 8px; padding: 0 12px; }
  .topbar-actions { gap: 5px; }
  .avatar-button { width: 34px; height: 34px; border-radius: 10px; }
  .content-head { min-height: 67px; padding: 11px 13px 8px; }
  .content-actions .button-secondary { width: 38px; padding: 0; }
  .content-actions .button-secondary span { display: none; }
  .breadcrumb:not(:last-of-type):not(:first-of-type), .breadcrumb:not(:last-of-type) + .breadcrumb-separator { display: none; }
  .breadcrumb[aria-current="page"] { max-width: 150px; }
  .file-section { padding: 0 13px 95px; }
  .file-toolbar { min-height: 54px; margin-bottom: 10px; }
  .file-toolbar h1 { font-size: 20px; }
  .sort-control { display: none; }
  .refresh-button { display: none; }
  .file-view.grid-view { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .file-card { min-height: 130px; padding: 13px 11px 11px; border-radius: 12px; }
  .file-icon { width: 50px; height: 50px; border-radius: 15px; }
  .file-name { font-size: 11px; }
  .file-menu { opacity: .6; }
  .file-check { opacity: .65; }
  .list-header { display: none; }
  .list-view .file-card { grid-template-columns: 33px minmax(0, 1fr) 26px; gap: 10px; padding-left: 42px; }
  .list-view .file-modified, .list-view .file-size { display: none; }
  .selection-bar { min-height: 48px; top: 5px; }
  .selection-bar button span { display: none; }
  .selection-bar > button:not(.icon-button) { width: 35px; justify-content: center; padding: 8px; }
  .selection-bar > strong { font-size: 11px; }
  .skeleton-grid { grid-template-columns: repeat(2, 1fr); }
  .skeleton-grid span { height: 120px; }
  .details-drawer { width: 100vw; }
  .preview-area { min-height: 245px; }
  .upload-panel { right: 7px; bottom: 7px; width: calc(100vw - 14px); border-radius: 15px; }
  .toast-region { top: 72px; right: 12px; width: calc(100vw - 24px); }
}

@media (max-width: 390px) {
  .file-view.grid-view { grid-template-columns: 1fr; }
  .file-card { min-height: 112px; }
  .auth-panel { padding: 23px; }
  .mobile-auth-brand { margin-bottom: 32px; }
  .login-heading { margin-bottom: 26px; }
  .selection-bar { gap: 3px; }
  .selection-bar > strong { max-width: 82px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

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

@media (prefers-contrast: more) {
  :root { --ink-150: #c6cbd3; --ink-400: #687387; }
  .file-card, .button-secondary, .sort-control, .segmented { border-color: var(--ink-300); }
}
