.account-menu__panel > .tong-companion__toggle {
    gap: 10px;
}

.tong-companion__glyph {
    display: grid;
    width: 18px;
    flex: 0 0 18px;
    place-items: center;
    color: #605CE5;
    font-size: 20px;
    line-height: 1;
}

.tong-companion__label {
    flex: 1;
}

.tong-companion__switch {
    display: flex;
    width: 32px;
    height: 19px;
    flex: 0 0 32px;
    align-items: center;
    margin-left: auto;
    padding: 2px;
    border-radius: 9999px;
    background: #D1D5DB;
    transition: background 160ms ease;
}

.tong-companion__switch > span {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #FFFFFF;
    box-shadow: 0 1px 3px rgba(16, 26, 61, 0.2);
    transition: transform 160ms ease;
}

.tong-companion__switch.is-on {
    background: #605CE5;
}

.tong-companion__switch.is-on > span {
    transform: translateX(13px);
}

.tong-companion {
    position: fixed;
    right: 18px;
    bottom: 16px;
    z-index: 55;
    display: grid;
    width: 160px;
    height: 166px;
    justify-items: center;
    gap: 6px;
    pointer-events: none;
}

.tong-companion__bubble {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    width: max-content;
    max-width: 180px;
    transform: translateX(-50%);
    box-sizing: border-box;
    padding: 5px 9px;
    border: 1px solid rgba(96, 92, 229, 0.13);
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 5px 18px rgba(39, 52, 96, 0.1);
    color: #111827;
    font: 600 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    text-align: center;
}

.tong-companion__figure {
    display: grid;
    width: 154px;
    height: 166px;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    cursor: grab;
    touch-action: none;
    user-select: none;
    pointer-events: auto;
}

.tong-companion__figure img,
.tong-companion__figure canvas {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
}

.tong-companion__figure [hidden] {
    display: none;
}

.tong-companion.is-dragging .tong-companion__figure {
    cursor: grabbing;
    animation: none;
}

.tong-companion__figure:focus-visible,
.tong-companion__close:focus-visible {
    outline: 2px solid #605CE5;
    outline-offset: 2px;
}

.tong-companion__close {
    position: absolute;
    top: 0;
    right: 1px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid #E5E7EB;
    border-radius: 50%;
    background: #FFFFFF;
    color: #6B7280;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(16, 26, 61, 0.12);
}

.tong-companion__close:hover {
    color: #605CE5;
}

@media (max-width: 700px) {
    .tong-companion {
        right: 8px;
        bottom: 8px;
        width: 124px;
        height: 130px;
    }

    .tong-companion__figure {
        width: 118px;
        height: 130px;
    }

    .tong-companion__bubble {
        padding: 4px 7px;
        font-size: 10px;
    }

    .tong-companion__close {
        top: 0;
        right: 0;
        width: 22px;
        height: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tong-companion__switch,
    .tong-companion__switch > span {
        transition: none;
    }

    .tong-companion,
    .tong-companion__figure,
    .tong-companion__figure.is-greeting {
        animation: none;
    }
}
