/* TABAK_PRIME_UNIFIED_SYNC_CHAT_STEP165 */
#tp-sync-chat,
#tp-sync-chat * {
    box-sizing: border-box;
    font-weight: 400 !important;
}

#tp-sync-chat[hidden],
.tp-sync-chat-panel[hidden] {
    display: none !important;
}

.tp-sync-chat-button {
    position: fixed;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    height: 50px;
    min-width: 54px;
    padding: 0 15px;
    border: 1px solid #cfcfcf;
    border-radius: 25px;
    background: #fff;
    color: #222;
    box-shadow: 0 8px 26px rgba(0,0,0,.16);
    cursor: pointer;
    font: inherit;
}

.tp-sync-chat-panel {
    position: fixed;
    right: 16px;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    z-index: 2147483000;
    width: min(390px, calc(100vw - 24px));
    height: min(560px, calc(100vh - 100px));
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d8d8d8;
    border-radius: 15px;
    background: #fff;
    color: #222;
    box-shadow: 0 14px 36px rgba(0,0,0,.2);
}

.tp-sync-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #e7e7e7;
}

.tp-sync-chat-close {
    border: 0;
    background: transparent;
    font: inherit;
    cursor: pointer;
}

.tp-sync-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px;
    background: #f7f7f7;
}

.tp-sync-chat-row {
    display: flex;
    margin-bottom: 8px;
}

.tp-sync-chat-row.is-client {
    justify-content: flex-end;
}

.tp-sync-chat-message {
    max-width: 82%;
    padding: 9px 11px;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tp-sync-chat-row.is-client .tp-sync-chat-message {
    background: #ececec;
}

.tp-sync-chat-time {
    display: block;
    margin-top: 4px;
    opacity: .56;
    font-size: 11px;
}

.tp-sync-chat-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e7e7e7;
}

.tp-sync-chat-input {
    min-width: 0;
    resize: none;
    border: 1px solid #ccc;
    border-radius: 9px;
    padding: 8px 9px;
    font: inherit;
}

.tp-sync-chat-send {
    align-self: end;
    border: 1px solid #bbb;
    border-radius: 9px;
    padding: 9px 11px;
    background: #f0f0f0;
    color: #222;
    font: inherit;
    cursor: pointer;
}

.tp-sync-chat-status,
.tp-sync-chat-empty {
    font-size: 12px;
    opacity: .64;
}

.tp-sync-chat-status {
    min-height: 20px;
    padding: 0 11px 6px;
}

.tp-sync-chat-empty {
    padding: 18px 6px;
    text-align: center;
}


/* TABAK_PRIME_MOBILE_CLIENT_FIX_STEP262 */
@media (max-width: 1023px) {
    .r-header.r-container {
        padding-left: 8px;
        padding-right: 8px;
        column-gap: 6px;
    }

    .r-header__list {
        min-width: 0;
    }

    .r-header__list_left {
        flex: 1 1 auto;
        min-width: 0;
    }

    .r-header__list_right {
        flex: 0 0 auto;
    }

    .r-header__list-item,
    .r-header__list_right .r-header__list-item {
        flex-shrink: 0;
        margin-right: 6px;
    }

    .r-header__list_right .r-header__list-item:last-child {
        margin-right: 0;
    }

    .r-header__list-item_logo {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
    }

    .r-header-logo {
        min-width: 0;
        max-width: 100%;
    }

    .r-header-logo img {
        display: block;
        width: 100%;
        height: auto;
        max-width: clamp(105px, 34vw, 145px);
        max-height: 30px;
        object-fit: contain;
        object-position: left center;
    }

    .r-header__list-item-link_phone {
        padding: 2px 5px 4px;
    }

    .r-header__list-item-link_phone svg {
        width: 20px;
        height: 20px;
    }

    .r-header__list-item-link_phone .icon-box__icon svg {
        width: 8px;
        height: 5px;
    }

    #open-chat-dialog,
    #open-chat-dialog-block {
        display: none !important;
    }

    .tp-sync-chat-button {
        right: 12px;
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }

    .tp-sync-chat-panel {
        right: 12px;
        bottom: calc(134px + env(safe-area-inset-bottom, 0px));
        height: min(
            560px,
            calc(100vh - 150px - env(safe-area-inset-bottom, 0px))
        );
    }
}

@media (max-width: 360px) {
    .r-header.r-container {
        padding-left: 6px;
        padding-right: 6px;
        column-gap: 4px;
    }

    .r-header__list-item,
    .r-header__list_right .r-header__list-item {
        margin-right: 4px;
    }

    .r-header-logo img {
        max-width: 105px;
    }
}

/* TABAK_PRIME_CHAT_ATTACHMENTS_STEP397 */
#tp-sync-chat .tp-sync-chat-form {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: end;
}

#tp-sync-chat .tp-sync-chat-file-input {
    display: none !important;
}

#tp-sync-chat .tp-sync-chat-attach,
#tp-sync-chat .tp-sync-chat-file-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

#tp-sync-chat .tp-sync-chat-attach {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    border: 1px solid #d3dcdf;
    border-radius: 14px;
    background: #f4f7f8;
    color: #0a6070;
}

#tp-sync-chat .tp-sync-chat-attach:hover,
#tp-sync-chat .tp-sync-chat-attach:focus-visible {
    border-color: #20ae69;
    background: #edf9f3;
    color: #168956;
    outline: none;
}

#tp-sync-chat .tp-sync-chat-attach:disabled,
#tp-sync-chat .tp-sync-chat-file-cancel:disabled {
    cursor: default;
    opacity: .55;
}

#tp-sync-chat .tp-sync-chat-attach svg {
    width: 23px;
    height: 23px;
}

#tp-sync-chat .tp-sync-chat-file-preview,
#tp-sync-chat .tp-sync-chat-upload-progress {
    grid-column: 1 / -1;
}

#tp-sync-chat .tp-sync-chat-file-preview {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 40px;
    gap: 10px;
    align-items: center;
    min-height: 58px;
    padding: 7px 8px;
    border: 1px solid rgba(7, 81, 108, .12);
    border-radius: 14px;
    background: #f1f7f7;
}

#tp-sync-chat .tp-sync-chat-file-preview[hidden],
#tp-sync-chat .tp-sync-chat-upload-progress[hidden] {
    display: none !important;
}

#tp-sync-chat .tp-sync-chat-file-preview-image {
    width: 48px;
    height: 44px;
    object-fit: cover;
    border-radius: 10px;
    background: #dde7e9;
}

#tp-sync-chat .tp-sync-chat-file-preview-image[hidden] {
    display: none !important;
}

#tp-sync-chat .tp-sync-chat-file-preview-image[hidden] + .tp-sync-chat-file-preview-info {
    grid-column: 1 / 3;
}

#tp-sync-chat .tp-sync-chat-file-preview-info {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 3px;
}

#tp-sync-chat .tp-sync-chat-file-preview-name {
    overflow: hidden;
    color: #1e343c;
    font-size: 13px;
    font-weight: 600 !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tp-sync-chat .tp-sync-chat-file-preview-size {
    color: #6c7c82;
    font-size: 11px;
    line-height: 1.2;
}

#tp-sync-chat .tp-sync-chat-file-cancel {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 12px;
    background: rgba(7, 81, 108, .08);
    color: #34515b;
    font-size: 22px;
    line-height: 1;
}

#tp-sync-chat .tp-sync-chat-upload-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

#tp-sync-chat .tp-sync-chat-upload-progress-track {
    display: block;
    height: 6px;
    overflow: hidden;
    border-radius: 999px;
    background: #dce7e9;
}

#tp-sync-chat .tp-sync-chat-upload-progress-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #20ae69, #0b6971);
    transition: width .15s ease;
}

#tp-sync-chat .tp-sync-chat-upload-progress-label {
    color: #526970;
    font-size: 11px;
    line-height: 1.2;
    white-space: nowrap;
}

#tp-sync-chat .tp-sync-chat-text + .tp-sync-chat-attachment {
    margin-top: 9px;
}

#tp-sync-chat .tp-sync-chat-attachment {
    display: flex;
    width: min(248px, 100%);
    max-width: 100%;
    align-items: center;
    gap: 9px;
    overflow: hidden;
    border: 1px solid rgba(7, 81, 108, .12);
    border-radius: 13px;
    background: rgba(255, 255, 255, .78);
    color: #18414d;
    text-decoration: none;
}

/* TABAK_PRIME_CHAT_ATTACHMENT_RETENTION_STEP458 */
#tp-sync-chat .tp-sync-chat-attachment-expired {
    display: flex;
    width: min(248px, 100%);
    max-width: 100%;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    border: 1px solid rgba(113, 128, 135, .24);
    border-radius: 13px;
    background: rgba(241, 244, 245, .92);
    color: #51636a;
}
#tp-sync-chat .tp-sync-chat-attachment-expired-name {
    overflow: hidden;
    font-size: 12px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#tp-sync-chat .tp-sync-chat-attachment-expired-note {
    font-size: 11px;
    line-height: 1.35;
}

#tp-sync-chat .tp-sync-chat-attachment:hover,
#tp-sync-chat .tp-sync-chat-attachment:focus-visible {
    border-color: rgba(32, 174, 105, .42);
    outline: none;
}

#tp-sync-chat .tp-sync-chat-attachment.is-image {
    display: block;
}

#tp-sync-chat .tp-sync-chat-attachment-image {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    background: #e4ecee;
}

#tp-sync-chat .tp-sync-chat-attachment.is-image .tp-sync-chat-attachment-info {
    padding: 8px 10px 9px;
}

#tp-sync-chat .tp-sync-chat-attachment.is-document {
    min-height: 58px;
    padding: 8px 10px;
}

#tp-sync-chat .tp-sync-chat-attachment-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    min-width: 38px;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #e6f4ef;
    color: #178b59;
}

#tp-sync-chat .tp-sync-chat-attachment-icon svg {
    width: 23px;
    height: 23px;
}

#tp-sync-chat .tp-sync-chat-attachment-info {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

#tp-sync-chat .tp-sync-chat-attachment-name {
    overflow: hidden;
    font-size: 12px;
    font-weight: 600 !important;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tp-sync-chat .tp-sync-chat-attachment-size {
    color: #718087;
    font-size: 10px;
    line-height: 1.2;
}

@media (max-width: 1023px) {
    #tp-sync-chat .tp-sync-chat-form {
        grid-template-columns: 44px minmax(0, 1fr) 48px !important;
        gap: 7px !important;
    }

    #tp-sync-chat .tp-sync-chat-attach {
        height: 48px;
        align-self: end;
        border-radius: 16px;
    }

    #tp-sync-chat .tp-sync-chat-file-cancel {
        width: 44px;
        height: 44px;
        min-width: 44px;
    }

    #tp-sync-chat .tp-sync-chat-file-preview {
        grid-template-columns: 48px minmax(0, 1fr) 44px;
    }
}


/* TABAK_PRIME_CHAT_ATTACHMENT_VIEWER_STEP452 */
html.tp-chat-attachment-viewer-open,
html.tp-chat-attachment-viewer-open body {
    overflow: hidden !important;
    overscroll-behavior: none;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer[hidden] {
    display: none !important;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer {
    position: fixed;
    z-index: 2147483646;
    inset: 0;
    display: flex;
    min-width: 0;
    min-height: 0;
    flex-direction: column;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #071a22;
    color: #fff;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer-head {
    display: grid;
    min-height: 64px;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, .10);
    background: rgba(7, 26, 34, .96);
}

#tp-sync-chat .tp-sync-chat-attachment-viewer-back,
#tp-sync-chat .tp-sync-chat-attachment-viewer-close {
    display: inline-flex;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 16px;
    background: rgba(255, 255, 255, .07);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 27px;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer-name {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: 14px;
    line-height: 1.25;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer-body {
    display: flex;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    overflow: auto;
    padding: 14px;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y pinch-zoom;
}

#tp-sync-chat .tp-sync-chat-attachment-viewer-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}



@media (max-width: 1023px) {
    #tp-sync-chat .tp-sync-chat-attachment-viewer {
        width: 100vw;
        height: 100dvh;
    }
}

@media (prefers-reduced-motion: reduce) {
    #tp-sync-chat .tp-sync-chat-upload-progress-bar {
        transition: none;
    }
}


/* TABAK_PRIME_POINT5_CLIENT_UNREAD_BADGE_STEP547 */
.tp-sync-chat-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.tp-sync-chat-unread-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e5252a;
    color: #fff;
    font: 700 11px/19px Arial, sans-serif !important;
    box-shadow: 0 1px 4px rgba(180,0,0,.32);
}
.tp-sync-chat-unread-badge[hidden] { display: none !important; }


/* TABAK_PRIME_POINT5_MOBILE_DOCK_UNREAD_BADGE_STEP557 */
@media (max-width: 1023px) {
    .fixed-bar__item_chat {
        position: relative;
    }

    .fixed-bar__item_chat .tp-sync-chat-dock-unread-badge {
        position: absolute;
        top: 3px;
        right: 7px;
        z-index: 4;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        min-width: 17px;
        height: 17px;
        padding: 0 4px;
        border: 2px solid #fff;
        border-radius: 999px;
        background: #e5252a;
        color: #fff;
        box-sizing: border-box;
        font: 700 10px/13px Arial, sans-serif !important;
        pointer-events: none;
        box-shadow: 0 1px 4px rgba(180, 0, 0, .24);
    }

    .fixed-bar__item_chat .tp-sync-chat-dock-unread-badge[hidden] {
        display: none !important;
    }
}

/* TABAK-PRIME STEP1603 / CLIENT DESKTOP CHAT / exact desktop-only scope */
@media (min-width: 1024px) {
  html body #tp-sync-chat > .tp-sync-chat-button {
    display: inline-flex !important;
    visibility: visible !important;
    position: fixed !important;
    right: clamp(16px, 1.7vw, 30px) !important;
    bottom: clamp(16px, 2.8vh, 28px) !important;
    width: 72px !important;
    min-width: 72px !important;
    max-width: 72px !important;
    height: 72px !important;
    min-height: 72px !important;
    padding: 0 !important;
    align-items: center !important;
    justify-content: center !important;
    border: 2px solid #c99a53 !important;
    border-radius: 50% !important;
    background: radial-gradient(circle at 35% 26%, #383027 0%, #211b17 54%, #141210 100%) !important;
    color: #e4b76e !important;
    box-shadow: 0 0 0 4px rgba(176,121,64,.10), 0 8px 30px rgba(0,0,0,.50), 0 0 20px rgba(176,121,64,.15) !important;
    z-index: 2147483002 !important;
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
    transform-origin: center center;
  }
  html body #tp-sync-chat > .tp-sync-chat-button:hover,
  html body #tp-sync-chat > .tp-sync-chat-button:focus-visible {
    border-color: #e7bd7b !important;
    box-shadow: 0 0 0 5px rgba(176,121,64,.17), 0 8px 30px rgba(0,0,0,.55), 0 0 28px rgba(218,166,90,.33) !important;
  }
  html body #tp-sync-chat > .tp-sync-chat-button:focus-visible {
    outline: 2px solid #efd5a0 !important;
    outline-offset: 4px !important;
  }
  html body #tp-sync-chat .tp-sync-chat-button-label {
    display: none !important;
  }
  html body #tp-sync-chat > .tp-sync-chat-button::after {
    content: "";
    display: block;
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2048%2048%22%20fill%3D%22none%22%20stroke%3D%22%23e0b16a%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Cpath%20d%3D%22M13%2039C6%2027%2011%2015%2024%2010c7-3%2012-4%2017-5-1%2015-4%2026-14%2032-5%203-10%203-14%202Z%22%20stroke-width%3D%222.2%22%2F%3E%3Cpath%20d%3D%22M13%2039c8-12%2015-20%2027-31M21%2029l-5-10M28%2021l-2-10M26%2033l10-3%22%20stroke-width%3D%221.65%22%2F%3E%3C%2Fsvg%3E") center / contain no-repeat;
    pointer-events: none;
    filter: drop-shadow(0 0 3px rgba(210,159,83,.20));
  }
  html body #tp-sync-chat > .tp-sync-chat-button > .tp-sync-chat-unread-badge {
    display: inline-flex;
    position: absolute !important;
    top: -5px !important;
    right: -5px !important;
    z-index: 2 !important;
    min-width: 23px !important;
    height: 23px !important;
    padding: 0 5px !important;
    border: 2px solid #211b17 !important;
    border-radius: 999px !important;
    background: #e32b34 !important;
    color: #fff !important;
    font: 700 11px/19px Arial,sans-serif !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.45) !important;
    pointer-events: none;
  }
  html body #tp-sync-chat > .tp-sync-chat-button > .tp-sync-chat-unread-badge[hidden] {
    display: none !important;
  }
  html body #tp-sync-chat > .tp-sync-chat-button.tp-step1603-has-unread {
    animation: tp-step1603-gentle-notice 9s ease-in-out infinite !important;
  }
  html body #tp-sync-chat > .tp-sync-chat-button.tp-step1603-has-unread::before {
    content: "";
    position: absolute;
    left: 26px;
    top: -10px;
    width: 17px;
    height: 14px;
    border: 2px solid rgba(215,166,96,.48);
    border-left-color: transparent;
    border-bottom-color: transparent;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    animation: tp-step1603-smoke 9s ease-in-out infinite;
  }
  html body #tp-sync-chat .tp-sync-chat-panel {
    position: fixed !important;
    right: clamp(12px, 1.8vw, 30px) !important;
    bottom: clamp(16px, 2.2dvh, 26px) !important;
    width: min(520px, calc(100vw - 32px)) !important;
    max-width: calc(100vw - 32px) !important;
    height: min(92dvh, calc(100dvh - 76px)) !important;
    max-height: calc(100dvh - 76px) !important;
    min-height: 0 !important;
    flex-direction: column;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  html body #tp-sync-chat .tp-sync-chat-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow-y: auto !important;
  }
  html body #tp-sync-chat .tp-sync-chat-form {
    flex-shrink: 0;
  }
  html body #tp-sync-chat:has(.tp-sync-chat-panel:not([hidden])) > .tp-sync-chat-button {
    display: none !important;
  }
}
@keyframes tp-step1603-gentle-notice {
  0%, 78%, 91%, 100% { transform: translateY(0) rotate(0deg); }
  81% { transform: translateY(-2px) rotate(-5deg); }
  84% { transform: translateY(0) rotate(4deg); }
  87% { transform: translateY(-1px) rotate(-2deg); }
  89% { transform: translateY(0) rotate(0deg); }
}
@keyframes tp-step1603-smoke {
  0%, 75%, 96%, 100% { opacity: 0; transform: translateY(4px) scale(.8) rotate(8deg); }
  80% { opacity: .45; }
  88% { opacity: .22; transform: translateY(-8px) scale(1.15) rotate(-8deg); }
}
@media (prefers-reduced-motion: reduce) {
  html body #tp-sync-chat > .tp-sync-chat-button.tp-step1603-has-unread,
  html body #tp-sync-chat > .tp-sync-chat-button.tp-step1603-has-unread::before {
    animation: none !important;
  }
}
/* TABAK-PRIME STEP1603 END */
