.fileupload_panel {
  --fu-border: #c9d2bf;
  --fu-text: #2b3535;
  --fu-muted: #6b7a7a;
  --fu-green: #a9c308;
  --fu-green-pale: #eef3e1;
  --fu-focus: #5a7000;
  --fu-error: #b3261e;

  margin: 8px 0 16px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, outline-color 0.15s ease;
}

.fileupload_panel.is-dragover {
  background: var(--fu-green-pale);
  outline: 2px dashed var(--fu-green);
  outline-offset: 4px;
}

/* ---------- Auswahlfläche ---------- */

.fileupload_zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 44px;
  padding: 16px;
  font-size: 0.95rem;
  color: var(--fu-muted);
  text-align: center;
  background: whitesmoke;
  border: 2px dashed var(--fu-border);
  border-radius: 8px;
  user-select: none;
  touch-action: manipulation;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.fileupload_zone:hover,
.fileupload_panel.is-dragover .fileupload_zone {
  background: var(--fu-green-pale);
  border-color: var(--fu-green);
}

.fileupload_zone:focus-visible {
  outline: 2px solid var(--fu-focus);
  outline-offset: 2px;
}

.fileupload_zone_caption {
  font-weight: 600;
  color: var(--fu-text);
}

.fileupload_hint {
  font-size: 0.85rem;
}

.fileupload_hint_touch {
  display: none;
}

.fileupload_zone.is-compact {
  flex-direction: row;
  margin-top: 8px;
  padding: 8px 12px;
}

.fileupload_zone.is-compact::before {
  content: "+";
  margin-right: 0.4em;
  font-size: 1.2em;
  font-weight: 700;
  line-height: 1;
  color: var(--fu-focus);
}

/* ---------- Dateiliste ---------- */

.fileupload_list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fileupload_item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px 6px 6px 8px;
  background: #fff;
  border: 1px solid var(--fu-border);
  border-radius: 8px;
  cursor: default;
}

.fileupload_item.is-processing {
  opacity: 0.7;
}

.fileupload_thumb {
  flex: 0 0 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--fu-focus);
  background: var(--fu-green-pale);
  border-radius: 6px;
}

.fileupload_thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fileupload_info {
  flex: 1;
  min-width: 0;
}

.fileupload_name {
  overflow: hidden;
  font-weight: 600;
  color: var(--fu-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fileupload_meta {
  font-size: 0.85rem;
  color: var(--fu-muted);
}

.fileupload_remove {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  font: inherit;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--fu-muted);
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.fileupload_remove:hover {
  color: var(--fu-error);
  background: #fdecea;
}

.fileupload_remove:focus-visible {
  outline: 2px solid var(--fu-focus);
  outline-offset: 2px;
}

/* ---------- Meldungen ---------- */

.fileupload_message {
  margin-top: 8px;
  padding: 0.6em 0.9em;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--fu-error);
  white-space: pre-line;
  background: #fdecea;
  border-radius: 8px;
  cursor: default;
}

.fileupload_message:empty {
  display: none;
}

/* ---------- Touch-Geräte ---------- */

@media (hover: none) {
  .fileupload_hint_pointer { display: none; }
  .fileupload_hint_touch   { display: inline; }

  .fileupload_zone:hover {
    background: #fff;
    border-color: var(--fu-border);
  }

  .fileupload_remove:hover {
    color: var(--fu-muted);
    background: transparent;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fileupload_panel,
  .fileupload_zone,
  .fileupload_remove {
    transition: none;
  }
}