﻿        /* Floating chat button */
        #plcbotBtn {
            position: fixed; bottom: 24px; right: 24px; z-index: 9000;
            width: 52px; height: 52px; border-radius: 50%;
            background: #0062cc; color: #fff; font-size: 24px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.25);
            transition: background .2s, transform .15s;
            user-select: none;
        }
        #plcbotBtn:hover { background: #004fa3; transform: scale(1.08); }
        #plcAiCornerBadge {
            position: absolute; top: -6px; right: -6px;
            background: linear-gradient(135deg, #7c3aed, #2563eb);
            color: #fff; font-size: 9px; font-weight: 800;
            padding: 2px 6px; border-radius: 6px;
            border: 1.5px solid #fff; letter-spacing: 0.5px;
            pointer-events: none;
            animation: plcBadgePulse 2.5s infinite;
            white-space: nowrap;
        }
        @keyframes plcBadgePulse {
            0%, 100% { transform: scale(1);    opacity: 1;   }
            50%      { transform: scale(1.12); opacity: .85; }
        }

        /* Chat panel */
        #plcbotPanel {
            position: fixed; bottom: 84px; right: 24px; z-index: 9001;
            width: 420px; max-height: 620px;
            background: #fff; border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,.18);
            display: none; flex-direction: column;
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            font-size: 13px; overflow: hidden;
        }

        /* Header */
        #plcbotHeader {
            background: linear-gradient(135deg, #0062cc 0%, #004fa3 100%);
            color: #fff; padding: 12px 16px;
            display: flex; align-items: center;
            justify-content: space-between;
            flex-shrink: 0;
            box-shadow: 0 2px 10px rgba(0,98,204,.3);
        }
        #plcbotOrgLabel {
            font-size: 14px; font-weight: 600; flex: 1;
            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
            display: flex; align-items: center; gap: 5px; margin-left: 6px;
        }
        #plcbotHeader .plcbot-title {
            font-weight: 600; font-size: 14px;
        }
        .plcbot-icon-btn {
            background: none; border: none; color: rgba(255,255,255,.8);
            font-size: 16px; cursor: pointer; padding: 2px 5px; border-radius: 4px;
            line-height: 1;
        }
        .plcbot-icon-btn:hover { color: #fff; background: rgba(255,255,255,.15); }

        /* FAQ chip bar — hidden on login page (only one FAQ chip, not useful) */
        #plcbotChipBar { display: none; }
        .plcbot-chip {
            padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600;
            border: 1.5px solid #0062cc; color: #0062cc; cursor: pointer;
            background: #fff; user-select: none; transition: all .15s;
            white-space: nowrap;
        }
        .plcbot-chip:hover  { background: #e8f0fe; border-color: #004fa3; color: #004fa3; }
        .plcbot-chip.active { background: #0062cc; color: #fff; border-color: #0062cc; }

        /* Messages */
        #plcbotMessages {
            flex: 1; overflow-y: auto; padding: 14px;
            display: flex; flex-direction: column; gap: 10px;
            min-height: 320px;
        }
        .plcbot-msg {
            max-width: 85%; padding: 8px 12px; border-radius: 12px;
            line-height: 1.45; word-break: break-word; font-size: 12.5px;
        }
        .plcbot-msg-user {
            background: #0062cc; color: #fff; align-self: flex-end;
            border-bottom-right-radius: 4px; white-space: pre-wrap;
        }
        .plcbot-msg-bot {
            background: #f0f4ff; color: #212529; align-self: flex-start;
            border-bottom-left-radius: 4px; white-space: normal;
        }

        /* Rich bot message formatting (same as WorkItemListing chatbot) */
        .plcbot-msg-bot .cbot-para  { margin: 0 0 4px 0; }
        .plcbot-msg-bot .cbot-spacer { height: 6px; }
        .plcbot-msg-bot .cbot-hr    { border: none; border-top: 1px solid #dee2e6; margin: 6px 0; }
        .plcbot-msg-bot .cbot-list  { margin: 4px 0 4px 18px; padding: 0; }
        .plcbot-msg-bot .cbot-list li { margin-bottom: 2px; }
        .plcbot-msg-bot .cbot-table-wrap { overflow-x: auto; margin: 6px 0; border-radius: 6px; }
        .plcbot-msg-bot .cbot-table { width: 100%; border-collapse: collapse; font-size: 12px; }
        .plcbot-msg-bot .cbot-table th {
            background: #0062cc; color: #fff; padding: 6px 10px;
            text-align: left; font-weight: 600; white-space: nowrap;
        }
        .plcbot-msg-bot .cbot-table td {
            padding: 5px 10px; border-bottom: 1px solid #e9ecef;
            color: #343a40; vertical-align: top;
        }
        .plcbot-msg-bot .cbot-table tbody tr:nth-child(even) td { background: #f0f4ff; }
        .plcbot-msg-bot .cbot-table tbody tr:hover td { background: #e8f0fe; }
        .plcbot-msg-bot .cbot-kpi-card {
            text-align: center; padding: 10px 6px;
        }
        .plcbot-msg-bot .cbot-kpi-value {
            font-size: 28px; font-weight: 800; color: #0062cc; line-height: 1.1;
        }
        .plcbot-msg-bot .cbot-kpi-label {
            font-size: 12px; color: #6c757d; margin-top: 4px;
        }

        /* Typing indicator */
        .plcbot-msg-typing {
            background: #f0f4ff; align-self: flex-start;
            padding: 10px 14px; border-radius: 12px; border-bottom-left-radius: 4px;
            display: flex; gap: 4px; align-items: center;
        }
        .plcbot-typing-dot {
            width: 7px; height: 7px; background: #6c757d; border-radius: 50%;
            animation: plcbotTypingBounce 1s infinite;
        }
        .plcbot-typing-dot:nth-child(2) { animation-delay: .2s; }
        .plcbot-typing-dot:nth-child(3) { animation-delay: .4s; }
        @keyframes plcbotTypingBounce {
            0%,60%,100% { transform: translateY(0); opacity: .6; }
            30%          { transform: translateY(-5px); opacity: 1; }
        }

        /* Input area */
        #plcbotInputArea {
            display: flex; gap: 6px; padding: 10px 12px;
            border-top: 1px solid #dee2e6; flex-shrink: 0; background: #fff;
        }
        #plcbotInput {
            flex: 1; padding: 7px 10px; border: 1px solid #ced4da;
            border-radius: 6px; font-size: 12.5px; outline: none;
            transition: border-color .15s;
        }
        #plcbotInput:focus { border-color: #0062cc; }
        #plcbotSend {
            padding: 7px 14px; background: #0062cc; color: #fff;
            border: none; border-radius: 6px; cursor: pointer;
            font-size: 12.5px; font-weight: 600; transition: background .15s;
        }
        #plcbotSend:hover     { background: #004fa3; }
        #plcbotSend:disabled  { background: #6c9ed6; cursor: not-allowed; }
