:root {
    color-scheme: light;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --line: #cbd5e1;
    --primary: #4f46e5;
    --primary-hover: #6366f1;
    --soft: #eef2ff;
    --soft-text: #4338ca;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    min-height: 100dvh;
    background: var(--bg);
    color: var(--text);
    font-family: "Segoe UI", Roboto, system-ui, sans-serif;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

img { max-width: 100%; height: auto; }

.page {
    width: min(100%, 32rem);
    margin: 0 auto;
    padding: 1rem;
}

.page-split { width: min(100%, 72rem); }

.layout { display: block; }

.card {
    background: var(--card);
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    padding: 1rem;
}

h1, h2, .label, label {
    font-weight: 700;
}

h1 {
    margin: 0 0 0.5rem;
    text-align: center;
    font-size: 1.6rem;
    line-height: 1.2;
    color: #0f172a;
}

h2 {
    margin: 0 0 0.25rem;
    font-size: 1.15rem;
}

.lead, .hint {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.lead {
    margin: 0 0 1.25rem;
    text-align: center;
}

.hint { margin: 0.35rem 0 0; }

form { display: grid; gap: 1rem; }

.field label, .label { display: block; margin-bottom: 0.35rem; font-size: 0.95rem; }

input[type="url"], input[type="text"] {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    padding: 0.8rem 0.75rem;
    font: inherit;
    font-size: 1rem;
}

input:focus {
    outline: 2px solid #818cf8;
    border-color: #6366f1;
}

.colors {
    display: grid;
    gap: 0.75rem;
}

.colors label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
}

input[type="color"] {
    width: 7rem;
    height: 3rem;
    padding: 0.25rem;
    border: 1px solid var(--line);
    border-radius: 0.7rem;
    background: #fff;
    cursor: pointer;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 3rem;
    margin-top: 0.75rem;
    border: 0;
    border-radius: 0.7rem;
    padding: 0.8rem 1rem;
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
}

.button-primary { background: var(--primary); color: #fff; }
.button-primary:hover { background: var(--primary-hover); }
.button-dark { background: #0f172a; color: #fff; }
.button-dark:hover { background: #334155; }
.button-ghost {
    background: #fff;
    color: #334155;
    border: 1px solid var(--line);
}
.button-ghost:hover { background: #f8fafc; }
.button-soft {
    width: auto;
    min-height: 2.75rem;
    margin: 0;
    background: var(--soft);
    color: var(--soft-text);
}

.logo-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

#logo-file {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.alert {
    margin: 0 0 1rem;
    border-radius: 0.7rem;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
}

.alert-error { background: #fef2f2; color: #b91c1c; }
.alert-notice { background: #fffbeb; color: #92400e; }

.preview {
    margin-top: 1rem;
    text-align: center;
}

.preview .hint { margin-bottom: 1rem; }

.preview-frame {
    overflow: hidden;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    background: #f8fafc;
    padding: 0.75rem;
}

.preview img {
    display: block;
    width: 100%;
    margin: 0 auto;
    border-radius: 0.6rem;
}

@media (min-width: 480px) {
    .colors { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .colors label { display: block; font-size: 0.78rem; }
    input[type="color"] { display: block; width: 100%; height: 2.75rem; margin-top: 0.35rem; }
}

@media (min-width: 768px) {
    .page { padding: 2.5rem 1.5rem; }
    .card { padding: 2rem; }
    h1 { font-size: 1.9rem; }
    input[type="url"], input[type="text"], .button { font-size: 0.95rem; }
}

@media (min-width: 1024px) {
    .page-split .layout {
        display: grid;
        grid-template-columns: minmax(0, 28rem) minmax(0, 1fr);
        gap: 2rem;
        align-items: start;
    }
    .preview { position: sticky; top: 2rem; margin-top: 0; }
    .preview img { width: auto; max-height: 70vh; }
}
