/* ── Card Component ───────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}
.card img {
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--border-active);
  border-color: var(--border-active);
}
.card:active { transform: translateY(-1px); }

/* Folder Card */
.card.folder .card-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--bg-elevated);
}
.card.folder .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.card.folder:hover .card-thumb img { transform: scale(1.06); }
.card.folder .folder-icon-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(6px);
  padding: 4px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-primary);
}

/* Photo / Image Card */
.card.photo .card-thumb, .card.image .card-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-elevated);
}
.card.photo .card-thumb img, .card.image .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.card.photo:hover .card-thumb img, .card.image:hover .card-thumb img { transform: scale(1.08); }

/* Video Card */
.card.video .card-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-elevated);
  position: relative;
}
.card.video .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.card.video:hover .card-thumb img { transform: scale(1.05); }
.play-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
}
.play-badge svg {
  width: 36px;
  height: 36px;
  color: white;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.5));
}

/* Document Card */
.card.document .card-thumb.doc-thumb {
  aspect-ratio: 4/3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated);
}
.doc-card-icon {
  font-size: 42px;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.4));
  transition: transform .25s ease;
}
.card.document:hover .doc-card-icon {
  transform: scale(1.15);
}

/* Card Label */
.card-label {
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.card-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  font-size: 11px;
  color: var(--text-muted);
}

@media (max-width: 480px) {
  .card-label { display: none; }
  .card { border-radius: var(--r-md); }
}

/* List View Rows */
.gallery-grid.list-view .card {
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  transform: none !important;
}
.gallery-grid.list-view .card:hover {
  transform: none !important;
}
.gallery-grid.list-view .card .card-thumb {
  width: 44px !important;
  height: 44px !important;
  aspect-ratio: unset !important;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}
.gallery-grid.list-view .card .card-thumb img {
  width: 100%;
  height: 100%;
}
.gallery-grid.list-view .card-label {
  flex: 1;
  padding: 0;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  display: flex !important;
}
.gallery-grid.list-view .card-name { font-size: 13px; }
.gallery-grid.list-view .play-badge { display: none; }

/* Skeleton Loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--r-lg);
}
.skeleton-thumb { aspect-ratio: 1; }
.skeleton-label { height: 14px; width: 70%; margin: 10px; border-radius: 4px; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* States */
.hidden { display: none !important; }

.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.empty-sub { font-size: 13px; }

.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Lightbox & Document Fallback ─────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
.lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5,6,10,.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.lb-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(92vw, 1100px);
  max-height: 92vh;
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transform: scale(.96);
  transition: transform .22s ease;
}
.lightbox.open .lb-panel { transform: scale(1); }

@media (max-width: 768px) {
  .lb-panel { width: 96vw; border-radius: var(--r-lg); }
}

/* Toolbar */
.lb-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lb-filename {
  flex: 1;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-toolbar-actions { display: flex; gap: 6px; }
.lb-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--r-sm);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all .15s;
}
.lb-btn svg { width: 16px; height: 16px; }
.lb-btn:hover { background: var(--bg-hover); color: var(--text-primary); border-color: var(--border-active); }
.lb-btn.lb-btn-danger:hover { background: rgba(239, 68, 68, 0.25); color: #ef4444; border-color: rgba(239, 68, 68, 0.5); }

/* Stage */
.lb-stage {
  flex: 1;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 0;
  position: relative;
}

.lb-media-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 0;
  overflow: hidden;
}
.lb-media-wrap img,
.lb-media-wrap video {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  border-radius: var(--r-md);
}

/* Document Fallback Card inside Lightbox */
.doc-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-elevated);
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  max-width: 480px;
}
.doc-icon-large {
  font-size: 64px;
  margin-bottom: 12px;
}
.doc-fallback-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
  word-break: break-all;
}
.doc-fallback-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 20px;
}
.btn.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--accent);
  color: white;
  text-decoration: none;
  font-weight: 600;
  border-radius: var(--r-md);
  font-size: 13.5px;
  transition: background .18s ease;
}
.btn.download-btn:hover {
  background: var(--accent-dim);
}

/* Nav arrows */
.lb-nav {
  flex-shrink: 0;
  width: 44px;
  height: 100%;
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .18s;
}
.lb-nav:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.lb-nav svg { width: 22px; height: 22px; }
.lb-nav:disabled { opacity: .2; cursor: default; pointer-events: none; }

/* Counter */
.lb-counter {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

/* ── Mkdir Modal ────────────────────────────────────────────── */
.mkdir-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: 7px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s ease;
}
.mkdir-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}

.mkdir-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.mkdir-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px);
}
.mkdir-modal-box {
  position: relative;
  width: 320px;
  max-width: 90vw;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 2;
  animation: popIn .2s ease;
}
.mkdir-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.mkdir-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}
.mkdir-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  margin-bottom: 20px;
}
.mkdir-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.mkdir-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.mkdir-btn-action {
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: none;
}
.mkdir-btn-action.cancel {
  background: var(--bg-elevated);
  color: var(--text-secondary);
}
.mkdir-btn-action.confirm {
  background: var(--accent);
  color: #fff;
}

/* ── File Upload & Dropzone UI ────────────────────────────── */
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, var(--accent-dim), #4f46e5);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(99,102,241,.35);
  transition: all .2s ease;
}
.upload-btn:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(129,140,248,.45);
}
.upload-btn svg { width: 16px; height: 16px; }

/* Upload Destination Folder Selector */
.upload-dest-group {
  margin-bottom: 16px;
  text-align: left;
}
.upload-dest-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.upload-dest-select-wrap {
  position: relative;
  width: 100%;
}
.upload-dest-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: auto;
}
.upload-dest-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Upload Progress Modal */
.upload-modal {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 16px 20px;
  animation: slideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
}
.upload-modal-header { margin-bottom: 10px; }
.upload-modal-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.upload-progress-bar {
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}
.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  transition: width .2s ease;
}
.upload-status-detail { font-size: 12px; color: var(--text-secondary); }

/* ── Upload Options Modal UI ──────────────────────────────── */
.upload-opt-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease;
}
.upload-opt-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
}
.upload-opt-box {
  position: relative;
  width: 380px;
  max-width: 92vw;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  z-index: 2;
  animation: popIn .2s ease;
}
.upload-opt-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.upload-opt-sub {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 18px;
}
.upload-mode-selector {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}
.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: all .18s ease;
}
.mode-option:hover {
  background: var(--bg-elevated);
  border-color: rgba(129,140,248,.3);
}
.mode-option.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(129,140,248,.3);
}
.mode-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--accent);
}
.mode-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mode-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
}
.mode-desc {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.upload-opt-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ── Multi-Selection UI ─────────────────────────────────────── */
.card-checkbox {
  display: flex;
  position: absolute;
  top: 8px;
  left: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(19,20,28,.75);
  border: 2px solid rgba(255,255,255,.6);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  z-index: 10;
  cursor: pointer;
  transition: all .15s ease;
  backdrop-filter: blur(4px);
  opacity: 0.5;
}
.card:hover .card-checkbox,
.card.selected .card-checkbox,
.card-checkbox.checked {
  display: flex;
  opacity: 1;
}
.card-checkbox:hover {
  transform: scale(1.15);
  border-color: var(--accent);
  background: rgba(99,102,241,.5);
}
.card.selected {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.card-checkbox.checked {
  background: var(--accent);
  border-color: var(--accent);
  opacity: 1;
  display: flex;
}

/* Floating Multi-Selection Action Bar */
.selection-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: 30px;
  padding: 8px 16px 8px 20px;
  box-shadow: var(--shadow-lg);
  animation: slideUp .25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 90vw;
}
.selection-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.selection-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
}
.selection-close-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.selection-count {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}
.selection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.selection-act-btn {
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.selection-act-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-active);
}
.selection-act-btn.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}
.selection-act-btn.danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: #ef4444;
}

/* ── Favorite Star & Storage Meter & Filter Controls ─────── */
.card-fav-btn {
  display: none;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(19,20,28,.8);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  align-items: center;
  justify-content: center;
  z-index: 5;
  cursor: pointer;
  transition: all .15s ease;
}
.card:hover .card-fav-btn,
.card-fav-btn.active,
.card.is-fav .card-fav-btn {
  display: flex;
}
.card-fav-btn.active {
  background: rgba(234, 179, 8, 0.2);
  border-color: rgba(234, 179, 8, 0.6);
  color: #facc15;
}

/* Storage Meter in Sidebar */
.storage-meter {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.storage-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-secondary);
}
.storage-text {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
}
.storage-bar {
  height: 5px;
  background: var(--bg-surface);
  border-radius: 3px;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 3px;
  transition: width .3s ease;
}

/* Breadcrumb & Toolbar Controls Bar */
.breadcrumb-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}
.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-elevated);
  padding: 3px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
}
.filter-tab {
  padding: 4px 10px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
}
.filter-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.filter-tab.active {
  background: var(--accent-dim);
  color: #fff;
  font-weight: 600;
}
.sort-select {
  padding: 5px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text-primary);
  font-size: 12px;
  outline: none;
  cursor: pointer;
}
.sort-select:focus {
  border-color: var(--accent);
}
.lb-btn.active {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Move Toolbar Button ──────────────────────────────────── */
.move-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(2, 132, 199, .35);
  transition: all .2s ease;
}
.move-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, .45);
}
.move-btn svg { width: 16px; height: 16px; }

.selection-act-btn.highlight {
  background: #0284c7;
  color: #fff;
  border-color: #0284c7;
}
.selection-act-btn.highlight:hover {
  background: #0ea5e9;
  border-color: #0ea5e9;
}

/* ── Card Drag & Drop to Move ────────────────────────────── */
.card[draggable="true"] {
  cursor: grab;
}
.card[draggable="true"]:active {
  cursor: grabbing;
}
.card.is-dragging {
  opacity: 0.45 !important;
  transform: scale(0.98);
  outline: none !important;
  border-color: transparent !important;
  box-shadow: none !important;
}
.card.folder.drag-target-hover {
  outline: 2px solid #38bdf8 !important;
  outline-offset: -2px;
  transform: scale(1.03);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4) !important;
  background: rgba(56, 189, 248, 0.16) !important;
  z-index: 20;
  transition: all 0.15s ease-out;
}
.crumb.crumb-drag-hover {
  background: rgba(56, 189, 248, 0.3) !important;
  color: #38bdf8 !important;
  border-color: #38bdf8 !important;
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
}

/* Suppress any legacy dropzone overlay completely */
.dropzone-overlay,
#dropzoneOverlay {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* ── Move Modal ───────────────────────────────────────────── */
.move-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease-out;
}
.move-modal.hidden {
  display: none;
}
.move-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
}
.move-modal-box {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-xl);
  padding: 24px;
  width: 92%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 85vh;
}
.move-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.move-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}
.modal-close-icon-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  transition: all .15s ease;
}
.modal-close-icon-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.move-modal-sub {
  font-size: 13px;
  color: var(--text-secondary);
  margin: -6px 0 0 0;
}
.move-tree-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 4px;
}
.move-tree-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.move-tree-new-folder-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
}
.move-tree-new-folder-btn:hover {
  background: var(--bg-hover);
  border-color: #0284c7;
  color: #38bdf8;
}
.move-folder-tree-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--r-md);
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  padding: 6px;
  gap: 2px;
}
.move-tree-loading {
  padding: 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
}
.move-folder-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: all .15s ease;
  user-select: none;
}
.move-folder-item:hover {
  background: var(--bg-hover);
}
.move-folder-item.selected {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.4);
}
.move-folder-item.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.move-folder-item .folder-badge {
  margin-left: auto;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text-secondary);
}
.move-modal-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}
.move-dest-preview {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.move-dest-preview .dest-label {
  color: var(--text-secondary);
}
.move-dest-preview .dest-path {
  color: #38bdf8;
  font-weight: 600;
  background: rgba(56, 189, 248, 0.1);
  padding: 2px 8px;
  border-radius: var(--r-sm);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.move-confirm-btn {
  background: linear-gradient(135deg, #0284c7, #0369a1) !important;
  color: #fff !important;
}
.move-confirm-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7) !important;
}

/* ── Toast Notification ───────────────────────────────────── */
.toast-notification {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(23, 25, 35, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(56, 189, 248, 0.2);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 10000;
  animation: slideUpFade .25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.toast-notification.hidden {
  display: none;
}
@keyframes slideUpFade {
  from { opacity: 0; transform: translateX(-50%) translateY(20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Duplicate Photos Detection Modal (Immich feature) ────── */
.dup-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn .2s ease-out;
}
.dup-modal.hidden { display: none; }
.dup-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 9, 14, 0.78);
  backdrop-filter: blur(6px);
}
.dup-modal-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--r-xl);
  width: 96vw;
  max-width: 1280px;
  height: 90vh;
  max-height: 900px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 60px rgba(0,0,0,0.6);
  animation: popIn .2s ease-out;
  overflow: hidden;
}
.dup-modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}
.dup-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dup-icon {
  font-size: 26px;
  filter: drop-shadow(0 2px 6px rgba(56, 189, 248, 0.3));
}
.dup-modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.dup-modal-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Toolbar */
.dup-controls-toolbar {
  padding: 12px 24px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.dup-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dup-control-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.dup-select {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: 13px;
  outline: none;
  cursor: pointer;
}
.dup-scan-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-left: auto;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
  transition: all 0.2s ease;
}
.dup-scan-btn:hover {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(14, 165, 233, 0.45);
}

/* Summary Bar */
.dup-summary-bar {
  padding: 10px 24px;
  background: rgba(14, 165, 233, 0.08);
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dup-summary-bar.hidden { display: none; }
.dup-summary-stats {
  font-size: 13.5px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dup-waste-highlight {
  color: #38bdf8;
  font-weight: 600;
}
.dup-summary-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.dup-action-btn {
  padding: 6px 12px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}
.dup-action-btn.secondary {
  background: var(--bg-card);
  border-color: var(--border-active);
  color: var(--text-secondary);
}
.dup-action-btn.secondary:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.dup-action-btn.danger {
  background: #dc2626;
  color: #fff;
  font-weight: 600;
}
.dup-action-btn.danger:hover:not(:disabled) {
  background: #ef4444;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}
.dup-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Results Container */
.dup-results-container {
  flex: 1;
  overflow-y: auto;
  padding: 18px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: var(--bg-body);
}

/* Loading & Empty */
.dup-empty-prompt {
  margin: auto;
  text-align: center;
  padding: 60px 20px;
}
.dup-empty-icon { font-size: 46px; margin-bottom: 12px; }
.dup-empty-title { font-size: 16px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.dup-empty-desc { font-size: 13.5px; color: var(--text-secondary); max-width: 440px; margin: 0 auto; line-height: 1.5; }

.dup-loading {
  margin: auto;
  text-align: center;
  padding: 60px 20px;
}
.dup-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(56, 189, 248, 0.2);
  border-top-color: #38bdf8;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
.dup-loading-title { font-size: 15px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.dup-loading-sub { font-size: 13px; color: var(--text-secondary); max-width: 400px; margin: 0 auto; line-height: 1.4; }

/* Group Card */
.dup-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.28);
  transition: border-color 0.2s;
  margin-bottom: 16px;
  flex-shrink: 0;
  width: 100%;
}
.dup-group-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
}
.dup-group-header {
  padding: 12px 18px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}
.dup-group-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.dup-group-num {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
}
.dup-badge-type {
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(14, 165, 233, 0.15);
  color: #38bdf8;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.dup-badge-type.exact {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}
.dup-badge-type.visual {
  background: rgba(168, 85, 247, 0.18);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}
.dup-group-size {
  color: var(--text-muted);
  font-size: 12px;
}
.dup-group-right-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dup-group-waste {
  color: var(--text-secondary);
  font-size: 12.5px;
}
.dup-group-waste strong {
  color: #f87171;
  font-weight: 700;
}
.dup-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-active);
  color: var(--text-primary);
  padding: 5px 12px;
  border-radius: var(--r-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dup-group-btn:hover {
  background: var(--bg-hover);
  border-color: #38bdf8;
  color: #38bdf8;
  transform: translateY(-1px);
}
.dup-group-btn.highlight {
  background: rgba(14, 165, 233, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.dup-group-btn.highlight:hover {
  background: rgba(14, 165, 233, 0.3);
}

/* Photo-First Comparison Grid */
.dup-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 16px;
  padding: 16px;
}

/* Individual Photo Card */
.dup-item-card {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 220px;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #090a10;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  user-select: none;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s ease, border-color 0.22s ease;
}
.dup-item-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.55);
}
.dup-item-card.is-original {
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.25);
}
.dup-item-card.selected-for-delete {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.45);
}

/* Photo Image */
.dup-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.dup-item-card:hover .dup-photo-img {
  transform: scale(1.04);
}

/* Delete Tint Overlay */
.dup-delete-tint {
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.dup-item-card.selected-for-delete .dup-delete-tint {
  opacity: 1;
}

/* Top Bar: Badge + Circular Checkbox */
.dup-photo-top-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
  pointer-events: none;
}
.dup-status-badge {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.dup-status-badge.orig {
  background: rgba(16, 185, 129, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.dup-status-badge.copy {
  background: rgba(239, 68, 68, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}
.dup-status-badge.kept {
  background: rgba(56, 189, 248, 0.9);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.dup-check-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.18s ease;
  font-size: 15px;
  font-weight: 800;
}
.dup-item-card.selected-for-delete .dup-check-circle {
  background: #ef4444;
  border: 2px solid #fff;
  color: #fff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.6);
}
.dup-item-card:not(.selected-for-delete) .dup-check-circle {
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.8);
  color: transparent;
}
.dup-item-card:hover .dup-check-circle {
  transform: scale(1.08);
}

/* Hover Zoom Button in Center */
.dup-photo-center-action {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: auto;
}
.dup-item-card:hover .dup-photo-center-action {
  opacity: 1;
}
.dup-zoom-action-btn {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
  transition: all 0.15s ease;
}
.dup-zoom-action-btn:hover {
  background: #0284c7;
  border-color: #38bdf8;
  transform: scale(1.05);
}

/* Bottom Metadata Gradient Overlay */
.dup-photo-bottom-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 2;
  padding: 32px 12px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.65) 60%, transparent 100%);
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dup-photo-name {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.dup-photo-folder {
  color: rgba(255, 255, 255, 0.85);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}
.dup-photo-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 2px;
}

/* Footer */
.dup-modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dup-footer-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}
.dup-footer-hint strong {
  color: #86efac;
}
.nav-badge.clean {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

/* ── Side-by-Side Photo Comparison Modal ── */
.dup-compare-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
}
.dup-compare-modal.hidden {
  display: none;
}
.dup-compare-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}
.dup-compare-box {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--r-xl);
  width: 96vw;
  max-width: 1360px;
  height: 92vh;
  max-height: 920px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
  animation: popIn 0.2s ease-out;
  overflow: hidden;
}
.dup-compare-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
}
.dup-compare-title-group {
  display: flex;
  align-items: center;
  gap: 12px;
}
.dup-compare-icon {
  font-size: 24px;
}
.dup-compare-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.dup-compare-sub {
  font-size: 12px;
  color: var(--text-secondary);
}
.dup-compare-body {
  flex: 1;
  overflow-x: auto;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  gap: 20px;
  background: var(--bg-body);
  align-items: stretch;
}
.dup-compare-card {
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  flex: 0 0 380px;
  width: 380px;
}
.dup-compare-card.is-keep {
  border-color: #10b981;
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}
.dup-compare-card.is-delete {
  border-color: #ef4444;
  box-shadow: 0 0 18px rgba(239, 68, 68, 0.35);
}
.dup-compare-img-box {
  height: 270px;
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.dup-compare-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}
.dup-compare-card-footer {
  padding: 14px 18px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dup-compare-file-info {
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dup-compare-file-name {
  font-weight: 700;
  font-size: 13.5px;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dup-compare-file-path {
  color: var(--text-muted);
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dup-compare-toggle-btn {
  padding: 8px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.18s ease;
  border: 1px solid transparent;
}
.dup-compare-toggle-btn.btn-keep {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.5);
}
.dup-compare-toggle-btn.btn-keep:hover {
  background: rgba(16, 185, 129, 0.35);
}
.dup-compare-toggle-btn.btn-delete {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.5);
}
.dup-compare-toggle-btn.btn-delete:hover {
  background: rgba(239, 68, 68, 0.35);
}
.dup-compare-footer {
  padding: 14px 24px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.dup-compare-hint {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* ── Storage Quota Header Widget ────────────────────────── */
.quota-widget-wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle, rgba(255,255,255,0.08));
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 200px;
}

.quota-widget-wrapper:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--accent, #6366f1);
}

.quota-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.74rem;
}

.quota-plan-tag {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.quota-plan-tag.badge-free {
  background: rgba(148, 163, 184, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.quota-plan-tag.badge-pro {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(56, 189, 248, 0.25));
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.5);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.2);
}

.quota-usage-text {
  color: var(--text-primary, #fff);
  font-weight: 600;
  font-size: 0.72rem;
  white-space: nowrap;
}

.quota-upgrade-btn {
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  border: none;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.quota-upgrade-btn:hover {
  transform: scale(1.05);
}

.quota-mini-progress {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.quota-mini-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

/* Quota Breakdown Hover Tooltip */
.quota-breakdown-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: #181d28;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 10000;
  display: none;
  animation: fadeIn 0.15s ease;
  pointer-events: none;
}

.quota-widget-wrapper:hover .quota-breakdown-tooltip {
  display: block;
}

.tooltip-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 0.35rem;
}

.tooltip-row strong {
  color: #fff;
}

.tooltip-footer {
  margin-top: 0.6rem;
  padding-top: 0.4rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.7rem;
  color: #38bdf8;
  text-align: center;
  font-weight: 600;
}

/* ── Upgrade Modal Specific Styles ──────────────────────── */
.modal-backdrop.open {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-box.large {
  max-width: 680px;
  width: 90%;
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  animation: modalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPop {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.plan-badge-pill {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  display: inline-block;
}

.plan-badge-pill.free {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.plan-badge-pill.pro {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.upgrade-status-box {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.upgrade-progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.upgrade-progress-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.upgrade-breakdown-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.quota-cat-row {
  display: grid;
  grid-template-columns: 110px 1fr 100px;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.78rem;
}

.quota-cat-name {
  color: rgba(255, 255, 255, 0.9);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.quota-cat-count {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.7rem;
}

.quota-cat-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
}

.quota-cat-bar-fill {
  height: 100%;
  background: #38bdf8;
  border-radius: 9999px;
}

.quota-cat-size {
  text-align: right;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  font-size: 0.74rem;
}

.pro-plan-card {
  margin-top: 1.25rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(56, 189, 248, 0.08));
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.pro-plan-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.85rem;
}

.pro-badge {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  color: #fff;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  display: inline-block;
}

.pro-price {
  text-align: right;
}

.price-val {
  font-size: 1.45rem;
  font-weight: 900;
  color: #38bdf8;
}

.price-unit {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.pro-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.pro-feature-list li {
  font-size: 0.83rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}



