* {
    box-sizing: border-box;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    margin: 0;
    background: #eef2ff;
    color: #111;
}

.app {
    max-width: 720px;
    margin: 0 auto;
}

/* ===== COLORFUL HEADER ===== */
.header {
    padding: 28px 16px;
    text-align: center;
    color: white;
    background: linear-gradient(135deg, #6366f1, #22d3ee, #34d399);
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
}

.header h1 {
    margin: 0;
    font-size: 1.9rem;
}
.header h2 {
    margin: 0;
    font-size: 1.4rem;
}

#targetLabel {
    margin-top: 6px;
    font-size: 0.9rem;
    opacity: 0.95;
}

/* ===== CONTROLS ===== */
.controls {
    display: flex;
    gap: 16px;
    padding: 20px 16px;
}

.controls button {
    flex: 1;
    padding: 20px;
    font-size: 1.15rem;
    font-weight: 600;
    border-radius: 18px;
    border: none;
    cursor: pointer;
}

#selectBtn {
    background: #6366f1;
    color: white;
}

#uploadBtn {
    background: #22c55e;
    color: white;
}

#uploadBtn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

/* ===== LIST ===== */
.list-card {
    margin: 0 16px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(0,0,0,0.1);
}

image {
    display: block;
    width: 64px;
}

table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed; /* 🔑 IMPORTANT */
}


thead {
    background: #eef2ff;
}

th, td {
    padding: 14px;
    vertical-align: middle;
    text-align: center;
}

tr:not(:last-child) {
    border-bottom: 1px solid #eee;
}

/* ===== FILE CELL ===== */
.file-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== HARD-LOCKED PREVIEW SIZE ===== */
.preview {
    min-width: 48px !important;
    min-height: 48px !important;
    max-width: 64px !important;
    max-height: 64px !important;

    /*min-width: 48px !important;
    min-height: 48px !important;
    max-width: 48px !important;
    max-height: 48px !important;*/

    object-fit: cover;
    border-radius: 10px;
    background: #ddd;
    display: block;
    flex-shrink: 0;
}

.file-name {
    font-size: 0.95rem;
    font-weight: 500;
    word-break: break-word;
}

/* ===== STATUS ===== */
.status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 3px solid #ddd;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.success { color: #22c55e; }
.error { color: #ef4444; }

/* ===== DELETE BUTTON ===== */
.delete-btn {
    padding: 8px 14px;
    border-radius: 12px;
    border: 2px solid #ef4444;
    background: transparent;
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
}

.delete-btn:hover {
    background: #ef4444;
    color: white;
}

.delete-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 600px) {
    .controls {
        flex-direction: column;
    }
}

/* ===== ERROR MESSAGE ===== */
.error-box {
    margin: 16px;
    padding: 16px 20px;
    border-radius: 16px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 600;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.hidden {
    display: none;
}

