/* Finder-style unified folder browse (P11) */

.dam-workspace.dam-workspace--browse-unified .dam-folder-grid-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.dam-folder-grid--unified {
  display: block;
  max-height: min(62vh, 680px);
  overflow: auto;
  padding: 4px 2px 16px;
}

.dam-browse-section {
  margin-bottom: 18px;
}

.dam-browse-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  padding: 0 4px 8px;
  border-bottom: 1px solid var(--line);
}

.dam-browse-section-head h3 {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.dam-browse-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 14px;
  align-content: start;
}

.dam-folder-grid--unified .dam-folder-card--inline-create {
  outline: 2px solid rgba(34, 139, 34, 0.55);
  outline-offset: 2px;
  background: rgba(220, 252, 231, 0.35);
}

.dam-inline-folder-input {
  width: 100%;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px 8px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(34, 139, 34, 0.35);
}

.dam-inline-folder-input:focus {
  outline: 2px solid rgba(34, 139, 34, 0.45);
  outline-offset: 1px;
}

.dam-folder-card-preview-frame--empty {
  display: grid;
  place-items: center;
  min-height: 88px;
  border-radius: 10px;
  background: #f7f6f4;
}

.dam-folder-card.is-drop-target,
.dam-folder-card--browse.is-drop-target {
  outline: 2px dashed #7c3aed;
  outline-offset: 3px;
  background: rgba(245, 243, 255, 0.85);
}

.dam-folder-card.is-dragging,
.dam-folder-card--browse.is-dragging {
  opacity: 0.58;
  cursor: grabbing;
}

.dam-asset-tile-wrap.is-dragging {
  opacity: 0.55;
}

.dam-folder-grid--unified .dam-asset-tile-wrap {
  min-height: 0;
}

.dam-folder-grid--unified .dam-folder-card-meta,
.dam-folder-grid--unified .dam-tile-footer .dam-tile-stamp {
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.dam-tile-stamp {
  display: block;
  margin-top: 2px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}

.dam-folder-browse-context-menu .dam-context-menu-hint {
  margin: 0 0 6px;
  padding: 0 10px;
  font-size: 0.75rem;
}

.dam-folder-info-popover {
  min-width: 280px;
  max-width: 360px;
  padding: 0;
}

.dam-folder-info-body {
  padding: 0 14px 14px;
}

.dam-folder-info-dl {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 0.84rem;
}

.dam-folder-info-dl dt {
  margin: 0;
  color: var(--muted);
  font-weight: 500;
}

.dam-folder-info-dl dd {
  margin: 0;
  font-weight: 600;
  color: var(--ink);
  word-break: break-word;
}

.dam-workspace.dam-workspace--browse-unified .dam-toolbar-panel--folders,
.dam-workspace.dam-workspace--chrome-unified .dam-toolbar-panel--folders {
  display: none !important;
}

/* Bulk toolbar retired — floating studio-action-bar is canonical */
.dam-workspace.dam-workspace--chrome-unified.dam-workspace--chrome-bulk .dam-toolbar-panel--bulk {
  display: none !important;
}

.dam-node-kind-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  line-height: 1.4;
  vertical-align: middle;
}

.dam-node-kind-badge--folder {
  color: #1d4ed8;
  background: rgba(59, 130, 246, 0.12);
}

.dam-node-kind-badge--collection {
  color: #6d28d9;
  background: rgba(139, 92, 246, 0.12);
}

.dam-crumb-current-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: min(52vw, 520px);
}

.dam-crumb-current-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dam-crumb-actions-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
}

.dam-crumb-segment.is-current .dam-crumb-actions-toggle:hover {
  background: rgba(11, 90, 59, 0.08);
}

@media (max-width: 900px) {
  .dam-browse-section-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
}

/* Upload P3 upgrades */
.dam-upload-collection-badge--locked {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(109, 40, 217, 0.22);
  background: rgba(139, 92, 246, 0.08);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
}

.dam-upload-collection-badge-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dam-upload-drawer-nav-warn {
  margin: 0;
  padding: 8px 16px;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #92400e;
  background: rgba(251, 191, 36, 0.14);
  border-bottom: 1px solid rgba(251, 191, 36, 0.28);
}

.dam-upload-drawer-nav-warn[hidden] {
  display: none !important;
}

.dam-tile-thumb--processing {
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px dashed rgba(99, 102, 241, 0.28);
  min-height: 88px;
}

.dam-tile-processing-glyph {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  border: 2px solid rgba(99, 102, 241, 0.25);
  border-top-color: rgba(99, 102, 241, 0.85);
  animation: dam-upload-spin 0.8s linear infinite;
}

.dam-tile-processing-label {
  font-size: 0.68rem;
  line-height: 1.35;
  text-align: center;
  color: var(--muted);
  word-break: break-word;
  max-width: 100%;
}

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

/* Perf: defer off-screen tile paint; smoother DnD targets */
.dam-asset-tile,
.dam-folder-card--browse {
  content-visibility: auto;
  contain-intrinsic-size: 196px 142px;
}

.dam-folder-card.is-drop-target {
  outline: 2px solid rgba(99, 102, 241, 0.72);
  outline-offset: 2px;
  transition: outline-color 0.12s ease, box-shadow 0.12s ease;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.dam-asset-tile.is-dragging,
.dam-folder-card.is-dragging {
  opacity: 0.55;
  transition: opacity 0.1s ease;
}

.dam-preview-img {
  content-visibility: auto;
}

/* macOS spring-loaded folder */
.dam-folder-card.is-spring-armed {
  outline: 2px dashed rgba(99, 102, 241, 0.55);
  outline-offset: 3px;
  transform: scale(1.02);
  transition: transform 0.18s ease, outline-color 0.18s ease;
}

.dam-folder-card.is-spring-open {
  outline: 2px solid rgba(99, 102, 241, 0.9);
  box-shadow: 0 8px 28px rgba(99, 102, 241, 0.18);
  transform: scale(1.04);
}

.dam-upload-local-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
}

.sync-status.is-uploading::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #0b5a3b;
  vertical-align: middle;
  animation: dam-upload-pulse 1s ease-in-out infinite;
}

@keyframes dam-upload-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Unified browse: asset tile hover-check + bulk select (mirrors browse-assets) */
.dam-workspace.dam-workspace--browse-unified .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-tile-hover-check,
.dam-workspace.dam-workspace--browse-unified .dam-asset-tile-check,
.dam-workspace.dam-workspace--chrome-unified .dam-asset-tile-check {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 9;
  min-width: 28px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.dam-workspace.dam-workspace--browse-unified .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-tile-hover-check {
  opacity: 0.42;
  pointer-events: auto;
  transition: opacity 0.15s ease;
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile:hover .dam-tile-hover-check,
.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-selected .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile:hover .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-selected .dam-tile-hover-check {
  opacity: 1;
}

.dam-tile-hover-check input,
.dam-asset-tile-check input {
  pointer-events: none;
  width: 18px;
  height: 18px;
  margin: 0;
  cursor: pointer;
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile:hover .dam-tile-hover-check,
.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-selected .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile:hover .dam-tile-hover-check,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-selected .dam-tile-hover-check,
.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile .dam-asset-tile-check,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile .dam-asset-tile-check,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile .dam-asset-tile-check,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile .dam-tile-hover-check,
.dam-workspace.dam-workspace--bulk-select .dam-folder-grid--unified .dam-ventura-tile .dam-asset-tile-check {
  opacity: 1;
  pointer-events: auto;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-folder-card.is-selected,
.dam-workspace.dam-workspace--bulk-select .dam-folder-card.is-selected {
  box-shadow: 0 0 0 2px #7c3aed, 0 8px 24px rgba(124, 58, 237, 0.12);
}

.dam-workspace.dam-workspace--has-asset-selection .dam-folder-card.is-partial-selected,
.dam-workspace.dam-workspace--bulk-select .dam-folder-card.is-partial-selected {
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.45), 0 4px 16px rgba(124, 58, 237, 0.08);
}

.dam-workspace.dam-workspace--has-asset-selection .dam-folder-card-check,
.dam-workspace.dam-workspace--bulk-select .dam-folder-card-check {
  opacity: 1;
  pointer-events: auto;
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-selected .dam-asset-tile,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-selected .dam-asset-tile,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-asset-tile {
  box-shadow: 0 0 0 2px #7c3aed, 0 8px 24px rgba(124, 58, 237, 0.14);
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-selected .dam-asset-tile-check input:checked,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-selected .dam-asset-tile-check input:checked,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-asset-tile-check input:checked {
  accent-color: #7c3aed;
}

.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-asset-tile-actions,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-tile-hover-check,
.dam-workspace.dam-workspace--has-asset-selection .dam-ventura-tile.is-selected .dam-asset-tile-check {
  opacity: 1;
  pointer-events: auto;
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-drawer-active .dam-asset-tile,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-drawer-active .dam-asset-tile {
  box-shadow: 0 0 0 2px rgba(45, 42, 38, 0.08), 0 4px 16px rgba(27, 24, 20, 0.08);
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile .dam-asset-tile-actions,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile .dam-asset-tile-actions {
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile:hover .dam-asset-tile-actions,
.dam-workspace.dam-workspace--browse-unified .dam-ventura-tile.is-selected .dam-asset-tile-actions,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile:hover .dam-asset-tile-actions,
.dam-workspace.dam-workspace--chrome-unified .dam-ventura-tile.is-selected .dam-asset-tile-actions {
  opacity: 1;
}
