.sagwc-widget {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 10000;
    color: #111827;
    font-family: inherit;
}

.sagwc-launcher {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    border: 1px solid #1f5fa8;
    border-radius: 999px;
    background: #1f5fa8;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.2);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 10px 16px;
}

.sagwc-panel {
    position: absolute;
    right: 0;
    bottom: 58px;
    display: none;
    width: min(360px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid #d6deea;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.24);
}

.sagwc-widget.is-open .sagwc-panel {
    display: block;
}

.sagwc-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    background: #111827;
    color: #fff;
    padding: 12px 14px;
}

.sagwc-panel-header strong,
.sagwc-panel-header span {
    display: block;
}

.sagwc-panel-header span {
    margin-top: 3px;
    color: #dbeafe;
    font-size: 0.82rem;
}

.sagwc-panel-header button {
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.sagwc-messages {
    display: flex;
    height: 260px;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    background: #f8fafc;
    padding: 12px;
}

.sagwc-message {
    max-width: 88%;
    border-radius: 10px;
    background: #fff;
    padding: 9px 10px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
    font-size: 0.9rem;
    line-height: 1.4;
}

.sagwc-message-system {
    max-width: none;
    background: #eef2ff;
    color: #334155;
}

.sagwc-from-customer {
    align-self: flex-end;
    background: #dbeafe;
}

.sagwc-from-staff {
    align-self: flex-start;
}

.sagwc-message-meta {
    margin-bottom: 4px;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
}

.sagwc-message a {
    color: #1f5fa8;
    text-decoration: underline;
}

.sagwc-product-message {
    width: 100%;
    max-width: 100%;
    padding: 8px;
}

.sagwc-product-card {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #d6deea;
    border-radius: 8px;
    background: #fff;
}

.sagwc-product-image {
    display: grid;
    min-height: 116px;
    place-items: center;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
    background: #f8fafc;
}

.sagwc-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sagwc-product-image-placeholder {
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 700;
}

.sagwc-product-copy {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 4px;
    padding: 9px 10px;
}

.sagwc-product-copy > span {
    color: #64748b;
    font-size: 0.72rem;
}

.sagwc-product-name {
    color: #111827 !important;
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.3;
    text-decoration: none !important;
}

.sagwc-product-name:hover {
    text-decoration: underline !important;
}

.sagwc-product-attributes {
    overflow-wrap: anywhere;
}

.sagwc-product-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 8px;
}

.sagwc-product-facts strong {
    color: #111827;
}

.sagwc-product-facts span {
    color: #047857;
    font-size: 0.68rem;
    font-weight: 800;
}

.sagwc-product-copy button,
.sagwc-product-action {
    min-height: 34px;
    margin-top: 3px;
    border: 0;
    border-radius: 7px;
    background: #1f5fa8;
    color: #fff !important;
    cursor: pointer;
    font: inherit;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 34px;
    text-align: center;
    text-decoration: none !important;
}

.sagwc-product-copy button:disabled {
    cursor: progress;
    opacity: 0.7;
}

.sagwc-product-copy button.is-added {
    background: #047857;
}

.sagwc-form {
    display: grid;
    gap: 8px;
    padding: 12px;
}

.sagwc-profile-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.sagwc-account-identity {
    display: grid;
    gap: 2px;
    border: 1px solid #d6deea;
    border-radius: 8px;
    background: #f8fafc;
    padding: 9px 10px;
}

.sagwc-account-identity span,
.sagwc-account-identity small {
    color: #64748b;
    font-size: 0.76rem;
}

.sagwc-account-identity strong {
    color: #111827;
    font-size: 0.9rem;
}

.sagwc-form input,
.sagwc-form textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 9px;
    font: inherit;
}

.sagwc-form textarea {
    resize: vertical;
}

.sagwc-hp {
    position: absolute;
    left: -9999px;
}

.sagwc-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.sagwc-form-actions span {
    min-height: 1em;
    color: #475569;
    font-size: 0.78rem;
}

.sagwc-form-actions button {
    border: 0;
    border-radius: 8px;
    background: #1f5fa8;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-weight: 800;
    padding: 9px 16px;
}

.sagwc-form-actions button:disabled {
    cursor: progress;
    opacity: 0.62;
}

body.sagwc-chat-open .kodee-fab,
body.sagwc-chat-open #vue-app {
    display: none !important;
}

@media (max-width: 640px) {
    .sagwc-widget {
        right: 12px;
        bottom: 12px;
    }

    .sagwc-panel {
        bottom: 54px;
    }

}
