*{
    box-sizing: border-box;
}

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

.container {
    width: 100%;
    max-width: 1100px;
    margin: 40px auto;
    padding: 20px;
}

.card {
    background: #fff;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 0 10px 40px rgba(0,0,0,.08);
}

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

.subtitle {
    max-width: 760px;
    margin: 12px auto 30px;
    text-align: center;
    line-height: 1.6;
    color: #6b7280;
}

/* Upload */

.upload-area {
    display: block;
    padding: 45px 20px;
    text-align: center;
    border: 2px dashed #c7cdd8;
    border-radius: 15px;
    background: #fafbfc;
    cursor: pointer;
    transition: .2s ease;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: #1b2fe7;
    background: #eff6ff;
}

.upload-icon {
    font-size: 50px;
    margin-bottom: 12px;
}

.upload-area h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.upload-area p {
    margin: 0;
    color: #6b7280;
}

#fileInput {
    display: none;
}

/* Selected files */

.selected-files {
    display: none;
    margin-top: 18px;
    padding: 15px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
}

.selected-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.selected-header strong {
    font-size: 14px;
}

.file-list {
    max-height: 180px;
    overflow: auto;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 0;
    border-bottom: 1px solid #edf0f4;
    font-size: 13px;
}

.file-item:last-child {
    border-bottom: 0;
}

.file-item-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-item-size {
    color: #6b7280;
    white-space: nowrap;
}

/* Buttons */

.actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

button {
    border: 0;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: .2s ease;
}

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

.primary-btn {
    background: #1b2fe7;
    color: #fff;
}

.primary-btn:hover:not(:disabled) {
    background: #1d4ed8;
}

.secondary-btn {
    background: #e5e7eb;
    color: #111827;
}

.secondary-btn:hover:not(:disabled) {
    background: #d1d5db;
}

.green-btn {
    background: #16a34a;
    color: #fff;
}

.green-btn:hover:not(:disabled) {
    background: #15803d;
}

/* Status */

.status {
    display: none;
    margin-top: 20px;
    padding: 13px 15px;
    border-radius: 10px;
    text-align: center;
    line-height: 1.5;
}

.status.info {
    display: block;
    background: #eff6ff;
    color: #1d4ed8;
}

.status.success {
    display: block;
    background: #f0fdf4;
    color: #15803d;
}

.status.error {
    display: block;
    background: #fef2f2;
    color: #dc2626;
}

/* Progress */

.progress-container {
    display: none;
    margin-top: 22px;
}

.progress-bar {
    width: 100%;
    height: 11px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: #1b2fe7;
    transition: width .15s ease;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

/* Summary */

.summary {
    display: none;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 25px;
}

.summary-card {
    padding: 18px;
    border-radius: 12px;
    background: #f8fafc;
    text-align: center;
}

.summary-value {
    font-size: 22px;
    font-weight: 700;
    color: #1b2fe7;
    word-break: break-word;
}

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

/* Benchmark */

.benchmark-section {
    display: none;
    margin-top: 30px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.section-title h2 {
    margin: 0;
    font-size: 21px;
}

.table-wrapper {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

table {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
}

thead {
    background: #f8fafc;
}

th,
td {
    padding: 13px 12px;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
}

th {
    color: #374151;
    font-weight: 700;
    white-space: nowrap;
}

td {
    color: #4b5563;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:hover {
    background: #f9fafb;
}

.best-row {
    background: #f0fdf4 !important;
}

.fastest-row {
    background: #eff6ff !important;
}

.balance-row {
    background: #fff7ed !important;
}

.level-badge {
    display: inline-block;
    padding: 5px 9px;
    border-radius: 7px;
    background: #eef2ff;
    color: #3730a3;
    font-weight: 700;
}

.result-badge {
    display: inline-block;
    margin-left: 5px;
    padding: 4px 7px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.badge-best {
    background: #dcfce7;
    color: #166534;
}

.badge-fast {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-balance {
    background: #ffedd5;
    color: #c2410c;
}

/* Result cards */

.results {
    display: none;
    margin-top: 25px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.result-card {
    padding: 20px;
    border-radius: 13px;
    border: 1px solid #e5e7eb;
    background: #fff;
}

.result-icon {
    font-size: 28px;
}

.result-title {
    margin-top: 8px;
    font-size: 13px;
    color: #6b7280;
}

.result-level {
    margin-top: 5px;
    font-size: 20px;
    font-weight: 700;
}

/* Download benchmark */

.download-section {
    display: none;
    margin-top: 25px;
}

.download-list {
    display: grid;
    gap: 10px;
}

.download-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
}

.download-name {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.download-meta {
    color: #6b7280;
    font-size: 12px;
    white-space: nowrap;
}

.small-download {
    padding: 8px 12px;
    background: #eef2ff;
    color: #3730a3;
}

/* Info */

.info {
    margin-top: 28px;
    padding: 18px;
    border-radius: 12px;
    background: #f8fafc;
    color: #4b5563;
    font-size: 13px;
    line-height: 1.7;
}

.info strong {
    color: #111827;
}

.footer {
    margin-top: 22px;
    text-align: center;
    color: #9ca3af;
    font-size: 12px;
}

/* Mobile */

@media (max-width: 750px) {

    .container {
        margin: 15px auto;
        padding: 10px;
    }

    .card {
        padding: 22px 16px;
    }

    h1 {
        font-size: 26px;
    }

    .summary {
        grid-template-columns: repeat(2, 1fr);
    }

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

    .download-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .download-name {
        width: 100%;
        flex-basis: 100%;
    }

}

@media (max-width: 450px) {

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

}
