* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f1ea;
    color: #2f2f2f;
}

.pdf-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.pdf-card {
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 22px;
    padding: 35px;
    box-shadow: 0 18px 45px rgba(0,0,0,0.12);
    text-align: center;
}

.pdf-card h1 {
    margin: 0 0 10px;
    font-size: 42px;
    color: #2c2c2c;
}

.intro {
    margin: 0 0 28px;
    color: #666;
    font-size: 17px;
}

.upload-box {
    margin-bottom: 20px;
}

.upload-box input {
    display: none;
}

.upload-box label {
    display: block;
    padding: 35px 20px;
    border: 2px dashed #b9a98f;
    border-radius: 18px;
    background: #fbfaf7;
    cursor: pointer;
    transition: 0.25s ease;
}

.upload-box label:hover {
    border-color: #8b6f47;
    background: #f7f0e4;
}

.upload-box strong {
    display: block;
    font-size: 20px;
    margin-bottom: 8px;
}

.upload-box span {
    display: block;
    color: #777;
    word-break: break-word;
}

.quality-box {
    text-align: left;
    margin-bottom: 22px;
}

.quality-box label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
}

.quality-box select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid #cfc5b4;
    font-size: 16px;
    background: #fff;
}

#compressBtn,
.download-btn,
.clear-btn {
    width: 100%;
    border: none;
    border-radius: 14px;
    padding: 15px 20px;
    font-size: 17px;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: 0.25s ease;
}

#compressBtn {
    background: #6b4226;
    color: #fff;
}

#compressBtn:hover {
    background: #52311c;
}

#compressBtn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.loading {
    margin-top: 22px;
    font-weight: bold;
    color: #6b4226;
}

.result {
    margin-top: 25px;
}

.success,
.error {
    border-radius: 18px;
    padding: 22px;
}

.success {
    background: #f2fbf2;
    border: 1px solid #b7dfb7;
    color: #245b24;
}

.error {
    background: #fff0f0;
    border: 1px solid #e0a5a5;
    color: #8a1f1f;
}

.success h3 {
    margin-top: 0;
}

.size-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin: 20px 0;
}

.size-grid div {
    background: #ffffff;
    border-radius: 14px;
    padding: 14px;
    border: 1px solid #dfeadf;
}

.size-grid span {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.size-grid strong {
    font-size: 20px;
}

.download-btn {
    background: #2f7d32;
    color: #fff;
    margin-top: 5px;
}

.download-btn:hover {
    background: #256428;
}

.clear-btn {
    background: #ddd2c3;
    color: #3d3124;
    margin-top: 12px;
}

.clear-btn:hover {
    background: #c9baa5;
}

@media (min-width: 640px) {
    .size-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 480px) {
    .pdf-card {
        padding: 25px 18px;
    }

    .pdf-card h1 {
        font-size: 34px;
    }
}

.badge {
    display: inline-block;
    background: #f7eadb;
    color: #6b4226;
    border: 1px solid #d8b98f;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 16px;
}

.upload-icon {
    font-size: 46px;
    margin-bottom: 10px;
}

.upload-box small {
    display: block;
    color: #8a7a66;
    margin-bottom: 12px;
}

.upload-box.drag-over label {
    border-color: #6b4226;
    background: #fff4e5;
    transform: scale(1.02);
}

.progress-wrap {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: bold;
    color: #6b4226;
    margin-bottom: 7px;
}

.progress-bar {
    width: 100%;
    height: 13px;
    background: #eee3d5;
    border-radius: 999px;
    overflow: hidden;
}

#progressFill {
    width: 0%;
    height: 100%;
    background: #6b4226;
    border-radius: 999px;
    transition: width 0.25s ease;
}

.file-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.file-item {
    background: #faf6f1;
    border: 1px solid #e4d7c7;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
}

.file-item strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-item span {
    color: #777;
    font-size: 13px;
}

.file-item small {
    background: #e7f7e7;
    color: #2f7d32;
    padding: 5px 10px;
    border-radius: 999px;
    font-weight: bold;
}

.batch-summary {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 20px 0;
}

.batch-summary div {
    background: #fff;
    border: 1px solid #dfeadf;
    border-radius: 14px;
    padding: 15px;
}

.batch-summary span {
    display: block;
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.batch-summary strong {
    font-size: 24px;
}

.compressed-list {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.compressed-item {
    background: #fff;
    border: 1px solid #dfeadf;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
}

.compressed-item strong {
    display: block;
    margin-bottom: 10px;
    word-break: break-word;
}

.compressed-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.compressed-stats span {
    background: #f4f4f4;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
}

.mini-download-btn {
    display: inline-block;
    background: #2f7d32;
    color: #fff;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: bold;
    transition: 0.25s ease;
}

.mini-download-btn:hover {
    background: #256428;
}

@media (max-width: 600px) {

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

    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .compressed-stats {
        flex-direction: column;
    }
}