/**
 * File drop widget – works with or without theme CSS variables.
 */
.sven-file-drop {
    --fd-surface: var(--surface, #f7f8fa);
    --fd-surface-alt: var(--surface-alt, #eef1f5);
    --fd-surface-muted: var(--surface-muted, #e2e6ec);
    --fd-border: var(--border-color, #cfd6df);
    --fd-primary: var(--primary-color, #0f172a);
    --fd-text: var(--text-color, #1e293b);
    --fd-muted: var(--text-muted, #64748b);
    --fd-btn: var(--button-color, #2563eb);
    --fd-secondary: var(--secondary-color, #e0f2fe);
    --fd-secondary-strong: var(--secondary-strong, #0284c7);
    --fd-radius-sm: var(--radius-sm, 6px);
    --fd-radius-md: var(--radius-md, 10px);
    --fd-shadow: var(--shadow-soft, 0 1px 3px rgba(15, 23, 42, 0.08));
    --fd-transition: var(--transition, border-color 0.2s ease, background 0.2s ease);

    margin: 1.5rem 0;
    padding: 1.35rem 1.5rem;
    background: var(--fd-surface);
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-md);
    box-shadow: var(--fd-shadow);
    max-width: 42rem;
    color: var(--fd-text);
}

.sven-file-drop--public {
    max-width: 52rem;
}

.sven-file-drop--disabled,
.sven-file-drop--denied {
    padding: 1rem 1.25rem;
    color: var(--fd-muted);
    font-size: 0.95rem;
}

.sven-file-drop__title {
    margin-top: 0;
    margin-bottom: 0.65rem;
    color: var(--fd-primary);
}

.sven-file-drop__intro {
    margin-bottom: 1rem;
}

.sven-file-drop__note-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fd-btn);
    margin-bottom: 0.35rem;
}

.sven-file-drop__upload-destination {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0 0 0.85rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    background: #fff;
    color: var(--fd-text);
    box-sizing: border-box;
}

.sven-file-drop__note {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    resize: vertical;
    min-height: 4rem;
    box-sizing: border-box;
}

.sven-file-drop__note:focus {
    outline: 2px solid var(--fd-secondary-strong);
    outline-offset: 2px;
    border-color: var(--fd-btn);
}

.sven-file-drop__contact {
    margin: 0 0 1.15rem;
    padding: 0.85rem 1rem 1rem;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface-alt);
}

.sven-file-drop__contact-legend {
    font-weight: 700;
    font-size: 1rem;
    color: var(--fd-primary);
    padding: 0 0.35rem;
}

.sven-file-drop__contact-hint {
    margin: 0 0 0.85rem;
    font-size: 0.85rem;
    color: var(--fd-muted);
}

.sven-file-drop__contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem 1rem;
}

@media (max-width: 520px) {
    .sven-file-drop__contact-grid {
        grid-template-columns: 1fr;
    }
}

.sven-file-drop__field--wide {
    grid-column: 1 / -1;
}

.sven-file-drop__field .sven-file-drop__note-label {
    margin-bottom: 0.25rem;
    font-size: 0.82rem;
}

.sven-file-drop__input-text {
    width: 100%;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--fd-surface);
    color: var(--fd-text);
    box-sizing: border-box;
}

.sven-file-drop__input-text:focus {
    outline: 2px solid var(--fd-secondary-strong);
    outline-offset: 1px;
    border-color: var(--fd-btn);
}

.sven-file-drop__category,
.sven-file-drop__project-picker {
    width: 100%;
    max-width: 100%;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.85rem;
    border: 1px solid var(--fd-border);
    border-radius: var(--fd-radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background: var(--fd-surface);
    color: var(--fd-text);
    box-sizing: border-box;
}

.sven-file-drop__pool-category-slot {
    margin-bottom: 0.25rem;
}

.sven-file-drop__hint {
    font-size: 0.85rem;
    margin-bottom: 1rem;
    color: var(--fd-muted);
}

.sven-file-drop__zone {
    display: block;
    position: relative;
    min-height: 5.5rem;
    padding: 2rem 1.25rem;
    border: 2px dashed var(--fd-border);
    border-radius: var(--fd-radius-sm);
    background: var(--fd-surface-alt);
    text-align: center;
    cursor: pointer;
    transition: var(--fd-transition);
}

.sven-file-drop__zone:hover,
.sven-file-drop__zone:focus-within,
.sven-file-drop__zone--hover {
    border-color: var(--fd-btn);
    background: var(--fd-secondary);
}

.sven-file-drop__zone:focus {
    outline: 2px solid var(--fd-secondary-strong);
    outline-offset: 3px;
}

/* Volle Fläche: Klick + Drag&Drop treffen den file-Input (zuverlässiger als nur Zone-Events). */
.sven-file-drop__zone .sven-file-drop__input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    font-size: 8rem;
}

.sven-file-drop__zone-text {
    position: relative;
    z-index: 1;
    pointer-events: none;
    font-weight: 600;
    color: var(--fd-primary);
    font-size: 1rem;
}

.sven-file-drop__max {
    margin: 0.75rem 0 0;
    font-size: 0.8rem;
    color: var(--fd-muted);
}

.sven-file-drop__overall-wrap {
    margin-top: 1rem;
}

.sven-file-drop__overall-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--fd-muted);
    margin-bottom: 0.35rem;
}

.sven-file-drop__overall-pct {
    font-variant-numeric: tabular-nums;
    color: var(--fd-btn);
}

.sven-file-drop__overall {
    height: 12px;
    background: var(--fd-surface-muted);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid var(--fd-border);
}

.sven-file-drop__overall-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--fd-btn), var(--fd-secondary-strong));
    border-radius: 999px;
    transition: width 0.12s ease-out;
    min-width: 0;
}

.sven-file-drop__status {
    margin: 0.65rem 0 0;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--fd-text);
    min-height: 1.35em;
}

.sven-file-drop__list {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.sven-file-drop__item {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.35rem;
    padding: 0.65rem 0.85rem;
    background: var(--fd-surface-alt);
    border-radius: var(--fd-radius-sm);
    border: 1px solid var(--fd-border);
}

.sven-file-drop__item-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--fd-primary);
    word-break: break-word;
}

.sven-file-drop__item-track {
    height: 8px;
    background: var(--fd-surface-muted);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.sven-file-drop__item--skipped .sven-file-drop__item-track {
    display: none;
}

.sven-file-drop__item-bar {
    height: 100%;
    background: var(--fd-btn);
    border-radius: 999px;
    transition: width 0.1s ease-out;
}

.sven-file-drop__item-msg {
    font-size: 0.8rem;
    color: var(--fd-muted);
}

.sven-file-drop__item--ok .sven-file-drop__item-msg {
    color: #1a7f4c;
}

.sven-file-drop__item--error .sven-file-drop__item-msg {
    color: #b42318;
}

.sven-file-drop__result {
    margin: 1rem 0 0;
    padding: 1rem 1.15rem;
    border-radius: var(--fd-radius-sm);
    border: 1px solid #1a7f4c;
    background: rgba(26, 127, 76, 0.08);
    font-size: 0.92rem;
    line-height: 1.45;
    color: var(--fd-text);
}

.sven-file-drop__result-title {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--fd-primary);
}

.sven-file-drop__result-ref {
    margin: 0 0 0.5rem;
}

.sven-file-drop__result-ids {
    margin: 0;
    font-size: 0.88rem;
    color: var(--fd-muted);
}
