:root {
    --chat-width: 370px;
    --chat-height: 560px;
    --border: #e5e7eb;
    --text: #111827;
    --muted: #6b7280;
    --bg: #ffffff;
    --user: #2563eb;
    --bot: #f3f4f6;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, sans-serif;
}

.page-hint {
    max-width: 640px;
    margin: 60px auto;
    padding: 0 20px;
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
}

.chatbot {
    position: fixed;
    right: 22px;
    bottom: 110px;
    z-index: 999999;
}

.chat-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    font-size: 25px;
    background: var(--user);
    color: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,.20);
    animation: chat-toggle-pulse 2s ease-in-out infinite;
}

@keyframes chat-toggle-pulse {
    0%, 100% {
        box-shadow: 0 8px 30px rgba(0,0,0,.20), 0 0 0 0 rgba(37,99,235,.55);
    }
    50% {
        box-shadow: 0 8px 30px rgba(0,0,0,.20), 0 0 0 12px rgba(37,99,235,0);
    }
}

.chat-panel {
    display: none;
    width: var(--chat-width);
    height: var(--chat-height);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 15px 50px rgba(0,0,0,.20);
    margin-bottom: -50px;
}

.chat-panel.open {
    display: flex;
    flex-direction: column;
}

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--user);
    color: #fff;
}

.chat-header small {
    display: block;
    opacity: .85;
    margin-top: 4px;
}

.icon-btn {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: #fafafa;
}

.message {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 12px;
    margin: 0 0 10px;
    white-space: pre-wrap;
    line-height: 1.45;
    font-size: 14px;
}

.message.user {
    margin-left: auto;
    background: var(--user);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message.bot {
    margin-right: auto;
    background: var(--bot);
    color: var(--text);
    border-bottom-left-radius: 4px;
}

.call-request-link {
    flex-shrink: 0;
    width: 100%;
    border: 0;
    border-top: 1px solid var(--border);
    background: #f0fdf4;
    color: #16a34a;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}

.call-request-link:hover {
    background: #16a34a;
    color: #fff;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.chat-form input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 11px 12px;
    outline: none;
}

.chat-form button {
    border: 0;
    border-radius: 10px;
    padding: 0 15px;
    background: var(--user);
    color: #fff;
    cursor: pointer;
}

.chat-form button:disabled {
    opacity: .6;
    cursor: wait;
}

@media (max-width: 480px) {
    .chatbot {
        right: 10px;
        bottom: 90px;
    }

    .chat-panel {
        width: calc(100vw - 20px);
        height: min(560px, calc(100vh - 90px));
    }
}

.call-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, .55);
    z-index: 9999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.call-overlay.open {
    display: flex;
}

.call-modal {
    width: 100%;
    max-width: 380px;
    background: var(--bg);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,.30);
}

.call-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    background: #16a34a;
    color: #fff;
}

.icon-btn-dark {
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

.call-form {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.call-form label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-top: 8px;
}

.call-form label:first-of-type {
    margin-top: 0;
}

.call-form input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
}

.call-form button {
    margin-top: 16px;
    border: 0;
    border-radius: 10px;
    padding: 11px 15px;
    background: #16a34a;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.call-form button:disabled {
    opacity: .6;
    cursor: wait;
}

.call-form-msg {
    font-size: 13px;
    padding: 8px 10px;
    border-radius: 8px;
    margin-top: 10px;
}

.call-form-msg.success {
    background: #dcfce7;
    color: #166534;
}

.call-form-msg.error {
    background: #fee2e2;
    color: #991b1b;
}
