/* Pagram cloude NAS - Premium Utilitarian Minimalist Design System */
/* Clean, warm monochrome palette, crisp 1px borders, anti-slop, zero neon */

:root {
  /* Default: Clean Warm Minimalist Light Theme */
  --bg-canvas: #f8f9fa;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f3f5;
  --bg-hover: #f3f4f6;
  --bg-active: #e5e7eb;

  --border-color: #e5e7eb;
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-hover: #cbd5e1;
  --border-focus: #18181b;

  --text-primary: #111827;
  --text-secondary: #4b5563;
  --text-muted: #6b7280;
  --text-faint: #9ca3af;

  /* Restrained semantic accents */
  --accent-primary: #18181b;
  --accent-primary-hover: #27272a;
  --accent-primary-text: #ffffff;

  --accent-blue: #2563eb;
  --accent-blue-bg: #eff6ff;
  --accent-blue-border: #bfdbfe;

  --accent-emerald: #059669;
  --accent-emerald-bg: #ecfdf5;
  --accent-emerald-border: #a7f3d0;

  --accent-danger: #dc2626;
  --accent-danger-bg: #fef2f2;
  --accent-danger-border: #fecaca;

  --accent-amber: #d97706;
  --accent-amber-bg: #fffbeb;
  --accent-amber-border: #fde68a;

  /* File Type Pastel Categories (Clean, desaturated) */
  --cat-folder-bg: #fefce8;
  --cat-folder-fg: #b45309;
  --cat-video-bg: #eff6ff;
  --cat-video-fg: #2563eb;
  --cat-image-bg: #ecfdf5;
  --cat-image-fg: #059669;
  --cat-audio-bg: #fdf4ff;
  --cat-audio-fg: #a21caf;
  --cat-document-bg: #f0fdf4;
  --cat-document-fg: #16a34a;
  --cat-archive-bg: #fff7ed;
  --cat-archive-fg: #c2410c;
  --cat-code-bg: #f8fafc;
  --cat-code-fg: #334155;
  --cat-other-bg: #f1f5f9;
  --cat-other-fg: #475569;

  /* Storage segment colors */
  --bar-os-color: #94a3b8;
  --bar-nas-color: #2563eb;
  --bar-free-color: #10b981;

  /* Radii & Elevations */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 8px 20px -4px rgba(0, 0, 0, 0.08), 0 2px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Emil Design Eng Micro-transitions (<180ms) */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.175, 0.885, 0.32, 1.15);
  --duration-fast: 140ms;
  --duration-normal: 200ms;
}

/* Dark Minimalist Theme */
[data-theme="dark"] {
  --bg-canvas: #09090b;
  --bg-surface: #121214;
  --bg-elevated: #18181b;
  --bg-subtle: #1c1c20;
  --bg-hover: #222226;
  --bg-active: #27272a;

  --border-color: #27272a;
  --border-subtle: rgba(255, 255, 255, 0.07);
  --border-hover: #3f3f46;
  --border-focus: #f4f4f5;

  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;

  --accent-primary: #ffffff;
  --accent-primary-hover: #e4e4e7;
  --accent-primary-text: #09090b;

  --accent-blue: #3b82f6;
  --accent-blue-bg: rgba(59, 130, 246, 0.12);
  --accent-blue-border: rgba(59, 130, 246, 0.25);

  --accent-emerald: #10b981;
  --accent-emerald-bg: rgba(16, 185, 129, 0.12);
  --accent-emerald-border: rgba(16, 185, 129, 0.25);

  --accent-danger: #ef4444;
  --accent-danger-bg: rgba(239, 68, 68, 0.12);
  --accent-danger-border: rgba(239, 68, 68, 0.25);

  --accent-amber: #f59e0b;
  --accent-amber-bg: rgba(245, 158, 11, 0.12);
  --accent-amber-border: rgba(245, 158, 11, 0.25);

  --cat-folder-bg: rgba(234, 179, 8, 0.12);
  --cat-folder-fg: #facc15;
  --cat-video-bg: rgba(59, 130, 246, 0.12);
  --cat-video-fg: #60a5fa;
  --cat-image-bg: rgba(16, 185, 129, 0.12);
  --cat-image-fg: #34d399;
  --cat-audio-bg: rgba(192, 38, 211, 0.12);
  --cat-audio-fg: #e879f9;
  --cat-document-bg: rgba(34, 197, 94, 0.12);
  --cat-document-fg: #4ade80;
  --cat-archive-bg: rgba(234, 88, 12, 0.12);
  --cat-archive-fg: #fb923c;
  --cat-code-bg: rgba(148, 163, 184, 0.12);
  --cat-code-fg: #94a3b8;
  --cat-other-bg: rgba(100, 116, 139, 0.12);
  --cat-other-fg: #94a3b8;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-card-hover: 0 8px 20px -4px rgba(0, 0, 0, 0.6);
  --shadow-modal: 0 20px 25px -5px rgba(0, 0, 0, 0.7);
}

/* Reset & Base Standards */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  min-height: 100dvh;
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--duration-normal) var(--ease-out), color var(--duration-normal) var(--ease-out);
}

.tabular-nums {
  font-variant-numeric: tabular-nums;
  font-family: 'JetBrains Mono', monospace;
}

/* Typography utilities */
.text-emerald { color: var(--accent-emerald) !important; }
.text-danger { color: var(--accent-danger) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Main App Shell Layout */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Top Sticky Navigation Bar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-xs);
  transition: background-color var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .navbar {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
  [data-theme="dark"] .navbar {
    background-color: rgba(18, 18, 20, 0.85);
  }
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-xs);
}

.brand-icon svg {
  width: 18px;
  height: 18px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.brand-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.125rem 0.45rem;
  border-radius: var(--radius-pill);
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Center Status Indicator */
.status-indicator {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.85rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-pill);
  font-size: 0.775rem;
  color: var(--text-secondary);
}

@media (min-width: 860px) {
  .status-indicator {
    display: inline-flex;
  }
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 0 2px var(--accent-emerald-bg);
  animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-ring {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

.status-sep {
  color: var(--text-faint);
}

.status-device {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Navbar Action Buttons */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Button Component System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: inherit;
  font-size: 0.825rem;
  font-weight: 600;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn .icon, .btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-primary {
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  background-color: var(--accent-primary-hover);
  border-color: var(--accent-primary-hover);
}

.btn-primary-sm {
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  border-color: var(--accent-primary);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-primary-sm:hover {
  background-color: var(--accent-primary-hover);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-color);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--bg-hover);
  border-color: var(--border-hover);
}

.btn-subtle {
  background-color: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-subtle:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-subtle-sm {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 0.775rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-subtle-sm:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--accent-danger);
  color: #ffffff;
  border-color: var(--accent-danger);
}

.btn-danger:hover {
  opacity: 0.92;
}

.btn-danger-sm {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
  border: 1px solid var(--accent-danger-border);
  font-size: 0.775rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.btn-danger-sm:hover {
  background-color: var(--accent-danger);
  color: #ffffff;
}

.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-fast) var(--ease-out);
}

.btn-icon:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon svg {
  width: 17px;
  height: 17px;
}

/* Visibility Helpers */
.hide-mobile { display: inline-flex !important; }
.show-mobile-only { display: none !important; }

@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .show-mobile-only { display: inline-flex !important; }
  .navbar { padding: 0.625rem 1rem; }
}

/* Main Container */
.main-content {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .main-content {
    padding: 1rem;
    padding-bottom: 5.5rem; /* For mobile bottom dock */
    gap: 1rem;
  }
}

/* Storage Hero Status Section */
.storage-hero {
  width: 100%;
}

.storage-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: background-color var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
}

.storage-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.125rem;
}

.storage-headline {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.storage-eyebrow {
  font-size: 0.725rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.storage-large-num {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

.storage-large-num #stat-free-space {
  font-family: 'JetBrains Mono', monospace;
}

.storage-unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.storage-meta-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-item {
  font-size: 0.725rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.badge-green {
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
}

.badge-neutral {
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', monospace;
}

/* Multi-Segment Minimalist Storage Bar */
.storage-meter-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.storage-bar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.storage-bar-pct {
  font-weight: 600;
  color: var(--text-primary);
}

.multi-progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
  display: flex;
  border: 1px solid var(--border-subtle);
}

.bar-segment {
  height: 100%;
  transition: width 400ms var(--ease-out);
}

.bar-os { background-color: var(--bar-os-color); }
.bar-nas { background-color: var(--bar-nas-color); }
.bar-free { background-color: var(--bar-free-color); }

.storage-legend {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-os { background-color: var(--bar-os-color); }
.dot-nas { background-color: var(--bar-nas-color); }
.dot-free { background-color: var(--bar-free-color); }

/* Explorer Section */
.explorer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Breadcrumbs */
.breadcrumbs-container {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 100%;
}

.breadcrumbs-container::-webkit-scrollbar {
  display: none;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.825rem;
}

.breadcrumb-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: inherit;
  font-weight: 500;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all var(--duration-fast) var(--ease-out);
}

.breadcrumb-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.breadcrumb-item.active {
  color: var(--text-primary);
  font-weight: 700;
  cursor: default;
}

.breadcrumb-item svg {
  width: 14px;
  height: 14px;
}

.breadcrumb-sep {
  color: var(--text-faint);
  font-size: 0.75rem;
  user-select: none;
}

/* Explorer Tools (Search, Sort, Toggle) */
.explorer-tools {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.65rem;
  height: 36px;
  width: 220px;
  transition: all var(--duration-fast) var(--ease-out);
  box-shadow: var(--shadow-xs);
}

@media (max-width: 640px) {
  .search-box {
    width: 100%;
    order: 2;
  }
}

.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px var(--border-subtle);
}

.search-icon {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  flex-shrink: 0;
  margin-right: 0.4rem;
}

.search-box input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.8rem;
}

.search-box input::placeholder {
  color: var(--text-faint);
}

.search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  display: none;
}

.search-clear:hover {
  color: var(--text-primary);
}

/* Sort Dropdown */
.custom-select-wrap {
  position: relative;
  height: 36px;
}

.custom-select-wrap select {
  height: 100%;
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 1.75rem 0 0.75rem;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-fast) var(--ease-out);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.6rem center;
}

.custom-select-wrap select:focus {
  border-color: var(--border-focus);
}

/* View Mode Switcher (Grid / List) */
.view-toggle {
  display: flex;
  align-items: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2px;
  height: 36px;
}

.toggle-btn {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.toggle-btn svg {
  width: 15px;
  height: 15px;
}

.toggle-btn:hover {
  color: var(--text-primary);
}

.toggle-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
}

/* Category Filter Tabs (Zero-slop, clean minimalism) */
.category-tabs {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 0.25rem;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 0.375rem 0.85rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 0.775rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-fast) var(--ease-out);
}

.cat-pill:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.cat-pill.active {
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  border-color: var(--accent-primary);
  font-weight: 600;
}

/* Bulk Selection Bar */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.625rem 1rem;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.825rem;
  font-weight: 600;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* File Viewport (Grid Mode) */
.file-viewport {
  width: 100%;
}

.file-viewport.grid-mode {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}

@media (max-width: 640px) {
  .file-viewport.grid-mode {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
  }
}

@media (max-width: 340px) {
  .file-viewport.grid-mode {
    grid-template-columns: 1fr;
  }
}

/* File Card Component */
.file-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-normal) var(--ease-out);
  min-height: 135px;
  overflow: hidden;
}

@media (max-width: 640px) {
  .file-card {
    padding: 0.75rem 0.85rem;
    min-height: 120px;
    border-radius: var(--radius-md);
  }
}

.file-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

.file-card:active {
  transform: scale(0.985);
}

.folder-card {
  background-color: var(--bg-surface);
}

.file-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 640px) {
  .file-card-top {
    margin-bottom: 0.5rem;
  }
}

/* Pastel Icon Wrappers & Thumbnails */
.file-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform var(--duration-fast) var(--ease-out);
  position: relative;
  overflow: hidden;
}

@media (max-width: 640px) {
  .file-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
  }
}

.file-card:hover .file-icon-wrap {
  transform: scale(1.04);
}

.file-icon-wrap svg {
  width: 20px;
  height: 20px;
}

@media (max-width: 640px) {
  .file-icon-wrap svg {
    width: 18px;
    height: 18px;
  }
}

.file-icon-wrap.has-thumb {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.file-card-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.icon-folder { background-color: var(--cat-folder-bg); color: var(--cat-folder-fg); }
.icon-video { background-color: var(--cat-video-bg); color: var(--cat-video-fg); }
.icon-image { background-color: var(--cat-image-bg); color: var(--cat-image-fg); }
.icon-audio { background-color: var(--cat-audio-bg); color: var(--cat-audio-fg); }
.icon-document { background-color: var(--cat-document-bg); color: var(--cat-document-fg); }
.icon-archive { background-color: var(--cat-archive-bg); color: var(--cat-archive-fg); }
.icon-code { background-color: var(--cat-code-bg); color: var(--cat-code-fg); }
.icon-other { background-color: var(--cat-other-bg); color: var(--cat-other-fg); }

/* Quick Action Bar on Card */
.card-actions-hover {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  opacity: 0.85;
  transition: opacity var(--duration-fast) var(--ease-out);
}

.file-card:hover .card-actions-hover {
  opacity: 1;
}

.card-actions-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.action-btn-mini {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.action-btn-mini:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.action-btn-mini.danger:hover {
  background-color: var(--accent-danger-bg);
  color: var(--accent-danger);
  border-color: var(--accent-danger-border);
}

.action-btn-mini svg {
  width: 13px;
  height: 13px;
}

/* More Actions Trigger Button (Clean for mobile & touch) */
.action-btn-more {
  width: 30px;
  height: 30px;
  display: none;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.action-btn-more:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.action-btn-more:active {
  transform: scale(0.92);
}

.action-btn-more svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 640px) {
  .card-actions-desktop {
    display: none !important;
  }
  .action-btn-more {
    display: inline-flex !important;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
  }
  .card-actions-hover {
    opacity: 1 !important;
  }
}

/* File Card Details */
.file-card-details {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
}

.file-card-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  overflow-wrap: anywhere;
  min-height: 2.7em;
}

@media (max-width: 640px) {
  .file-card-name {
    font-size: 0.775rem;
    min-height: 2.7em;
  }
}

.file-card-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.meta-size {
  font-weight: 500;
}

.meta-dot {
  color: var(--text-faint);
  font-size: 0.65rem;
  user-select: none;
}

.meta-date {
  color: var(--text-muted);
}

/* File Viewport (List Mode) */
.file-viewport.list-mode {
  display: flex;
  flex-direction: column;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.list-row {
  display: grid;
  grid-template-columns: 36px 1fr 100px 140px 130px;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out);
  font-size: 0.825rem;
}

.list-row:last-child {
  border-bottom: none;
}

.list-row:hover:not(.list-header) {
  background-color: var(--bg-hover);
}

.list-header {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background-color: var(--bg-subtle);
  cursor: default;
}

.list-file-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-xs);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.list-file-icon svg {
  width: 16px;
  height: 16px;
}

.list-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.list-col-name {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  overflow: hidden;
  min-width: 0;
}

.list-name-text {
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.825rem;
}

.list-meta-mobile {
  display: none;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.list-col-mtime {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.list-col-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.hide-desktop {
  display: none;
}

@media (max-width: 640px) {
  .list-header {
    display: none !important;
  }
  .list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0.875rem;
    gap: 0.65rem;
  }
  .list-col-size,
  .list-col-mtime {
    display: none !important;
  }
  .hide-desktop {
    display: flex !important;
  }
  .list-col-actions .card-actions-desktop {
    display: none !important;
  }
  .list-col-actions .action-btn-more {
    display: inline-flex !important;
  }
}

/* Empty & Loading States */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  margin: 1rem 0;
}

.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-lg);
  background-color: var(--bg-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.empty-icon svg {
  width: 28px;
  height: 28px;
}

.empty-state h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 380px;
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 4rem 1.5rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Floating Upload Task Drawer */
.upload-drawer {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  width: 360px;
  max-width: calc(100vw - 3rem);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-up 200ms var(--ease-out);
}

@media (max-width: 640px) {
  .upload-drawer {
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: none;
    bottom: calc(68px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background-color: var(--bg-subtle);
  border-bottom: 1px solid var(--border-color);
}

.drawer-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.825rem;
  font-weight: 700;
  color: var(--text-primary);
}

.drawer-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.icon-btn-xs {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.icon-btn-xs:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.drawer-body {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@media (max-width: 640px) {
  .drawer-body {
    max-height: 180px;
  }
}

.upload-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.upload-item:last-child {
  border-bottom: none;
}

.upload-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.775rem;
}

.upload-item-name {
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item-size {
  color: var(--text-muted);
  font-size: 0.725rem;
  flex-shrink: 0;
}

.upload-progress-track {
  width: 100%;
  height: 5px;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background-color: var(--accent-primary);
  border-radius: var(--radius-pill);
  transition: width 150ms linear;
}

.upload-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Mobile Floating Bottom Dock (Thumb-friendly navigation) */
.mobile-bottom-dock {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  z-index: 35;
  padding: 0 1rem env(safe-area-inset-bottom, 0px) 1rem;
  align-items: center;
  justify-content: space-around;
}

@media (max-width: 640px) {
  .mobile-bottom-dock {
    display: flex;
  }
}

.dock-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
  flex: 1;
  max-width: 110px;
}

.dock-btn:active {
  transform: scale(0.94);
}

.dock-icon {
  width: 20px;
  height: 20px;
}

.dock-btn-primary {
  color: var(--accent-primary);
}

.dock-primary-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -8px;
  box-shadow: var(--shadow-card);
}

.dock-primary-icon svg {
  width: 17px;
  height: 17px;
}

/* Modals System (Clean, Minimalist with Mobile Bottom Sheet adaptation) */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fade-in 180ms var(--ease-out);
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 520px;
  overflow: hidden;
  animation: scale-up 180ms var(--ease-out);
  display: flex;
  flex-direction: column;
}

@keyframes scale-up {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.modal-sm {
  max-width: 440px;
}

.preview-modal-container {
  max-width: 800px;
  max-height: 85vh;
}

.modal-handle {
  display: none;
  width: 36px;
  height: 4px;
  border-radius: var(--radius-pill);
  background-color: var(--border-hover);
  margin: 0.6rem auto 0.2rem;
}

@media (max-width: 640px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-container {
    max-width: 100%;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    animation: slide-up-sheet 200ms var(--ease-out);
    max-height: 88vh;
  }
  @keyframes slide-up-sheet {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
  .modal-handle {
    display: block;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.modal-content {
  padding: 1.25rem;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* Forms & Inputs */
.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-input {
  width: 100%;
  height: 40px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.85rem;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text-primary);
  outline: none;
  transition: all var(--duration-fast) var(--ease-out);
}

.form-input:focus {
  border-color: var(--border-focus);
  background-color: var(--bg-surface);
  box-shadow: 0 0 0 2px var(--border-subtle);
}

/* Alert dialog box */
.alert-box-warning {
  background-color: var(--accent-danger-bg);
  border: 1px solid var(--accent-danger-border);
  color: var(--accent-danger);
  font-size: 0.775rem;
  padding: 0.625rem 0.85rem;
  border-radius: var(--radius-md);
  margin-top: 0.75rem;
  line-height: 1.4;
}

/* Telemetry Grid in Modal */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.telemetry-box {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.t-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
}

.t-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
}

.t-sub {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.telemetry-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.code-sm {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  background-color: var(--bg-subtle);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-xs);
  color: var(--text-primary);
}

/* Share / QR Modal */
.modal-desc {
  font-size: 0.825rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  line-height: 1.5;
}

.qr-placeholder {
  display: inline-flex;
  padding: 0.75rem;
  background-color: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.copy-url-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.copy-url-group input {
  flex: 1;
  height: 36px;
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0 0.75rem;
  font-size: 0.775rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.copy-toast {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* Preview Modal Media */
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 70%;
}

.preview-type-icon svg {
  width: 18px;
  height: 18px;
}

.preview-filename {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-filesize {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.preview-img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  margin: 0 auto;
  display: block;
}

.preview-video {
  width: 100%;
  max-height: 60vh;
  border-radius: var(--radius-md);
  background-color: #000000;
}

.preview-audio-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2rem 1rem;
}

.preview-audio-wrap audio {
  width: 100%;
  max-width: 400px;
}

.preview-text {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 55vh;
  overflow-y: auto;
}

/* Drag and Drop Backdrop Overlay */
.drag-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 70;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.drag-overlay.active {
  display: flex;
}

.drag-card {
  background-color: var(--bg-surface);
  border: 2px dashed var(--accent-primary);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  text-align: center;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow-modal);
  animation: scale-up 150ms var(--ease-out);
}

.drag-icon-ring {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--accent-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.icon-lg {
  width: 32px;
  height: 32px;
}

.drag-card h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.drag-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
}

.drag-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--accent-emerald-bg);
  color: var(--accent-emerald);
  border: 1px solid var(--accent-emerald-border);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
}

/* Toast Container & Notification Pill */
.toast-container {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

@media (min-width: 641px) {
  .toast-container {
    bottom: 2rem;
  }
}

.toast {
  pointer-events: auto;
  background-color: var(--accent-primary);
  color: var(--accent-primary-text);
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: var(--shadow-modal);
  animation: toast-in 180ms var(--ease-out);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile & Touch Action Bottom Sheet */
.sheet-modal-container {
  max-width: 440px;
}

.sheet-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.75rem;
}

.sheet-item-lead {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 0;
}

.sheet-item-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}

.sheet-item-name {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-item-meta {
  font-size: 0.725rem;
  color: var(--text-muted);
}

.sheet-actions-group {
  padding: 0.5rem 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.sheet-action-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background-color var(--duration-fast) var(--ease-out);
}

.sheet-action-item:hover,
.sheet-action-item:active {
  background-color: var(--bg-hover);
}

.sheet-action-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.sheet-action-icon svg {
  width: 18px;
  height: 18px;
}

.sheet-action-content {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  flex: 1;
  min-width: 0;
}

.sheet-action-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.sheet-action-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.sheet-action-danger .sheet-action-icon {
  background-color: var(--accent-danger-bg);
  border-color: var(--accent-danger-border);
  color: var(--accent-danger);
}

.sheet-action-danger .sheet-action-title {
  color: var(--accent-danger);
}

/* PDF Preview Frame */
.preview-pdf-wrap {
  width: 100%;
  height: 65vh;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.preview-pdf-frame {
  width: 100%;
  flex: 1;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: #333333;
}

.pdf-fallback-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.85rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  color: var(--text-secondary);
}
