.ych-fab,
.ych,
.ych * {
    box-sizing: border-box;
}
.ych-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9998;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 56px;
    padding: 0 22px 0 16px;
    border: 0;
    border-radius: 28px;
    background: linear-gradient(100deg, #00aaff 35%, #7fd8ff 50%, #00aaff 65%) #00aaff;
    background-size: 300% 100%;
    color: #fff;
    font: 700 16px/1 var(--font-sans, system-ui, sans-serif);
    box-shadow: 0 8px 24px rgba(0, 120, 190, .4);
    cursor: pointer;
    animation: ych-shine 3s ease-in-out infinite, ych-pulse 3s ease-out infinite;
}
.ych-fab:hover {
    background: #0d3b66;
    animation: none;
}
@keyframes ych-shine {
    0% { background-position: 100% 0; }
    60%, 100% { background-position: 0 0; }
}
@keyframes ych-pulse {
    0% { box-shadow: 0 8px 24px rgba(0, 120, 190, .4), 0 0 0 0 rgba(0, 170, 255, .5); }
    70%, 100% { box-shadow: 0 8px 24px rgba(0, 120, 190, .4), 0 0 0 14px rgba(0, 170, 255, 0); }
}
@media (prefers-reduced-motion: reduce) {
    .ych-fab { animation: none; }
}
.ych-fab__icon {
    width: 26px;
    height: 26px;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M4 3h16a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H8l-5 4V5a2 2 0 0 1 2-2z'/%3E%3C/svg%3E");
}
.ych-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: #ff3b30;
    color: #fff;
    font-size: 13px;
    line-height: 22px;
    text-align: center;
}
.ych-fab__badge[hidden] {
    display: none;
}
body.ych-open .ych-fab {
    display: none;
}

.ych {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    width: 380px;
    height: min(620px, calc(100vh - 48px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 16px 50px rgba(13, 59, 102, .3);
    overflow: hidden;
    color: #0f172a;
    font: 15px/1.4 var(--font-sans, system-ui, sans-serif);
}
.ych[hidden] {
    display: none;
}
.ych__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(120deg, #0d3b66, #00aaff);
    color: #fff;
}
.ych__avatar {
    flex: 0 0 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .18);
    font-size: 18px;
    font-weight: 800;
    line-height: 40px;
    text-align: center;
}
.ych__who {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}
.ych__who span {
    font-size: 12px;
    opacity: .85;
}
.ych__close {
    padding: 0 4px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.ych__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    overflow-y: auto;
    background: #f1f5f9;
}
.ych__body > * {
    flex-shrink: 0;
}
.ych__product {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #d6e4f0;
    border-radius: 12px;
    background: #fff;
}
.ych__product[hidden],
.ych__product img[hidden] {
    display: none;
}
.ych__product img {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    object-fit: contain;
}
.ych__product div {
    display: flex;
    flex-direction: column;
    min-width: 0;
    font-size: 13px;
}
.ych__product small {
    color: #64748b;
    font-size: 11px;
}
.ych__product b {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.ych__product span {
    color: #0d3b66;
    font-weight: 700;
}
.ych__msg {
    position: relative;
    max-width: 82%;
    padding: 10px 12px 18px;
    border-radius: 14px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.ych__msg time {
    position: absolute;
    right: 10px;
    bottom: 4px;
    font-size: 10px;
    opacity: .55;
}
.ych__msg--us {
    align-self: flex-start;
    padding-bottom: 10px;
    border-bottom-left-radius: 4px;
    background: #fff;
}
.ych__msg--us[data-id] {
    padding-bottom: 18px;
}
.ych__msg--me {
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    background: #d9f1ff;
}
.ych__msg.is-pending {
    opacity: .6;
    padding-bottom: 10px;
}
.ych__msg.is-failed {
    padding-bottom: 10px;
    background: #fdecec;
}
.ych__note {
    align-self: center;
    max-width: 90%;
    color: #64748b;
    font-size: 12px;
    text-align: center;
}
.ych__note--err {
    color: #d92d20;
}
.ych__contact {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(13, 59, 102, .08);
}
.ych__kinds {
    display: flex;
    flex-basis: 100%;
    gap: 4px;
    padding: 3px;
    border-radius: 10px;
    background: #eef4fa;
}
.ych__kinds button {
    flex: 1;
    min-width: 0;
    height: 32px;
    padding: 0 4px;
    border: 0;
    border-radius: 8px;
    background: none;
    color: #0d3b66;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.ych__kinds button.is-active {
    background: #fff;
    color: #0077b6;
    box-shadow: 0 1px 4px rgba(13, 59, 102, .15);
}
.ych__contact input {
    flex: 1 1 170px;
    min-width: 0;
    height: 44px;
    padding: 0 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    font: inherit;
    font-size: 16px;
}
.ych__contact button[type="submit"] {
    flex: 1 1 auto;
    height: 44px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: #ff8c00;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
.ych__contact button:disabled {
    opacity: .6;
}
.ych__contact small {
    flex-basis: 100%;
    color: #64748b;
    font-size: 11px;
}
.ych__contact small a {
    color: inherit;
}
.ych__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 0;
    background: #f1f5f9;
}
.ych__chips[hidden] {
    display: none;
}
.ych__chips button {
    padding: 8px 12px;
    border: 1px solid #00aaff;
    border-radius: 16px;
    background: #fff;
    color: #0077b6;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
}
.ych__chips button:hover {
    background: #e6f6ff;
}
.ych__form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px;
    background: #f1f5f9;
}
.ych__form textarea {
    flex: 1;
    min-height: 44px;
    max-height: 120px;
    padding: 11px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 22px;
    background: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.3;
    resize: none;
}
.ych__form textarea:focus,
.ych__contact input:focus {
    outline: 2px solid rgba(0, 170, 255, .35);
    border-color: #00aaff;
}
.ych__form button {
    flex: 0 0 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #00aaff no-repeat 55% center / 20px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M3 20.5 21 12 3 3.5 3 10l12 2-12 2z'/%3E%3C/svg%3E");
    cursor: pointer;
}
.ych__form button:hover {
    background-color: #0d3b66;
}
.ych__hp {
    position: absolute !important;
    left: -9999px !important;
    width: 1px;
    height: 1px;
}
.ych__foot {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    font-weight: 600;
}
.ych__foot a {
    color: #0077b6;
    text-decoration: none;
}
.ych__foot a:hover {
    text-decoration: underline;
}

@media (pointer: coarse), (hover: none), (max-width: 1024px) {
    .ych-fab {
        right: 14px;
        bottom: calc(76px + env(safe-area-inset-bottom));
        width: 56px;
        padding: 0;
        justify-content: center;
    }
    .ych-fab__text {
        display: none;
    }
}
@media (max-width: 600px) {
    .ych {
        inset: 0;
        width: auto;
        height: auto;
        border-radius: 0;
    }
    body.ych-open {
        overflow: hidden;
    }
    .ych__foot {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}
