
#tomcar-chat-toggle {
    position: fixed;
    right: 22px;
    bottom: 22px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: #1763d1;
    color: white;
    font-size: 27px;
    cursor: pointer;
    z-index: 999998;
    box-shadow: 0 4px 16px rgba(0,0,0,.2);
}

#tomcar-chat-panel {
    position: fixed;
    right: 22px;
    bottom: 94px;
    width: 370px;
    height: 520px;
    max-height: calc(100dvh - 120px);
    background: white;
    color: #202124;
    border: 1px solid #ddd;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 35px rgba(0,0,0,.2);
    z-index: 999999;
    flex-direction: column;
    font-family: Arial, sans-serif;
}

#tomcar-chat-panel:not([hidden]) {
    display: flex;
}

#tomcar-chat-panel[hidden] {
    display: none !important;
}

.tomcar-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #1763d1;
    color: white;
}

.tomcar-chat-header strong,
.tomcar-chat-header small {
    display: block;
}

.tomcar-chat-header small {
    font-size: 11px;
    margin-top: 4px;
}

#tomcar-chat-close {
    background: transparent;
    color: white;
    border: none;
    font-size: 30px;
    cursor: pointer;
    line-height: 1;
}

#tomcar-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tomcar-message {
    padding: 11px 13px;
    border-radius: 12px;
    max-width: 90%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.45;
}

.tomcar-bot {
    background: #f0f2f5;
    align-self: flex-start;
}

.tomcar-user {
    background: #1763d1;
    color: white;
    align-self: flex-end;
}

#tomcar-chat-form {
    display: flex;
    gap: 7px;
    padding: 10px;
    border-top: 1px solid #ddd;
}

#tomcar-chat-input {
    flex: 1;
    min-width: 0;
    border: 1px solid #bbb;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    background: white;
    color: #202124;
}

#tomcar-chat-form button {
    border: none;
    border-radius: 8px;
    background: #1763d1;
    color: white;
    padding: 10px;
    cursor: pointer;
}

#tomcar-chat-form button:disabled {
    opacity: .5;
    cursor: wait;
}

.tomcar-chat-note {
    margin: 0;
    padding: 5px 10px 10px;
    font-size: 10px;
    color: #555;
}

.tomcar-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    #tomcar-chat-panel {
        right: 10px;
        bottom: 85px;
        width: calc(100vw - 20px);
        height: min(520px, calc(100dvh - 105px));
    }

    #tomcar-chat-toggle {
        right: 15px;
        bottom: 15px;
    }
}

#tomcar-chat-booking {
    display: block;
    margin: 8px 10px;
    padding: 12px;
    background: #1763d1;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    font-weight: bold;
    border-radius: 8px;
}

#tomcar-chat-booking:hover {
    background: #104da8;
    color: white;
}
