.file-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.file-field__pickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}
.file-field__pickers[hidden] { display: none; }

.file-field__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border: 1px dashed var(--accent-muted);
  border-radius: var(--radius-md);
  background: none;
  color: var(--accent-primary);
  font-family: inherit;
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}
.file-field__btn:hover {
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}
.file-field__btn[aria-pressed="true"] {
  border-style: solid;
  border-color: var(--accent-primary);
  background: var(--accent-subtle);
}
.file-field__btn .material-symbols-rounded { font-size: 16px; }
.file-field__btn[hidden] { display: none; }

.file-field__progress { margin-top: var(--space-2); }
.file-field__progress[hidden] { display: none; }

.file-field__attached {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-1-5) var(--space-2);
  background: var(--surface-base);
  border: 1px solid var(--accent-muted);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius-md);
  transition: all var(--duration-fast) var(--ease-out);
}
.file-field__attached:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-sm);
}
.file-field__attached[hidden] { display: none; }

.file-field__file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.file-field__icon {
  font-size: 16px;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.file-field__thumb {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  cursor: pointer;
  background: var(--surface-sunken);
}
.file-field__thumb:hover { opacity: 0.8; }
.file-field__thumb[hidden] { display: none; }

.file-field__name {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-field__actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}

.file-field__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--ease-out);
}
.file-field__action:hover {
  background: var(--surface-hover);
  color: var(--accent-primary);
}
.file-field__action--danger:hover {
  color: var(--status-error);
}
.file-field__action .material-symbols-rounded { font-size: 16px; }

.file-chip {
  position: relative;
  overflow: hidden;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-base);
  text-decoration: none;
  color: var(--text-primary);
  font-size: var(--text-xs);
}
.file-chip:hover { background: var(--surface-hover); }
.file-chip__type {
  flex-shrink: 0;
  font-weight: var(--weight-bold);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
}
.file-chip__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: var(--weight-medium);
}
.file-chip__size { flex-shrink: 0; color: var(--text-tertiary); }

.file-chip--pdf .file-chip__type { color: var(--status-error); }
.file-chip--doc .file-chip__type,
.file-chip--docx .file-chip__type { color: var(--status-info); }
.file-chip--xls .file-chip__type,
.file-chip--xlsx .file-chip__type,
.file-chip--csv .file-chip__type { color: var(--status-success); }
.file-chip--ppt .file-chip__type,
.file-chip--pptx .file-chip__type { color: var(--status-warning); }
.file-chip--zip .file-chip__type { color: var(--text-tertiary); }
.file-chip--mp4 .file-chip__type,
.file-chip--mov .file-chip__type,
.file-chip--webm .file-chip__type { color: var(--accent-primary); }
.file-chip--mp3 .file-chip__type,
.file-chip--wav .file-chip__type { color: var(--accent-hover); }

.file-chip__thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.file-chip__action {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  margin-left: var(--space-1);
  transition: background var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
}
.file-chip__action .material-symbols-rounded {
  font-size: 16px;
}
.file-chip__action:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

.file-chip--uploading {
  opacity: 0.9;
}

.file-chip__progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--accent-subtle);
}
.file-chip__progress-bar {
  height: 100%;
  background: var(--accent-primary);
  width: 0%;
  transition: width var(--duration-normal) var(--ease-out);
}

.file-chip--uploaded {
  border-color: var(--status-success);
}
.file-chip--uploaded .file-chip__progress-bar {
  background: var(--status-success);
}

.file-chip--error {
  border-color: var(--status-error);
  background: var(--status-error-bg);
  color: var(--status-error-text);
}
.file-chip__error-icon {
  font-size: 16px;
  color: var(--status-error);
  flex-shrink: 0;
}
.file-chip__error-msg {
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--status-error-text);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}
