.ps-calc {
    max-width: 1180px;
    --ps-accent: #74212c;
    --ps-accent-dark: #5c1a23;
}

.ps-calc__heading {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 1.5rem 0 0.75rem;
}

.ps-calc__tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.ps-calc__tile {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    text-align: center;
    width: calc(20% - 0.6rem);
    min-width: 110px;
}

.ps-calc__tile-img {
    display: block;
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 6px;
    box-shadow: 0 0 0 1px #e6ebf0;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}

.ps-calc__tile-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ps-calc__tile.is-active .ps-calc__tile-img {
    box-shadow: 0 0 0 2px var(--ps-accent);
}

.ps-calc__tile-title {
    display: block;
    margin-top: 0.45rem;
    font-size: 0.86rem;
    line-height: 1.25;
    color: #333;
}

.ps-calc__layout {
    display: grid;
    grid-template-columns: minmax(220px, 360px) 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid #eef1f4;
    border-radius: 12px;
    background: #fff;
}

.ps-calc__layout--fence {
    grid-template-columns: minmax(200px, 280px) 1fr 1fr;
}

.ps-calc__scheme {
    position: relative;
    min-height: 240px;
}

.ps-calc__scheme-slide {
    display: none;
}

.ps-calc__scheme-slide.is-active {
    display: block;
}

.ps-calc__scheme img {
    display: none;
    width: 100%;
    max-width: 340px;
    height: auto;
}

.ps-calc__scheme img.is-active {
    display: block;
}

.ps-calc__block-title {
    font-weight: 700;
    margin-bottom: 0.65rem;
    font-size: 0.95rem;
}

.ps-calc__block-title--sm {
    font-size: 0.88rem;
    margin-top: 0.75rem;
}

.ps-calc__block + .ps-calc__block {
    margin-top: 1rem;
}

.ps-calc__dims {
    display: none;
}

.ps-calc__dims.is-active {
    display: block;
}

.ps-calc__dim {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
    font-size: 0.88rem;
    cursor: pointer;
}

.ps-calc__dim.is-active input {
    border-color: var(--ps-accent);
}

.ps-calc__dim input,
.ps-calc__dim select {
    border: 1px solid #d7dde3;
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    background: #fff;
}

.ps-calc__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.ps-calc__pill {
    border: 1px solid #d7dde3;
    background: #fff;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ps-calc__pill.is-active {
    background: var(--ps-accent);
    border-color: var(--ps-accent);
    color: #fff;
}

.ps-calc__swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.ps-calc__swatch {
    -webkit-appearance: none;
    appearance: none;
    display: inline-block;
    box-sizing: border-box;
    width: 42px;
    height: 42px;
    margin: 0;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background-color: #d7dde3;
    /* Both axes required: a single % value only sets width and leaves a rectangular band. */
    background-size: 250% 250%;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    line-height: 0;
    vertical-align: top;
    cursor: pointer;
}

.ps-calc__swatch::-moz-focus-inner {
    border: 0;
    padding: 0;
}

.ps-calc__swatch:focus {
    outline: none;
}

.ps-calc__swatch:focus-visible {
    outline: 2px solid var(--ps-accent);
    outline-offset: 2px;
}

.ps-calc__swatch.is-active {
    border-color: var(--ps-accent);
    box-shadow: none;
}

.ps-calc__swatch--empty {
    background-color: transparent;
    background-image: linear-gradient(135deg, #eee, #ccc);
}

.ps-calc__color-label {
    font-size: 0.88rem;
    margin: 0 0 0.5rem;
}

.ps-calc__subblock--edge {
    display: none;
}

.ps-calc__subblock--edge.is-active {
    display: block;
}

.ps-calc__actions {
    text-align: center;
    margin: 1.5rem 0;
}

.ps-calc__submit {
    min-width: 220px;
    box-shadow: 0 8px 24px rgba(116, 33, 44, 0.25);
}

.ps-calc__result {
    margin-top: 1rem;
    padding: 1.25rem;
    border: 1px solid #eef1f4;
    border-radius: 12px;
    background: #fafbfc;
}

.ps-calc__result:empty {
    display: none;
}

.ps-calc__table {
    width: 100%;
    border-collapse: collapse;
}

.ps-calc__table th,
.ps-calc__table td {
    text-align: left;
    padding: 0.55rem 0.4rem;
    border-bottom: 1px solid #e6ebf0;
    vertical-align: middle;
}

.ps-calc__line-img {
    width: 72px;
    height: 72px;
    object-fit: contain;
}

.ps-calc__total {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0.85rem 0;
}

.ps-calc__error {
    color: #9b2c2c;
}

@media (max-width: 991px) {
    .ps-calc__layout {
        grid-template-columns: 1fr;
    }

    .ps-calc__tile {
        width: calc(33.333% - 0.5rem);
    }
}

@media (max-width: 575px) {
    .ps-calc__tile {
        width: calc(50% - 0.375rem);
    }

    .ps-calc__tile-img {
        width: 84px;
        height: 84px;
    }
}

/* Siding: walls / openings / corners (legacy calc_ui parity) */
.ps-calc__repeat {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.ps-calc__repeat--corners {
    margin-bottom: 0.25rem;
}

.ps-calc__card {
    position: relative;
    width: calc(20% - 0.7rem);
    min-width: 150px;
    padding: 0.85rem 0.75rem 0.75rem;
    border: 1px solid #eef1f4;
    border-radius: 10px;
    background: #fff;
}

.ps-calc__card--action {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    border-style: dashed;
}

.ps-calc__card-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin-bottom: 0.55rem;
}

.ps-calc__card-close {
    position: absolute;
    top: 0.35rem;
    right: 0.45rem;
    border: 0;
    background: transparent;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #888;
}

.ps-calc__card-close:hover {
    color: var(--ps-accent);
}

.ps-calc__layout--siding-gable {
    grid-template-columns: minmax(220px, 360px) 1fr;
}

.ps-calc__gable[hidden],
.ps-calc__picket-only[hidden],
[data-ps-plank-wrap][hidden],
[data-ps-tipsh-wrap][hidden] {
    display: none !important;
}

.ps-calc__tile:disabled {
    opacity: 1;
    cursor: default;
}

@media (max-width: 991px) {
    .ps-calc__card {
        width: calc(33.333% - 0.6rem);
    }
}

@media (max-width: 575px) {
    .ps-calc__card {
        width: 100%;
    }
}
/* Listing cards on /calc/. Distinct from .ps-calc__card inside a calculator. */
.ps-calc-card {
    color: inherit;
    background: #fff;
}
.ps-calc-card:hover,
.ps-calc-card:focus,
.ps-calc-card:focus-visible {
    color: inherit;
}
.ps-calc-card__title {
    color: #7B2430;
    font-weight: 700;
}
.ps-calc-card:hover .ps-calc-card__title {
    color: #5c1a23;
}
.ps-calc-card__text {
    color: #5e5a58;
}
.ps-calc-card__img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #f4f6f8;
    display: block;
}
