/**
 * UWK RAG Chat v2 — Widget Styles
 * Komplett neu geschrieben, basiert visuell auf v1
 * Position: LEFT (Testphase), kein Dark Mode
 */

/* ==========================================
   CSS Variables
   ========================================== */

:root {
    --uwk-primary: #0073aa;
    --uwk-primary-dark: #005a87;
    --uwk-text: #333333;
    --uwk-text-light: #666666;
    --uwk-bg: #ffffff;
    --uwk-bg-light: #f5f5f5;
    --uwk-border: #e0e0e0;
    --uwk-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    --uwk-radius: 16px;
    --uwk-radius-sm: 8px;
}

/* ==========================================
   Root Container
   ========================================== */

#uwk2-chat-root {
    color-scheme: light !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--uwk-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#uwk2-chat-root *,
#uwk2-chat-root *::before,
#uwk2-chat-root *::after {
    box-sizing: border-box;
}

/* ==========================================
   Launcher Button
   ========================================== */

.uwk2-launcher {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 115, 170, 0.4);
    transition: all 0.3s ease;
    z-index: 999998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    animation: uwk2-attention 3s ease-in-out 2s infinite;
}

.uwk2-launcher:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(0, 115, 170, 0.5);
    animation: none;
}

.uwk2-launcher--open {
    animation: none;
}

@keyframes uwk2-attention {
    0%, 100% {
        transform: scale(1) translateY(0);
    }
    10% {
        transform: scale(1.08) translateY(-4px);
        box-shadow: 0 8px 30px rgba(0, 115, 170, 0.5);
    }
    20% {
        transform: scale(1) translateY(0);
    }
}

/* Icons inside launcher */
.uwk2-launcher svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    transition: transform 0.3s ease;
}

.uwk2-launcher .uwk2-icon-close {
    display: none;
}

.uwk2-launcher--open .uwk2-icon-chat {
    display: none;
}

.uwk2-launcher--open .uwk2-icon-close {
    display: block;
}

/* Badge (unread count) */
.uwk2-launcher__badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 20px;
    height: 20px;
    background: #e53935;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.uwk2-launcher--open .uwk2-launcher__badge,
.uwk2-launcher--chat-open .uwk2-launcher__badge {
    opacity: 0;
    transform: scale(0);
}

.uwk2-launcher--unread .uwk2-launcher__badge {
    opacity: 1;
    transform: scale(1);
}

/* ==========================================
   Chat Window
   ========================================== */

.uwk2-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 380px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    color: #333333;
    border-radius: var(--uwk-radius);
    box-shadow: var(--uwk-shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s ease;
}

.uwk2-window--hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
}

.uwk2-window--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Maximierter Modus */
.uwk2-window--maximized {
    width: 520px;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    bottom: 20px;
    right: 20px;
    border-radius: 12px;
    transition: all 0.3s ease;
}

/* ==========================================
   Header
   ========================================== */

.uwk2-header {
    background: var(--uwk-primary);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.uwk2-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.uwk2-header__avatar svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

.uwk2-header__info {
    flex: 1;
    min-width: 0;
}

.uwk2-header__title {
    font-weight: 600;
    font-size: 16px;
    margin: 0;
}

.uwk2-header__status {
    font-size: 12px;
    opacity: 0.8;
    margin: 2px 0 0 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.uwk2-header__status-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    display: inline-block;
}

.uwk2-header__buttons {
    display: flex;
    align-items: center;
    gap: 4px;
}

.uwk2-header__reset,
.uwk2-header__maximize,
.uwk2-header__close {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uwk2-header__reset:hover,
.uwk2-header__maximize:hover,
.uwk2-header__close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.uwk2-header__reset svg,
.uwk2-header__maximize svg,
.uwk2-header__close svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    display: block;
}

/* ==========================================
   State Indicator (debug only)
   ========================================== */

.uwk2-state-indicator {
    display: none;
    padding: 4px 12px;
    background: #fff3cd;
    color: #856404;
    font-size: 11px;
    text-align: center;
    border-bottom: 1px solid #ffc107;
}

.uwk2-state-indicator--visible {
    display: block;
}

/* ==========================================
   Messages Container
   ========================================== */

.uwk2-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f5f5f5;
}

/* Custom Scrollbar */
.uwk2-messages::-webkit-scrollbar {
    width: 6px;
}

.uwk2-messages::-webkit-scrollbar-track {
    background: transparent;
}

.uwk2-messages::-webkit-scrollbar-thumb {
    background: var(--uwk-border);
    border-radius: 3px;
}

.uwk2-messages::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

/* ==========================================
   Message Bubbles
   ========================================== */

.uwk2-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: uwk2-fadeIn 0.3s ease;
}

@keyframes uwk2-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uwk2-message--user {
    align-self: flex-end;
}

.uwk2-message--assistant {
    align-self: flex-start;
}

.uwk2-message__bubble {
    padding: 12px 16px;
    border-radius: var(--uwk-radius);
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.uwk2-message--user .uwk2-message__bubble {
    background: var(--uwk-primary);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.uwk2-message--assistant .uwk2-message__bubble {
    background: #ffffff;
    color: #333333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Text formatting inside bubbles */
.uwk2-message__bubble p {
    margin: 0 0 8px 0;
}

.uwk2-message__bubble p:last-child {
    margin-bottom: 0;
}

.uwk2-message__bubble ul {
    margin: 8px 0;
    padding-left: 18px;
}

.uwk2-message__bubble li {
    margin: 3px 0;
}

.uwk2-message__bubble a {
    color: inherit;
    text-decoration: underline;
}

.uwk2-message--user .uwk2-message__bubble a {
    color: #ffffff;
}

.uwk2-message--assistant .uwk2-message__bubble a {
    color: var(--uwk-primary);
}

/* Timestamp */
.uwk2-message__time {
    font-size: 11px;
    color: var(--uwk-text-light);
    margin-top: 4px;
    padding: 0 4px;
}

.uwk2-message--user .uwk2-message__time {
    text-align: right;
}

/* ==========================================
   Inline Product Snippets (data-product-url)
   ========================================== */

div[data-product-url] {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    margin: 8px 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    max-width: 280px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}

div[data-product-url]:hover {
    border-color: var(--uwk-primary);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

/* ==========================================
   Product Cards (from API response)
   ========================================== */

.uwk2-products {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 8px;
}

.uwk2-product-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    transition: box-shadow 0.2s, border-color 0.2s;
    color: inherit;
}

.uwk2-product-card:hover {
    border-color: var(--uwk-primary);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
}

.uwk2-product-card img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 6px;
    object-fit: cover;
    background: #f8f8f8;
}

.uwk2-product-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.uwk2-product-name {
    font-weight: 600;
    font-size: 13px;
    color: #1a1a1a;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uwk2-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #c41e3a;
}

.uwk2-product-uvp {
    font-size: 11px;
    color: #999;
    text-decoration: line-through;
    margin-left: 6px;
}

.uwk2-product-arrow {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--uwk-primary);
    color: #fff;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
    transition: transform 0.2s, background 0.2s;
}

.uwk2-product-card:hover .uwk2-product-arrow {
    background: var(--uwk-primary-dark);
    transform: scale(1.1);
}

/* ==========================================
   Typing Indicator
   ========================================== */

.uwk2-typing {
    display: none;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: #ffffff;
    border-radius: var(--uwk-radius);
    border-bottom-left-radius: 4px;
    width: fit-content;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.uwk2-typing--visible {
    display: flex;
}

.uwk2-typing__dot {
    width: 8px;
    height: 8px;
    background: var(--uwk-text-light);
    border-radius: 50%;
    animation: uwk2-dot-bounce 1.4s infinite ease-in-out;
}

.uwk2-typing__dot:nth-child(1) { animation-delay: 0s; }
.uwk2-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.uwk2-typing__dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes uwk2-dot-bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-4px); }
}

/* ==========================================
   Suggestions (Quick Replies)
   ========================================== */

.uwk2-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 0;
    margin-top: 4px;
}

.uwk2-suggestion-btn {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border: 1px solid #cce0f5;
    border-radius: 16px;
    padding: 7px 13px;
    font-size: 12px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.uwk2-suggestion-btn:hover {
    background: var(--uwk-primary);
    border-color: var(--uwk-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 115, 170, 0.3);
}

/* ==========================================
   Start Buttons (Welcome Screen — Pill-Style)
   ========================================== */

.uwk2-start-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
    margin-top: 4px;
}

.uwk2-start-btn {
    background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
    border: 1px solid #cce0f5;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    color: #0073aa;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.uwk2-start-btn:hover {
    background: var(--uwk-primary);
    border-color: var(--uwk-primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* ==========================================
   Contact Suggestion Banner
   ========================================== */

.uwk2-contact-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 8px 0;
    background: linear-gradient(135deg, #fff8f0 0%, #fff3e6 100%);
    border: 1px solid #f5d9b3;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.uwk2-contact-banner:hover {
    border-color: #e8a84c;
    box-shadow: 0 4px 12px rgba(232, 168, 76, 0.2);
    transform: translateY(-1px);
}

.uwk2-contact-banner__icon {
    font-size: 20px;
    flex-shrink: 0;
}

.uwk2-contact-banner__text {
    font-size: 13px;
    color: #8a6d3b;
    line-height: 1.4;
}

.uwk2-contact-banner__text strong {
    color: #6b4f1d;
}

/* ==========================================
   Input Area
   ========================================== */

.uwk2-input-area {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid var(--uwk-border);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.uwk2-input-wrapper {
    flex: 1;
    min-width: 0;
}

.uwk2-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--uwk-border);
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    resize: none;
    max-height: 120px;
    min-height: 44px;
    line-height: 1.4;
    background: #ffffff;
    color: #333333;
}

.uwk2-textarea:focus {
    border-color: var(--uwk-primary);
}

.uwk2-textarea::placeholder {
    color: #999;
}

/* Send Button */
.uwk2-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: var(--uwk-border);
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.uwk2-send-btn--active {
    background: var(--uwk-primary);
    color: #ffffff;
}

.uwk2-send-btn--active:hover {
    background: var(--uwk-primary-dark);
    transform: scale(1.05);
}

.uwk2-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Upload Button (hidden by default) */
.uwk2-upload-btn {
    display: flex;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--uwk-text-light);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, opacity 0.2s;
    flex-shrink: 0;
    padding: 0;
    opacity: 0.55;
    align-self: flex-end;
    margin-bottom: 6px;
}

.uwk2-upload-btn:hover {
    opacity: 1;
    color: var(--uwk-primary);
}

.uwk2-upload-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.uwk2-upload-input {
    display: none;
}

/* Live-Support (Mitarbeiter-Uebernahme) */
.uwk2-message--supporter { display: flex; flex-direction: column; align-items: flex-start; margin: 8px 0; }
.uwk2-supporter-label { font-size: 11px; color: #c82333; font-weight: 600; margin: 0 0 3px 4px; }
.uwk2-supporter-bubble {
    max-width: 85%; background: linear-gradient(135deg, #dc3545, #c82333); color: #fff;
    border-radius: 14px 14px 14px 4px; padding: 9px 13px; line-height: 1.4; word-wrap: break-word;
}
.uwk2-takeover-notice {
    text-align: center; margin: 10px 0; font-size: 12px; color: #1e7e34;
    background: #e7f6ec; border: 1px solid #bfe3c9; border-radius: 10px; padding: 6px 12px;
}

/* ==========================================
   GDPR Footer
   ========================================== */

.uwk2-gdpr {
    padding: 6px 12px;
    background: var(--uwk-bg-light);
    font-size: 10px;
    color: #999;
    text-align: center;
    border-top: 1px solid var(--uwk-border);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.uwk2-gdpr a {
    color: #888;
    text-decoration: none;
}

.uwk2-gdpr a:hover {
    color: var(--uwk-primary);
}

.uwk2-gdpr span {
    color: #ccc;
}

.uwk2-gdpr__contact {
    background: none;
    border: none;
    color: #888;
    font-size: 10px;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.uwk2-gdpr__contact:hover {
    color: var(--uwk-primary);
}

/* ==========================================
   Contact Form Overlay
   ========================================== */

.uwk2-contact-form {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: inherit;
}

.uwk2-contact-form--visible {
    opacity: 1;
    visibility: visible;
}

.uwk2-contact-form__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--uwk-primary);
    color: #ffffff;
    border-radius: var(--uwk-radius) var(--uwk-radius) 0 0;
}

.uwk2-contact-form__title {
    font-weight: 600;
    font-size: 16px;
}

.uwk2-contact-form__back {
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    opacity: 0.7;
    transition: all 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uwk2-contact-form__back:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.15);
}

.uwk2-contact-form__back svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.uwk2-contact-form__body {
    flex: 1;
    background: #ffffff;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.uwk2-contact-form__desc {
    font-size: 13px;
    color: var(--uwk-text-light);
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.uwk2-contact-form__group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.uwk2-contact-form__row {
    display: flex;
    gap: 10px;
}

.uwk2-contact-form__label {
    font-size: 12px;
    font-weight: 500;
    color: #333333;
}

.uwk2-contact-form__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--uwk-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s;
}

.uwk2-contact-form__input:focus {
    outline: none;
    border-color: var(--uwk-primary);
}

.uwk2-contact-form__input::placeholder {
    color: #888;
}

.uwk2-contact-form__textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--uwk-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #ffffff;
    color: #333333;
    transition: border-color 0.2s;
    resize: vertical;
    min-height: 80px;
}

.uwk2-contact-form__textarea:focus {
    outline: none;
    border-color: var(--uwk-primary);
}

.uwk2-contact-form__textarea::placeholder {
    color: #888;
}

.uwk2-contact-form__select {
    appearance: auto;
    cursor: pointer;
}

.uwk2-contact-form__checkbox {
    font-size: 12px;
    color: var(--uwk-text-light);
    line-height: 1.5;
}

.uwk2-contact-form__checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

.uwk2-contact-form__checkbox input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    accent-color: var(--uwk-primary);
}

.uwk2-contact-form__checkbox a {
    color: var(--uwk-primary);
    text-decoration: underline;
}

.uwk2-contact-form__error {
    font-size: 12px;
    color: #c41e3a;
    min-height: 16px;
}

.uwk2-contact-form__success {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: #fff;
    padding: 40px 20px;
    text-align: center;
    gap: 12px;
}

.uwk2-contact-form__success-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #22c55e;
    color: #fff;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.uwk2-contact-form__success h4 {
    font-size: 18px;
    margin: 0;
    color: var(--uwk-text);
}

.uwk2-contact-form__success p {
    font-size: 14px;
    color: var(--uwk-text-light);
    margin: 0;
}

.uwk2-contact-form__done {
    margin-top: 12px;
    padding: 10px 24px;
    background: var(--uwk-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}

.uwk2-contact-form__done:hover {
    background: var(--uwk-primary-dark);
}

.uwk2-contact-form__submit {
    width: 100%;
    padding: 12px 20px;
    background: var(--uwk-primary);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.uwk2-contact-form__submit:hover:not(:disabled) {
    background: var(--uwk-primary-dark);
}

.uwk2-contact-form__submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ==========================================
   Error Message
   ========================================== */

.uwk2-error {
    background: #fee;
    color: #c00;
    padding: 12px 16px;
    border-radius: var(--uwk-radius-sm);
    font-size: 13px;
    text-align: center;
}

/* ==========================================
   RESPONSIVE — Tablets
   ========================================== */

@media (max-width: 768px) {
    .uwk2-window {
        width: 340px;
        height: 480px;
        bottom: 80px;
        right: 15px;
    }

    .uwk2-product-card {
        max-width: 100%;
    }
}

/* ==========================================
   RESPONSIVE — Smartphones
   ========================================== */

@media (max-width: 600px) {
    /* Maximize-Button auf Mobile verstecken */
    .uwk2-header__maximize {
        display: none !important;
    }

    /* Body scroll lock when chat open */
    body.uwk2-chat-active {
        overflow: hidden;
        touch-action: none;
        -webkit-overflow-scrolling: auto;
    }

    /* Chat as bottom-sheet popup */
    .uwk2-window {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        width: 100%;
        max-width: 100vw;
        height: 70vh;
        max-height: 70vh;
        height: 70dvh;
        max-height: 70dvh;
        border-radius: 16px 16px 0 0;
        margin: 0;
        padding: 0;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding-bottom: env(safe-area-inset-bottom, 0);
        font-size: 14px;
        overflow: hidden;
    }

    .uwk2-window--hidden {
        transform: translateY(100%);
    }

    .uwk2-window--visible {
        transform: translateY(0);
    }

    /* Launcher higher for mobile nav bar */
    .uwk2-launcher {
        bottom: 80px;
        right: 15px;
        width: 58px;
        height: 58px;
        margin-bottom: env(safe-area-inset-bottom, 0);
    }

    .uwk2-launcher svg {
        width: 28px;
        height: 28px;
    }

    /* Header */
    .uwk2-header {
        padding: 12px 14px;
        border-radius: 16px 16px 0 0;
        flex-shrink: 0;
    }

    .uwk2-header__avatar {
        width: 34px;
        height: 34px;
    }

    .uwk2-header__avatar svg {
        width: 20px;
        height: 20px;
    }

    .uwk2-header__title {
        font-size: 15px;
    }

    .uwk2-header__status {
        font-size: 11px;
    }

    .uwk2-header__reset,
    .uwk2-header__close {
        padding: 8px;
        min-width: 40px;
        min-height: 40px;
    }

    .uwk2-header__reset svg,
    .uwk2-header__close svg {
        width: 20px;
        height: 20px;
    }

    /* Messages */
    .uwk2-messages {
        padding: 10px;
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        word-break: break-word;
    }

    .uwk2-message {
        max-width: 88%;
    }

    .uwk2-message__bubble {
        padding: 10px 12px;
        font-size: 13px;
        line-height: 1.4;
        word-break: break-word;
    }

    /* Suggestions */
    .uwk2-suggestions {
        gap: 6px;
    }

    .uwk2-suggestion-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Start buttons */
    .uwk2-start-btn {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* Input area */
    .uwk2-input-area {
        padding: 8px 10px;
        padding-bottom: max(8px, calc(env(safe-area-inset-bottom, 0px) + 6px));
        flex-shrink: 0;
    }

    .uwk2-textarea {
        padding: 10px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
        min-height: 40px;
        max-height: 80px;
    }

    .uwk2-send-btn {
        width: 44px;
        height: 44px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .uwk2-send-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Product cards */
    .uwk2-product-card {
        max-width: 100%;
        padding: 8px;
    }

    .uwk2-product-card img {
        width: 50px;
        height: 50px;
    }

    .uwk2-product-name {
        font-size: 13px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .uwk2-product-price {
        font-size: 14px;
    }

    .uwk2-product-arrow {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    /* GDPR compact */
    .uwk2-gdpr {
        padding: 5px 10px;
        font-size: 9px;
        gap: 3px;
    }
}

/* ==========================================
   RESPONSIVE — Small Smartphones
   ========================================== */

@media (max-width: 360px) {
    .uwk2-window {
        height: 65vh;
        max-height: 65vh;
        height: 65dvh;
        max-height: 65dvh;
    }

    .uwk2-header {
        padding: 10px;
        gap: 8px;
    }

    .uwk2-header__avatar {
        width: 30px;
        height: 30px;
    }

    .uwk2-header__title {
        font-size: 14px;
    }

    .uwk2-message__bubble {
        padding: 8px 10px;
        font-size: 13px;
    }

    .uwk2-product-card img {
        width: 44px;
        height: 44px;
    }

    .uwk2-textarea {
        padding: 8px 12px;
        min-height: 36px;
        font-size: 16px;
    }

    .uwk2-send-btn {
        width: 38px;
        height: 38px;
    }
}

/* ==========================================
   RESPONSIVE — Landscape Mobile
   ========================================== */

@media (max-width: 812px) and (orientation: landscape) {
    .uwk2-window {
        height: 100%;
        max-height: 100vh;
    }

    .uwk2-header {
        padding: 10px 16px;
    }

    .uwk2-messages {
        padding: 8px 12px;
    }

    .uwk2-message__bubble {
        padding: 10px 14px;
    }
}
