/* Chat page */
#chat-1 {
    overflow: hidden;
}

#n8n-chat-container {
    --chat--color--primary: #ff7f01;
    --chat--color--primary-shade-50: #e46f00;
    --chat--color--primary--shade-100: #c95f00;
    --chat--color--secondary: #ff9f4a;
    --chat--color-secondary-shade-50: #f08f36;
    --chat--color-dark: #1f2937;
    --chat--color-light: #f7f4ef;
    --chat--color-light-shade-50: #ebe4da;
    --chat--color-light-shade-100: #d8cec1;
    --chat--color-medium: #c8bfb2;
    --chat--message--bot--background: #ffffff;
    --chat--message--bot--color: #1f2937;
    --chat--message--user--background: #fff1e2;
    --chat--message--user--color: #7a3d00;
    --chat--button--background--primary: #ff7f01;
    --chat--button--background--primary--hover: #e46f00;
    --chat--button--background--primary--disabled: #f6c089;
    --chat--input--send--button--background: #f1f1f1;
    --chat--input--send--button--color: #ff7f01;
    --chat--input--send--button--background-hover: #ff7f01;
    --chat--input--send--button--color-hover: #ffffff;
    --chat--input--file--button--color: #ff7f01;
    --chat--input--file--button--color-hover: #c95f00;
    --chat--body--background: #fbf8f4;
    --chat--footer--background: #fbf8f4;
    --chat--window--bottom: 0;
    --chat--window--right: 0;
    --chat--window--margin-bottom: 0;
    --chat--header--padding: 10px 14px;
    --chat--message--font-size: 0.82rem;
    --chat--input--font-size: 0.82rem;
    --chat--button--font-size: 0.82rem;
    position: fixed !important;
    right: 20px;
    bottom: 0;
    width: min(420px, calc(100vw - 24px));
    height: min(700px, 100vh);
    min-width: 280px;
    min-height: 420px;
    padding: 0 8px 0;
    box-sizing: border-box;
    overflow: visible !important;
    z-index: 2147483647 !important;
    font-size: 1rem;
}

#n8n-chat-container .chat-window-wrapper,
#n8n-chat-container .n8n-chat {
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
    position: relative !important;
    z-index: 2147483647 !important;
}

#n8n-chat-container .chat-window-wrapper {
    width: 100% !important;
    height: 100% !important;
    bottom: 0 !important;
    right: 0 !important;
    justify-content: flex-end !important;
    align-items: flex-end !important;
}

#n8n-chat-container .chat-window {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    position: relative !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
    border: 1px solid #e0e0e0;
    border-bottom: none;
    overflow: hidden !important;
    z-index: 2147483647 !important;
}

#n8n-chat-container .chat-window-wrapper .chat-window-toggle {
    margin-top: 0 !important;
    margin-left: 0 !important;
    margin-bottom: 24px !important;
}

#n8n-chat-container .chat-window-wrapper:has(.chat-window:not([style*="display: none"])) .chat-window-toggle {
    display: none !important;
}

#n8n-chat-container textarea,
#n8n-chat-container input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    resize: none !important;
}

#n8n-chat-container .chat-window-toggle,
#n8n-chat-container .chat-header {
    background-color: #ff7f01;
}

#n8n-chat-container .chat-header {
    min-height: auto;
}

#n8n-chat-container .chat-header h1 {
    margin: 0;
    padding: 0 !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-align: left !important;
}

#n8n-chat-container .chat-header p {
    display: none !important;
}

#n8n-chat-container .chat-close-button {
    color: #fff;
    padding: 6px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
    cursor: pointer !important;
    pointer-events: auto !important;
    position: relative;
    z-index: 2;
}

#n8n-chat-container .chat-close-button svg {
    width: 18px;
    height: 18px;
}

#n8n-chat-container .chat-close-button:hover {
    background-color: rgba(0, 0, 0, 0.28);
    transform: scale(1.05);
}

#n8n-chat-container .chat-close-button:active {
    transform: scale(0.96);
}

#n8n-chat-container .chat-messages-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#n8n-chat-container .chat-message {
    max-width: 82%;
    padding: 10px 12px 22px;
    border-radius: 16px;
    font-size: 14px;
    text-align: left !important;
}

#n8n-chat-container .chat-message p,
#n8n-chat-container .chat-message li,
#n8n-chat-container .chat-message .chat-message-markdown span,
#n8n-chat-container .chat-message .chat-message-markdown,
#n8n-chat-container .chat-message .chat-message-markdown *,
#n8n-chat-container textarea,
#n8n-chat-container input[type="text"],
#n8n-chat-container .chat-button,
#n8n-chat-container .chat-layout,
#n8n-chat-container .chat-body,
#n8n-chat-container .chat-footer {
    font-size: 14px !important;
    line-height: 1.4;
    text-align: left !important;
}

#n8n-chat-container .chat-message + .chat-message {
    margin-top: 0;
}

#n8n-chat-container .chat-message.chat-message-from-user {
    margin-left: auto;
    margin-right: 0;
    border-bottom-right-radius: 4px;
}

#n8n-chat-container .chat-message.chat-message-from-bot {
    margin-left: 0;
    margin-right: auto;
    border-bottom-left-radius: 4px;
}

#n8n-chat-container .chat-message-time {
    font-size: 11px;
    line-height: 1;
    opacity: 0.7;
    position: absolute;
    right: 10px;
    bottom: 6px;
}

#n8n-chat-container button[type="submit"] {
    background: #f1f1f1 !important;
    color: #ff7f01 !important;
    transition: background-color 0.2s ease, color 0.2s ease;
}

#n8n-chat-container button[type="submit"]:hover,
#n8n-chat-container button[type="submit"]:focus-visible {
    background: #ff7f01 !important;
    color: #ffffff !important;
}

#n8n-chat-container button[type="submit"] svg,
#n8n-chat-container button[type="submit"] svg path {
    color: currentColor !important;
    fill: currentColor !important;
    stroke: currentColor !important;
}

#n8n-chat-container .chat-powered-by {
    display: none !important;
}

.lang-switcher {
    display: inline-flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 24px;
}

.lang-switcher button {
    background: none;
    border: none;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: #666;
    transition: background 0.2s, color 0.2s;
}

.lang-switcher button.active {
    background: var(--color-theme, #6a4dff);
    color: #fff;
}

.lang-switcher button:not(.active):hover {
    background: #f4f4f4;
}
