:root {
    color-scheme: light;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: #172033;
    background: #f4f7fb;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

/*body {
    min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}*/

main { /*width: min(100%, 720px);*/ 
min-height: 100vh;
    margin: 0;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.card {
    padding: clamp(24px, 5vw, 44px);
    background: #fff;
    border: 1px solid #e4eaf2;
    border-radius: 20px;
    box-shadow: 0 18px 55px rgb(30 55 90 / 9%);
}

h1 { margin: 0; font-size: clamp(1.65rem, 5vw, 2.15rem); letter-spacing: -0.04em; }
.intro { margin: 10px 0 28px; color: #617086; line-height: 1.6; }

.drop-zone {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 36px 20px;
    text-align: center;
    background: #f8faff;
    border: 2px dashed #c9d5e5;
    border-radius: 14px;
    transition: border-color .2s, background .2s;
}

.drop-zone.is-dragging { border-color: #4263eb; background: #f0f4ff; }
.upload-icon { width: 42px; height: 42px; color: #4263eb; }
.drop-title { margin: 0; font-weight: 650; }
.drop-hint, .limits { margin: 0; color: #718096; font-size: .9rem; }
.limits { font-size: .82rem; }

.button, .choose-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    color: #fff;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
    background: #4263eb;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
    transition: background .2s, transform .2s;
}

.button:hover:not(:disabled), .choose-button:hover { background: #3451d1; transform: translateY(-1px); }
.button:focus-visible, .choose-button:focus-visible { outline: 3px solid #aabaff; outline-offset: 3px; }
.button:disabled { opacity: .55; cursor: not-allowed; }
#image-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; clip-path: inset(50%); }

.selection { margin-top: 20px; }
.selection-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.selection-heading h2, .previews h2 { margin: 0; font-size: 1rem; }
.file-list { display: grid; gap: 8px; padding: 0; margin: 0; list-style: none; }
.file-item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px; color: #46556b; background: #f7f9fc; border-radius: 8px; font-size: .9rem; overflow-wrap: anywhere; }
.file-size { flex: 0 0 auto; color: #718096; }
.actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.loader { display: inline-flex; align-items: center; gap: 9px; color: #46556b; font-size: .92rem; }
.spinner { width: 18px; height: 18px; border: 2px solid #dbe3f0; border-top-color: #4263eb; border-radius: 50%; animation: spin .75s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.progress-wrap { margin-top: 16px; }
.progress-meta { display: flex; justify-content: space-between; margin-bottom: 6px; color: #617086; font-size: .82rem; }
progress { display: block; width: 100%; height: 8px; appearance: none; border: 0; border-radius: 99px; overflow: hidden; }
progress::-webkit-progress-bar { background: #e8edf5; border-radius: 99px; }
progress::-webkit-progress-value { background: #4263eb; border-radius: 99px; transition: width .15s; }
progress::-moz-progress-bar { background: #4263eb; border-radius: 99px; }

.message { margin: 18px 0 0; padding: 12px 14px; border-radius: 9px; line-height: 1.5; }
.message.success { color: #17633b; background: #eaf8ef; }
.message.error { color: #9d2b2b; background: #fff0f0; }
.previews { margin-top: 30px; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 12px; }
.preview { min-width: 0; padding: 8px; background: #f7f9fc; border-radius: 10px; }
.preview img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: #e8edf5; border-radius: 7px; }
.preview figcaption { margin-top: 7px; color: #46556b; font-size: .8rem; overflow-wrap: anywhere; }

[hidden] { display: none !important; }

@media (max-width: 480px) {
    body { padding: 16px 12px; }
    .card { border-radius: 15px; }
    .drop-zone { padding: 28px 14px; }
    .actions { align-items: stretch; flex-direction: column; }
    .button { width: 100%; }
}