.theme-workspace,
.theme-settings {
    display: grid;
    gap: 18px;
}

.theme-hero,
.theme-detail-hero,
.theme-card,
.theme-settings-panel {
    border: 1px solid rgba(215, 200, 181, 0.9);
    background: rgba(255, 252, 247, 0.92);
    box-shadow: 0 20px 52px rgba(35, 28, 19, 0.08);
}

.theme-hero,
.theme-detail-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 24px;
    border-radius: 24px;
    background:
        radial-gradient(circle at right, color-mix(in srgb, var(--accent) 18%, transparent), transparent 28%),
        rgba(255, 252, 247, 0.94);
}

.theme-eyebrow {
    margin: 0 0 8px;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.theme-hero h2,
.theme-detail-hero h2 {
    margin: 0;
    font-size: clamp(2rem, 3vw, 3.1rem);
    line-height: 0.98;
    font-family: var(--display-font);
}

.theme-hero p,
.theme-detail-hero p {
    margin: 8px 0 0;
    color: var(--muted);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 18px;
}

.theme-card {
    display: grid;
    border-radius: 9px;
    overflow: hidden;
}

.theme-card.active {
    border-color: color-mix(in srgb, var(--accent) 45%, white);
}

.theme-preview {
    position: relative;
    height: 190px;
    overflow: hidden;
    background:
        radial-gradient(circle at 20% 20%, var(--theme-accent), transparent 24%),
        linear-gradient(135deg, var(--theme-secondary), var(--theme-primary));
}

.theme-preview-top {
    height: 38px;
    background: rgba(255, 255, 255, 0.12);
}

.theme-preview-body {
    position: absolute;
    left: 22px;
    right: 22px;
    bottom: 22px;
    display: grid;
    gap: 7px;
    color: white;
}

.theme-preview-body span {
    width: 68%;
    height: 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.42);
}

.theme-preview-body strong {
    font-size: 1.35rem;
}

.theme-preview-body small {
    color: rgba(255, 255, 255, 0.72);
}

.theme-active-badge,
.theme-version {
    position: absolute;
    right: 12px;
    padding: 6px 9px;
    border-radius: 6px;
    color: white;
    font-weight: 900;
    font-size: 0.78rem;
}

.theme-active-badge {
    top: 12px;
    background: #47c284;
}

.theme-version {
    bottom: 12px;
    background: rgba(21, 22, 35, 0.72);
}

.theme-card-copy,
.theme-card-foot {
    padding: 16px;
}

.theme-card-copy h3 {
    margin: 0 0 7px;
}

.theme-card-copy p {
    color: var(--muted);
    margin: 0;
    line-height: 1.45;
}

.theme-swatches {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.theme-swatches span {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.theme-card-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(215, 200, 181, 0.75);
}

.theme-card-foot small {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.theme-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

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

.theme-settings-panel {
    display: grid;
    gap: 14px;
    padding: 20px;
    border-radius: 18px;
}

.theme-settings-panel h3 {
    margin: 0;
}

.theme-settings-panel label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 800;
}

.theme-field-row,
.theme-token-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.theme-token-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.theme-contract-list {
    display: grid;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(215, 200, 181, 0.75);
}

.theme-contract-list div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(215, 200, 181, 0.75);
}

.theme-contract-list div:last-child {
    border-bottom: 0;
}

.theme-contract-list span {
    color: var(--muted);
}

@media (max-width: 980px) {
    .theme-hero,
    .theme-detail-hero,
    .theme-card-foot {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-settings-grid,
    .theme-field-row,
    .theme-token-grid {
        grid-template-columns: 1fr;
    }
}
