.vitz-contacts {
    position: relative;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    border: 1px solid #ded8d1;
    border-radius: 18px;
    background: #fff;
}

.vitz-contacts__header {
    display: flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
    padding: 18px 20px;
    border-bottom: 1px solid #ded9d2;
    background: #e9e7e3;
}

.vitz-contacts__header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    color: #ed6500;
    font-size: 18px;
    line-height: 1;
}

.vitz-contacts__header-icon svg,
.vitz-contacts__button svg,
.vitz-contacts__close svg {
    display: block;
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.vitz-contacts__heading,
.vitz-contacts__person {
    display: block;
    min-width: 0;
}

.vitz-contacts__title {
    margin: 0 !important;
    color: #282522;
    font: inherit;
    font-weight: 600;
}

.vitz-contacts__subtitle,
.vitz-contacts__name {
    display: block;
    color: #716a62;
}

.vitz-contacts__function {
    display: block;
    color: #282522;
    font-weight: 600;
}

.vitz-contacts__content {
    min-width: 0;
}

.vitz-contacts__group {
    min-width: 0;
}

.vitz-contacts__group + .vitz-contacts__group {
    margin-top: 18px;
}

.vitz-contacts__group-title {
    margin: 0 0 10px !important;
    color: #282522;
    font: inherit;
    font-weight: 600;
}

.vitz-contacts__group-persons {
    min-width: 0;
}

.vitz-contacts__item {
    min-width: 0;
}

.vitz-contacts__initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: #fff0e5;
    color: #a74300;
    font-weight: 600;
    line-height: 1;
}

.vitz-contacts__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid #ed6500;
    border-radius: 999px;
    padding: 8px 12px;
    background: #fff;
    color: #bd4e00;
    font: inherit;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}

.vitz-contacts__button:hover,
.vitz-contacts__button:focus-visible {
    background: #ed6500;
    color: #fff;
}

.vitz-contacts--list .vitz-contacts__content {
    padding: 8px 20px 16px;
}

.vitz-contacts--list .vitz-contacts__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 13px;
    padding: 15px 0;
    border-bottom: 1px solid #e9e4dd;
}

.vitz-contacts--list .vitz-contacts__item:last-child {
    margin-bottom: 0 !important;
    border-bottom-color: transparent;
}

.vitz-contacts--cards .vitz-contacts__content {
    padding: 16px;
}

.vitz-contacts--cards .vitz-contacts__group-persons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.vitz-contacts--cards .vitz-contacts__item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border: 1px solid #e2ddd6;
    border-radius: 15px;
    background: #fff;
}

.vitz-contacts--cards .vitz-contacts__button {
    grid-column: 1 / -1;
    width: 100%;
    background: #ed6500;
    color: #fff;
}

.vitz-contacts--cards .vitz-contacts__button:hover,
.vitz-contacts--cards .vitz-contacts__button:focus-visible {
    background: #c75300;
}

.vitz-contacts--functions .vitz-contacts__content {
    padding: 10px 16px 16px;
}

.vitz-contacts--functions .vitz-contacts__group-persons {
    display: grid;
}

.vitz-contacts--functions .vitz-contacts__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 16px 12px 16px 16px;
    border-width: 0 0 1px 4px;
    border-style: solid;
    border-color: #e9e4dd #e9e4dd #e9e4dd #ed6500;
    background: #fff;
}

.vitz-contacts--functions .vitz-contacts__item:nth-child(3n + 2) { border-left-color: #d29600; }
.vitz-contacts--functions .vitz-contacts__item:nth-child(3n) { border-left-color: #7b8e74; }
.vitz-contacts--functions .vitz-contacts__item:last-child { margin-bottom: 0 !important; border-bottom-color: transparent; }

.vitz-contacts__popup {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(25, 20, 16, .64);
    overscroll-behavior: contain;
    box-sizing: border-box;
}

.vitz-contacts__portal-root,
.vitz-contacts__portal-scope {
    display: contents !important;
}

.vitz-contacts__popup[hidden] {
    display: none !important;
}

.vitz-contacts__dialog {
    width: min(680px, 100%);
    max-width: 100%;
    max-height: calc(100dvh - 48px);
    overflow: auto;
    box-sizing: border-box;
    overscroll-behavior: contain;
    border: 1px solid #ddd6ce;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 22px 70px rgba(30, 22, 15, .28);
}

.vitz-contacts__dialog-header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 14px;
    padding: 18px 20px;
    border-bottom: 1px solid #e6e0d9;
    background: inherit;
}

.vitz-contacts__dialog-title,
.vitz-contacts__dialog-recipient {
    display: block;
}

.vitz-contacts__dialog-title {
    color: #282522;
    font-weight: 600;
}

.vitz-contacts__dialog-recipient {
    margin-top: 2px;
    color: #716a62;
}

.vitz-contacts__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid #ddd7cf;
    border-radius: 50%;
    background: #fff;
    color: #3e3934;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.vitz-contacts__form {
    padding: 18px 20px 22px;
}

.vitz-contacts__form .vitz-form {
    margin: 0;
}

body.vitz-contact-popup-open {
    overflow: hidden;
}

.elementor-editor-active .vitz-contacts__popup.is-editor-preview {
    position: absolute;
    min-height: 600px;
}

.vitz-contacts__empty {
    padding: 16px;
    border: 1px dashed #c9c9c9;
    border-radius: 8px;
    color: #666;
    text-align: center;
}

@media (max-width: 600px) {
    .vitz-contacts--cards .vitz-contacts__content {
        padding: 11px;
    }

    .vitz-contacts--cards .vitz-contacts__group-persons {
        grid-template-columns: 1fr;
    }

    .vitz-contacts--list .vitz-contacts__content {
        padding: 4px 14px 12px;
    }

    .vitz-contacts--list .vitz-contacts__item {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 10px;
    }

    .vitz-contacts--list .vitz-contacts__button {
        grid-column: 2;
        justify-self: start;
    }

    .vitz-contacts--functions .vitz-contacts__item {
        grid-template-columns: minmax(0, 1fr);
    }

    .vitz-contacts--functions .vitz-contacts__button {
        justify-self: start;
    }

    .vitz-contacts__popup {
        padding: 10px;
    }

    .vitz-contacts__dialog {
        width: 100%;
        max-height: calc(100dvh - 20px);
    }

    .vitz-contacts__dialog-header {
        padding: 15px;
    }

    .vitz-contacts__form {
        padding: 15px;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .vitz-contacts__popup:not([hidden]) .vitz-contacts__dialog {
        animation: vitz-contact-dialog-in .18s ease-out;
    }

    @keyframes vitz-contact-dialog-in {
        from { opacity: 0; transform: translateY(10px) scale(.985); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
}
