.aetrix-chat-widget {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 80;
    font-family: Inter, sans-serif;
}

.aetrix-chat-widget * {
    box-sizing: border-box;
}

.aetrix-chat-widget__toggle {
    width: 4rem;
    height: 4rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #003949 0%, #065167 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 24px 48px -18px rgba(0, 57, 73, 0.55);
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.aetrix-chat-widget__toggle:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 32px 56px -18px rgba(0, 57, 73, 0.65);
}

.aetrix-chat-widget__toggle .material-symbols-outlined {
    font-size: 1.75rem;
}

.aetrix-chat-widget__panel {
    position: absolute;
    right: 0;
    bottom: 5rem;
    width: min(24rem, calc(100vw - 2rem));
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(194, 199, 209, 0.9);
    border-radius: 1.25rem;
    box-shadow: 0 40px 80px -32px rgba(25, 28, 30, 0.35);
    overflow: hidden;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    backdrop-filter: blur(22px);
}

.aetrix-chat-widget.is-open .aetrix-chat-widget__panel {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

.aetrix-chat-widget.is-open .aetrix-chat-widget__toggle {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.92);
}

.aetrix-chat-widget__header {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #003949 0%, #065167 100%);
    color: #ffffff;
}

.aetrix-chat-widget__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.aetrix-chat-widget__header-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.aetrix-chat-widget__status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #84f5e8;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(132, 245, 232, 0.25);
    animation: aetrix-status-pulse 2.2s ease-in-out infinite;
}

@keyframes aetrix-status-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.aetrix-chat-widget__title {
    font-family: Manrope, sans-serif;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0;
}

.aetrix-chat-widget__header-actions {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.aetrix-chat-widget__icon-button {
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.aetrix-chat-widget__icon-button:hover {
    background: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.aetrix-chat-widget__body {
    padding: 0.9rem;
    background: linear-gradient(180deg, #f7f9fb 0%, #ffffff 100%);
}

.aetrix-chat-widget__quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.aetrix-chat-widget__chip {
    border: 1px solid #c2c7d1;
    background: #ffffff;
    color: #003949;
    border-radius: 999px;
    padding: 0.45rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.aetrix-chat-widget__chip:hover {
    border-color: #003949;
    background: #f2f4f6;
    transform: translateY(-1px);
}

.aetrix-chat-widget__messages {
    min-height: 16rem;
    max-height: min(50vh, 24rem);
    overflow-y: auto;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.aetrix-chat-widget__message {
    max-width: 88%;
    border-radius: 1rem;
    padding: 0.75rem 0.9rem;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
}

.aetrix-chat-widget__message--assistant {
    align-self: flex-start;
    background: #e9f4fb;
    color: #003949;
    border-top-left-radius: 0.35rem;
}

.aetrix-chat-widget__message--user {
    align-self: flex-end;
    background: #003949;
    color: #ffffff;
    border-top-right-radius: 0.35rem;
}

.aetrix-chat-widget__composer {
    display: flex;
    gap: 0.6rem;
    align-items: flex-end;
    padding-top: 0.85rem;
    margin-top: 0.9rem;
    border-top: 1px solid #e0e3e5;
}

.aetrix-chat-widget__input {
    flex: 1;
    min-height: 3rem;
    max-height: 7rem;
    resize: vertical;
    border: 1px solid #c2c7d1;
    border-radius: 0.95rem;
    background: #ffffff;
    color: #191c1e;
    padding: 0.85rem 0.95rem;
    font: inherit;
    box-shadow: none;
}

.aetrix-chat-widget__input:focus {
    outline: 2px solid rgba(0, 57, 73, 0.14);
    border-color: #003949;
}

.aetrix-chat-widget__send {
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #003949 0%, #065167 100%);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 16px 28px -16px rgba(0, 57, 73, 0.7);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.aetrix-chat-widget__send:hover {
    transform: translateY(-1px);
    box-shadow: 0 20px 30px -16px rgba(0, 57, 73, 0.82);
}

.aetrix-chat-widget__powered {
    padding: 0.55rem 0.9rem;
    font-size: 0.7rem;
    color: #727780;
    text-align: center;
    border-top: 1px solid #e0e3e5;
    background: #f7f9fb;
    letter-spacing: 0.01em;
}

.aetrix-chat-widget__powered strong {
    color: #003949;
    font-weight: 700;
}

@media (max-width: 640px) {
    .aetrix-chat-widget {
        right: 0.75rem;
        bottom: 0.75rem;
    }

    .aetrix-chat-widget__panel {
        width: min(24rem, calc(100vw - 1.5rem));
        bottom: 4.6rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .aetrix-chat-widget__panel,
    .aetrix-chat-widget__toggle,
    .aetrix-chat-widget__icon-button,
    .aetrix-chat-widget__chip,
    .aetrix-chat-widget__send {
        transition: none;
    }
}