.theme-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 22px;
    align-items: start;
}

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

.theme-section {
    border: 1px solid var(--silc-border);
    border-radius: 16px;
    padding: 18px;
    background: #fffaf2;
}

.theme-section h3 {
    margin: 0 0 16px;
    color: var(--silc-navy);
}

.theme-section label span,
.color-input span {
    display: block;
    font-weight: 800;
    font-size: 13px;
    margin-bottom: 8px;
}

.theme-section input,
.theme-section select,
.theme-section textarea,
.color-input input[type="text"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--silc-border);
    border-radius: 10px;
    padding: 0 12px;
    font: inherit;
    background: white;
}

.theme-section textarea {
    min-height: 110px;
    padding: 12px;
    resize: vertical;
}

.theme-section .code-area {
    min-height: 180px;
    font-family: Consolas, monospace;
}

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

.color-input > div {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 8px;
    align-items: center;
}

.color-input input[type="color"] {
    width: 54px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--silc-border);
    border-radius: 10px;
    background: white;
}

.theme-preview {
    position: sticky;
    top: 24px;
    display: grid;
    gap: 18px;
}

.preview-card {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--preview-border);
    background: var(--preview-bg);
    box-shadow: 0 20px 50px rgba(6,29,54,.08);
}

.preview-hero {
    padding: 34px;
    background:
        radial-gradient(circle at 75% 25%, color-mix(in srgb, var(--preview-accent) 35%, transparent), transparent 28%),
        linear-gradient(135deg, var(--preview-grad-from), var(--preview-grad-to));
    color: white;
}

.preview-logo {
    font-family: Georgia, serif;
    font-size: 46px;
    line-height: .9;
}

.preview-hero > span {
    color: var(--preview-soft);
    text-transform: uppercase;
    letter-spacing: .18em;
    font-size: 12px;
}

.preview-hero h2 {
    font-family: Georgia, serif;
    font-size: 42px;
    line-height: .95;
    margin: 26px 0 14px;
    color: white;
}

.preview-hero p {
    color: rgba(255,255,255,.75);
    line-height: 1.6;
}

.preview-hero button {
    border: 0;
    border-radius: 999px;
    padding: 12px 18px;
    background: var(--preview-accent);
    color: white;
    font-weight: 900;
}

.preview-content {
    padding: 18px;
    display: grid;
    gap: 12px;
}

.preview-content div {
    background: var(--preview-surface);
    border: 1px solid var(--preview-border);
    border-radius: 14px;
    padding: 14px;
}

.preview-content strong,
.preview-content span {
    display: block;
}

.preview-content strong {
    color: var(--preview-text);
}

.preview-content span {
    color: var(--preview-muted);
    margin-top: 4px;
    line-height: 1.4;
}

@media (max-width: 1300px) {
    .theme-layout {
        grid-template-columns: 1fr;
    }

    .theme-preview {
        position: static;
    }
}

@media (max-width: 800px) {
    .theme-color-grid {
        grid-template-columns: 1fr;
    }
}
