/* Narrow additions for the official configurator; legacy styling stays authoritative. */
.pega-configurator-viewer__desktop-settings { display: contents; }
.pega-configurator-viewer__official-controls {
    position: absolute;
    z-index: 3;
    right: .8rem;
    bottom: 2.8rem;
    display: grid;
    justify-items: end;
    gap: .4rem;
    max-width: min(17rem, calc(100% - 1.6rem));
}
.pega-configurator-viewer__official-toggle {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: .55rem;
    padding: .45rem .7rem;
    border: 1px solid var(--pega-config-line, #e4e6e6);
    border-radius: 5px;
    background: color-mix(in srgb, var(--pega-config-paper, #f7f7f5) 96%, transparent);
    color: var(--pega-config-ink, #242b2d);
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}
.pega-configurator-viewer__official-toggle input {
    width: 1rem;
    height: 1rem;
    flex: 0 0 1rem;
    margin: 0;
    accent-color: var(--pega-config-green, #044040);
}
.pega-configurator-viewer__official-toggle input:focus-visible {
    outline: 2px solid var(--pega-config-green, #044040);
    outline-offset: 2px;
}
.pega-configurator-viewer__official-color {
    display: grid;
    gap: .3rem;
    width: min(17rem, calc(100% - 1.6rem));
    padding: .45rem .7rem;
    border: 1px solid var(--pega-config-line, #e4e6e6);
    border-radius: 5px;
    background: color-mix(in srgb, var(--pega-config-paper, #f7f7f5) 96%, transparent);
    color: var(--pega-config-ink, #242b2d);
    font-size: .78rem;
    font-weight: 600;
}
.pega-configurator-viewer__official-color[hidden] { display: none !important; }
.pega-configurator-viewer__official-color select {
    box-sizing: border-box;
    appearance: none;
    min-height: 34px;
    min-width: 0;
    width: 100%;
    padding: .4rem 2rem .4rem .65rem;
    border: 1px solid var(--pega-config-line, #e4e6e6);
    border-radius: 3px;
    background: var(--pega-config-paper, #f7f7f5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='m1 1 5 5 5-5' fill='none' stroke='%23242b2d' stroke-width='1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right .65rem center;
    background-size: .65rem .45rem;
    color: inherit;
    font: inherit;
    font-weight: 400;
}
.pega-configurator__per-unit-note {
    margin: .25rem 0 .8rem;
    color: var(--pega-config-muted, #697174);
    font-size: .86rem;
    line-height: 1.5;
}
.pega-configurator__drain-warning {
    display: block;
    flex: 0 0 100%;
    margin: .35rem 0 0;
    color: var(--pega-config-muted, #697174);
    font-size: .78rem;
    line-height: 1.45;
}
.pega-configurator__summary [data-pega-summary-list] > li:has(.pega-configurator__drain-warning) {
    display: block;
}
.pega-configurator__official-breakdown {
    display: grid;
    gap: .45rem;
    margin: .75rem 0 0;
    padding: .75rem 0 0;
    border-top: 1px solid var(--pega-config-line, #e4e6e6);
    list-style: none;
}
.pega-configurator__official-breakdown[hidden],
.pega-configurator__drain-warning[hidden] { display: none !important; }
.pega-configurator__official-breakdown li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    color: var(--pega-config-muted, #697174);
    font-size: .88rem;
    line-height: 1.45;
}
.pega-configurator__official-breakdown li strong {
    color: var(--pega-config-ink, #242b2d);
    font-weight: 600;
    text-align: right;
}
.pega-configurator-viewer__measurement {
    /* Preserve the original native hotspot appearance, including back views. */
    --min-hotspot-opacity: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 32px;
    width: auto;
    max-width: 100%;
    margin: 0;
    padding: .28rem .5rem;
    border: 1px solid rgba(255,255,255,.72);
    border-radius: 4px;
    background: rgba(29, 39, 37, .88);
    box-shadow: 0 1px 5px rgba(0,0,0,.28);
    color: #fff;
    font: 600 .78rem/1.2 var(--uv-font-family, inherit);
    letter-spacing: .01em;
    white-space: nowrap;
    pointer-events: none;
    -webkit-text-stroke: .15px rgba(0,0,0,.35);
}
.pega-configurator-viewer__measurement[data-pega-measurement-group="kella"],
.pega-configurator-viewer__measurement[data-pega-measurement-group="basin"] {
    max-width: 94px;
    min-height: 28px;
    padding: .2rem .3rem;
    font-size: .7rem;
    white-space: normal;
    text-align: center;
    overflow-wrap: normal;
}
.pega-configurator-viewer.is-dark-environment .pega-configurator-viewer__measurement {
    border-color: rgba(29,39,37,.72);
    background: rgba(248, 248, 244, .94);
    color: #242b2d;
    -webkit-text-stroke: 0;
}
.pega-configurator-viewer__model::part(default-hotspot) { display: none; }
.pega-configurator-viewer__hint[hidden] { display: none !important; }
.pega-configurator-viewer.is-expanded .pega-configurator-viewer__hint {
    grid-row: 2;
    position: relative;
    inset: auto;
    padding: .35rem .65rem;
    background: #fff;
    color: #25332d;
}
.pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-controls {
    grid-row: 3;
    position: relative;
    inset: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    max-width: none;
    padding: .4rem .65rem;
}
.pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-color { box-sizing: border-box; width: min(14rem, 100%); }
.pega-configurator-viewer.is-dark-environment.is-expanded .pega-configurator-viewer__hint { background: #182722; color: #f4f8f5; }
/* Touch/tablet overrides below retain the existing bottom-row controls. */
@media (min-width: 768px) and (pointer: fine), (min-width: 1025px) {
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings {
        position: absolute;
        z-index: 3;
        top: .8rem;
        left: .8rem;
        display: grid;
        gap: .4rem;
        width: 16rem;
        max-width: calc(100% - 5.5rem);
        max-height: calc(100% - 4rem);
        overflow-y: auto;
    }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings .pega-configurator-viewer__environment,
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings .pega-configurator-viewer__official-controls {
        position: static;
        inset: auto;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
    }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings .pega-configurator-viewer__official-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        justify-items: stretch;
        padding: 0;
    }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings .pega-configurator-viewer__official-toggle,
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__desktop-settings .pega-configurator-viewer__official-color {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
    }
}
@media (forced-colors: active) {
    .pega-configurator-viewer__official-color select { appearance: auto; background-image: none; }
}
@media (max-width: 767px) {
    /* Keep controls out of the model/annotation area on narrow screens. */
    .pega-configurator-viewer:not(.is-expanded):has(.pega-configurator-viewer__official-controls) {
        height: auto;
    }
    .pega-configurator-viewer__official-controls {
        position: relative;
        right: auto;
        bottom: auto;
        justify-items: stretch;
        gap: .3rem;
        max-width: none;
        padding: .65rem;
    }
    .pega-configurator-viewer:has(.pega-configurator-viewer__official-controls) .pega-configurator-viewer__hint {
        position: relative;
        inset: auto;
        margin: .35rem .65rem 0;
        padding: .4rem .55rem;
        border: 1px solid #dce2df;
        border-radius: 4px;
        background: #fff;
        color: #25332d;
        line-height: 1.4;
    }
    .pega-configurator-viewer.is-dark-environment .pega-configurator-viewer__hint {
        background: #182722;
        color: #f4f8f5;
        border-color: #46554f;
    }
    .pega-configurator-viewer:not(.is-expanded):has(.pega-configurator-viewer__official-controls) [data-pega-model-fallback] {
        bottom: auto;
        height: 300px;
    }
    .pega-configurator-viewer__official-toggle {
        min-height: 36px;
        padding: .35rem .55rem;
        font-size: .75rem;
    }
    .pega-configurator-viewer__official-color {
        box-sizing: border-box;
        width: 100%;
        padding: .35rem .55rem;
        font-size: .75rem;
    }
    .pega-configurator-viewer__official-color select { font-size: 16px; }
    .pega-configurator-viewer__measurement {
        min-width: 40px;
        min-height: 28px;
        padding: .22rem .36rem;
        font-size: .7rem;
    }
}
/* Include touch phones in landscape without changing fine-pointer desktops. */
@media (max-width: 767px), (max-width: 1024px) and (pointer: coarse) {
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        justify-items: stretch;
        align-items: stretch;
        min-width: 0;
        width: 100%;
    }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-toggle { min-width: 0; }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-color {
        grid-column: 1 / -1;
        min-width: 0;
        width: 100%;
        padding: 0;
        border: 0;
    }
    .pega-configurator-viewer.is-expanded .pega-configurator-viewer__official-color select { font-size: 16px; }
}
