* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", sans-serif;
    background: #f5f7fa;
    color: #172033;
}

.container {
    width: min(900px, calc(100% - 32px));
    margin: 0 auto;
    padding: 60px 0 100px;
}

.badge {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: #e8eefc;
    font-size: 13px;
    font-weight: 700;
}

h1 {
    margin: 18px 0 10px;
    font-size: clamp(40px, 8vw, 68px);
    letter-spacing: -.04em;
}

.lead {
    max-width: 680px;
    font-size: 20px;
    line-height: 1.55;
    color: #536078;
}

section {
    margin-top: 34px;
    padding: 28px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0,0,0,.06);
}

h2 {
    margin-top: 0;
}

.help {
    color: #667085;
}

.upload-box {
    min-height: 180px;
    border: 2px dashed #b8c3d8;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    background: #fafbfe;
    transition: .2s;
}

.upload-box:hover {
    border-color: #446ee7;
    background: #f5f8ff;
}

.upload-icon {
    font-size: 40px;
    line-height: 1;
}

.previews {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(120px,1fr));
    gap: 12px;
    margin-top: 18px;
}

.preview {
    position: relative;
}

.preview img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
}

.preview span {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button {
    width: 100%;
    margin-top: 22px;
    padding: 15px 20px;
    border: 0;
    border-radius: 12px;
    background: #172033;
    color: white;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
}

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

.loading {
    margin-top: 20px;
    font-weight: 700;
}

.hidden {
    display: none;
}

.error-box {
    margin-top: 20px;
    padding: 14px;
    border-radius: 10px;
    background: #fff1f0;
    color: #b42318;
}

.result-grid {
    display: grid;
    grid-template-columns:
        repeat(auto-fit, minmax(180px,1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.result-item {
    padding: 15px;
    background: #f7f8fb;
    border-radius: 12px;
}

.result-label {
    display: block;
    margin-bottom: 5px;
    color: #667085;
    font-size: 12px;
    text-transform: uppercase;
}

.result-value {
    font-weight: 700;
}

.confidence {
    display: block;
    margin-top: 4px;
    color: #667085;
    font-size: 12px;
}

.result-section {
    margin-top: 22px;
}

.result-section h3 {
    margin-bottom: 8px;
}

.result-section ul {
    padding-left: 20px;
}

pre {
    overflow: auto;
    padding: 16px;
    border-radius: 12px;
    background: #101828;
    color: #e6edf3;
    font-size: 13px;
}

.ok {
    color: #138a4b;
    font-weight: 700;
}

.error {
    color: #b42318;
    font-weight: 700;
}

@media (max-width: 600px) {
    .container {
        padding-top: 35px;
    }

    section {
        padding: 20px;
    }
}
