.fxgp-messaging-widget * {
    box-sizing: border-box;
}

.fxgp-messaging-widget__bubble {
    position: fixed;
    right: 18px;
    bottom: 18px;
    width: 52px;
    height: 52px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #111827;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.fxgp-messaging-widget__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    font-weight: 700;
    text-align: center;
    display: none;
}

.fxgp-messaging-widget__panel {
    position: fixed;
    right: 18px;
    bottom: 82px;
    width: min(420px, calc(100vw - 36px));
    height: min(640px, calc(100vh - 120px));
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    overflow: hidden;
    z-index: 99999;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.25);
    display: none;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.fxgp-messaging-widget__header {
    height: 48px;
    padding: 0 12px;
    background: #111827;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.fxgp-messaging-widget__header-title {
    font-size: 14px;
    font-weight: 700;
}

.fxgp-messaging-widget__header-actions button {
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    opacity: 0.9;
}

.fxgp-messaging-widget__body {
    height: calc(100% - 48px);
    display: flex;
    flex-direction: column;
}

.fxgp-messaging-widget__screen {
    flex: 1;
    overflow: auto;
    padding: 12px;
    background: #f9fafb;
}

.fxgp-messaging-widget__typing {
    padding: 6px 12px;
    font-size: 12px;
    color: #6b7280;
    background: #f9fafb;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.fxgp-messaging-widget__hint {
    font-size: 13px;
    color: #6b7280;
    padding: 8px 0;
}

.fxgp-messaging-widget__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fxgp-messaging-widget__conv {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
}

.fxgp-messaging-widget__conv-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    color: #111827;
}

.fxgp-messaging-widget__conv-unread {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ef4444;
    flex: 0 0 auto;
    display: none;
}

.fxgp-messaging-widget__conv-snippet {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fxgp-messaging-widget__messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fxgp-messaging-widget__msg {
    max-width: 85%;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.35;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.fxgp-messaging-widget__msg--me {
    align-self: flex-end;
    background: #2563eb;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.fxgp-messaging-widget__msg--other {
    align-self: flex-start;
    background: #fff;
    color: #111827;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-bottom-left-radius: 4px;
}

.fxgp-messaging-widget__msg-body {
    white-space: pre-wrap;
}

.fxgp-messaging-widget__items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.fxgp-messaging-widget__item {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: rgba(249, 250, 251, 0.9);
}

.fxgp-messaging-widget__msg--me .fxgp-messaging-widget__item {
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.12);
}

.fxgp-messaging-widget__item-title {
    font-weight: 700;
    font-size: 12px;
    opacity: 0.95;
}

.fxgp-messaging-widget__item-meta {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.85;
}

.fxgp-messaging-widget__item-data {
    margin: 6px 0 0 0;
    padding: 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.04);
    white-space: pre-wrap;
    word-break: break-word;
    overflow: hidden;
}

.fxgp-messaging-widget__unlock {
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 0;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.fxgp-messaging-widget__unlock:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.fxgp-messaging-widget__msg--me .fxgp-messaging-widget__item-data {
    background: rgba(255, 255, 255, 0.12);
}

.fxgp-messaging-widget__composer {
    padding: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    display: flex;
    gap: 8px;
}

.fxgp-messaging-widget__composer textarea {
    flex: 1;
    resize: none;
    height: 44px;
    padding: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font-size: 13px;
}

.fxgp-messaging-widget__composer button {
    height: 44px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: #111827;
    color: #fff;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
}

.fxgp-messaging-widget__composer button.fxgp-messaging-widget__secondary {
    background: #e5e7eb;
    color: #111827;
}

.fxgp-messaging-widget__row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.fxgp-messaging-widget__row button {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    cursor: pointer;
    font-size: 13px;
}

.fxgp-messaging-widget__row button.fxgp-messaging-widget__danger {
    border-color: rgba(239, 68, 68, 0.4);
    color: #b91c1c;
}

.fxgp-messaging-comment-thread {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.fxgp-messaging-comment-thread .fxgp-messaging-widget__header {
    border-radius: 0;
}

.fxgp-messaging-comment-thread .fxgp-messaging-widget__body {
    height: auto;
    min-height: 280px;
}

.fxgp-messaging-comment-thread .fxgp-messaging-widget__screen {
    max-height: 520px;
}

.fxgp-messaging-comment-thread .fxgp-messaging-widget__msg {
    max-width: 100%;
}
