@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500;700&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f6f8fc;
  --bg-2: #eef1f7;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --primary: #4f46e5;
  --primary-h: #4338ca;
  --primary-light: #eef2ff;
  --primary-ring: rgba(79, 70, 229, .15);
  --text: #0f1419;
  --t2: #4b5563;
  --t3: #9ca3af;
  --t4: #cbd5e1;
  --border: #e5e7eb;
  --border-soft: #eef0f3;
  --success: #059669;
  --success-bg: #ecfdf5;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --info: #2563eb;
  --info-bg: #eff6ff;
  --purple: #7c3aed;
  --purple-bg: #faf5ff;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --shadow-1: 0 1px 2px rgba(15,20,25,.04);
  --shadow-2: 0 1px 2px rgba(15,20,25,.04), 0 8px 24px -8px rgba(15,20,25,.06);
  --shadow-3: 0 4px 12px rgba(15,20,25,.06), 0 16px 40px -12px rgba(15,20,25,.12);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --fh: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --fm: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
}

html, body {
  font-family: var(--fh);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }
.num, .tabular { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }
.mono { font-family: var(--fm); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 4px; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--primary); color: #fff;
  padding: 10px 16px; border-radius: 0 0 8px 0;
  z-index: 9999; font-weight: 700;
}
.skip-link:focus { left: 0; }

/* ═══ NAV ═══ */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 3px rgba(15,20,25,.03);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
}
@media (min-width: 768px) {
  .nav-inner { padding: 12px 24px; gap: 20px; }
}
.nav-brand { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.nav-logo {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 16px -6px rgba(99,102,241,.5), inset 0 1px 0 rgba(255,255,255,.2);
  flex-shrink: 0;
}
.nav-logo svg { width: 18px; height: 18px; }
.nav-brand-text {
  font-size: 15px; font-weight: 800;
  letter-spacing: -.025em; color: var(--text);
  white-space: nowrap;
}
@media (min-width: 768px) { .nav-brand-text { font-size: 16px; } }
@media (max-width: 520px) { .nav-brand-text { display: none; } }

.nav-search { flex: 1; min-width: 0; position: relative; }
.nav-search input {
  width: 100%;
  padding: 9px 14px 9px 38px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-family: var(--fh); font-size: 13.5px;
  color: var(--text); outline: none;
  transition: all .15s var(--ease);
}
@media (min-width: 768px) {
  .nav-search input { font-size: 14px; padding: 10px 14px 10px 40px; }
}
.nav-search input:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.nav-search input::placeholder { color: var(--t4); }
.nav-search .search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--t3); pointer-events: none;
}
.nav-search .search-icon svg { width: 16px; height: 16px; display: block; }

.search-dropdown {
  position: absolute;
  top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: var(--shadow-3);
  border: 1px solid var(--border);
  max-height: 60vh; overflow-y: auto;
  z-index: 60;
  display: none;
  overscroll-behavior: contain;
}
.search-dropdown.show { display: block; }
@media (max-width: 767px) {
  .search-dropdown {
    position: fixed; top: 62px;
    left: 10px; right: 10px;
    max-height: 65vh;
  }
}
.search-group { padding: 8px; }
.search-group + .search-group { border-top: 1px solid var(--border-soft); }
.search-group-label {
  font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--t3); padding: 8px 10px 6px;
}
.search-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  cursor: pointer; transition: background .1s var(--ease);
}
.search-item:hover, .search-item:focus { background: var(--bg); outline: none; }
.search-item-icon {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--primary-light); color: var(--primary);
  display: grid; place-items: center; flex-shrink: 0;
}
.search-item-icon svg { width: 14px; height: 14px; }
.search-item-body { flex: 1; min-width: 0; }
.search-item-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  letter-spacing: -.01em;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.search-item-sub { font-size: 11px; color: var(--t3); margin-top: 1px; font-weight: 500; }
.search-empty { padding: 32px 20px; text-align: center; }
.search-empty p { font-size: 12.5px; color: var(--t3); font-weight: 500; }

.nav-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.nav-icon-btn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--t2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .15s var(--ease);
  flex-shrink: 0;
}
.nav-icon-btn:hover { background: var(--bg); color: var(--text); border-color: #d1d5db; }
.nav-icon-btn:active { transform: scale(.95); }
.nav-icon-btn svg { width: 16px; height: 16px; }

/* ═══ CONTAINER ═══ */
.container {
  max-width: 1200px; margin: 0 auto;
  padding: 20px 14px 80px;
}
@media (min-width: 768px) { .container { padding: 28px 24px 80px; } }

/* ═══ BREADCRUMBS ═══ */
.breadcrumbs {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600;
  color: var(--t3); margin-bottom: 18px;
  flex-wrap: wrap;
}
.breadcrumbs a {
  color: var(--t2); padding: 4px 8px;
  border-radius: 6px;
  transition: all .15s var(--ease);
  display: inline-flex; align-items: center; gap: 4px;
}
.breadcrumbs a:hover { background: var(--surface); color: var(--primary); }
.breadcrumbs svg { width: 13px; height: 13px; }
.breadcrumbs .sep { color: var(--t4); }
.breadcrumbs .current { color: var(--text); padding: 4px 0; }

/* ═══ HERO ═══ */
.hero { padding: 24px 0 20px; text-align: center; }
@media (min-width: 768px) { .hero { padding: 40px 0 32px; } }
.hero h1 {
  font-size: clamp(24px, 5vw, 38px);
  font-weight: 800; letter-spacing: -.035em;
  line-height: 1.15; margin-bottom: 10px; color: var(--text);
}
.hero h1 .gradient {
  background: linear-gradient(135deg, #6366f1, #8b5cf6 60%, #ec4899);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 14px; color: var(--t2); font-weight: 500;
  max-width: 480px; margin: 0 auto;
}
@media (min-width: 768px) { .hero p { font-size: 15px; } }

/* ═══ STATS ═══ */
.stats-strip {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; margin-top: 20px;
  max-width: 380px; margin-left: auto; margin-right: auto;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px; padding: 12px 14px;
  text-align: center; box-shadow: var(--shadow-1);
}
.stat-tile .v {
  font-size: 22px; font-weight: 800;
  letter-spacing: -.03em; line-height: 1;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.stat-tile .l {
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--t3); margin-top: 5px;
}

/* ═══ SECTION HEADER ═══ */
.sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; gap: 12px; flex-wrap: wrap;
}
.sec-hd h2 {
  font-size: 15px; font-weight: 800;
  letter-spacing: -.02em; color: var(--text);
}
.sec-hd .actions { display: flex; gap: 6px; align-items: center; }

/* ═══ SQUARE FOLDER GRID ═══ */
.grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
  margin-bottom: 32px;
}
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }

.tile {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  aspect-ratio: 1 / 1;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all .18s var(--ease);
  cursor: pointer;
  overflow: hidden;
}
@media (min-width: 700px) { .tile { padding: 16px; gap: 12px; } }
.tile:hover {
  border-color: #c7d2fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(15,20,25,.06), 0 16px 32px -16px rgba(79,70,229,.15);
}

.tile-icon {
  width: 40px; height: 40px;
  border-radius: 11px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: var(--primary);
  border: 1px solid #e0e7ff;
  display: grid; place-items: center;
  flex-shrink: 0;
}
@media (min-width: 700px) {
  .tile-icon { width: 44px; height: 44px; border-radius: 12px; }
}
.tile-icon svg { width: 18px; height: 18px; }
@media (min-width: 700px) { .tile-icon svg { width: 20px; height: 20px; } }

.tile-name {
  font-size: 13px; font-weight: 700;
  letter-spacing: -.015em; line-height: 1.35;
  color: var(--text);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}
@media (min-width: 700px) { .tile-name { font-size: 14px; } }

.tile-meta {
  font-size: 11px; color: var(--t3); font-weight: 500;
  display: flex; align-items: center; gap: 5px; flex-wrap: wrap;
  margin-top: auto;
}
.tile-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--t4); }

/* ═══ FILE LIST ═══ */
.file-list { display: flex; flex-direction: column; gap: 10px; }

.file-row {
  background: var(--surface);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  display: flex; align-items: center; gap: 12px;
  transition: all .16s var(--ease);
  cursor: pointer;
  position: relative;
}
@media (min-width: 768px) { .file-row { padding: 14px 16px; gap: 14px; } }
.file-row:hover {
  border-color: #c7d2fe;
  box-shadow: 0 4px 12px -4px rgba(15,20,25,.08);
  transform: translateY(-1px);
}
.file-row:active { transform: scale(.998); }

.f-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.f-icon svg { width: 20px; height: 20px; }
.f-icon.pdf   { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; border: 1px solid #fecaca; }
.f-icon.doc   { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; border: 1px solid #bfdbfe; }
.f-icon.ppt   { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #ea580c; border: 1px solid #fed7aa; }
.f-icon.xls   { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #059669; border: 1px solid #a7f3d0; }
.f-icon.txt   { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #4b5563; border: 1px solid #d1d5db; }
.f-icon.img   { background: linear-gradient(135deg, #faf5ff, #f3e8ff); color: #7c3aed; border: 1px solid #e9d5ff; }
.f-icon.zip   { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; border: 1px solid #fde68a; }
.f-icon.other { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #6b7280; border: 1px solid #d1d5db; }

.file-row .info { flex: 1; min-width: 0; }
.file-row .info .name {
  font-weight: 700; font-size: 13.5px;
  letter-spacing: -.015em; line-height: 1.35;
  word-break: break-word; color: var(--text);
  margin-bottom: 4px;
}
@media (min-width: 768px) {
  .file-row .info .name { font-size: 14px; }
}
.file-row .info .meta {
  font-size: 11.5px; color: var(--t3); font-weight: 500;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.file-row .info .meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--t4); }

.type-badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 6px;
  font-size: 9.5px; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase;
  border: 1px solid transparent;
}
.type-badge.pdf   { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.type-badge.doc   { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.type-badge.ppt   { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.type-badge.xls   { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.type-badge.txt   { background: #f3f4f6; color: #374151; border-color: #d1d5db; }
.type-badge.img   { background: #faf5ff; color: #6d28d9; border-color: #e9d5ff; }
.type-badge.zip   { background: #fffbeb; color: #b45309; border-color: #fde68a; }
.type-badge.other { background: #f3f4f6; color: #4b5563; border-color: #d1d5db; }

.file-row-chevron {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-2);
  color: var(--t3);
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s var(--ease);
}
.file-row-chevron svg { width: 14px; height: 14px; }
.file-row:hover .file-row-chevron {
  background: var(--primary-light);
  color: var(--primary);
}

/* ═══ RECENT UPLOADS CARD ═══ */
.recent-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px;
  box-shadow: var(--shadow-1);
}
.recent-card .file-row {
  padding: 10px 12px;
  margin-bottom: 6px;
  box-shadow: none;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.recent-card .file-row:last-of-type { margin-bottom: 0; }
.recent-card .f-icon { width: 38px; height: 38px; }
.recent-card .f-icon svg { width: 16px; height: 16px; }
.recent-card .file-row .info .name { font-size: 13px; margin-bottom: 3px; }
.recent-card .file-row .info .meta { font-size: 11px; }

.recent-view-all {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  margin-top: 6px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--t2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s var(--ease);
}
.recent-view-all:hover {
  background: var(--primary-light);
  color: var(--primary);
  border-color: #c7d2fe;
}
.recent-view-all svg { width: 13px; height: 13px; }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 10px 16px;
  border-radius: 10px; border: none; cursor: pointer;
  font-size: 13.5px; font-weight: 700;
  letter-spacing: -.005em;
  transition: all .15s var(--ease);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap; position: relative;
}
.btn:active { transform: scale(.97); }
.btn svg { flex-shrink: 0; }
.btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(79,70,229,.4), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover { box-shadow: 0 6px 18px -4px rgba(79,70,229,.5); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary {
  background: var(--surface); color: var(--t2);
  border: 1px solid var(--border); box-shadow: var(--shadow-1);
}
.btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #d1d5db; }
.btn-ghost {
  background: transparent; color: var(--t2);
  border: 1px solid transparent;
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; gap: 5px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-lg { padding: 14px 22px; font-size: 14.5px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn.loading { pointer-events: none; opacity: .75; }
.btn.loading .btn-label { visibility: hidden; }
.btn.loading::after {
  content: ''; position: absolute; top: 50%; left: 50%;
  width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══ FORMS ═══ */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 12.5px; font-weight: 700;
  color: var(--t2); margin-bottom: 8px;
}
.input {
  width: 100%; padding: 12px 16px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  font-family: var(--fh); font-size: 14px;
  background: var(--surface); color: var(--text);
  outline: none; transition: all .15s var(--ease);
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.input::placeholder { color: var(--t4); }
select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' 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 14px center;
  background-size: 16px;
  padding-right: 42px; cursor: pointer;
}

.pin-wrapper { max-width: 400px; margin: 40px auto 0; }
@media (min-width: 768px) { .pin-wrapper { margin-top: 80px; } }
.pin-input {
  text-align: center; font-size: 26px;
  letter-spacing: 12px; font-weight: 800;
  padding: 16px 20px;
  font-family: var(--fm); font-variant-numeric: tabular-nums;
}

/* ═══ RADIO CARDS ═══ */
.radio-group { display: flex; flex-direction: column; gap: 10px; }
.radio-card {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer; transition: all .15s var(--ease);
}
.radio-card:hover { border-color: #c7d2fe; background: #fafbff; }
.radio-card input { display: none; }
.radio-card.active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-ring);
}
.radio-card .radio-icon {
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--bg-2); color: var(--t2);
  display: grid; place-items: center;
  flex-shrink: 0; transition: all .15s var(--ease);
}
.radio-card.active .radio-icon { background: var(--primary); color: #fff; }
.radio-card .radio-icon svg { width: 16px; height: 16px; }
.radio-card .radio-body { flex: 1; min-width: 0; }
.radio-card .radio-title { font-size: 13.5px; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.radio-card .radio-sub { font-size: 11.5px; color: var(--t3); margin-top: 2px; font-weight: 500; }

/* ═══ UPLOAD PAGE ═══ */
.upload-page { max-width: 720px; margin: 0 auto; }
.upload-page-header { margin-bottom: 22px; text-align: center; }
.upload-page-header h1 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 6px; }
@media (min-width: 768px) { .upload-page-header h1 { font-size: 26px; } }
.upload-page-header p { font-size: 13px; color: var(--t3); font-weight: 500; }

.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px; text-align: center;
  cursor: pointer; transition: all .2s var(--ease);
  background: var(--surface);
}
@media (min-width: 768px) { .dropzone { padding: 56px 32px; } }
.dropzone:hover { border-color: #c7d2fe; background: #fafbff; }
.dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: scale(1.01);
}
.dropzone-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #f5f3ff);
  color: var(--primary);
  border: 1px solid #e0e7ff;
  display: grid; place-items: center;
  margin: 0 auto 16px;
  transition: all .2s var(--ease);
}
.dropzone-icon svg { width: 26px; height: 26px; }
.dropzone.dragover .dropzone-icon {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  transform: scale(1.05);
}
.dropzone-title { font-size: 15px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 6px; }
.dropzone-sub { font-size: 12.5px; color: var(--t3); font-weight: 500; }
.dropzone input[type=file] { display: none; }

.upload-section {
  margin-top: 20px; padding: 18px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
  animation: slideDown .3s var(--ease);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.upload-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.upload-section-header h3 {
  font-size: 12px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--t3);
}
.upload-section-header .badge {
  font-size: 11px; font-weight: 700;
  padding: 3px 9px;
  background: var(--primary-light); color: var(--primary);
  border-radius: 6px;
}

.queue { display: flex; flex-direction: column; gap: 8px; }
.queue-item {
  background: var(--surface-2);
  border-radius: 11px;
  padding: 12px 14px;
  border: 1px solid var(--border-soft);
  animation: fadeUp .25s var(--ease);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.queue-item .row {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.queue-item .fname {
  font-weight: 700; font-size: 13px;
  letter-spacing: -.01em;
  word-break: break-word;
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  color: var(--text);
}
.queue-item .fname .fname-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.queue-item .status {
  font-size: 11.5px; color: var(--t3); font-weight: 600;
  flex-shrink: 0;
}
.queue-item .status.done { color: var(--success); }
.queue-item .status.error { color: var(--danger); }
.queue-item .status.uploading { color: var(--primary); }
.queue-item .status.ready { color: var(--success); }

.queue-item .remove-btn {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: transparent; border: none;
  color: var(--t3); cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s var(--ease);
}
.queue-item .remove-btn:hover { background: var(--danger-bg); color: var(--danger); }
.queue-item .remove-btn:disabled { opacity: .3; cursor: not-allowed; }
.queue-item .remove-btn svg { width: 14px; height: 14px; }

.progress {
  height: 4px; background: var(--bg-2);
  border-radius: 2px; overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  width: 0%;
  border-radius: 2px;
  transition: width .2s var(--ease);
}
.progress-bar.ready {
  background: linear-gradient(90deg, #10b981, #059669);
}

/* ═══ EMPTY ═══ */
.empty { text-align: center; padding: 56px 20px; color: var(--t3); }
.empty-icon {
  width: 56px; height: 56px;
  border-radius: 16px;
  background: var(--bg-2); color: var(--t3);
  display: grid; place-items: center;
  margin: 0 auto 16px;
}
.empty-icon svg { width: 24px; height: 24px; }
.empty h3 { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 6px; letter-spacing: -.02em; }
.empty p { font-size: 12.5px; color: var(--t3); font-weight: 500; }

/* ═══ MODALS ═══ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(15, 20, 25, .55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeIn .2s var(--ease);
}
.modal-backdrop.show { display: flex; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 24px 60px -12px rgba(15,20,25,.35);
  animation: modalIn .25s var(--ease);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.file-modal { max-width: 1000px; width: 100%; height: 90vh; max-height: 90vh; }
.recent-modal { max-width: 640px; width: 100%; height: 85vh; max-height: 85vh; }

@media (max-width: 767px) {
  .modal-backdrop { padding: 0; align-items: stretch; }
  .file-modal, .recent-modal {
    height: 100dvh; max-height: 100dvh;
    max-width: 100%; border-radius: 0;
  }
}

.fm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  padding-top: calc(12px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border-soft);
  flex-shrink: 0;
  background: var(--surface);
}
.fm-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: grid; place-items: center;
  flex-shrink: 0;
  font-size: 10px; font-weight: 800;
  letter-spacing: .04em; text-transform: uppercase;
}
.fm-icon.pdf   { background: linear-gradient(135deg, #fef2f2, #fee2e2); color: #dc2626; border: 1px solid #fecaca; }
.fm-icon.doc   { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: #2563eb; border: 1px solid #bfdbfe; }
.fm-icon.ppt   { background: linear-gradient(135deg, #fff7ed, #ffedd5); color: #ea580c; border: 1px solid #fed7aa; }
.fm-icon.xls   { background: linear-gradient(135deg, #ecfdf5, #d1fae5); color: #059669; border: 1px solid #a7f3d0; }
.fm-icon.txt   { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #4b5563; border: 1px solid #d1d5db; }
.fm-icon.img   { background: linear-gradient(135deg, #faf5ff, #f3e8ff); color: #7c3aed; border: 1px solid #e9d5ff; }
.fm-icon.zip   { background: linear-gradient(135deg, #fffbeb, #fef3c7); color: #d97706; border: 1px solid #fde68a; }
.fm-icon.other { background: linear-gradient(135deg, #f3f4f6, #e5e7eb); color: #6b7280; border: 1px solid #d1d5db; }

.fm-info { flex: 1; min-width: 0; }
.fm-name {
  font-size: 14px; font-weight: 800;
  letter-spacing: -.015em; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.fm-meta {
  font-size: 11.5px; color: var(--t3); font-weight: 500;
  margin-top: 2px;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.fm-close {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--bg-2); border: none;
  color: var(--t2); cursor: pointer;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: all .15s var(--ease);
}
.fm-close:hover { background: var(--border); color: var(--text); }
.fm-close svg { width: 16px; height: 16px; }

.fm-body {
  flex: 1;
  background: #1f2937;
  position: relative;
  min-height: 0;
  overflow: hidden;
}
.fm-body iframe {
  width: 100%; height: 100%;
  border: 0; display: block;
  background: #1f2937;
}
.fm-body object {
  width: 100%; height: 100%;
  display: block; border: 0;
}
.fm-body img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
  background: #0f1419;
}

.fm-body.fm-body-plain {
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
}
.fm-no-preview {
  text-align: center; max-width: 320px; color: var(--t3);
}
.fm-no-preview-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  background: var(--bg-2); color: var(--t3);
  display: grid; place-items: center;
  margin: 0 auto 18px;
}
.fm-no-preview-icon svg { width: 28px; height: 28px; }
.fm-no-preview h3 {
  font-size: 15px; font-weight: 800;
  color: var(--text); margin-bottom: 8px;
  letter-spacing: -.02em;
}
.fm-no-preview p {
  font-size: 13px; color: var(--t3);
  line-height: 1.55; font-weight: 500;
}

.fm-actions {
  display: flex; gap: 8px;
  padding: 12px 14px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border-soft);
  flex-shrink: 0;
}
.fm-btn {
  flex: 1;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 7px; padding: 12px 14px;
  border-radius: 11px; border: none;
  font-family: var(--fh); font-size: 13.5px; font-weight: 700;
  cursor: pointer;
  transition: all .15s var(--ease);
  text-decoration: none;
  min-height: 46px;
}
.fm-btn:active { transform: scale(.97); }
.fm-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.fm-btn-secondary {
  background: var(--surface); color: var(--t2);
  border: 1.5px solid var(--border);
}
.fm-btn-secondary:hover { background: var(--surface-2); color: var(--text); border-color: #d1d5db; }
.fm-btn-primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  box-shadow: 0 4px 12px -2px rgba(79,70,229,.4);
}
.fm-btn-primary:hover { box-shadow: 0 6px 18px -4px rgba(79,70,229,.5); }

/* Recent modal body */
.recent-body-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

/* ═══ TOASTS ═══ */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 300;
  display: flex; flex-direction: column; gap: 10px;
  pointer-events: none; max-width: 380px;
}
@media (max-width: 640px) {
  .toast-container { left: 16px; right: 16px; top: auto; bottom: 20px; align-items: stretch; }
}
.toast {
  background: var(--surface);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 12px 36px -8px rgba(15,20,25,.25);
  border: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  pointer-events: auto;
  animation: toastIn .3s var(--ease);
  position: relative;
}
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.toast.out { animation: toastOut .25s var(--ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }
.toast::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.toast.success::before { background: var(--success); }
.toast.error::before { background: var(--danger); }
.toast.info::before { background: var(--info); }
.toast.warning::before { background: var(--warning); }
.toast-icon {
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; flex-shrink: 0;
}
.toast.success .toast-icon { background: var(--success-bg); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-bg); color: var(--danger); }
.toast.info .toast-icon { background: var(--info-bg); color: var(--info); }
.toast.warning .toast-icon { background: var(--warning-bg); color: var(--warning); }
.toast-icon svg { width: 15px; height: 15px; }
.toast-body { flex: 1; min-width: 0; }
.toast-title { font-size: 13px; font-weight: 800; letter-spacing: -.005em; }
.toast-msg { font-size: 12px; color: var(--t2); margin-top: 2px; font-weight: 500; }

/* ═══ UTILITIES ═══ */
.hidden { display: none !important; }
.muted { color: var(--t3); }
.text-center { text-align: center; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
/* ═══════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ═══════════════════════════════════════════════════════════════ */
.skeleton {
  background: linear-gradient(90deg, #f0f2f5 0%, #f8f9fb 50%, #f0f2f5 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
}
.skeleton-line { height: 12px; border-radius: 6px; }
.skeleton-title { height: 18px; border-radius: 6px; width: 60%; }
.skeleton-block { height: 60px; border-radius: 12px; }
.skeleton-circle { border-radius: 50%; }

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* Skeleton layouts for common shapes */
.skeleton-folder-tile {
  aspect-ratio: 1 / 1;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skeleton-folder-tile .skeleton-circle { width: 40px; height: 40px; border-radius: 11px; }
.skeleton-folder-tile .skeleton-line:first-of-type { width: 80%; margin-top: auto; }
.skeleton-folder-tile .skeleton-line:last-of-type { width: 55%; }

.skeleton-file-row {
  height: 72px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
}
.skeleton-file-row .skeleton-circle { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.skeleton-file-row .skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.skeleton-file-row .skeleton-line:first-child { width: 65%; }
.skeleton-file-row .skeleton-line:last-child { width: 40%; height: 10px; }