
:root {
    --hr-navy: #17233f;
    --hr-blue: #243b72;
    --hr-blue-2: #1c2e58;
    --hr-magenta: #da1e6a;
    --hr-orange: #f69433;
    --hr-cyan: #1c9fd7;
    --hr-green: #27c98b;
    --hr-bg: #f7f9fc;
    --hr-border: #e1e6ef;
    --hr-text: #17233f;
    --hr-muted: #71809a;
}

.hr-rag-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999999;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.hr-rag-launcher {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(145deg, var(--hr-blue), var(--hr-navy));
    box-shadow:
        0 12px 30px rgba(23, 35, 63, .28),
        0 0 0 1px rgba(255,255,255,.25);
    transition: transform .2s ease, box-shadow .2s ease;
}

.hr-rag-launcher::after {
    content: "";
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--hr-magenta), var(--hr-orange), var(--hr-cyan));
    z-index: -1;
    opacity: .8;
    filter: blur(7px);
}

.hr-rag-launcher:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 16px 34px rgba(23, 35, 63, .34);
}

.hr-rag-launcher img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.hr-rag-panel {
    position: absolute;
    right: 0;
    bottom: 0;
    width: min(390px, calc(100vw - 32px));
    height: min(620px, calc(100vh - 48px));
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(.97);
    transform-origin: bottom right;
    transition:
        opacity .2s ease,
        transform .2s ease,
        visibility .2s ease;
    pointer-events: none;
}

.hr-rag-widget.is-open .hr-rag-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.hr-rag-widget.is-open .hr-rag-launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(.8);
}

.hr-rag-card {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 24px;
    background: #fff;
    border: 1px solid rgba(23, 35, 63, .10);
    box-shadow: 0 24px 70px rgba(23, 35, 63, .24);
    display: flex;
    flex-direction: column;
}

.hr-rag-header {
    min-height: 82px;
    padding: 16px 16px 15px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: #fff;
    background:
        linear-gradient(135deg, var(--hr-navy) 0%, var(--hr-blue) 70%, #294889 100%);
    position: relative;
}

.hr-rag-header::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    background: linear-gradient(
        90deg,
        var(--hr-magenta),
        var(--hr-orange),
        var(--hr-cyan)
    );
}

.hr-rag-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.hr-rag-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    border-radius: 14px;
    background: rgba(255,255,255,.13);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hr-rag-avatar img {
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.hr-rag-title {
    font-size: 17px;
    line-height: 1.2;
    font-weight: 700;
    white-space: nowrap;
}

.hr-rag-status {
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(255,255,255,.82);
}

.hr-rag-status span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--hr-green);
    box-shadow: 0 0 0 4px rgba(39,201,139,.13);
}

.hr-rag-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.hr-rag-clear,
.hr-rag-close {
    border: 0;
    cursor: pointer;
    color: rgba(255,255,255,.92);
    background: transparent;
    font: inherit;
}

.hr-rag-clear {
    padding: 8px 7px;
    font-size: 13px;
}

.hr-rag-clear:hover {
    color: #fff;
}

.hr-rag-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    line-height: 1;
    background: rgba(255,255,255,.10);
}

.hr-rag-close:hover {
    background: rgba(255,255,255,.18);
}

.hr-rag-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 14px 14px;
    background:
        radial-gradient(circle at 100% 0%, rgba(218,30,106,.035), transparent 34%),
        var(--hr-bg);
    scroll-behavior: smooth;
}

.hr-rag-message {
    display: flex;
    margin: 0 0 14px;
}

.hr-rag-bot {
    justify-content: flex-start;
}

.hr-rag-user {
    justify-content: flex-end;
}

.hr-rag-bubble {
    max-width: 88%;
    padding: 12px 14px;
    border-radius: 15px 15px 15px 5px;
    border: 1px solid var(--hr-border);
    background: #fff;
    color: var(--hr-text);
    font-size: 14px;
    line-height: 1.55;
    box-shadow: 0 2px 8px rgba(23,35,63,.035);
    overflow-wrap: anywhere;
}

.hr-rag-user .hr-rag-bubble {
    border: 0;
    border-radius: 15px 15px 5px 15px;
    color: #fff;
    background: linear-gradient(135deg, var(--hr-blue), #304c8d);
    box-shadow: 0 7px 18px rgba(36,59,114,.18);
}

.hr-rag-typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-width: 52px;
}

.hr-rag-typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #8a97ad;
    animation: hr-rag-bounce 1s infinite ease-in-out;
}

.hr-rag-typing span:nth-child(2) { animation-delay: .15s; }
.hr-rag-typing span:nth-child(3) { animation-delay: .30s; }

@keyframes hr-rag-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: .55; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.hr-rag-suggestions {
    flex: 0 0 auto;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 14px 8px;
    background: #fff;
    scrollbar-width: none;
}

.hr-rag-suggestions::-webkit-scrollbar {
    display: none;
}

.hr-rag-suggestions button {
    flex: 0 0 auto;
    padding: 8px 12px;
    border: 1px solid #dce3ee;
    border-radius: 999px;
    background: #fff;
    color: var(--hr-blue);
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: all .18s ease;
}

.hr-rag-suggestions button:hover {
    border-color: var(--hr-cyan);
    color: var(--hr-blue);
    box-shadow: 0 3px 10px rgba(28,159,215,.10);
}

.hr-rag-form {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 14px 10px;
    background: #fff;
}

.hr-rag-input {
    width: 100%;
    min-height: 52px;
    max-height: 120px;
    resize: none;
    box-sizing: border-box;
    padding: 14px 15px;
    border: 1px solid #dce3ee;
    border-radius: 15px;
    outline: none;
    background: #f8fafc;
    color: var(--hr-text);
    font: inherit;
    font-size: 14px;
    line-height: 1.35;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.hr-rag-input:focus {
    background: #fff;
    border-color: var(--hr-cyan);
    box-shadow: 0 0 0 3px rgba(28,159,215,.10);
}

.hr-rag-send {
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
    border: 0;
    border-radius: 15px;
    cursor: pointer;
    color: #fff;
    background: linear-gradient(135deg, var(--hr-blue), #2d4c8e);
    box-shadow: 0 7px 16px rgba(36,59,114,.20);
    font-size: 22px;
    transition: transform .18s ease, box-shadow .18s ease;
}

.hr-rag-send:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 20px rgba(36,59,114,.26);
}

.hr-rag-send:disabled {
    cursor: not-allowed;
    opacity: .6;
    transform: none;
}

.hr-rag-footer {
    flex: 0 0 auto;
    padding: 0 14px 12px;
    text-align: center;
    color: #8a97ad;
    font-size: 10px;
    line-height: 1.4;
    background: #fff;
}

.screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 600px) {
    .hr-rag-widget {
        right: 14px;
        bottom: 14px;
    }

    .hr-rag-launcher {
        width: 58px;
        height: 58px;
    }

    .hr-rag-launcher img {
        width: 34px;
        height: 34px;
    }

    .hr-rag-panel {
        width: min(390px, calc(100vw - 20px));
        height: min(650px, calc(100vh - 28px));
    }

    .hr-rag-card {
        border-radius: 20px;
    }

    .hr-rag-header {
        min-height: 76px;
    }
}
