.fwk-jc {
    clear: both;
    width: 100%;
    margin: 22px 0 18px;
    box-sizing: border-box;
    color: #222;
    font-size: 14px;
}

.fwk-jc__group {
    min-width: 0;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.fwk-jc__group legend {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    color: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: 0;
    text-align: left;
}

.fwk-jc__patches {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
}

.fwk-jc__patch {
    position: relative;
    display: inline-flex;
    width: 44px;
    height: 44px;
    margin: 0;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    border: 1px solid #bcbcbc;
    background: #fff;
    cursor: pointer;
    vertical-align: top;
}

.fwk-jc__patch.is-selected {
    border-color: #111;
    box-shadow: 0 0 0 1px #111 inset;
}

.fwk-jc__patch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.fwk-jc__patch img {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.fwk-jc__patch-text {
    max-width: 40px;
    padding: 2px;
    font-size: 8px;
    line-height: 1.1;
    text-align: center;
}

.fwk-jc__tooltip {
    position: absolute;
    z-index: 30;
    left: 50%;
    bottom: calc(100% + 10px);
    width: max-content;
    max-width: 220px;
    padding: 6px 8px;
    transform: translateX(-50%) translateY(4px);
    border: 1px solid #ddd;
    background: #fff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
    color: #111;
    font-size: 12px;
    line-height: 1.25;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

.fwk-jc__patch:has(img)::after {
    position: absolute;
    z-index: 29;
    left: 50%;
    bottom: calc(100% + 34px);
    width: 180px;
    height: 180px;
    transform: translateX(-50%) translateY(4px);
    border: 1px solid #ddd;
    background: var(--fwk-patch-preview, #fff) center / contain no-repeat;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease, transform .15s ease;
}

.fwk-jc__patch:hover .fwk-jc__tooltip,
.fwk-jc__patch:focus-within .fwk-jc__tooltip,
.fwk-jc__patch:hover::after,
.fwk-jc__patch:focus-within::after {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fwk-jc__customize {
    width: 100%;
    margin: 0;
    padding: 8px 10px;
    box-sizing: border-box;
    border: 1px solid #ddd;
}

.fwk-jc__customize > label {
    display: flex;
    min-height: 20px;
    margin: 0 0 10px;
    align-items: center;
    gap: 8px;
    font-weight: 400;
    line-height: 20px;
    cursor: pointer;
}

.fwk-jc__customize > label:last-of-type {
    margin-bottom: 0;
}

.fwk-jc__customize input[type="radio"] {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
}

.fwk-jc__fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 12px;
}

.fwk-jc__fields[hidden] {
    display: none;
}

.fwk-jc__fields label {
    display: block;
    margin: 0;
    font-size: 12px;
}

.fwk-jc__fields input {
    width: 100%;
    min-height: 38px;
    margin-top: 4px;
    box-sizing: border-box;
}

.fwk-jc__total {
    margin: -12px 0 22px;
}

.fwk-jc__total strong {
    color: #e00000;
    font-weight: 500;
}

.fwk-jc-lightbox {
    position: fixed;
    z-index: 100000;
    inset: 0;
    display: flex;
    padding: 28px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(0, 0, 0, .78);
}

.fwk-jc-lightbox[hidden] {
    display: none;
}

.fwk-jc-lightbox img {
    max-width: min(680px, 92vw);
    max-height: 78vh;
    padding: 12px;
    box-sizing: border-box;
    background: #fff;
    object-fit: contain;
}

.fwk-jc-lightbox__caption {
    margin-top: 10px;
    color: #fff;
    font-size: 14px;
}

.fwk-jc-lightbox__close {
    position: fixed;
    top: 14px;
    right: 18px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 36px;
    line-height: 42px;
    cursor: pointer;
}

body.fwk-jc-lightbox-open {
    overflow: hidden;
}

@media (max-width: 720px) {
    .fwk-jc__patch:has(img)::after,
    .fwk-jc__tooltip {
        display: none;
    }
}

@media (max-width: 520px) {
    .fwk-jc__fields {
        grid-template-columns: 1fr;
    }
}
