:root {
    color-scheme: light;
    --bg: #eef2f3;
    --panel: #ffffff;
    --ink: #1f2933;
    --muted: #61717d;
    --line: #d8e0e4;
    --accent: #0d7c75;
    --accent-dark: #075e59;
    --error-bg: #fff1f0;
    --error-ink: #9f1f18;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: var(--bg);
}

.app {
    width: min(920px, calc(100% - 32px));
    margin: 0 auto;
    padding: 48px 0;
}

.panel,
.results {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(31, 41, 51, 0.08);
}

.panel {
    padding: 32px;
}

.heading {
    margin-bottom: 26px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 0;
    font-size: clamp(30px, 6vw, 46px);
    line-height: 1.05;
}

h2 {
    margin-bottom: 18px;
    font-size: 24px;
}

.converter-form {
    display: grid;
    gap: 22px;
}

.dropzone {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 28px;
    place-items: center;
    text-align: center;
    border: 2px dashed #9fb2b9;
    border-radius: 8px;
    background: #f8fbfb;
    cursor: pointer;
}

.dropzone-title {
    font-size: 20px;
    font-weight: 700;
}

.dropzone-subtitle,
.result-item p {
    color: var(--muted);
}

.dropzone input {
    max-width: 100%;
}

.selected-files {
    display: none;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

.selected-files:not(:empty) {
    display: block;
}

.selected-files-title {
    margin-bottom: 10px;
    font-weight: 700;
}

.selected-files ul {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.selected-files li {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #eef2f3;
}

.preview-pair {
    display: grid;
    grid-template-columns: repeat(2, 80px);
    gap: 10px;
}

.preview-pair figure {
    margin: 0;
}

.preview-pair figcaption {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.selected-file-info {
    display: grid;
    gap: 5px;
}

.selected-file-info span,
.selected-file-info small {
    margin: 0;
    overflow-wrap: anywhere;
}

.selected-file-info span {
    color: var(--ink);
    font-weight: 400;
}

.selected-file-info small {
    font-size: 13px;
}

.selected-files li strong {
    flex: 0 0 auto;
    color: var(--ink);
}

.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

label span,
legend {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
}

input[type="number"],
input[type="file"] {
    width: 100%;
    font: inherit;
}

input[type="number"] {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
    padding: 0;
    border: 0;
}

.radio-group legend {
    flex: 0 0 100%;
}

.radio-group label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #fff;
}

.radio-group span {
    margin: 0;
}

.range-field input {
    width: 100%;
    accent-color: var(--accent);
}

button,
.download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    border-radius: 6px;
    background: var(--accent);
    cursor: pointer;
}

button:hover,
.download:hover {
    background: var(--accent-dark);
}

.notice {
    margin-bottom: 20px;
    padding: 14px 16px;
    border-radius: 6px;
}

.notice p {
    margin: 0;
}

.notice p + p {
    margin-top: 8px;
}

.notice-error {
    color: var(--error-ink);
    background: var(--error-bg);
}

.results {
    margin-top: 24px;
    padding: 28px 32px;
}

.result-list {
    display: grid;
    gap: 12px;
}

.result-item {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfc;
}

.result-item h3 {
    margin-bottom: 6px;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.result-item p {
    margin-bottom: 0;
}

.download {
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .app {
        width: min(100% - 20px, 920px);
        padding: 24px 0;
    }

    .panel,
    .results {
        padding: 22px;
    }

    .grid,
    .result-item,
    .selected-files li {
        grid-template-columns: 80px minmax(0, 1fr);
    }

    .result-item,
    .selected-files li {
        align-items: stretch;
    }

    .download,
    .preview-pair,
    .selected-files li strong {
        grid-column: 1 / -1;
    }
}
