.ifresh-support {
    --chat-ink: var(--ink, #1a1122);
    --chat-muted: var(--ink-2, #4b3f57);
    --chat-line: rgba(76, 39, 95, 0.14);
    --chat-soft: rgba(248, 246, 250, 0.72);
    --chat-panel: rgba(255, 255, 255, 0.78);
    --chat-mine: var(--navy, #4c275f);
    --chat-mine-deep: var(--navy-deep, #392041);
    --chat-accent: var(--amber, #f5ad0d);
    --chat-accent-deep: var(--hint, #c48500);
    --chat-ok: var(--green, #00b050);
    --chat-glass-edge: rgba(255, 255, 255, 0.72);
    position: fixed;
    z-index: 1080;
    bottom: 1.25rem;
    inset-inline-end: 1.25rem;
    font-family: inherit;
    color: var(--chat-ink);
}

.ifresh-support-launch {
    width: 4.35rem;
    height: 4.35rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--primary, #4c275f);
    color: #fff;
    box-shadow:
        0 12px 28px rgba(76, 39, 95, 0.38),
        0 0 0 3px rgba(76, 39, 95, 0.18),
        0 0 0 7px rgba(var(--primary-rgb, 76, 39, 95), 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    cursor: pointer;
    display: grid;
    place-items: center;
    padding: 0;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
    animation: ifresh-chat-pulse 2.4s ease-in-out infinite;
}

.ifresh-support-launch:hover {
    transform: translateY(-2px) scale(1.05);
    animation: none;
    background: var(--primary-dark, #392041);
    box-shadow:
        0 16px 36px rgba(76, 39, 95, 0.45),
        0 0 0 3px rgba(76, 39, 95, 0.24),
        0 0 0 8px rgba(var(--primary-rgb, 76, 39, 95), 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.ifresh-support-launch img {
    width: 3.85rem;
    height: 3.85rem;
    object-fit: contain;
    filter: none;
}

@keyframes ifresh-chat-pulse {
    0%,
    100% {
        box-shadow:
            0 12px 28px rgba(76, 39, 95, 0.38),
            0 0 0 3px rgba(76, 39, 95, 0.18),
            0 0 0 7px rgba(var(--primary-rgb, 76, 39, 95), 0.22),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }

    50% {
        box-shadow:
            0 14px 32px rgba(76, 39, 95, 0.42),
            0 0 0 3px rgba(76, 39, 95, 0.22),
            0 0 0 10px rgba(var(--primary-rgb, 76, 39, 95), 0.16),
            inset 0 1px 0 rgba(255, 255, 255, 0.22);
    }
}

.ifresh-support-panel {
    display: none;
    width: min(25.5rem, calc(100vw - 2rem));
    height: min(42rem, calc(100vh - 5.5rem));
    background: var(--chat-soft);
    border: 1px solid var(--chat-glass-edge);
    border-radius: 1.55rem;
    box-shadow:
        0 28px 70px rgba(44, 22, 54, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.75);
    overflow: hidden;
    flex-direction: column;
    backdrop-filter: blur(18px) saturate(1.3);
    -webkit-backdrop-filter: blur(18px) saturate(1.3);
}

.ifresh-support.is-open .ifresh-support-panel {
    display: flex;
    animation: ifresh-chat-rise .28s ease-out;
}

.ifresh-support.is-open .ifresh-support-launch {
    display: none;
}

@keyframes ifresh-chat-rise {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ifresh-support-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    padding: 1rem 1rem .85rem;
    background:
        radial-gradient(120% 140% at 0% 0%, rgba(245, 173, 13, 0.22), transparent 50%),
        linear-gradient(160deg, var(--chat-mine) 0%, var(--chat-mine-deep) 70%, #2a1832 100%);
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.ifresh-support-tools {
    display: flex;
    gap: 0.35rem;
}

.ifresh-support-tools button,
.ifresh-support-note button,
.ifresh-support-compose button {
    border: 0;
    background: transparent;
    color: var(--chat-muted);
    cursor: pointer;
    transition: color .15s ease, background .15s ease, transform .15s ease;
}

.ifresh-support-tools button {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.14);
}

.ifresh-support-tools button:hover {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.ifresh-support-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1;
}

.ifresh-support-logo {
    width: 2.65rem;
    height: 2.65rem;
    border-radius: 999px;
    background: #fff;
    color: var(--chat-accent);
    display: grid;
    place-items: center;
    font-size: 1.05rem;
    overflow: hidden;
    flex: 0 0 auto;
    box-shadow: 0 0 0 3px rgba(245, 173, 13, 0.35);
}

.ifresh-support-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.38rem;
    background: #fff;
}

.ifresh-support-brand strong,
.ifresh-support-brand span {
    display: block;
}

.ifresh-support-brand strong {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
}

.ifresh-support-brand > div > span:not(.ifresh-support-status) {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    font-weight: 600;
}

.ifresh-support-status {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    margin-top: .2rem;
    color: #bbf7d0;
    font-size: .7rem;
    font-weight: 700;
}

.ifresh-support-status i {
    width: .45rem;
    height: .45rem;
    border-radius: 999px;
    background: var(--chat-ok);
    box-shadow: 0 0 0 3px rgba(0, 176, 80, 0.25);
}

.ifresh-support-thread {
    flex: 1;
    overflow: auto;
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 28%),
        var(--chat-soft);
}

.ifresh-support-row {
    display: flex;
    gap: 0.55rem;
    align-items: flex-end;
    max-width: 92%;
}

.ifresh-support-row.is-mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.ifresh-support-avatar {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    background: #fff;
    color: var(--chat-accent);
    display: grid;
    place-items: center;
    font-size: 0.7rem;
    flex: 0 0 auto;
    overflow: hidden;
    border: 1px solid var(--chat-line);
    box-shadow: 0 4px 10px rgba(44, 22, 54, 0.08);
}

.ifresh-support-avatar img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0.18rem;
    background: #fff;
}

.ifresh-support-bubble {
    background: rgba(255, 255, 255, 0.88);
    color: var(--chat-ink);
    border: 1px solid var(--chat-glass-edge);
    border-radius: 1.05rem 1.05rem 1.05rem .35rem;
    padding: 0.72rem 0.9rem;
    line-height: 1.5;
    font-size: 0.94rem;
    white-space: pre-wrap;
    word-break: break-word;
    box-shadow: 0 8px 18px rgba(44, 22, 54, 0.06);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ifresh-support-row.is-mine .ifresh-support-bubble {
    background: linear-gradient(145deg, var(--chat-mine) 0%, var(--chat-mine-deep) 100%);
    color: #fff;
    border-color: transparent;
    border-radius: 1.05rem 1.05rem .35rem 1.05rem;
    box-shadow: 0 10px 22px rgba(76, 39, 95, 0.28);
}

.ifresh-support-note {
    margin: 0 0.9rem 0.75rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--chat-glass-edge);
    border-radius: 1rem;
    padding: 0.8rem 2rem 0.8rem 0.9rem;
    position: relative;
    color: var(--chat-muted);
    font-size: 0.8rem;
    line-height: 1.45;
    box-shadow: 0 8px 20px rgba(44, 22, 54, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.ifresh-support-note button {
    position: absolute;
    top: 0.45rem;
    inset-inline-end: 0.45rem;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 999px;
    color: var(--chat-muted);
}

.ifresh-support-note button:hover {
    background: rgba(238, 231, 242, 0.8);
    color: var(--chat-ink);
}

.ifresh-support-note a {
    color: var(--chat-mine);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ifresh-support-compose {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin: 0 0.85rem 0.55rem;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--chat-glass-edge);
    border-radius: 999px;
    padding: 0.35rem;
    box-shadow: 0 10px 24px rgba(44, 22, 54, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.ifresh-support-compose input {
    flex: 1;
    border: 0;
    outline: none;
    background: transparent !important;
    box-shadow: none !important;
    min-width: 0;
    font-size: 0.94rem;
    color: var(--chat-ink);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.ifresh-support-compose input::placeholder {
    color: var(--ink-3, #6f6279);
}

.ifresh-support-compose > button:not(.ifresh-support-send) {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    color: var(--chat-muted);
}

.ifresh-support-compose > button:not(.ifresh-support-send):hover {
    background: rgba(238, 231, 242, 0.8);
    color: var(--chat-ink);
}

.ifresh-support-send {
    width: 2.35rem !important;
    height: 2.35rem !important;
    border-radius: 999px !important;
    background: linear-gradient(145deg, var(--chat-accent) 0%, var(--chat-accent-deep) 100%) !important;
    color: #1a1122 !important;
    font-weight: 800;
    box-shadow: 0 8px 16px rgba(196, 133, 0, 0.35);
}

.ifresh-support-send:hover {
    transform: translateY(-1px);
}

.ifresh-support-emojis {
    display: none;
    gap: 0.3rem;
    justify-content: flex-end;
    padding: 0 1rem 0.45rem;
}

.ifresh-support-emojis.is-open {
    display: flex;
}

.ifresh-support-emojis button {
    border: 1px solid var(--chat-line);
    background: rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    width: 2.1rem;
    height: 2.1rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(44, 22, 54, 0.06);
}

.ifresh-support-emojis button:hover {
    transform: translateY(-1px);
}

.ifresh-support-credit {
    text-align: center;
    color: var(--ink-3, #6f6279);
    font-size: 0.72rem;
    padding: 0 1rem 0.85rem;
}

.ifresh-support-credit b {
    color: var(--chat-ink);
}

@media (max-width: 575.98px) {
    .ifresh-support {
        bottom: .85rem;
        inset-inline-end: .85rem;
    }

    .ifresh-support-panel {
        width: calc(100vw - 1.5rem);
        height: min(78vh, calc(100vh - 4.5rem));
        border-radius: 1.25rem;
    }
}
