/* Metadata layout */
#metadataSection {
  width: 100% !important;
}

.output-format-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.output-format-row label {
  font-weight: 600;
  color: var(--text);
}

.output-format-row select {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  color: var(--text);
  min-width: 170px;
}

.output-format-note {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  max-width: 320px;
}

/* Force the button to take its own full-width row */
#cleanMetadataBtn {
  display: block !important;
  width: fit-content;
  margin-bottom: 1rem;
}

.file-list-details summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  list-style: none;
}

.file-list-details[open] summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.file-list-details summary::-webkit-details-marker {
  display: none;
}

.file-list-details summary::before {
  content: "▾";
  display: inline-block;
  margin-right: 0.5rem;
  transition: transform 0.2s ease;
}

.file-list-details[open] summary::before {
  transform: rotate(180deg);
}

.file-list {
  margin: 0;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-top: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
  background: var(--surface);
  max-height: 260px;
  overflow-y: auto;
}

.file-list .file-item {
  margin-bottom: 0.5rem;
}

.file-item.selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--surface));
}

/* Table shrinks to content but stays BELOW the button */
#metadataTable {
  display: inline-table !important;
  border-collapse: collapse;
  margin-top: 0.5rem;
}

/* Table cell styling */
#metadataTable th,
#metadataTable td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

#metadataTable th {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
}

#metadataTable td {
  font-size: 0.95rem;
  color: var(--text);
}

/* Small preview image */
#smallPreviewWrapper img {
  max-width: 200px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  padding: 4px;
}