* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f3f4f6;
    color: #111827;
}

.container {
    max-width: 1250px;
    margin: auto;
    padding: 25px;
}

h1 {
    text-align: center;
    margin: 5px 0;
    font-size: 30px;
}

.subtitle {
    text-align: center;
    color: #6b7280;
    margin-bottom: 25px;
}

.box {
    background: white;
    padding: 22px;
    border-radius: 16px;
    box-shadow: 0 5px 25px rgba(0,0,0,.07);
    margin-bottom: 20px;
}

.upload-area {
    border: 3px dashed #9ca3af;
    border-radius: 15px;
    padding: 42px 20px;
    text-align: center;
    cursor: pointer;
    background: #fafafa;
    transition: .2s;
}

.upload-area:hover,
.upload-area.dragover {
    background: #eef2ff;
    border-color: #4f46e5;
}

.upload-area input {
    display: none;
}

.upload-icon {
    font-size: 45px;
}

.upload-title {
    font-size: 18px;
    font-weight: bold;
    margin-top: 10px;
}

.upload-subtitle {
    color: #6b7280;
    margin-top: 7px;
}

.settings-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(190px, 1fr));
    gap: 15px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.field label {
    font-size: 13px;
    font-weight: bold;
}

select {
    width: 100%;
    padding: 11px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.info-box {
    margin-top: 15px;
    padding: 13px;
    border-radius: 9px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.6;
}

.buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

button {
    border: none;
    border-radius: 9px;
    padding: 12px 17px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    background: #111827;
    color: white;
}

button:hover {
    opacity: .88;
}

button:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.primary {
    background: #4f46e5;
}

.success {
    background: #15803d;
}

.orange {
    background: #ea580c;
}

.red {
    background: #dc2626;
}

.status {
    margin-top: 15px;
    font-weight: bold;
}

.file-list {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(240px, 1fr));
    gap: 15px;
}

.file-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.file-preview {
    width: 100%;
    height: 170px;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.file-info {
    padding: 12px;
}

.file-name {
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
}

.remove-file {
    margin-top: 9px;
    padding: 7px 10px;
    font-size: 12px;
    background: #dc2626;
}

.progress-wrapper {
    margin-top: 10px;
}

.progress-background {
    width: 100%;
    height: 7px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: #4f46e5;
    transition: width .2s;
}

.progress-text {
    font-size: 11px;
    margin-top: 4px;
    color: #6b7280;
}

.results {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}

.result-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

.result-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.result-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.result-info {
    padding: 12px;
}

.result-number {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

.result-name {
    font-size: 13px;
    font-weight: bold;
    word-break: break-word;
}

.result-meta {
    font-size: 12px;
    color: #6b7280;
    margin-top: 5px;
    line-height: 1.5;
}

.download-one {
    width: 100%;
    margin-top: 9px;
    padding: 9px;
    background: #111827;
}

.empty {
    padding: 45px 20px;
    text-align: center;
    color: #6b7280;
    background: #f8fafc;
    border-radius: 12px;
}

.hidden {
    display: none !important;
}

@media(max-width:650px) {

    .container {
        padding: 10px;
    }

    h1 {
        font-size: 23px;
    }

    .box {
        padding: 15px;
    }

    .upload-area {
        padding: 30px 12px;
    }

    .buttons button {
        width: 100%;
    }

    .results {
        grid-template-columns: 1fr;
    }
}
