/* Selectores y vistas previas de adjuntos · SCD APL V2 */
.apl-v2-attachments {
  min-inline-size: var(--apl-ui-space-0);
  position: relative;
}
.apl-v2-attachments .apl-file-picker__input {
  position: absolute;
  inline-size: var(--apl-ui-border-width);
  block-size: var(--apl-ui-border-width);
  padding: var(--apl-ui-space-0);
  border: 0;
  clip-path: inset(50%);
  overflow: hidden;
}
.apl-v2-attachments .apl-file-picker__surface {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--apl-ui-space-3);
  min-block-size: var(--apl-ui-control-height-lg);
  padding: var(--apl-ui-space-3);
  margin: var(--apl-ui-space-0);
  border: var(--apl-ui-border-width) dashed var(--apl-ui-color-brand-border-strong);
  border-radius: var(--apl-ui-radius-card);
  background: var(--apl-ui-color-brand-surface);
  color: var(--apl-ui-color-text-strong);
  cursor: pointer;
}
.apl-v2-attachments .apl-file-picker__copy :is(strong, small) {
  display: block;
  white-space: normal;
  overflow-wrap: anywhere;
}
.apl-v2-attachments .apl-file-picker__copy strong { font-weight: var(--apl-ui-font-weight-semibold); }
.apl-v2-attachments .apl-file-picker__copy small {
  color: var(--apl-ui-color-text-muted);
  margin-block-start: var(--apl-ui-space-1);
}
.apl-v2-attachments .apl-file-picker__action {
  background: var(--apl-ui-color-surface);
  border: var(--apl-ui-border-width) solid var(--apl-ui-color-brand-border);
  border-radius: var(--apl-ui-radius-md);
  color: var(--apl-ui-color-brand-dark);
  font-weight: var(--apl-ui-font-weight-semibold);
  padding: var(--apl-ui-space-1) var(--apl-ui-space-2);
}
.apl-v2-attachments .apl-file-picker__surface:hover,
.apl-v2-attachments.is-dragging .apl-file-picker__surface,
.apl-v2-attachments .apl-file-picker__input:focus-visible + .apl-file-picker__surface {
  outline: var(--apl-ui-border-width) solid var(--apl-ui-color-brand-dark);
  outline-offset: var(--apl-ui-space-1);
}
.apl-v2-attachment-list { display: grid; gap: var(--apl-ui-space-2); }
.apl-v2-attachment-list:empty { display: none; }
.apl-v2-attachment-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--apl-ui-space-2);
  align-items: center;
  padding: var(--apl-ui-space-2);
  border: var(--apl-ui-border-width) solid var(--apl-ui-color-border-soft);
  border-radius: var(--apl-ui-radius-md);
  background: var(--apl-ui-color-surface);
}
.apl-v2-attachment-row > span { overflow-wrap: anywhere; }
.apl-v2-attachment-thumb,
.apl-v2-brand-mark {
  display: inline-grid;
  place-items: center;
  overflow: hidden;
  flex: none;
  inline-size: var(--apl-ui-control-height-lg);
  block-size: var(--apl-ui-control-height-lg);
  border-radius: var(--apl-ui-radius-md);
  background: var(--apl-ui-color-surface-subtle);
  color: var(--apl-ui-color-brand-dark);
  border: var(--apl-ui-border-width) solid var(--apl-ui-color-border-soft);
}
.apl-v2-brand-mark--large {
  inline-size: calc(var(--apl-ui-control-height-lg) * 2);
  block-size: calc(var(--apl-ui-control-height-lg) * 2);
}
[data-apl-scd="apl-v2"] :is(.apl-v2-attachment-thumb, .apl-v2-brand-mark) > img[alt] {
  display: block;
  inline-size: 100%;
  block-size: 100%;
  min-inline-size: var(--apl-ui-space-0);
  min-block-size: var(--apl-ui-space-0);
  object-fit: contain;
}
@media (max-width: 480px) {
  .apl-v2-attachments .apl-file-picker__surface { grid-template-columns: auto minmax(0, 1fr); }
  .apl-v2-attachments .apl-file-picker__action { grid-column: 2; justify-self: start; }
  .apl-v2-attachment-row { grid-template-columns: auto minmax(0, 1fr); }
  .apl-v2-attachment-row .apl-v2-actions { grid-column: 2; }
}
