/**
 * MultipleUpload v1.0
 * (c) RichScripts
 */

/* ── CSS Custom Properties ── */
:root {
    --mu-primary: #4f46e5;
    --mu-primary-hover: #4338ca;
    --mu-primary-light: #eef2ff;
    --mu-success: #16a34a;
    --mu-success-light: #f0fdf4;
    --mu-danger: #dc2626;
    --mu-danger-light: #fef2f2;
    --mu-warning: #d97706;
    --mu-gray-50: #f9fafb;
    --mu-gray-100: #f3f4f6;
    --mu-gray-200: #e5e7eb;
    --mu-gray-300: #d1d5db;
    --mu-gray-400: #9ca3af;
    --mu-gray-500: #6b7280;
    --mu-gray-600: #4b5563;
    --mu-gray-700: #374151;
    --mu-gray-800: #1f2937;
    --mu-gray-900: #111827;
    --mu-font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --mu-font-size: 0.875rem;
    --mu-border-radius: 0.5rem;
    --mu-border-radius-sm: 0.375rem;
    --mu-transition: 150ms ease;
    --mu-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --mu-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --mu-thumb-size: 64px;
    /* Drop-zone glyph. Override with any url()/none to rebrand the empty state. */
    --mu-dropzone-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 13v8'/%3E%3Cpath d='m8 17 4-4 4 4'/%3E%3Cpath d='M20 16.7A5 5 0 0 0 18 7h-1.3A8 8 0 1 0 4 14.9'/%3E%3C/svg%3E");
}

/* ── Base ── */
.mu-uploader,
.mu-dropzone-standalone,
.mu-attachments {
    font-family: var(--mu-font-family);
    font-size: var(--mu-font-size);
    color: var(--mu-gray-800);
    line-height: 1.5;
}

/* ── Select Button ── */
.mu-button-area,
.mu-attachments-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.mu-select-btn,
.mu-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1.25rem;
    background: var(--mu-primary);
    color: white;
    border: none;
    border-radius: var(--mu-border-radius-sm);
    font-size: var(--mu-font-size);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--mu-transition), box-shadow var(--mu-transition), transform var(--mu-transition);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.14);
}
.mu-select-btn:focus-visible,
.mu-upload-btn:focus-visible {
    outline: 2px solid var(--mu-primary);
    outline-offset: 2px;
}

.mu-upload-btn {
    background: var(--mu-success);
}

.mu-select-btn:hover,
.mu-upload-btn:hover {
    background: var(--mu-primary-hover);
    box-shadow: var(--mu-shadow-md);
    transform: translateY(-1px);
}

.mu-upload-btn:hover {
    background: #15803d;
}

.mu-select-btn:active,
.mu-upload-btn:active {
    transform: translateY(0);
}

/* ── Drop Zone ── */
.mu-dropzone,
.mu-dropzone-standalone .mu-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    min-height: 176px;
    padding: 2rem;
    margin-top: 1rem;
    border: 2px dashed var(--mu-gray-300);
    border-radius: calc(var(--mu-border-radius) * 1.5);
    background: radial-gradient(130% 130% at 50% 0%, #fff 0%, var(--mu-gray-50) 70%);
    color: var(--mu-gray-500);
    text-align: center;
    cursor: pointer;
    transition: border-color var(--mu-transition), background var(--mu-transition), color var(--mu-transition), box-shadow var(--mu-transition), transform var(--mu-transition);
}

/* Upload glyph for drop zones whose markup carries no .mu-dropzone-icon element.
   Drawn as a mask so it inherits the zone's colour and tints on hover/drag.
   Browsers without :has() skip the rule and get the previous text-only zone. */
.mu-dropzone:not(:has(.mu-dropzone-icon))::before,
.mu-dropzone-standalone .mu-dropzone-content:not(:has(.mu-dropzone-icon))::before {
    content: "";
    width: 42px;
    height: 42px;
    background-color: currentColor;
    opacity: 0.5;
    -webkit-mask: var(--mu-dropzone-glyph) center / contain no-repeat;
            mask: var(--mu-dropzone-glyph) center / contain no-repeat;
    transition: opacity var(--mu-transition), transform var(--mu-transition);
}
.mu-dropzone:hover::before,
.mu-dropzone-standalone .mu-dropzone-content:hover::before {
    opacity: 0.95;
    transform: translateY(-2px);
}

.mu-dropzone:hover,
.mu-dropzone-standalone .mu-dropzone-content:hover {
    border-color: var(--mu-primary);
    background: var(--mu-primary-light);
    color: var(--mu-primary);
    box-shadow: 0 12px 28px -18px var(--mu-primary);
    transform: translateY(-1px);
}

.mu-drag-over,
.mu-drag-over .mu-dropzone-content {
    border-color: var(--mu-primary) !important;
    background: var(--mu-primary-light) !important;
    color: var(--mu-primary) !important;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

.mu-dropzone-icon { opacity: 0.6; }
.mu-dropzone-text { font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.01em; }

/* ── Inline Image Thumbnails ── */
.mu-preview-area {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0;
}

.mu-thumb {
    position: relative;
    width: var(--mu-thumb-size);
    height: var(--mu-thumb-size);
    border-radius: var(--mu-border-radius-sm);
    overflow: hidden;
    border: 2px solid var(--mu-gray-200);
    background: var(--mu-gray-100);
    flex-shrink: 0;
    transition: border-color var(--mu-transition), box-shadow var(--mu-transition);
    animation: mu-thumb-appear 200ms ease;
}

@keyframes mu-thumb-appear {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.mu-thumb:hover {
    border-color: var(--mu-primary);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

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

.mu-thumb-close {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--mu-transition), background var(--mu-transition);
    z-index: 2;
}

.mu-thumb:hover .mu-thumb-close {
    opacity: 1;
}

.mu-thumb-close:hover {
    background: var(--mu-danger);
}

/* Thumbnail overlay states */
.mu-thumb-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.mu-thumb-overlay--uploading {
    background: rgba(0, 0, 0, 0.4);
}

.mu-thumb-overlay--done {
    background: rgba(22, 163, 74, 0.5);
    animation: mu-overlay-flash 600ms ease;
}

.mu-thumb-overlay--error {
    background: rgba(220, 38, 38, 0.5);
}

@keyframes mu-overlay-flash {
    0% { background: rgba(22, 163, 74, 0.8); }
    100% { background: rgba(22, 163, 74, 0.5); }
}

.mu-thumb-progress-ring {
    width: 28px;
    height: 28px;
}

.mu-thumb-progress-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.mu-thumb-progress-ring circle:last-child {
    transition: stroke-dasharray 200ms ease;
}

/* ── Progress Bar ── */
.mu-progress {
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--mu-gray-50);
    border-radius: var(--mu-border-radius-sm);
    border: 1px solid var(--mu-gray-200);
}

.mu-progress-bar {
    height: 0.5rem;
    background: var(--mu-gray-200);
    border-radius: 9999px;
    overflow: hidden;
}

.mu-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--mu-primary), #7c3aed);
    border-radius: 9999px;
    transition: width 200ms ease;
    width: 0;
}

.mu-progress-text {
    margin-top: 0.375rem;
    font-size: 0.8125rem;
    color: var(--mu-gray-500);
    font-variant-numeric: tabular-nums;
}

/* ── Queue ── */
.mu-queue {
    margin-top: 0.75rem;
}

.mu-queue-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: white;
    border: 1px solid var(--mu-gray-200);
    border-radius: var(--mu-border-radius-sm);
    margin-bottom: 0.375rem;
    transition: background var(--mu-transition), border-color var(--mu-transition);
    animation: mu-queue-slide-in 200ms ease;
}

@keyframes mu-queue-slide-in {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.mu-queue-item:hover {
    background: var(--mu-gray-50);
    border-color: var(--mu-gray-300);
}

.mu-queue-item--completed { border-left: 3px solid var(--mu-success); }
.mu-queue-item--failed { border-left: 3px solid var(--mu-danger); background: var(--mu-danger-light); }
.mu-queue-item--uploading { border-left: 3px solid var(--mu-primary); background: var(--mu-primary-light); }
.mu-queue-item--cancelled { opacity: 0.5; }

.mu-file-icon {
    flex-shrink: 0;
    font-size: 1rem;
}

.mu-status-icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
    font-weight: bold;
}

.mu-status-ok { color: var(--mu-success); }
.mu-status-error { color: var(--mu-danger); }
.mu-status-uploading { color: var(--mu-primary); animation: mu-spin 1s linear infinite; }
.mu-status-cancelled { color: var(--mu-gray-400); }
.mu-status-pending { color: var(--mu-gray-400); }

@keyframes mu-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mu-queue-name {
    flex: 1;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mu-queue-size {
    flex-shrink: 0;
    color: var(--mu-gray-500);
    font-size: 0.8125rem;
}

.mu-queue-progress {
    flex: 0 0 100px;
    height: 0.375rem;
    background: rgba(79, 70, 229, 0.2);
    border-radius: 9999px;
    overflow: hidden;
}

.mu-queue-progress-fill {
    height: 100%;
    background: var(--mu-primary);
    border-radius: 9999px;
    transition: width 200ms ease;
}

.mu-queue-percent {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--mu-primary);
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.mu-queue-error {
    flex-shrink: 0;
    color: var(--mu-danger);
    font-size: 0.8125rem;
}

.mu-queue-cancel,
.mu-queue-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--mu-gray-400);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--mu-transition), color var(--mu-transition);
}

.mu-queue-cancel:hover { background: var(--mu-danger-light); color: var(--mu-danger); }
.mu-queue-remove:hover { background: var(--mu-gray-100); color: var(--mu-gray-600); }

/* ── Attachments ── */
.mu-attachments {
    border: 1px solid var(--mu-gray-200);
    border-radius: var(--mu-border-radius);
    overflow: hidden;
}

.mu-attachments-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--mu-gray-50);
    border-bottom: 1px solid var(--mu-gray-200);
}

.mu-attachments-count {
    color: var(--mu-gray-500);
    font-size: 0.8125rem;
}

.mu-attachments-list { padding: 0; }

.mu-attachment-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--mu-gray-100);
    transition: background var(--mu-transition);
}

.mu-attachment-item:last-child { border-bottom: none; }
.mu-attachment-item:hover { background: var(--mu-gray-50); }

.mu-attachment-icon { flex-shrink: 0; font-size: 1rem; }

.mu-attachment-thumb {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid var(--mu-gray-200);
}

.mu-attachment-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mu-attachment-size {
    flex-shrink: 0;
    color: var(--mu-gray-500);
    font-size: 0.8125rem;
}

.mu-attachment-progress {
    flex-shrink: 0;
    color: var(--mu-primary);
    font-weight: 600;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
}

.mu-attachment-remove {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--mu-gray-400);
    cursor: pointer;
    transition: background var(--mu-transition), color var(--mu-transition);
}

.mu-attachment-remove:hover {
    background: var(--mu-danger-light);
    color: var(--mu-danger);
}

/* ── Paused / Processing / Disabled States ── */
.mu-queue-item--paused { border-left: 3px solid var(--mu-warning); background: rgba(217, 119, 6, 0.05); }
.mu-queue-item--processing { border-left: 3px solid var(--mu-primary); background: var(--mu-primary-light); }
.mu-status-paused { color: var(--mu-warning); }
.mu-status-processing { color: var(--mu-primary); animation: mu-pulse 1.5s ease infinite; }

@keyframes mu-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.mu-disabled {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

.mu-queue-retry,
.mu-queue-pause,
.mu-queue-resume {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: none;
    border-radius: 9999px;
    background: transparent;
    color: var(--mu-gray-400);
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--mu-transition), color var(--mu-transition);
}

.mu-queue-retry:hover { background: var(--mu-primary-light); color: var(--mu-primary); }
.mu-queue-pause:hover { background: rgba(217, 119, 6, 0.1); color: var(--mu-warning); }
.mu-queue-resume:hover { background: var(--mu-success-light); color: var(--mu-success); }

/* ── Thumbnail paused overlay ── */
.mu-thumb-overlay--paused {
    background: rgba(217, 119, 6, 0.5);
}

/* ── Toast Notifications ── */
.mu-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: 360px;
}

.mu-toast {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.75rem 1rem;
    border-radius: var(--mu-border-radius);
    background: white;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.08);
    font-family: var(--mu-font-family);
    font-size: var(--mu-font-size);
    color: var(--mu-gray-800);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 300ms ease, transform 300ms ease;
    border-left: 4px solid var(--mu-gray-300);
}

.mu-toast--visible {
    opacity: 1;
    transform: translateX(0);
}

.mu-toast--leaving {
    opacity: 0;
    transform: translateX(100%);
}

.mu-toast--success { border-left-color: var(--mu-success); }
.mu-toast--error { border-left-color: var(--mu-danger); }
.mu-toast--warning { border-left-color: var(--mu-warning); }
.mu-toast--info { border-left-color: var(--mu-primary); }

.mu-toast-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
}

.mu-toast--success .mu-toast-icon { color: var(--mu-success); }
.mu-toast--error .mu-toast-icon { color: var(--mu-danger); }
.mu-toast--warning .mu-toast-icon { color: var(--mu-warning); }
.mu-toast--info .mu-toast-icon { color: var(--mu-primary); }

.mu-toast-message {
    flex: 1;
    line-height: 1.4;
}

.mu-toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--mu-gray-400);
    font-size: 1rem;
    cursor: pointer;
    border-radius: 9999px;
    transition: background var(--mu-transition), color var(--mu-transition);
}

.mu-toast-close:hover {
    background: var(--mu-gray-100);
    color: var(--mu-gray-600);
}

/* ── Lightbox ── */
.mu-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100001;
    align-items: center;
    justify-content: center;
}

.mu-lightbox--visible {
    display: flex;
}

.mu-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    animation: mu-fade-in 200ms ease;
}

@keyframes mu-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.mu-lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: mu-lightbox-zoom 200ms ease;
}

@keyframes mu-lightbox-zoom {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.mu-lightbox-media {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 90vw;
    max-height: 80vh;
}
.mu-lightbox-img,
.mu-lightbox-video {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: var(--mu-border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    background: #000;
}
.mu-lightbox-video {
    width: min(90vw, 1280px);
    height: auto;
}
.mu-lightbox-pdf {
    width: min(90vw, 1100px);
    height: 80vh;
    border: none;
    background: #fff;
    border-radius: var(--mu-border-radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.mu-lightbox-caption {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--mu-font-family);
    font-size: var(--mu-font-size);
    text-align: center;
}

.mu-lightbox-close {
    position: absolute;
    top: -2rem;
    right: -1rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1.25rem;
    border-radius: 9999px;
    cursor: pointer;
    transition: background var(--mu-transition);
}

.mu-lightbox-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ── Confirm Dialog ── */
.mu-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100002;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    animation: mu-fade-in 150ms ease;
}

.mu-confirm-dialog {
    background: white;
    border-radius: var(--mu-border-radius);
    padding: 1.5rem;
    min-width: 300px;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    font-family: var(--mu-font-family);
    animation: mu-lightbox-zoom 150ms ease;
}

.mu-confirm-message {
    margin: 0 0 1.25rem 0;
    font-size: 0.9375rem;
    color: var(--mu-gray-800);
    line-height: 1.5;
}

.mu-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

.mu-confirm-btn {
    padding: 0.4rem 1rem;
    border: 1px solid var(--mu-gray-300);
    border-radius: var(--mu-border-radius-sm);
    font-size: var(--mu-font-size);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--mu-transition), border-color var(--mu-transition);
}

.mu-confirm-btn--cancel {
    background: white;
    color: var(--mu-gray-600);
}

.mu-confirm-btn--cancel:hover {
    background: var(--mu-gray-50);
    border-color: var(--mu-gray-400);
}

.mu-confirm-btn--ok {
    background: var(--mu-primary);
    color: white;
    border-color: var(--mu-primary);
}

.mu-confirm-btn--ok:hover {
    background: var(--mu-primary-hover);
    border-color: var(--mu-primary-hover);
}

/* ── Full Page Drop Overlay ── */
.mu-fullpage-drop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(79, 70, 229, 0.08);
    backdrop-filter: blur(2px);
    align-items: center;
    justify-content: center;
}

.mu-fullpage-drop-overlay--visible {
    display: flex;
}

.mu-fullpage-drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 4rem;
    background: white;
    border: 3px dashed var(--mu-primary);
    border-radius: 1rem;
    color: var(--mu-primary);
    font-family: var(--mu-font-family);
    font-size: 1.125rem;
    font-weight: 600;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    animation: mu-lightbox-zoom 200ms ease;
}

/* ── Attachment uploading state ── */
.mu-attachment-item--uploading {
    background: var(--mu-primary-light);
}

/* ── Dark Mode ── */
.mu-dark,
.mu-uploader.mu-dark,
.mu-dropzone-standalone.mu-dark,
.mu-attachments.mu-dark {
    --mu-gray-50: #1a1a2e;
    --mu-gray-100: #16213e;
    --mu-gray-200: #2a2a4a;
    --mu-gray-300: #3a3a5a;
    --mu-gray-400: #6a6a8a;
    --mu-gray-500: #9a9aba;
    --mu-gray-600: #c0c0d0;
    --mu-gray-700: #d0d0e0;
    --mu-gray-800: #e8e8f0;
    --mu-gray-900: #f5f5ff;
    --mu-primary-light: rgba(79, 70, 229, 0.15);
    --mu-success-light: rgba(22, 163, 74, 0.15);
    --mu-danger-light: rgba(220, 38, 38, 0.15);
}

.mu-dark .mu-queue-item,
.mu-dark .mu-thumb {
    background: var(--mu-gray-100);
}

.mu-dark .mu-toast {
    background: var(--mu-gray-100);
    color: var(--mu-gray-800);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.mu-dark .mu-confirm-dialog {
    background: var(--mu-gray-100);
    color: var(--mu-gray-800);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.mu-dark .mu-confirm-btn--cancel {
    background: var(--mu-gray-50);
    color: var(--mu-gray-600);
    border-color: var(--mu-gray-300);
}

.mu-dark .mu-fullpage-drop-content {
    background: var(--mu-gray-100);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ── Responsive ── */
@media (max-width: 480px) {
    .mu-queue-progress { display: none; }
    .mu-queue-item { flex-wrap: wrap; }
    .mu-thumb { --mu-thumb-size: 48px; }
}

/* ─────────────────────────────────────────────────────────────────────
   StatusBar widget — MultipleUpload.createStatusBar(target, { uploader })
   ───────────────────────────────────────────────────────────────────── */
.mu-statusbar {
    display: block;
    padding: 0.65rem 0.85rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    font: 500 0.85rem system-ui, -apple-system, sans-serif;
    color: #1e293b;
}
.mu-statusbar-progress {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    overflow: hidden;
    margin-bottom: 0.55rem;
}
.mu-statusbar-progress-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--mu-primary, #0891b2), var(--mu-primary-deep, #155e75));
    transition: width 200ms cubic-bezier(.2,.8,.2,1);
}
.mu-statusbar-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}
.mu-statusbar-pct {
    font-weight: 700;
    font-size: 0.95rem;
    color: #0f172a;
    min-width: 3.2rem;
}
.mu-statusbar-pct-num { font-variant-numeric: tabular-nums; }
.mu-statusbar-counts {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    color: #64748b;
    font-size: 0.78rem;
}
.mu-statusbar-count b {
    color: #0f172a;
    font-variant-numeric: tabular-nums;
    margin-right: 0.15em;
}
.mu-statusbar-count-failed b { color: #dc2626; }
.mu-statusbar-count-complete b { color: #16a34a; }
.mu-statusbar-speed, .mu-statusbar-eta {
    color: #64748b;
    font-size: 0.78rem;
    font-variant-numeric: tabular-nums;
    padding: 0.25rem 0.55rem;
    border-radius: 0.45rem;
    background: rgba(148, 163, 184, 0.12);
}
.mu-statusbar-controls {
    margin-left: auto;
    display: inline-flex;
    gap: 0.25rem;
}
.mu-statusbar-btn {
    background: transparent;
    border: 1px solid rgba(148, 163, 184, 0.32);
    color: #475569;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 0.45rem;
    cursor: pointer;
    font-size: 0.85rem;
    line-height: 1;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.mu-statusbar-btn:hover { background: rgba(15, 23, 42, 0.04); color: #0f172a; border-color: rgba(100, 116, 139, 0.5); }
.mu-statusbar-cancel:hover { color: #dc2626; border-color: rgba(220, 38, 38, 0.4); }

/* ─────────────────────────────────────────────────────────────────────
   Informer widget — MultipleUpload.createInformer(target, { uploader })
   ───────────────────────────────────────────────────────────────────── */
.mu-informer {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    pointer-events: none;
}
.mu-informer-entry {
    pointer-events: auto;
    padding: 0.55rem 0.85rem;
    border-radius: 0.55rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.32);
    box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.14);
    font: 500 0.82rem system-ui, -apple-system, sans-serif;
    color: #1e293b;
    transform: translateY(-4px);
    opacity: 0;
    transition: transform 220ms cubic-bezier(.2,.8,.2,1), opacity 220ms ease;
    border-left-width: 3px;
}
.mu-informer-entry--shown { transform: translateY(0); opacity: 1; }
.mu-informer-error    { border-left-color: #dc2626; }
.mu-informer-success  { border-left-color: #16a34a; }
.mu-informer-info     { border-left-color: #0891b2; }
.mu-informer-warning  { border-left-color: #d97706; }

/* ─────────────────────────────────────────────────────────────────────
   Drag-to-reorder queue rows (enableQueueReorder: true)
   ───────────────────────────────────────────────────────────────────── */
.mu-queue-item--reorderable {
    cursor: grab;
    transition: opacity 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.mu-queue-item--reorderable:hover {
    background: rgba(8, 145, 178, 0.04);
}
.mu-queue-drag-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    color: #94a3b8;
    cursor: grab;
    user-select: none;
    margin-right: 0.25rem;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: color 140ms ease;
}
.mu-queue-item--reorderable:hover .mu-queue-drag-handle { color: #475569; }
.mu-queue-item--dragging {
    opacity: 0.45;
    cursor: grabbing;
}
.mu-queue-item--drop-target {
    box-shadow: 0 -3px 0 0 #0891b2 inset;
    background: rgba(8, 145, 178, 0.08);
}

/* ─────────────────────────────────────────────────────────────────────
   Multi-tab progress dashboard
   ───────────────────────────────────────────────────────────────────── */
.mu-multitab-dashboard {
    display: block;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
    font: 500 0.875rem system-ui, sans-serif;
    color: #1e293b;
}
.mu-multitab-header {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.mu-multitab-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.65rem;
    height: 1.4rem;
    padding: 0 0.45rem;
    background: rgba(8, 145, 178, 0.14);
    color: #0e7490;
    border-radius: 999px;
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
}
.mu-multitab-empty {
    padding: 0.85rem 0;
    color: #94a3b8;
    font-style: italic;
    font-size: 0.82rem;
}
.mu-multitab-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.mu-multitab-tab {
    padding: 0.55rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 0.5rem;
    background: rgba(248, 250, 252, 0.6);
}
.mu-multitab-tab-head {
    font-size: 0.72rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 0.35rem;
}
.mu-multitab-tab-head code {
    background: rgba(8, 145, 178, 0.14);
    color: #0e7490;
    padding: 0 0.35em;
    border-radius: 0.25rem;
    font-family: ui-monospace, "SF Mono", monospace;
    font-size: 0.85em;
}
.mu-multitab-tab-tasks {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.mu-multitab-task {
    display: grid;
    grid-template-columns: 1fr 80px auto;
    align-items: center;
    gap: 0.45rem;
    padding: 0.25rem 0.3rem;
    border-radius: 0.35rem;
    font-size: 0.78rem;
}
.mu-multitab-task[data-status="completed"] { color: #16a34a; }
.mu-multitab-task[data-status="failed"]    { color: #dc2626; }
.mu-multitab-task-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.mu-multitab-task-bar {
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    overflow: hidden;
}
.mu-multitab-task-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0891b2, #155e75);
    transition: width 220ms cubic-bezier(.2,.8,.2,1);
}
.mu-multitab-task-meta {
    color: #64748b;
    font-variant-numeric: tabular-nums;
    text-align: right;
    font-size: 0.7rem;
}
/* ═══════════════════════════════════════════════════════════════════
   Drop-zone style variants (opt-in)
   ───────────────────────────────────────────────────────────────────
   Add one of these next to the drop zone to change its look without
   forking the stylesheet:

     <upload-dropzone class="mu-dropzone--tile">
     MultipleUpload.create('#x', { dropZoneMode: true })  ->  add the class
                                                          to the container

   Each variant is written twice: once for the inline zone the
   <multiple-upload> helper renders (.mu-dropzone) and once for the
   standalone zone (.mu-dropzone-standalone > .mu-dropzone-content).
   They inherit the same --mu-* tokens, so theming still applies.
   ═══════════════════════════════════════════════════════════════════ */

/* tile - solid card, no dash. Reads as a surface rather than a target. */
.mu-dropzone--tile.mu-dropzone,
.mu-dropzone--tile .mu-dropzone-content {
    border: 1px solid var(--mu-gray-200);
    border-radius: calc(var(--mu-border-radius) * 1.75);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 24px -18px rgba(16, 24, 40, 0.45);
}
.mu-dropzone--tile.mu-dropzone:hover,
.mu-dropzone--tile .mu-dropzone-content:hover {
    border-color: var(--mu-primary);
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 18px 32px -18px var(--mu-primary);
}

/* ring - solid tinted ring on a soft fill. Friendly, high-affordance. */
.mu-dropzone--ring.mu-dropzone,
.mu-dropzone--ring .mu-dropzone-content {
    border: 2px solid var(--mu-primary-light);
    border-radius: calc(var(--mu-border-radius) * 2.25);
    background: var(--mu-primary-light);
    color: var(--mu-primary);
}
.mu-dropzone--ring.mu-dropzone:hover,
.mu-dropzone--ring .mu-dropzone-content:hover {
    border-color: var(--mu-primary);
    background: var(--mu-primary-light);
}

/* inset - a recessed well. Suits zones sitting inside a panel. */
.mu-dropzone--inset.mu-dropzone,
.mu-dropzone--inset .mu-dropzone-content {
    border: 1px solid var(--mu-gray-200);
    border-radius: var(--mu-border-radius);
    background: var(--mu-gray-100);
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.06);
}
.mu-dropzone--inset.mu-dropzone:hover,
.mu-dropzone--inset .mu-dropzone-content:hover {
    background: var(--mu-gray-50);
    border-color: var(--mu-primary);
    box-shadow: inset 0 2px 6px rgba(16, 24, 40, 0.04);
}

/* minimal - no box at all; a hairline and centred content. */
.mu-dropzone--minimal.mu-dropzone,
.mu-dropzone--minimal .mu-dropzone-content {
    border: 0;
    border-top: 1px solid var(--mu-gray-200);
    border-bottom: 1px solid var(--mu-gray-200);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    min-height: 132px;
}
.mu-dropzone--minimal.mu-dropzone:hover,
.mu-dropzone--minimal .mu-dropzone-content:hover {
    background: transparent;
    border-top-color: var(--mu-primary);
    border-bottom-color: var(--mu-primary);
    box-shadow: none;
    transform: none;
}

/* compact - short and horizontal: glyph beside the label, not above it. */
.mu-dropzone--compact.mu-dropzone,
.mu-dropzone--compact .mu-dropzone-content {
    flex-direction: row;
    gap: 0.85rem;
    min-height: 0;
    padding: 1rem 1.25rem;
    border-radius: calc(var(--mu-border-radius) * 1.25);
}
.mu-dropzone--compact.mu-dropzone::before,
.mu-dropzone--compact .mu-dropzone-content::before {
    width: 26px;
    height: 26px;
}
.mu-dropzone--compact .mu-dropzone-icon svg {
    width: 26px;
    height: 26px;
}
/* ── More drop-zone variants ─────────────────────────────────────── */

/* gradient - soft brand wash. Good hero/marketing placement. */
.mu-dropzone--gradient.mu-dropzone,
.mu-dropzone--gradient .mu-dropzone-content {
    border: 1px solid var(--mu-primary-light);
    border-radius: calc(var(--mu-border-radius) * 1.75);
    background: linear-gradient(135deg, var(--mu-primary-light) 0%, #fff 55%, var(--mu-primary-light) 100%);
    color: var(--mu-primary);
}
.mu-dropzone--gradient.mu-dropzone:hover,
.mu-dropzone--gradient .mu-dropzone-content:hover {
    border-color: var(--mu-primary);
    background: linear-gradient(135deg, var(--mu-primary-light) 0%, #fff 45%, var(--mu-primary-light) 100%);
}

/* banner - wide and short with an accent edge. Sits above a form. */
.mu-dropzone--banner.mu-dropzone,
.mu-dropzone--banner .mu-dropzone-content {
    flex-direction: row;
    gap: 0.9rem;
    min-height: 0;
    padding: 0.95rem 1.15rem;
    border: 1px solid var(--mu-gray-200);
    border-left: 4px solid var(--mu-primary);
    border-radius: var(--mu-border-radius-sm);
    background: var(--mu-gray-50);
    text-align: left;
}
.mu-dropzone--banner.mu-dropzone::before,
.mu-dropzone--banner .mu-dropzone-content::before {
    width: 24px;
    height: 24px;
}

/* bold - deliberately loud dashes for a primary, unmissable target. */
.mu-dropzone--bold.mu-dropzone,
.mu-dropzone--bold .mu-dropzone-content {
    border: 3px dashed var(--mu-primary);
    border-radius: calc(var(--mu-border-radius) * 1.5);
    background: var(--mu-primary-light);
    color: var(--mu-primary);
    min-height: 200px;
}
.mu-dropzone--bold.mu-dropzone:hover,
.mu-dropzone--bold .mu-dropzone-content:hover {
    background: #fff;
}

/* dark - for dark sections; opts out of the light palette entirely. */
.mu-dropzone--dark.mu-dropzone,
.mu-dropzone--dark .mu-dropzone-content {
    border: 1px dashed rgba(255, 255, 255, 0.28);
    border-radius: calc(var(--mu-border-radius) * 1.5);
    background: #0f172a;
    color: #cbd5e1;
}
.mu-dropzone--dark.mu-dropzone:hover,
.mu-dropzone--dark .mu-dropzone-content:hover {
    border-color: #38bdf8;
    background: #111f3a;
    color: #e2e8f0;
    box-shadow: 0 14px 30px -18px #38bdf8;
}

/* ═══════════════════════════════════════════════════════════════════
   Progress-bar style variants (opt-in)
   ───────────────────────────────────────────────────────────────────
   Put one of these on the .mu-progress wrapper:
       <div class="mu-progress mu-progress--thin"> ... </div>
   They restyle .mu-progress-bar / .mu-progress-fill only, so the
   markup, ARIA attributes and width updates are untouched.
   ═══════════════════════════════════════════════════════════════════ */

/* thin - a hairline. Unobtrusive under a file row. */
.mu-progress--thin .mu-progress-bar { height: 0.1875rem; }

/* thick - chunky, easy to read across a room. */
.mu-progress--thick .mu-progress-bar { height: 0.875rem; }

/* flat - one solid colour, square ends, no gradient. */
.mu-progress--flat .mu-progress-bar,
.mu-progress--flat .mu-progress-fill { border-radius: 2px; }
.mu-progress--flat .mu-progress-fill { background: var(--mu-primary); }

/* striped - classic moving barber pole while a transfer is live. */
.mu-progress--striped .mu-progress-fill {
    /* The base rule paints the fill with the `background` SHORTHAND, so setting
       background-image alone would replace the gradient and leave translucent
       stripes over nothing - the bar rendered empty. Repaint a solid brand base
       underneath, then lay the stripes on top. */
    background-color: var(--mu-primary);
    background-image: linear-gradient(45deg,
        rgba(255, 255, 255, 0.22) 25%, transparent 25%,
        transparent 50%, rgba(255, 255, 255, 0.22) 50%,
        rgba(255, 255, 255, 0.22) 75%, transparent 75%, transparent);
    background-size: 1rem 1rem;
    animation: mu-progress-stripes 1s linear infinite;
}
@keyframes mu-progress-stripes { from { background-position: 1rem 0; } to { background-position: 0 0; } }

/* segmented - ticked into blocks; reads as discrete chunks. */
.mu-progress--segmented .mu-progress-bar { border-radius: 3px; }
.mu-progress--segmented .mu-progress-fill {
    border-radius: 3px;
    -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 14px);
            mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 14px);
}

/* glow - soft halo in the brand colour. Suits dark surfaces. */
.mu-progress--glow .mu-progress-fill {
    box-shadow: 0 0 10px var(--mu-primary), 0 0 2px var(--mu-primary);
}

/* Respect a reduced-motion preference: stop the stripe animation. */
@media (prefers-reduced-motion: reduce) {
    .mu-progress--striped .mu-progress-fill { animation: none; }
}
