.chat-widget { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1200; }

.chat-widget-toggle {
    position: relative; width: 124px; height: 132px; border-radius: 0;
    border: none; cursor: pointer; background: transparent; padding: 0;
    color: #fff; display: flex; align-items: center; justify-content: center;
    transition: transform 0.18s ease, filter 0.2s ease;
}
.chat-widget-signal-ring {
    content: ""; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px;
    margin: -42px 0 0 -42px;
    border-radius: 50%; z-index: -1; box-sizing: border-box;
    border: 2px solid rgba(238, 74, 63, 0.55);
    animation: chat-widget-signal 2.4s cubic-bezier(0.2, 0.6, 0.4, 1) infinite;
}
.chat-widget-signal-ring-delay { animation-delay: 1.2s; }
.chat-widget-toggle:hover { transform: scale(1.06) translateY(-1px); }
.chat-widget-toggle:active { transform: scale(0.97); }

.chat-widget-bot-icon {
    width: 100%; height: 100%; object-fit: contain;
    filter: drop-shadow(0 10px 16px rgba(194, 40, 60, 0.4));
}

@keyframes chat-widget-signal {
    0% { transform: scale(1); opacity: 0.65; }
    100% { transform: scale(1.55); opacity: 0; }
}

.chat-widget-panel {
    position: absolute; right: 0; bottom: 100px; width: min(360px, 92vw); height: min(500px, 72vh);
    display: flex; flex-direction: column; overflow: hidden; border-radius: 20px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    animation: chat-widget-panel-in 0.22s ease;
}
@keyframes chat-widget-panel-in {
    from { opacity: 0; transform: translateY(10px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-widget-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.1rem; background: linear-gradient(120deg, #ff8a65, #c2286b);
    color: #fff; flex-shrink: 0;
}
.chat-widget-header-info { display: flex; flex-direction: column; gap: 0.15rem; }
.chat-widget-header-title { font-weight: 700; font-size: 0.98rem; }
.chat-widget-header-status {
    display: flex; align-items: center; gap: 0.35rem; font-size: 0.75rem; color: rgba(255, 255, 255, 0.85);
}
.chat-widget-status-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #4ce0a0; display: inline-block;
    box-shadow: 0 0 0 3px rgba(76, 224, 160, 0.25);
}
.chat-widget-close {
    background: rgba(255, 255, 255, 0.18); border: none; color: #fff; width: 30px; height: 30px;
    border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; transition: background 0.15s ease;
}
.chat-widget-close:hover { background: rgba(255, 255, 255, 0.3); }

.chat-widget-messages {
    flex: 1; overflow-y: auto; padding: 1.1rem; display: flex; flex-direction: column; gap: 0.7rem;
    background: var(--color-bg, transparent);
}

.chat-widget-msg {
    max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 16px; font-size: 0.88rem;
    line-height: 1.45; white-space: pre-line; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}
.chat-widget-msg-bot {
    align-self: flex-start; background: var(--color-bg-secondary); color: var(--color-text);
    border-bottom-left-radius: 5px; border: 1px solid var(--color-border);
}
.chat-widget-msg-user {
    align-self: flex-end; background: linear-gradient(135deg, #ff8a65, #c2286b); color: #fff;
    border-bottom-right-radius: 5px; box-shadow: 0 4px 12px rgba(226, 59, 90, 0.3);
}
.chat-widget-msg-loading {
    align-self: flex-start; color: var(--color-text-muted); font-style: italic; box-shadow: none;
    background: none; padding-left: 0.2rem;
}
.chat-widget-msg-link {
    color: #e2405a; font-weight: 600; text-decoration: underline; word-break: break-all;
}
.chat-widget-msg-user .chat-widget-msg-link { color: #fff; }

.chat-widget-taste-options { display: flex; flex-wrap: wrap; gap: 0.5rem; align-self: flex-start; max-width: 85%; }
.chat-widget-taste-option {
    padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid var(--color-accent);
    background: transparent; color: var(--color-accent); font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: background-color 0.15s ease, color 0.15s ease;
}
.chat-widget-taste-option:hover:not(:disabled) { background: var(--color-accent); color: #fff; }
.chat-widget-taste-option:disabled { opacity: 0.55; cursor: default; }
.chat-widget-taste-option.selected { background: var(--color-accent); color: #fff; opacity: 1; }

.chat-widget-form {
    display: flex; gap: 0.6rem; padding: 0.85rem; border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
}
.chat-widget-form input {
    flex: 1; padding: 0.65rem 1rem; border-radius: 999px; border: 1px solid var(--color-border);
    background: var(--color-bg-secondary); color: var(--color-text); font-size: 0.88rem;
    transition: border-color 0.15s ease;
}
.chat-widget-form input:focus { outline: none; border-color: var(--color-accent); }

.chat-widget-send-btn {
    width: 40px; height: 40px; border-radius: 50%; border: none; flex-shrink: 0; cursor: pointer;
    background: linear-gradient(135deg, #ff8a65, #c2286b); color: #fff; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center; transition: transform 0.15s ease;
    box-shadow: 0 4px 12px rgba(226, 59, 90, 0.35);
}
.chat-widget-send-btn:hover { transform: scale(1.06); }
.chat-widget-send-btn:disabled { opacity: 0.6; cursor: default; transform: none; }

@media (max-width: 480px) {
    .chat-widget-panel { width: calc(100vw - 2rem); right: -0.5rem; }
}