.adbb-chat-root {
    font-family: 'Raleway', sans-serif;
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99980;
    pointer-events: none;
}

.adbb-chat-root * {
    box-sizing: border-box;
}

.adbb-chat-fab,
.adbb-chat-panel {
    pointer-events: auto;
}

.adbb-chat-fab {
    display: none;
    position: relative;
    width: 60px;
    height: 60px;
    border: 0;
    border-radius: 50%;
    background: #C8A5AD;
    color: #fff;
    box-shadow: 0 10px 30px rgba(29, 29, 27, 0.28);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.adbb-chat-fab:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 34px rgba(29, 29, 27, 0.34);
}

.adbb-chat-root.is-min .adbb-chat-fab {
    display: inline-flex;
}

.adbb-chat-badge {
    display: none;
    position: absolute;
    top: -6px;
    right: -8px;
    min-width: 26px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px #fff;
}

.adbb-chat-badge.is-on {
    display: inline-flex;
}

.adbb-chat-panel {
    display: none;
    width: min(400px, calc(100vw - 24px));
    height: min(620px, calc(100vh - 40px));
    background: #fff;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(29, 29, 27, 0.28);
    flex-direction: column;
    overscroll-behavior: contain;
}

.adbb-chat-root.is-open .adbb-chat-panel,
.adbb-chat-root.is-max .adbb-chat-panel {
    display: flex;
}

.adbb-chat-root.is-max {
    right: 16px;
    bottom: 16px;
    left: auto;
    top: auto;
}

.adbb-chat-root.is-max .adbb-chat-panel {
    width: min(760px, calc(100vw - 32px));
    height: min(86vh, 860px);
}

.adbb-chat-header {
    background: #1D1D1B;
    color: #fff;
    padding: 14px 14px 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.adbb-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #C8A5AD;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.adbb-chat-heading {
    min-width: 0;
    flex: 1;
}

.adbb-chat-heading h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adbb-chat-heading p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adbb-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.adbb-chat-icon-btn {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.adbb-chat-icon-btn:hover,
.adbb-chat-icon-btn.is-on {
    background: rgba(255, 255, 255, 0.14);
}

.adbb-chat-notify-toggle {
    width: 50px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}

.adbb-chat-notify-toggle.is-on {
    background: #C8A5AD;
}

.adbb-chat-notify-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    color: #1D1D1B;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease;
}

.adbb-chat-notify-toggle.is-on .adbb-chat-notify-knob {
    transform: translateX(22px);
}

.adbb-chat-back {
    display: none;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.adbb-chat-root.has-list.is-thread .adbb-chat-back {
    display: inline-flex;
}

.adbb-chat-list {
    display: none;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #fff;
}

.adbb-chat-root.is-list .adbb-chat-list {
    display: block;
}

.adbb-chat-tabs {
    display: none;
    flex-shrink: 0;
    background: #f7f4f5;
    border-bottom: 1px solid #eed7dd;
    padding: 8px;
    gap: 6px;
}

.adbb-chat-root.has-tabs.is-list .adbb-chat-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.adbb-chat-workspaces {
    display: none;
    flex-shrink: 0;
    padding: 8px 8px 0;
    gap: 6px;
    background: #f7f4f5;
}

.adbb-chat-root.has-list.is-list .adbb-chat-workspaces {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adbb-chat-workspace {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #707070;
    padding: 8px 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    position: relative;
}

.adbb-chat-workspace.is-on {
    background: #fff;
    color: #1D1D1B;
    box-shadow: 0 1px 4px rgba(29, 29, 27, 0.08);
}

.adbb-chat-root.is-inquiries.has-tabs.is-list .adbb-chat-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adbb-chat-root.is-inquiries .adbb-chat-composer select,
.adbb-chat-root.is-inquiries .adbb-chat-composer input[name="message_type"],
.adbb-chat-root.is-inquiries .adbb-chat-internal-label {
    display: none;
}

.adbb-chat-close-inquiry {
    display: inline-flex;
    margin-top: 8px;
    border: 1px solid #e5d4d7;
    background: #fff;
    color: #8a5a5a;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.adbb-chat-close-inquiry[hidden] {
    display: none;
}

.adbb-chat-delete-inquiry {
    display: inline-flex;
    margin-top: 8px;
    margin-left: 8px;
    border: 1px solid #f1c4c4;
    background: #fff;
    color: #b42318;
    border-radius: 10px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.adbb-chat-delete-inquiry[hidden] {
    display: none;
}

.adbb-chat-convo-wrap {
    position: relative;
}

.adbb-chat-convo-wrap .adbb-chat-convo {
    padding-right: 40px;
}

.adbb-chat-inq-delete-row {
    position: absolute;
    top: 12px;
    right: 10px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
}

.adbb-chat-convo-wrap:hover .adbb-chat-inq-delete-row {
    display: inline-flex;
}

.adbb-chat-composer.is-inquiry-closed .adbb-chat-composer-row {
    opacity: 0.55;
}

.adbb-chat-tab {
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #707070;
    padding: 7px 4px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    position: relative;
}

.adbb-chat-tab span {
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
}

.adbb-chat-tab em {
    font-style: normal;
    font-size: 10px;
    opacity: 0.75;
}

.adbb-chat-tab.is-on {
    background: #fff;
    color: #1D1D1B;
    box-shadow: 0 1px 4px rgba(29, 29, 27, 0.08);
}

.adbb-chat-tab-unread {
    position: absolute;
    top: 2px;
    right: 2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.adbb-chat-pager {
    display: none;
    flex-shrink: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #f0f0ee;
    background: #fff;
    color: #707070;
    font-size: 12px;
}

.adbb-chat-root.has-tabs.is-list .adbb-chat-pager.is-on {
    display: flex;
}

.adbb-chat-page-btn {
    border: 1px solid #ead6db;
    background: #fff;
    color: #1D1D1B;
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.adbb-chat-page-btn:hover:not(:disabled) {
    background: #faf7f8;
}

.adbb-chat-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.adbb-chat-root.is-list .adbb-chat-thread {
    display: none;
}

.adbb-chat-thread {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.adbb-chat-convo {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #f0f0ee;
    background: #fff;
    padding: 14px 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.adbb-chat-convo:hover {
    background: #faf7f8;
}

.adbb-chat-convo-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #C8A5AD;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.adbb-chat-convo-body {
    min-width: 0;
    flex: 1;
}

.adbb-chat-convo-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.adbb-chat-convo.is-unread .adbb-chat-convo-preview {
    color: #1D1D1B;
    font-weight: 600;
}

.adbb-chat-unread-label {
    color: #dc2626;
    font-weight: 700;
    white-space: nowrap;
}

.adbb-chat-convo-top strong {
    font-size: 14px;
    color: #1D1D1B;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adbb-chat-toast {
    pointer-events: auto;
    position: absolute;
    right: 0;
    bottom: 72px;
    width: min(320px, calc(100vw - 24px));
    background: #1D1D1B;
    color: #fff;
    border-radius: 12px;
    padding: 12px 14px;
    box-shadow: 0 10px 24px rgba(29, 29, 27, 0.28);
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 2;
}

.adbb-chat-toast strong {
    font-size: 13px;
}

.adbb-chat-toast span {
    font-size: 12px;
    opacity: 0.85;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.adbb-chat-root.is-open .adbb-chat-toast,
.adbb-chat-root.is-max .adbb-chat-toast {
    bottom: auto;
    top: -72px;
}

.adbb-chat-convo-top span {
    font-size: 11px;
    color: #8a8a87;
    flex-shrink: 0;
}

.adbb-chat-convo-preview {
    margin: 0;
    font-size: 13px;
    color: #707070;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.adbb-chat-convo-unread {
    display: none;
    min-width: 18px;
    height: 18px;
    margin-top: 4px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
}

.adbb-chat-convo-unread.is-on {
    display: inline-flex;
}

.adbb-chat-empty-list {
    text-align: center;
    color: #707070;
    padding: 48px 16px;
}

.adbb-chat-tip {
    display: none;
    padding: 10px 14px;
    background: #f8eef1;
    color: #1D1D1B;
    font-size: 12px;
    line-height: 1.45;
    border-bottom: 1px solid #eed7dd;
}

.adbb-chat-tip.is-on {
    display: block;
}

.adbb-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f4f4f3;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.adbb-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.adbb-chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.adbb-chat-empty {
    text-align: center;
    color: #707070;
    padding: 48px 16px;
}

.adbb-chat-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: #e7e7e5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9a9a97;
}

.adbb-chat-row {
    display: flex;
    margin-bottom: 12px;
}

.adbb-chat-row.is-continue {
    margin-top: -4px;
    margin-bottom: 6px;
}

.adbb-chat-row.is-own {
    justify-content: flex-end;
}

.adbb-chat-row.is-system {
    justify-content: center;
}

.adbb-chat-bubble-wrap {
    max-width: 82%;
}

.adbb-chat-row.is-system .adbb-chat-bubble-wrap {
    max-width: 100%;
}

.adbb-chat-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #8a8a87;
}

.adbb-chat-time {
    margin-top: 6px;
    font-size: 10px;
    line-height: 1.2;
    letter-spacing: 0.01em;
    text-align: right;
    color: #8a8a87;
}

.adbb-chat-row.is-own .adbb-chat-time,
.adbb-chat-row.is-system .adbb-chat-time {
    color: rgba(255, 255, 255, 0.62);
}

.adbb-chat-row.is-own .adbb-chat-meta {
    justify-content: flex-end;
}

.adbb-chat-row.is-system .adbb-chat-meta {
    justify-content: center;
}

.adbb-chat-bubble {
    position: relative;
    padding: 10px 14px;
    border-radius: 18px;
    box-shadow: 0 1px 2px rgba(29, 29, 27, 0.08);
    font-size: 14px;
    line-height: 1.45;
    color: #1D1D1B;
    background: #fff;
    border: 1px solid #ececec;
}

.adbb-chat-row.is-own .adbb-chat-bubble {
    background: #1D1D1B;
    color: #fff;
    border-color: #1D1D1B;
    border-bottom-right-radius: 6px;
}

.adbb-chat-row:not(.is-own):not(.is-system) .adbb-chat-bubble {
    border-bottom-left-radius: 6px;
}

.adbb-chat-row.is-system .adbb-chat-bubble {
    background: #C8A5AD;
    color: #fff;
    border-color: #C8A5AD;
}

.adbb-chat-type {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.02em;
    background: #f3f3f2;
    color: #707070;
}

.adbb-chat-row.is-own .adbb-chat-type,
.adbb-chat-row.is-system .adbb-chat-type {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.adbb-chat-internal {
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    background: #fef3c7;
    color: #92400e;
}

.adbb-chat-delete {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    border: 0;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.adbb-chat-bubble:hover .adbb-chat-delete {
    display: inline-flex;
}

.adbb-chat-composer {
    padding: 12px;
    background: #fff;
    border-top: 1px solid #ececec;
    flex-shrink: 0;
}

.adbb-chat-composer select,
.adbb-chat-composer input[name="message_type"],
.adbb-chat-composer textarea {
    width: 100%;
    border: 1px solid #d8d8d6;
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    color: #1D1D1B;
    outline: none;
}

.adbb-chat-composer select:focus,
.adbb-chat-composer input[name="message_type"]:focus,
.adbb-chat-composer textarea:focus {
    border-color: #C8A5AD;
    box-shadow: 0 0 0 3px rgba(200, 165, 173, 0.25);
}

.adbb-chat-composer textarea {
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

.adbb-chat-composer-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 8px;
}

.adbb-chat-send {
    border: 0;
    border-radius: 12px;
    background: #1D1D1B;
    color: #fff;
    padding: 11px 14px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.adbb-chat-send:disabled {
    opacity: 0.6;
    cursor: default;
}

.adbb-chat-internal-label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 12px;
    color: #707070;
}

.adbb-chat-dock-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 24px;
    box-shadow: 0 1px 3px rgba(29, 29, 27, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.adbb-chat-dock-card p {
    margin: 4px 0 0;
    color: #707070;
    font-size: 14px;
}

.adbb-chat-dock-card h5 {
    margin: 0;
    color: #1D1D1B;
    font-size: 16px;
}

.adbb-chat-open-btn {
    border: 0;
    border-radius: 10px;
    background: #C8A5AD;
    color: #fff;
    padding: 10px 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .adbb-chat-root {
        right: 12px;
        bottom: 12px;
    }

    .adbb-chat-root.is-open .adbb-chat-panel {
        width: calc(100vw - 16px);
        height: min(72vh, 620px);
    }

    .adbb-chat-root.is-max {
        inset: 0;
        right: 0;
        bottom: 0;
    }

    .adbb-chat-root.is-max .adbb-chat-panel {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .adbb-chat-dock-card {
        flex-direction: column;
        align-items: stretch;
    }
}
