.pfai-builder {
    --pfai-accent: #ef3b93;
    margin: 1.2rem 0 1.5rem;
    padding: 1.25rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
}

.pfai-builder h3 { margin-top: 0; }
.pfai-help { margin-bottom: 1rem; }

.pfai-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
}

.pfai-fields label {
    display: flex;
    flex-direction: column;
    font-weight: 600;
    gap: .35rem;
}

.pfai-fields input,
.pfai-fields select {
    width: 100%;
    min-height: 42px;
}

.pfai-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.pfai-status {
    min-height: 1.5em;
    margin: .8rem 0;
}

.pfai-status.is-error { color: #b32d2e; }

/*
 * V0.1.3: each artwork is deliberately shown almost full-width so the
 * customer can judge the line work and personalised lettering properly.
 */
.pfai-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.1rem;
    width: 100%;
}

.pfai-design {
    position: relative;
    width: 100%;
    padding: .85rem;
    border: 3px solid transparent;
    border-radius: 12px;
    background: #f7f7f7;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.pfai-design.is-selected {
    border-color: var(--pfai-accent);
    box-shadow: 0 0 0 3px rgba(239, 59, 147, .12);
}

.pfai-design.is-selected::before {
    content: "✓ Selected";
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    padding: .3rem .55rem;
    border-radius: 999px;
    background: var(--pfai-accent);
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.1;
    box-shadow: 0 1px 4px rgba(0,0,0,.18);
}

.pfai-design img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 2;
    object-fit: contain;
    background: #fff;
    border: 1px solid #d7d7d7;
    border-radius: 4px;
}

.pfai-design-caption {
    margin: .55rem .1rem 0;
    color: #555;
    font-size: .9rem;
    line-height: 1.35;
}

.pfai-select {
    margin-top: .7rem;
    width: 100%;
}

.pfai-design.is-selected .pfai-select,
.pfai-design.is-selected .pfai-select:disabled {
    opacity: 1;
    cursor: default;
}

.pfai-custom-wrap[hidden] { display: none !important; }
.pfai-label-text { display: block; }
.pfai-required { display: inline; color: #b32d2e; margin-left: .15em; }
.pfai-custom-wrap small { font-weight: 400; color: #666; line-height: 1.35; }

@media (max-width: 700px) {
    .pfai-fields { grid-template-columns: 1fr; }
    .pfai-controls { align-items: stretch; }
    .pfai-generate { width: 100%; }
    .pfai-builder { padding: 1rem; }
    .pfai-design { padding: .6rem; }
}
