.mat-builder { padding-bottom: 2rem; }
.mat-builder [hidden] { display: none !important; }
.mat-builder-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 1.5rem; align-items: start; }
.mat-builder-preview { position: relative; }
.mat-builder-preview img { display: block; width: 100%; }
.mat-builder-preview [data-pile-preview] { position: absolute; inset: 0; height: 100%; object-fit: contain; }
.mat-builder label { display: block; margin: 0 0 .35rem; }
.mat-builder select, .mat-builder-order input, .mat-builder-order textarea {
    display: block; width: 100%; box-sizing: border-box; padding: .5rem; color: inherit;
    background: #fff; border: 1px solid #aaa; border-radius: .2rem;
}
.mat-builder fieldset { border: 0; padding: 0; margin: .8rem 0; min-width: 0; }
.mat-builder legend { font: inherit; }
.mat-swatches { display: flex; flex-wrap: wrap; gap: .35rem; }
.mat-swatches button { width: 44px; height: 44px; padding: 2px; background: #fff; border: 2px solid transparent; border-radius: .2rem; cursor: pointer; }
.mat-swatches button[aria-pressed="true"] { border-color: #005781; }
.mat-swatches img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mat-builder-total { margin-top: .8rem; font-weight: 700; }
.mat-builder-order { box-sizing: border-box; width: min(34rem, calc(100% - 2rem)); max-height: calc(100% - 2rem); border: 0; border-radius: .3rem; padding: 1rem; overflow: auto; }
.mat-builder-order::backdrop { background: rgb(0 0 0 / 60%); }
.mat-order-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 767px) {
    .mat-builder-grid { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
}
.mat-swatch-label { flex: 0 0 100%; }
