:root {
    --myblue-width: 520px;
    --myblue-brand: #1a73e8;
    --myblue-brand-hover: #1557b0;
    --myblue-brand-active: #0d47a1;
}

.myblue-header-section a#myblue-chat-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    cursor: pointer;
}

.myblue-header-avatar-wrap {
    position: relative;
    display: flex;
}

.myblue-header-avatar {
    width: 40px;
    height: 40px;
    border: 2px solid var(--main-color);
    border-radius: 100px;
    transition: border-color .18s ease, transform .18s ease;
}

.myblue-header-name {
    color: var(--header-text-color);
    font-weight: 700;
    transition: color .18s ease;
}

.myblue-header-section a#myblue-chat-bubble:hover .myblue-header-avatar {
    border-color: var(--myblue-brand);
    transform: scale(1.06);
}

.myblue-header-section a#myblue-chat-bubble:hover .myblue-header-name {
    color: var(--text-color-strong);
}

#myblue-chat-bubble.myblue-button-open .myblue-header-avatar {
    border-color: var(--myblue-brand);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, .25);
}

#myblue-chat-bubble.myblue-button-open .myblue-header-name {
    color: var(--myblue-brand);
}

#myblue-chat-bubble.myblue-hint .myblue-header-avatar {
    animation: myblue-pulse 2.2s ease-in-out 3;
}

@keyframes myblue-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(26, 115, 232, .55); }
    70%  { box-shadow: 0 0 0 10px rgba(26, 115, 232, 0); }
    100% { box-shadow: 0 0 0 0 rgba(26, 115, 232, 0); }
}

.myblue-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #e53935;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--header-background-color);
}

.myblue-badge[hidden] {
    display: none;
}

#myblue-chat-container {
    position: fixed;
    top: var(--header-height);
    right: 0;
    bottom: 0;
    width: var(--myblue-width);
    min-width: 420px;
    max-width: 960px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    background: var(--modal-background);
    border-left: 1px solid var(--content-border-color);
    border-radius: 12px 0 0 0;
    overflow: hidden;
    box-shadow: -8px 0 28px rgba(0, 0, 0, .18);
    transform: translateX(100%);
    visibility: hidden;
    transition: transform .22s ease, visibility 0s linear .22s;
}

#myblue-chat-container.myblue-open {
    transform: translateX(0);
    visibility: visible;
    transition: transform .22s ease, visibility 0s linear 0s;
}

#myblue-chat-container.myblue-instant {
    transition: none;
}

body.myblue-panel-open .container-header {
    z-index: 10001;
}

.myblue-resizer {
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    z-index: 2;
    cursor: col-resize;
    background: transparent;
    transition: background .15s ease;
}

.myblue-resizer:hover,
body.myblue-resizing .myblue-resizer {
    background: rgba(26, 115, 232, .35);
}

body.myblue-resizing {
    user-select: none;
    cursor: col-resize;
}

body.myblue-resizing #myblue-chat-iframe {
    pointer-events: none;
}

.myblue-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
}

#myblue-chat-iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
}

.myblue-panel-state {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 24px;
    text-align: center;
    background: var(--modal-background);
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
}

.myblue-panel-state[hidden] {
    display: none;
}

.myblue-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 3px solid var(--content-border-color);
    border-top-color: var(--myblue-brand);
    animation: myblue-spin .8s linear infinite;
}

.myblue-panel-state.myblue-state-failed .myblue-spinner {
    display: none;
}

@keyframes myblue-spin {
    to { transform: rotate(360deg); }
}

.myblue-state-retry {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    background: var(--myblue-brand);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.myblue-state-retry:hover {
    background: var(--myblue-brand-hover);
}

.myblue-state-retry[hidden] {
    display: none;
}

.myblue-hint-bubble {
    position: fixed;
    top: calc(var(--header-height) + 12px);
    right: 90px;
    z-index: 10002;
    display: none;
    max-width: 290px;
    padding: 14px 34px 14px 16px;
    border-radius: 12px;
    background: var(--modal-background);
    border: 1px solid var(--content-border-color);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .22);
    color: var(--text-color);
    font-size: 13px;
    line-height: 1.5;
}

.myblue-hint-bubble strong {
    color: var(--text-color-strong);
}

.myblue-hint-bubble.myblue-hint-visible {
    display: block;
    animation: myblue-hint-in .28s ease;
}

.myblue-hint-bubble::after {
    content: '';
    position: absolute;
    top: -7px;
    right: 110px;
    width: 12px;
    height: 12px;
    transform: rotate(45deg);
    background: var(--modal-background);
    border-left: 1px solid var(--content-border-color);
    border-top: 1px solid var(--content-border-color);
}

@keyframes myblue-hint-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.myblue-hint-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.myblue-hint-close:hover {
    background: var(--content-background);
    color: var(--text-color-strong);
}
