.rails-den-composer-attachments {
  margin-top: 12px;
  padding: 14px 16px;
  border: 1px solid var(--rails-den-border);
  border-radius: var(--rails-den-radius);
  background: var(--rails-den-surface);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.rails-den-composer-attachments.is-dragover {
  border-color: var(--rails-den-primary);
  background: rgba(200, 59, 50, 0.08);
  box-shadow:
    inset 0 0 0 2px
    rgba(200, 59, 50, 0.18);
}

.rails-den-composer-attachments-label {
  display: block;
  margin-bottom: 8px;
  color: var(--rails-den-text);
  font-size: 0.9rem;
  font-weight: 700;
}

.rails-den-composer-attachments-input {
  display: block;
  width: 100%;
  color: var(--rails-den-muted);
  font: inherit;
  font-size: 0.9rem;
}

.rails-den-composer-attachments-input::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  border: 1px solid var(--rails-den-border);
  border-radius: 8px;
  background: var(--rails-den-surface-raised);
  color: var(--rails-den-text);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.rails-den-composer-attachments-input::file-selector-button:hover {
  border-color: var(--rails-den-primary);
}

.rails-den-composer-attachments-help {
  margin: 8px 0 0;
  color: var(--rails-den-muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.rails-den-attachment-queue {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.rails-den-attachment-queue[hidden] {
  display: none;
}

.rails-den-attachment-queue-item {
  min-width: 0;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--rails-den-border);
  border-radius: 10px;
  background: var(--rails-den-surface-input);
}

.rails-den-attachment-queue-thumbnail {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: block;
  border: 1px solid var(--rails-den-border);
  border-radius: 8px;
  object-fit: cover;
}

.rails-den-attachment-queue-icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rails-den-border);
  border-radius: 8px;
  background: var(--rails-den-surface-raised);
  font-size: 1.35rem;
}

.rails-den-attachment-queue-details {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: 4px;
}

.rails-den-attachment-queue-name {
  overflow: hidden;
  color: var(--rails-den-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rails-den-attachment-queue-metadata {
  color: var(--rails-den-muted);
  font-size: 0.8rem;
}

.rails-den-attachment-queue-remove {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid var(--rails-den-border);
  border-radius: 8px;
  background: transparent;
  color: var(--rails-den-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
}

.rails-den-attachment-queue-remove:hover {
  border-color: var(--rails-den-danger);
  background: rgba(249, 112, 102, 0.1);
  color: var(--rails-den-danger);
}

.rails-den-attachment-queue-remove:focus-visible {
  outline: 3px solid rgba(249, 112, 102, 0.3);
  outline-offset: 2px;
}

.rails-den-post-attachments {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.rails-den-post-attachment {
  margin: 0;
}

.rails-den-post-attachment-image {
  max-width: 100%;
}

.rails-den-post-attachment-preview {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 640px;
  border: 1px solid var(--rails-den-border);
  border-radius: var(--rails-den-radius);
  object-fit: contain;
}

.rails-den-post-attachment-caption {
  margin-top: 7px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--rails-den-muted);
  font-size: 0.82rem;
}

.rails-den-post-attachment-download {
  color: var(--rails-den-primary-hover);
  font-weight: 700;
  text-decoration: none;
}

.rails-den-post-attachment-download:hover {
  text-decoration: underline;
}

.rails-den-post-attachment-file {
  max-width: 520px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--rails-den-border);
  border-radius: 10px;
  background: var(--rails-den-surface);
  color: inherit;
  text-decoration: none;
}

.rails-den-post-attachment-file:hover {
  border-color: var(--rails-den-primary);
  background: var(--rails-den-surface-raised);
}

.rails-den-post-attachment-icon {
  flex: 0 0 auto;
  font-size: 1.35rem;
}

.rails-den-post-attachment-details {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.rails-den-post-attachment-name {
  overflow: hidden;
  color: var(--rails-den-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rails-den-post-attachment-size {
  color: var(--rails-den-muted);
  font-size: 0.8rem;
}

@media (max-width: 640px) {
  .rails-den-attachment-queue-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rails-den-attachment-queue-thumbnail {
    width: 60px;
    height: 60px;
    flex-basis: 60px;
  }

  .rails-den-attachment-queue-remove {
    margin-left: auto;
  }

  .rails-den-post-attachment-preview {
    max-height: 480px;
  }

  .rails-den-post-attachment-file {
    max-width: 100%;
  }
}
