/*
 * /theme editor UI — colour-picker grid + live preview pane.
 */

.theme-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
    gap: 2rem;
    margin-bottom: 2.5rem;
}
@media (max-width: 880px) {
    .theme-grid { grid-template-columns: 1fr; }
}

.theme-editor,
.theme-preview {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
}

.theme-editor h2,
.theme-preview h2 { margin-top: 0; margin-bottom: 0.25rem; }

.theme-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: center;
    padding: 0.75rem 0;
    border-top: 1px solid var(--border);
}
.theme-row:first-of-type { border-top: 0; padding-top: 0.25rem; }

.theme-row label {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
    cursor: pointer;
}
.theme-row label strong { color: var(--text); font-size: 0.9rem; font-weight: 600; }
.theme-row label small  { color: var(--muted); font-size: 0.78rem; }
.theme-row label code   { color: var(--accent-2); font-size: 0.72rem; font-family: SFMono-Regular, Menlo, Consolas, monospace; }

.theme-swatch {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.theme-swatch input[type=color] {
    -webkit-appearance: none;
    appearance: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0;
    background: transparent;
    cursor: pointer;
}
.theme-swatch input[type=color]::-webkit-color-swatch-wrapper { padding: 2px; border-radius: 4px; }
.theme-swatch input[type=color]::-webkit-color-swatch { border: 0; border-radius: 4px; }

.theme-hex {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.4rem 0.55rem;
    font: 500 0.82rem/1.2 SFMono-Regular, Menlo, Consolas, monospace;
    width: 7.5rem;
    text-transform: lowercase;
}
.theme-hex:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(217, 70, 239, 0.18);
}

.theme-actions {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.theme-preview .cmp-demo { background: var(--bg); }
