/* Ordivion V0.9.51.13.6 – Dominantfarben und visuelle Farbsuche */

.orv-color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.orv-color-swatches.is-compact {
  display: grid;
  grid-template-columns: repeat(3, 20px);
  gap: 4px;
  width: max-content;
}

.orv-color-swatch-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.orv-color-swatch {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 7px;
  border: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  background: var(--orv-swatch-color, transparent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.orv-color-swatches.is-compact .orv-color-swatch {
  width: 20px;
  height: 20px;
  flex-basis: 20px;
  border-radius: 5px;
}

.orv-color-swatches.has-details {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: stretch;
}

.orv-color-swatches.has-details .orv-color-swatch-item {
  padding: 8px;
  border: 1px solid color-mix(in srgb, currentColor 18%, transparent);
  border-radius: 8px;
}

.orv-color-swatch-details {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  align-items: baseline;
  min-width: 0;
  font-size: 0.9em;
}

.workspace-color-filter-card.has-active-filter {
  outline: 1px solid color-mix(in srgb, currentColor 28%, transparent);
  outline-offset: -1px;
}

.orv-color-filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 12px;
}

.orv-color-filter-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.orv-color-filter-field > span:first-child {
  font-weight: 600;
}

.orv-color-filter-field input[type="text"],
.orv-color-filter-field input[type="number"] {
  width: 100%;
  min-width: 0;
}

.orv-color-picker-field {
  grid-column: 1 / -1;
}

.orv-color-picker-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  gap: 7px;
  align-items: stretch;
}

.orv-color-picker-row input[type="color"] {
  width: 52px;
  min-height: 38px;
  padding: 2px;
  cursor: pointer;
}

.orv-color-clear-btn {
  min-width: 38px;
  padding-inline: 10px;
  font-size: 1.2em;
  line-height: 1;
}

.gallery-grid.tile-info-collapsed.view-compact-dominant_colors
.tile-compact-row[data-compact-field="dominant_colors"] {
  display: flex !important;
}

.gallery-grid.tile-info-collapsed.tile-compact-layout-aligned.view-compact-dominant_colors
.tile-compact-row[data-compact-field="dominant_colors"] {
  display: grid !important;
}

/* V0.9.51.13.7.1: Die ausgeklappte Kachelansicht ist vollständig.
   Die persönliche compactFields-Auswahl steuert ausschließlich den
   eingeklappten Zustand und darf die ausführliche Info nicht ausblenden. */
.gallery-info-row-dominant-colors {
  display: grid;
}

.edit-dominant-colors-section .edit-section-title {
  margin-bottom: 10px;
}

@media (max-width: 800px) {
  .orv-color-filter-grid {
    grid-template-columns: 1fr;
  }

  .orv-color-picker-field {
    grid-column: auto;
  }

  .orv-color-swatches.has-details {
    grid-template-columns: 1fr;
  }
}


/* V0.9.51.15.20 – neun Farben als echte 3×3-Matrix. */
.orv-color-analysis-provenance {
  grid-column: 1 / -1;
  margin-top: 4px;
  color: color-mix(in srgb, currentColor 70%, transparent);
  font-size: 0.82em;
}
