#fourr-chat-widget {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 999999;
    font-family: Arial, Helvetica, sans-serif;
}

.fourr-chat-window {
    box-sizing: border-box;
    width: 400px;
    max-width: calc(100vw - 30px);
    height: 520px;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.fourr-chat-header {
    background: #07507f;
    color: #fff;
    padding: 17px 18px 14px;
}

.fourr-chat-title {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 4px;
}

.fourr-chat-subtitle {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.95;
}

.fourr-chat-body {
    box-sizing: border-box;
    min-width: 0;
    line-height: 1.25;
    min-height: 0;
    padding: 16px;
    overflow-y: auto;
    flex: 1;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.fourr-chat-body::-webkit-scrollbar {
    display: none;
}


.fourr-chat-message {
    border-radius: 10px;
    padding: 11px 13px;
    font-size: 13px;
    line-height: 1.45;
    color: #123b59;
}

.fourr-chat-welcome {
    border: 1px solid #d6e2ea;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    margin-bottom: 12px;
}

.fourr-chat-info {
    background: #eaf6fc;
    border: 1px solid #d4e8f2;
    margin-top: 12px;
}

.fourr-chat-actions {
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.fourr-chat-actions button {
    box-sizing: border-box;
    min-width: 0;
    line-height: normal;
    min-height: 38px;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 1px solid #c8dce9;
    border-radius: 7px;
    color: #073d63;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fourr-chat-actions button:hover {
    background: #f0f8fc;
    border-color: #1685d4;
}

.fourr-chat-human {
    width: 100%;
    margin-top: 12px;
    padding: 10px;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border: 1px solid #1685d4;
    border-radius: 7px;
    color: #07507f;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.fourr-chat-human:hover {
    background: #f0f8fc;
}

.fourr-chat-human span {
    margin-right: 5px;
}

#fourr-chat-messages {
    margin-top: 10px;
}

.fourr-chat-user-message {
    margin: 8px 0;
    margin-left: 35px;
    padding: 9px 11px;
    background: #087fd3;
    color: #fff;
    border-radius: 10px 10px 3px 10px;
    font-size: 13px;
    line-height: 1.4;
}

.fourr-chat-system-message {
    margin: 8px 35px 8px 0;
    padding: 9px 11px;
    background: #eef5f9;
    color: #123b59;
    border-radius: 10px 10px 10px 3px;
    font-size: 13px;
    line-height: 1.4;
}

.fourr-chat-input-area {
    display: flex;
    gap: 8px;
    padding: 10px 12px 12px;
    background: #fff;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-top: 1px solid #e5e5e5;
}

#fourr-chat-input {
    min-width: 0;
    line-height: 1.25;
    flex: 1;
    height: 39px;
    border: 1px solid #cbd8e0;
    border-radius: 7px;
    padding: 0 12px;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

#fourr-chat-input:focus {
    border-color: #1685d4;
}

#fourr-chat-send {
    width: 70px;
    height: 39px;
    border: 0;
    border-radius: 7px;
    background: #087fd3;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

#fourr-chat-send:hover {
    background: #066db7;
}

#fourr-chat-toggle {
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: #087fd3;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.22);
    cursor: pointer;
    float: right;
    font-size: 29px;
    line-height: 58px;
    padding: 0;
}

#fourr-chat-toggle span {
    display: block;
    transform: translateY(-1px);
}

.fourr-chat-hidden .fourr-chat-window {
    display: none;
}

@media (max-width: 600px) {

    #fourr-chat-widget {
        right: 12px;
        bottom: 12px;
    }

    .fourr-chat-window {
        width: calc(100vw - 24px);
        max-width: none;
        height: min(600px, calc(100vh - 90px));
    }

    #fourr-chat-toggle {
        width: 54px;
        height: 54px;
        line-height: 54px;
    }
}

/* =========================================================
 * 4R HUMAN REPRESENTATIVE FORM
 * ========================================================= */

.fourr-chat-human-form {
    margin-top: 12px;
    padding: 13px;
    background: #f7fafc;
    border: 1px solid #d6e2ea;
    border-radius: 10px;
}

.fourr-chat-human-form-title {
    color: #07507f;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 4px;
}

.fourr-chat-human-form-subtitle {
    color: #5d7180;
    font-size: 11px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.fourr-chat-human-form label {
    display: block;
    margin: 8px 0 4px;
    color: #123b59;
    font-size: 11px;
    font-weight: 700;
}

.fourr-chat-human-form label span {
    color: #d33;
}

.fourr-chat-human-form input,
.fourr-chat-human-form textarea {
    box-sizing: border-box;
    width: 100%;
    border: 1px solid #cbd8e0;
    border-radius: 6px;
    background: #fff;
    color: #123b59;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 12px;
    outline: none;
}

.fourr-chat-human-form input {
    height: 34px;
    padding: 0 9px;
}

.fourr-chat-human-form textarea {
    min-height: 75px;
    padding: 8px 9px;
    resize: vertical;
}

.fourr-chat-human-form input:focus,
.fourr-chat-human-form textarea:focus {
    border-color: #1685d4;
}

.fourr-chat-human-form-actions {
    display: flex;
    gap: 7px;
    margin-top: 12px;
}

.fourr-chat-human-form-actions button {
    box-sizing: border-box;
    flex: 1;
    min-height: 36px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 800;
    cursor: pointer;
}

#fourr-human-back {
    background: #fff;
    border: 1px solid #c8dce9;
    color: #07507f;
}

#fourr-human-back:hover {
    background: #f0f8fc;
}

#fourr-human-submit {
    border: 1px solid #087fd3;
    background: #087fd3;
    color: #fff;
}

#fourr-human-submit:hover:not(:disabled) {
    background: #066db7;
}

#fourr-human-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.fourr-chat-human-form-status {
    margin-top: 9px;
    font-size: 11px;
    line-height: 1.4;
    color: #123b59;
}


/* Keep the native Tawk launcher hidden.
   The 4R Assistant is the only visible chat launcher. */
button.tawk-button[aria-label="Chat widget"] {
    display: none !important;
}
