:root {
    --ehs-blue: #1e63ac;
    --ehs-blue-dark: #164f8d;
    --ehs-navy: #0d2b4e;
    --ehs-green: #56b62b;
    --ehs-bg: #f6f8fb;
    --ehs-border: #e5e7eb;
    --ehs-text: #25364a;
    --ehs-muted: #7a8797;
    --ehs-shadow: 0 24px 70px rgba(13, 43, 78, 0.20);
}

.ehs-chat-overlay {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 9998;
    background: rgba(8, 24, 43, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility .3s ease;
}

.ehs-chat-overlay.active {
    opacity: 1;
    visibility: visible;
}

.ehs-chat-launcher {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9998;
    height: 64px;
    width: 64px;
    padding: 7px;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    border: none;
    border-radius: 32px 0 0 32px;
    background: #1e6db8;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 35px rgba(30, 99, 172, 0.28);
    transition: width .35s cubic-bezier(.4, 0, .2, 1), box-shadow .3s ease;
}


/* Expanded state */

.ehs-chat-launcher:hover {
    width: 165px;
    box-shadow: 0 15px 40px rgba(30, 99, 172, 0.38);
}


/* White icon */

.ehs-launcher-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #fff;
    color: #1e6db8;
    font-size: 20px;
    flex-shrink: 0;
    position: relative;
    z-index: 2;
}


/* Label hidden initially */

.ehs-launcher-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(12px);
    transition: opacity .2s ease .08s, transform .3s ease .05s;
}


/* Reveal after launcher expands */

.ehs-chat-launcher:hover .ehs-launcher-label {
    opacity: 1;
    transform: translateX(0);
}

.ehs-launcher-pulse {
    position: absolute;
    left: 8px;
    top: 8px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
    animation: ehsPulse 2s infinite;
}

@keyframes ehsPulse {
    0% {
        transform: scale(.8);
        opacity: .7;
    }
    70% {
        transform: scale(1.45);
        opacity: 0;
    }
    100% {
        transform: scale(1.45);
        opacity: 0;
    }
}

.ehs-chatbot {
    position: fixed;
    inset: 0;
    margin: auto;
    width: 420px;
    height: min(680px, calc(100vh - 135px));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(13, 43, 78, .08);
    border-radius: 22px;
    box-shadow: var(--ehs-shadow);
    opacity: 0;
    visibility: hidden;
    transform: scale(.94);
    transition: opacity .25s ease, visibility .25s ease, transform .25s ease;
}

.ehs-chatbot.ehs-chat-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.ehs-chat-header {
    flex-shrink: 0;
    min-height: 76px;
    padding: 14px 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient( 135deg, #0d2b4e 0%, #1e63ac 100%);
    color: #fff;
}

.ehs-chat-header-left {
    display: flex;
    align-items: center;
    gap: 11px;
}

.ehs-bot-avatar {
    width: 43px;
    height: 43px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .15);
    font-size: 18px;
}

.ehs-chat-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.3;
}

.ehs-chat-status {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: rgba(255, 255, 255, .72);
}

.ehs-online-dot {
    width: 7px;
    height: 7px;
    display: inline-block;
    border-radius: 50%;
    background: #7ee45a;
    box-shadow: 0 0 0 3px rgba(126, 228, 90, .15);
}

.ehs-chat-close {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(255, 255, 255, .8);
    font-size: 16px;
    transition: background .2s ease, color .2s ease;
}

.ehs-chat-close:hover {
    background: rgba(255, 255, 255, .1);
    color: #fff;
}

.ehs-progress-wrapper {
    flex-shrink: 0;
    padding: 10px 17px 11px;
    background: #fff;
    border-bottom: 1px solid var(--ehs-border);
}

.ehs-progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .7px;
    text-transform: uppercase;
    color: var(--ehs-muted);
}

.ehs-progress-track {
    width: 100%;
    height: 4px;
    overflow: hidden;
    border-radius: 10px;
    background: #edf0f4;
}

.ehs-progress-bar {
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient( 90deg, var(--ehs-blue), var(--ehs-green));
    transition: width .45s ease;
}

.ehs-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 25px;
    background: var(--ehs-bg);
    scroll-behavior: smooth;
}

.ehs-chat-body::-webkit-scrollbar {
    width: 5px;
}

.ehs-chat-body::-webkit-scrollbar-track {
    background: transparent;
}

.ehs-chat-body::-webkit-scrollbar-thumb {
    background: #ccd3dc;
    border-radius: 20px;
}

.ehs-message-row {
    width: 100%;
    display: flex;
    margin-bottom: 14px;
    animation: ehsMessageIn .3s ease both;
}

.ehs-message-row.bot {
    justify-content: flex-start;
    align-items: flex-end;
    gap: 7px;
}

.ehs-message-row.user {
    justify-content: flex-end;
}

@keyframes ehsMessageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ehs-message-avatar {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: var(--ehs-navy);
    color: #fff;
    font-size: 11px;
}

.ehs-message-bubble {
    max-width: 82%;
    padding: 11px 13px;
    font-size: 12px;
    line-height: 1.55;
}

.ehs-message-row.bot .ehs-message-bubble {
    background: #fff;
    color: var(--ehs-text);
    border: 1px solid #e8ebef;
    border-radius: 15px 15px 15px 4px;
    box-shadow: 0 2px 8px rgba(13, 43, 78, .04);
}

.ehs-message-row.user .ehs-message-bubble {
    background: var(--ehs-blue);
    color: #fff;
    border-radius: 15px 15px 4px 15px;
}

.ehs-bot-question {
    font-weight: 600;
    color: var(--ehs-navy);
}

.ehs-options-wrapper {
    margin: -3px 0 18px 35px;
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    animation: ehsMessageIn .3s ease both;
}

.ehs-option-btn {
    border: 1px solid #dce2e8;
    background: #fff;
    color: var(--ehs-navy);
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    transition: background .2s ease, border .2s ease, color .2s ease, transform .2s ease;
}

.ehs-option-btn:hover {
    background: #edf5fc;
    border-color: var(--ehs-blue);
    color: var(--ehs-blue);
    transform: translateY(-1px);
}

.ehs-option-btn.ehs-option-selected {
    background: #eaf6e5;
    border-color: var(--ehs-green);
    color: #34851a;
}

.ehs-option-btn:disabled {
    cursor: default;
    opacity: .48;
    transform: none;
}

.ehs-option-btn.ehs-option-selected:disabled {
    opacity: 1;
}

.ehs-multi-actions {
    width: 100%;
    margin-top: 5px;
}

.ehs-multi-counter {
    margin-bottom: 7px;
    font-size: 9px;
    font-weight: 600;
    color: var(--ehs-muted);
}

.ehs-multi-continue {
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    background: var(--ehs-green);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    transition: opacity .2s ease;
}

.ehs-multi-continue:disabled {
    background: #d5d9de;
    cursor: default;
}

.ehs-input-area {
    flex-shrink: 0;
    padding: 12px 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-top: 1px solid var(--ehs-border);
}

.ehs-input-area input {
    flex: 1;
    min-width: 0;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #dfe4e9;
    border-radius: 22px;
    background: #f7f9fb;
    outline: none;
    font-size: 12px;
    color: var(--ehs-text);
    transition: border .2s ease, background .2s ease;
}

.ehs-input-area input:focus {
    background: #fff;
    border-color: var(--ehs-blue);
}

.ehs-input-area input::placeholder {
    color: #a5adb8;
}

#ehs-send-btn {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--ehs-blue);
    color: #fff;
    font-size: 14px;
    transition: transform .2s ease, background .2s ease;
}

#ehs-send-btn:hover {
    transform: scale(1.04);
    background: var(--ehs-blue-dark);
}

.ehs-typing-wrapper {
    flex-shrink: 0;
    padding: 8px 16px 12px;
    display: flex;
    align-items: flex-end;
    gap: 7px;
    background: var(--ehs-bg);
}

.ehs-typing-bubble {
    height: 34px;
    padding: 0 13px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: #fff;
    border: 1px solid #e8ebef;
    border-radius: 14px 14px 14px 4px;
}

.ehs-typing-bubble span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #9aa5b1;
    animation: ehsTyping 1.2s infinite;
}

.ehs-typing-bubble span:nth-child(2) {
    animation-delay: .15s;
}

.ehs-typing-bubble span:nth-child(3) {
    animation-delay: .3s;
}

@keyframes ehsTyping {
    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .45;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

.ehs-analysis-card {
    margin: 5px 0 17px 35px;
    padding: 16px;
    border-radius: 15px;
    background: linear-gradient( 135deg, #0d2b4e, #1e63ac);
    color: #fff;
    animation: ehsMessageIn .4s ease both;
}

.ehs-analysis-title {
    margin-bottom: 11px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255, 255, 255, .7);
}

.ehs-score-row {
    display: flex;
    gap: 10px;
}

.ehs-score-box {
    flex: 1;
    padding: 10px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .1);
}

.ehs-score-label {
    margin-bottom: 4px;
    font-size: 8px;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: rgba(255, 255, 255, .65);
}

.ehs-score-number {
    font-size: 22px;
    font-weight: 800;
}

.ehs-score-number small {
    font-size: 9px;
    opacity: .6;
}

.ehs-insight-box {
    margin-top: 11px;
    padding-top: 11px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    font-size: 10px;
    line-height: 1.6;
    color: rgba(255, 255, 255, .82);
}

.ehs-skip-wrapper {
    margin: -4px 0 15px 35px;
}

.ehs-skip-btn {
    padding: 6px 13px;
    border: 1px solid #dce2e8;
    border-radius: 18px;
    background: transparent;
    color: #7c8795;
    font-size: 9px;
    font-weight: 600;
}

.ehs-success-message {
    margin: 6px 0 15px 35px;
    padding: 14px;
    border-radius: 14px;
    background: #edf8e9;
    border: 1px solid #d7eccf;
    color: #397e22;
    font-size: 11px;
    line-height: 1.6;
    animation: ehsMessageIn .4s ease both;
}

@media (max-width: 575px) {
    .ehs-launcher-label {
        display: none;
    }
    .ehs-chat-launcher {
        right: 0;
        top: 58%;
        bottom: auto;
        width: 58px;
        height: 58px;
        padding: 6px;
        justify-content: center;
        border-radius: 18px 0 0 18px;
        transform: translateY(-50%);
    }
    .ehs-launcher-icon {
        width: 46px;
        height: 46px;
    }
    .ehs-chatbot {
        inset: 0;
        margin: auto;
        width: calc(100% - 24px);
        height: calc(100dvh - 40px);
        border-radius: 18px;
        transform: translate(-50%, -46%) scale(.96);
    }
    .ehs-chat-body {
        padding: 17px 12px 22px;
    }
    .ehs-message-bubble {
        max-width: 87%;
    }
    .ehs-options-wrapper {
        margin-left: 34px;
    }
}