.hstore-live-chat {
    position: fixed;
    right: 16px;
    bottom: 18px;
    top: auto;
    transform: none;
    z-index: 1080;
    font-family: inherit;
}

.hstore-live-chat *,
.hstore-live-chat *::before,
.hstore-live-chat *::after {
    box-sizing: border-box;
}

.hstore-live-chat__toggle {
    min-width: 126px;
    height: 50px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 12px 26px rgba(249, 115, 22, 0.34);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 15px 0 12px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.2px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hstore-live-chat__toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(249, 115, 22, 0.44);
}

.hstore-live-chat__toggle-icon {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: #fff;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 13px;
    position: relative;
    z-index: 1;
}

.hstore-live-chat__toggle-icon::before,
.hstore-live-chat__toggle-icon::after {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    border: 2px solid rgba(249, 115, 22, 0.34);
    opacity: 0;
    transform: scale(0.72);
    animation: hstore-live-chat-toggle-pulse 2s ease-out infinite;
    z-index: -1;
}

.hstore-live-chat__toggle-icon::after {
    animation-delay: 1s;
}

@keyframes hstore-live-chat-toggle-pulse {
    0% {
        opacity: 0.66;
        transform: scale(0.72);
    }
    70% {
        opacity: 0;
        transform: scale(1.32);
    }
    100% {
        opacity: 0;
        transform: scale(1.32);
    }
}

.hstore-live-chat__toggle-label {
    white-space: nowrap;
    line-height: 1;
    font-weight: 800;
}

.hstore-live-chat__badge {
    position: absolute;
    top: -5px;
    right: -4px;
    min-width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    border: 2px solid #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    font-weight: 700;
    display: none;
    padding: 0 4px;
}

.hstore-live-chat__panel {
    position: absolute;
    right: 0;
    bottom: 62px;
    top: auto;
    transform: none;
    width: min(392px, calc(100vw - 24px));
    height: min(680px, calc(100vh - 96px));
    background: #f7f8fa;
    border: 1px solid #dbe2eb;
    border-radius: 22px;
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.34);
    overflow: hidden;
    display: none;
    flex-direction: column;
}

.hstore-live-chat--open .hstore-live-chat__panel {
    display: flex;
}

.hstore-live-chat--thread-focus .hstore-live-chat__hero {
    display: none;
}

.hstore-live-chat--thread-focus .hstore-live-chat__content {
    margin-top: 0;
    padding: 0;
    height: 100%;
}

.hstore-live-chat--thread-focus .hstore-live-chat__view--messages.is-active {
    min-height: 100%;
    height: 100%;
}

.hstore-live-chat--thread-focus .hstore-live-chat__thread {
    height: 100%;
    border: 0;
    border-radius: 0;
}

.hstore-live-chat--thread-focus .hstore-live-chat__tabs {
    display: none;
}

.hstore-live-chat__hero {
    padding: 14px 16px 18px;
    min-height: 184px;
    background:
        radial-gradient(120px 70px at -30px -20px, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0)),
        radial-gradient(130px 80px at 105% 25%, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0)),
        linear-gradient(155deg, var(--primary-color), var(--primary-dark));
    color: #fff;
}

.hstore-live-chat__hero-top {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
}

.hstore-live-chat__brand {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: 0.2px;
}

.hstore-live-chat__brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.28);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 14px;
}

.hstore-live-chat__brand-name {
    color: #fff;
    font-weight: 800;
    line-height: 1;
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hstore-live-chat__avatars {
    display: inline-flex;
    align-items: center;
}

.hstore-live-chat__avatar {
    width: 31px;
    height: 31px;
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.88);
    margin-left: -8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.25);
    font-size: 12px;
    font-weight: 700;
}

.hstore-live-chat__avatar:first-child {
    margin-left: 0;
}

.hstore-live-chat__close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.hstore-live-chat__close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.hstore-live-chat__hero-body {
    margin-top: 18px;
}

.hstore-live-chat__hello {
    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
    opacity: 0.96;
}

.hstore-live-chat__title {
    margin: 6px 0 10px;
    font-size: clamp(32px, 4.7vw, 40px);
    line-height: 1.05;
    font-weight: 800;
    color: #fff;
    max-width: 95%;
}

.hstore-live-chat__status {
    font-size: 12.5px;
    line-height: 1.35;
    opacity: 0.94;
}

.hstore-live-chat__content {
    margin-top: 0;
    padding: 10px 14px 0;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.hstore-live-chat__view {
    display: none;
    height: 100%;
    min-height: 0;
}

.hstore-live-chat__view.is-active {
    display: block;
}

.hstore-live-chat__view--home,
.hstore-live-chat__view--help {
    overflow-y: auto;
    padding: 2px 2px 12px;
}

.hstore-live-chat__card {
    text-decoration: none;
    width: 100%;
    border: 0;
    border-radius: 13px;
    background: #fff;
    padding: 13px 14px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
    color: #0f172a;
    cursor: pointer;
}

.hstore-live-chat__card i {
    color: var(--primary-color);
}

.hstore-live-chat__card-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.hstore-live-chat__card-title {
    font-weight: 700;
    font-size: 17px;
    color: #0f172a;
}

.hstore-live-chat__card-main small {
    color: #64748b;
    font-size: 13px;
}

.hstore-live-chat__card--primary {
    border-left: 3px solid var(--primary-color);
}

.hstore-live-chat__card--search {
    font-weight: 600;
}

.hstore-live-chat__links,
.hstore-live-chat__help-item,
.hstore-live-chat__history-item,
.hstore-live-chat__history-start {
    box-shadow: 0 7px 18px rgba(15, 23, 42, 0.1);
}

.hstore-live-chat__links {
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
}

.hstore-live-chat__link-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 15px;
    color: #0f172a;
    text-decoration: none;
    border-bottom: 1px solid #e5e7eb;
}

.hstore-live-chat__link-item:last-child {
    border-bottom: 0;
}

.hstore-live-chat__link-item i {
    color: var(--primary-color);
}

.hstore-live-chat__view--messages.is-active {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.hstore-live-chat__history,
.hstore-live-chat__thread {
    display: none;
    flex-direction: column;
    min-height: 0;
    height: 100%;
}

.hstore-live-chat__history.is-active,
.hstore-live-chat__thread.is-active {
    display: flex;
}

.hstore-live-chat__history-head,
.hstore-live-chat__thread-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 8px;
}

.hstore-live-chat__history-head h4 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
}

.hstore-live-chat__history-head button,
.hstore-live-chat__thread-head button {
    border: 0;
    background: transparent;
    color: #64748b;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
}

.hstore-live-chat__thread {
    background: #f4f5f7;
    border-radius: 14px;
    border: 1px solid #e3e8ef;
    overflow: hidden;
}

.hstore-live-chat__thread-head {
    background: #fff;
    border-bottom: 1px solid #e6ebf2;
    gap: 6px;
}

.hstore-live-chat__thread-head button {
    width: 28px;
    height: 28px;
    border-radius: 7px;
}

.hstore-live-chat__thread-agent {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.hstore-live-chat__thread-logo {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(249, 115, 22, 0.18);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 15px;
    overflow: hidden;
    padding: 3px;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.18);
}

.hstore-live-chat__thread-logo img {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: block;
    object-fit: contain;
}

.hstore-live-chat__thread-logo i {
    display: none;
}

.hstore-live-chat__thread-logo.is-fallback {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border-color: transparent;
    color: #fff;
}

.hstore-live-chat__thread-logo.is-fallback i {
    display: inline-flex;
}

.hstore-live-chat__history-list {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 2px;
}

.hstore-live-chat__history-item {
    width: 100%;
    border: 0;
    background: #fff;
    border-radius: 14px;
    margin-bottom: 10px;
    padding: 11px 12px;
    text-align: left;
    cursor: pointer;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px;
    align-items: center;
}

.hstore-live-chat__history-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    font-size: 13px;
    font-weight: 700;
}

.hstore-live-chat__history-main strong {
    display: block;
    color: #0f172a;
    font-size: 14px;
    line-height: 1.2;
}

.hstore-live-chat__history-main small {
    display: block;
    color: #64748b;
    font-size: 12px;
    margin-top: 2px;
}

.hstore-live-chat__history-meta {
    text-align: right;
}

.hstore-live-chat__history-time {
    color: #64748b;
    font-size: 11px;
}

.hstore-live-chat__history-unread {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    margin-top: 3px;
    padding: 0 5px;
}

.hstore-live-chat__history-empty {
    display: none;
    text-align: center;
    color: #64748b;
    padding: 25px 10px;
    font-size: 13px;
}

.hstore-live-chat__history-empty i {
    font-size: 24px;
    opacity: 0.7;
}

.hstore-live-chat__history-start {
    border: 0;
    border-radius: 12px;
    margin: 10px 2px 0;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-weight: 700;
    padding: 11px 14px;
    cursor: pointer;
}

.hstore-live-chat__thread-meta {
    flex: 1;
    min-width: 0;
}

.hstore-live-chat__thread-meta strong {
    display: block;
    font-size: 14.5px;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.hstore-live-chat__thread-meta small {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    max-width: 100%;
    border-radius: 999px;
    background: rgba(22, 163, 74, 0.09);
    color: #15803d;
    font-size: 11.8px;
    font-weight: 700;
    line-height: 1.2;
    padding: 3px 9px 3px 22px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hstore-live-chat__thread-meta small::before,
.hstore-live-chat__thread-meta small::after {
    content: '';
    border-radius: 999px;
    position: absolute;
    top: 50%;
    left: 9px;
    transform: translateY(-50%);
    pointer-events: none;
    display: block;
}

.hstore-live-chat__thread-meta small::before {
    width: 7px;
    height: 7px;
    background: #22c55e;
    z-index: 2;
}

.hstore-live-chat__thread-meta small::after {
    width: 13px;
    height: 13px;
    left: 6px;
    border: 2px solid rgba(34, 197, 94, 0.28);
    animation: hstore-live-chat-online-pulse 1.8s ease-out infinite;
}

.hstore-live-chat__thread-meta small.is-online {
    color: #0f766e;
    overflow: visible;
    text-overflow: initial;
}

.hstore-live-chat__thread-meta small.is-online::before {
    background: #22c55e;
}

.hstore-live-chat__thread-meta small.is-online::after {
    border: 2px solid rgba(34, 197, 94, 0.4);
    animation: hstore-live-chat-online-pulse 1.6s ease-out infinite;
}

@keyframes hstore-live-chat-online-pulse {
    0% {
        transform: translateY(-50%) scale(0.75);
        opacity: 0.85;
    }
    70% {
        transform: translateY(-50%) scale(1.25);
        opacity: 0;
    }
    100% {
        transform: translateY(-50%) scale(1.25);
        opacity: 0;
    }
}

.hstore-live-chat__body {
    padding: 14px 10px 10px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 auto;
    min-height: 0;
}

.hstore-live-chat__intro {
    padding: 2px 6px 8px;
}

.hstore-live-chat__intro-note {
    text-align: center;
    color: #64748b;
    font-size: 12px;
    margin-bottom: 12px;
}

.hstore-live-chat__intro-bubble {
    max-width: 78%;
    background: #ececec;
    color: #1f2937;
    border-radius: 18px;
    padding: 12px 14px;
    font-size: 15px;
    line-height: 1.45;
}

.hstore-live-chat__intro-meta {
    margin-top: 8px;
    color: #6b7280;
    font-size: 12px;
}

.hstore-live-chat__msg {
    max-width: 80%;
    border-radius: 16px;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.hstore-live-chat__msg .meta {
    font-size: 11px;
    opacity: 0.75;
    margin-bottom: 4px;
}

.hstore-live-chat__event-wrap {
    display: flex;
    justify-content: center;
    margin: 4px 0;
}

.hstore-live-chat__event {
    background: #dde5f1;
    color: #334155;
    font-size: 12px;
    line-height: 1.2;
    border-radius: 999px;
    padding: 5px 10px;
    font-weight: 600;
}

.hstore-live-chat__msg--mine {
    margin-left: auto;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    border-bottom-right-radius: 6px;
}

.hstore-live-chat__msg--admin,
.hstore-live-chat__msg--other {
    background: #ececec;
    border: 0;
    color: #111827;
    border-bottom-left-radius: 6px;
}

.hstore-live-chat__typing {
    display: none;
    padding: 0 12px 9px;
}

.hstore-live-chat__typing.is-active {
    display: block;
}

.hstore-live-chat__typing-bubble {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 11px;
    background: #ececec;
    border-radius: 999px;
    border-bottom-left-radius: 8px;
}

.hstore-live-chat__typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #64748b;
    opacity: 0.45;
    animation: hstore-live-chat-typing 1.25s infinite ease-in-out;
}

.hstore-live-chat__typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.hstore-live-chat__typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes hstore-live-chat-typing {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    40% {
        transform: translateY(-2px);
        opacity: 1;
    }
}

.hstore-live-chat__composer {
    border-top: 1px solid #e5e9f0;
    background: #fff;
    padding: 10px;
}

.hstore-live-chat__closed-notice {
    display: none;
    align-items: center;
    gap: 8px;
    border-radius: 10px;
    border: 1px solid #f1b8bf;
    background: #fff1f3;
    color: #8b1e2d;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 600;
}

.hstore-live-chat__closed-notice i {
    font-size: 12px;
}

.hstore-live-chat__thread.is-closed .hstore-live-chat__composer {
    padding: 12px;
}

.hstore-live-chat__thread.is-closed .hstore-live-chat__guest,
.hstore-live-chat__thread.is-closed .hstore-live-chat__textarea,
.hstore-live-chat__thread.is-closed .hstore-live-chat__actions {
    display: none !important;
}

.hstore-live-chat__thread.is-closed .hstore-live-chat__closed-notice {
    display: flex;
}

.hstore-live-chat__guest {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.hstore-live-chat__input,
.hstore-live-chat__textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 9px 10px;
    font-size: 14px;
    outline: none;
}

.hstore-live-chat__textarea {
    resize: none;
    min-height: 82px;
    max-height: 130px;
}

.hstore-live-chat__input:focus,
.hstore-live-chat__textarea:focus {
    border-color: rgba(249, 115, 22, 0.55);
    box-shadow: none;
}

html.hstore-keyboard-focus .hstore-live-chat__input:focus,
html.hstore-keyboard-focus .hstore-live-chat__textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, 0.14);
}

.hstore-live-chat__actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.hstore-live-chat__hint {
    font-size: 11px;
    color: #64748b;
}

.hstore-live-chat__send {
    border: 0;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    cursor: pointer;
}

.hstore-live-chat__send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.hstore-live-chat__view--help {
    padding: 4px 2px 10px;
}

.hstore-live-chat__help-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    text-decoration: none;
    background: #fff;
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    color: #0f172a;
}

.hstore-live-chat__help-item i {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
}

.hstore-live-chat__help-item strong {
    display: block;
    font-size: 14px;
}

.hstore-live-chat__help-item small {
    color: #64748b;
}

.hstore-live-chat__tabs {
    border-top: 1px solid #e2e8f0;
    background: #fff;
    padding: 5px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.hstore-live-chat__tab {
    position: relative;
    border: 0;
    border-radius: 11px;
    padding: 7px 6px;
    background: transparent;
    color: #64748b;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
}

.hstore-live-chat__tab i {
    font-size: 16px;
}

.hstore-live-chat__tab.is-active {
    color: var(--primary-color);
    background: rgba(255, 106, 0, 0.08);
}

.hstore-live-chat__messages-dot {
    display: none;
    position: absolute;
    top: 5px;
    right: 20px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
}

@media (max-width: 767px) {
    .hstore-live-chat {
        right: 10px;
        bottom: 10px;
    }

    .hstore-live-chat__toggle {
        min-width: 54px;
        width: 54px;
        height: 54px;
        border-radius: 999px;
        justify-content: center;
        padding: 0;
    }

    .hstore-live-chat__toggle-label {
        display: none;
    }

    .hstore-live-chat__toggle-icon {
        display: inline-flex;
    }

    .hstore-live-chat__panel {
        right: 0;
        bottom: 68px;
        top: auto;
        transform: none;
        width: calc(100vw - 20px);
        height: min(660px, calc(100vh - 82px));
    }

    .hstore-live-chat__hero {
        min-height: 170px;
    }

    .hstore-live-chat__hello {
        font-size: 22px;
    }

    .hstore-live-chat__title {
        font-size: clamp(29px, 8vw, 36px);
    }

    .hstore-live-chat__avatars {
        display: none;
    }
}
