.dhh-file-upload {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1.5px dashed var(--line, #d7dce5);
  border-radius: 12px;
  background: #fcfdff;
  color: var(--ink, #1f2937);
  transition: border-color .15s ease, background-color .15s ease;
}

.dhh-file-upload.is-uploaded {
  border-style: solid;
  border-color: #b9dfc9;
  background: #f8fcfa;
}

.dhh-file-upload.has-error {
  border-style: solid;
  border-color: #e4a8a4;
  background: #fff9f8;
}

.dhh-file-upload.is-busy {
  opacity: .78;
}

.dhh-file-upload__header {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.dhh-file-upload--without-state-icon .dhh-file-upload__header {
  grid-template-columns: minmax(0, 1fr) auto;
}

.dhh-file-upload__state-icon,
.dhh-file-upload__file-icon {
  display: inline-grid;
  flex: none;
  place-items: center;
  color: var(--navy, #0f2747);
  background: #eef2f7;
}

.dhh-file-upload__state-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.dhh-file-upload.is-uploaded .dhh-file-upload__state-icon {
  color: var(--green, #147a52);
  background: var(--green-bg, #e7f6ed);
}

.dhh-file-upload__svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dhh-file-upload__copy,
.dhh-file-upload__file-copy {
  display: grid;
  min-width: 0;
}

.dhh-file-upload__copy {
  gap: 2px;
}

.dhh-file-upload__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  color: var(--ink, #1f2937);
  font-size: 12.5px;
  font-weight: 650;
  line-height: 1.4;
}

.dhh-file-upload__status,
.dhh-file-upload__file-meta {
  color: var(--muted, #667085);
  font-size: 11px;
  line-height: 1.4;
}

.dhh-file-upload.is-uploaded .dhh-file-upload__status {
  color: var(--green, #147a52);
}

.dhh-file-upload__optional {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 9.5px;
  font-weight: 650;
  line-height: 1.3;
}

.dhh-file-upload__optional {
  background: #eef1f5;
  color: var(--muted, #667085);
}

.dhh-file-upload__required {
  margin-left: 4px;
  color: #a83d36;
  font-size: 13px;
  font-weight: 800;
}

.dhh-file-upload__actions,
.dhh-file-upload__file-actions {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.dhh-file-upload__files {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid #dcebe2;
}

.dhh-file-upload__file {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #d9e4dd;
  border-radius: 9px;
  background: #fff;
}

.dhh-file-upload__file-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #b4433c;
  background: #fff0ef;
}

.dhh-file-upload__file-icon .dhh-file-upload__svg {
  width: 16px;
  height: 16px;
}

.dhh-file-upload__file-copy {
  gap: 1px;
}

.dhh-file-upload__filename {
  min-width: 0;
  overflow: hidden;
  color: var(--ink, #1f2937);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dhh-file-upload__icon-action {
  display: inline-grid;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0;
  place-items: center;
  border: 1px solid var(--line, #d7dce5);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--muted, #667085);
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.dhh-file-upload__icon-action:hover:not(:disabled) {
  border-color: #b9c2d0;
  background: #f4f6f9;
  color: var(--ink, #1f2937);
}

.dhh-file-upload__icon-action:focus-visible {
  border-color: var(--navy, #0f2747);
  box-shadow: 0 0 0 3px rgba(15, 39, 71, .13);
}

.dhh-file-upload__icon-action--primary {
  border-color: var(--navy, #0f2747);
  background: var(--navy, #0f2747);
  color: #fff;
}

.dhh-file-upload__icon-action--primary:hover:not(:disabled) {
  border-color: #1c3b64;
  background: #1c3b64;
  color: #fff;
}

.dhh-file-upload__icon-action--danger:hover:not(:disabled) {
  border-color: #efc3c0;
  background: #fff2f1;
  color: #b42318;
}

.dhh-file-upload__icon-action:disabled {
  border-color: #e1e5eb;
  background: #f2f4f7;
  color: #a3aab5;
  cursor: not-allowed;
}

.dhh-file-upload__native-input {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.dhh-file-upload__remove-form {
  display: none;
}

.dhh-file-upload__error {
  margin: 0;
  color: #b42318;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

@media (max-width: 560px) {
  .dhh-file-upload {
    padding: 12px;
  }

  .dhh-file-upload__header {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 9px;
  }

  .dhh-file-upload__state-icon {
    width: 34px;
    height: 34px;
  }

  .dhh-file-upload__file {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    padding: 8px;
  }

  .dhh-file-upload__file-icon,
  .dhh-file-upload__icon-action {
    width: 30px;
    height: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dhh-file-upload,
  .dhh-file-upload__icon-action {
    transition: none;
  }
}
