:root {
    color-scheme: light;
    font-family: Arial, Helvetica, sans-serif;
    background: #ececec;
    color: #222;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: #ececec;
}

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

.results-shell { width: min(1360px, calc(100% - 32px)); }

.card {
    background: #fff;
    border: 1px solid #d1d1d1;
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 3px 14px rgba(0,0,0,.08);
}

h1 { margin: 0; font-size: 30px; }
.subtitle { margin: 6px 0 28px; color: #666; }

.field-group, fieldset { margin: 0 0 28px; }
fieldset { border: 0; padding: 0; }
legend, .field-title { display: block; font-weight: 700; margin-bottom: 10px; }
.field-help { margin: -4px 0 12px; color: #666; font-size: 14px; }

fieldset > label { margin-right: 18px; }

input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    background: #fafafa;
}

input[type="color"] {
    width: 72px;
    height: 42px;
    padding: 3px;
    border: 1px solid #c8c8c8;
    border-radius: 6px;
    background: #fff;
}

.thickness-options {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.thickness-options label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.thickness-options img { display: block; max-height: 36px; }

button, .button-link, .download-link {
    display: inline-block;
    border: 0;
    border-radius: 6px;
    text-decoration: none;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

button, .button-link {
    padding: 12px 18px;
    background: #272727;
    color: #fff;
}

.button-link.secondary {
    background: #eee;
    color: #222;
}

button:hover, .button-link:hover { filter: brightness(.92); }

.error-message {
    margin: 24px 0;
    padding: 14px 16px;
    border: 1px solid #d4a5a5;
    border-radius: 6px;
    background: #fff2f2;
}

.results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}
.results-heading .subtitle { margin-bottom: 0; }

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

.result-item {
    min-width: 0;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}
.result-item.thumbnail { grid-column: 1 / -1; }

.result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}
.result-meta h2 { margin: 0 0 3px; font-size: 17px; }
.result-meta span { color: #777; font-size: 13px; }
.download-link { color: #175ea8; white-space: nowrap; }

.result-item img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #c8c8c8;
    background: #000;
}
.result-item.preview img { max-width: 320px; }
.result-item.thumbnail img { width: 172px; }

.expiry-note {
    margin: 28px 0 0;
    color: #666;
    font-size: 13px;
}

@media (max-width: 760px) {
    .page-shell { padding: 20px 0; }
    .card { padding: 20px; }
    .results-grid { grid-template-columns: 1fr; }
    .result-item.thumbnail { grid-column: auto; }
    .results-heading { flex-direction: column; }
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

@media (max-width: 700px) {
    .results-actions {
        width: 100%;
        justify-content: flex-start;
    }
}
