.pp-chat-input-container {
    align-items: flex-end;
    flex-shrink: 0;
    min-height: 40px;
    max-height: 240px;
    overflow: visible;
    position: relative;
    padding-top: 16px;
    margin-top: auto;
}
.pp-drawer-chat-input {
    max-height: 200px;
    overflow-y: hidden;
    resize: none;
}
.pp-drawer-chat-input::-webkit-scrollbar {
    display: none;
}

.pp-drawer-chat {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 0;
}

.pp-chat-history-container {
    flex: 1 1 0;
    min-height: 120px;
    /* max-height: 50vh; */
    background: transparent;
    border: none;
    margin-bottom: 10px;
    overflow-y: auto;
    padding: 0;
    box-shadow: none;
}

/* Dark scrollbar for chat history container */
.pp-chat-history-container::-webkit-scrollbar {
    width: 8px;
    background: transparent;
}
.pp-chat-history-container::-webkit-scrollbar-thumb {
    background: #232323;
    border-radius: 4px;
}
.pp-chat-history-container::-webkit-scrollbar-thumb:hover {
    background: #444;
}
.pp-chat-history-container {
    scrollbar-width: thin;
    scrollbar-color: #232323 transparent;
}

/* Chat input container styles are consolidated above */

.pp-chat-history {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    padding: 0;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-bottom: 0.5rem;
    justify-content: flex-end;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
}
.pp-chat-history::-webkit-scrollbar {
    width: 6px;
    background: transparent;
}
.pp-chat-history::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 3px;
}
.pp-chat-history::-webkit-scrollbar-thumb:hover {
    background: #222;
}

.pp-chat-input-container {

    background: #323232;
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
    border: none;
    padding: 0.5rem 3.2rem 2rem 1rem;
    min-height: 40px;
    box-sizing: border-box;
    margin: 0;
}
.pp-drawer-chat-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: #fff;
    padding: 0;
    min-height: 24px;
    resize: none;
    line-height: 1.5;
    font-family: inherit;
    background: transparent;
    margin: 0;
    overflow-y: auto;
}
.pp-drawer-chat-input::placeholder {
    color: #aaa;
    opacity: 1;
}
.pp-drawer-chat-send {
    position: absolute;
    right: 0.3rem;
    bottom: 0.3rem;
    background: #232323;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.7;
    transition: background 0.2s, opacity 0.2s;
    padding: 0;
}
.pp-drawer-chat-send:disabled {
    opacity: 0.2;
    cursor: not-allowed;
}
.pp-drawer-chat-send:not(:disabled):hover, .pp-drawer-chat-send:not(:disabled):focus {
    background: #181818;
    opacity: 1;
}
.pp-drawer-chat-send svg {
    display: block;
    width: 18px;
    height: 18px;
    stroke: #fff;
}
.pp-rec-chat-separator {
    width: 100%;
    height: 1px;
    background: #333; /* semi-transparent dark */
    margin: 10px 0 18px 0;
    opacity: 0.5;
    border-radius: 1px;
}
/* Chat history styles are defined above - removed duplicate */
.pp-chat-row {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
}
.pp-chat-bubble {
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 1rem;
    line-height: 1.5;
    max-width: 90%;
    word-break: break-word;
    box-sizing: border-box;
}
.pp-chat-user .pp-chat-bubble {
    background: #e6e6e6;
    color: #232323;
    margin-left: auto;
}
.pp-chat-assistant .pp-chat-bubble {
    background: #323232;
    color: #fff;
    margin-right: auto;
}
.pp-chat-tools {
    width: 100%;
    text-align: right;
    margin-bottom: 0.2rem;
    margin-top: 0.2rem;
}
.pp-chat-clear {
    color: #aaa;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
    opacity: 0.7;
    transition: color 0.2s, opacity 0.2s;
}
.pp-chat-clear:hover, .pp-chat-clear:focus {
    color: #fff;
    opacity: 1;
}

/* Chat bubble link styles - override theme colors with high specificity */
body .pp-drawer .pp-chat-bubble a,
body .pp-drawer .pp-chat-bubble a:link,
body .pp-drawer .pp-chat-bubble a:visited {
    color: #ddd;
    text-decoration: none;
    font-weight: 500;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

body .pp-drawer .pp-chat-bubble a:hover,
body .pp-drawer .pp-chat-bubble a:focus,
body .pp-drawer .pp-chat-bubble a:active {
    color: #fff;
    text-decoration: underline;
    background: none;
    opacity: 1;
}

/* Additional specificity for chat assistant links (dark background) */
body .pp-drawer .pp-chat-assistant .pp-chat-bubble a,
body .pp-drawer .pp-chat-assistant .pp-chat-bubble a:link,
body .pp-drawer .pp-chat-assistant .pp-chat-bubble a:visited {
    color: #ddd;
    text-decoration: underline;
    font-size: 0.9rem;
}

body .pp-drawer .pp-chat-assistant .pp-chat-bubble a:hover,
body .pp-drawer .pp-chat-assistant .pp-chat-bubble a:focus,
body .pp-drawer .pp-chat-assistant .pp-chat-bubble a:active {
    color: #fff;
}

/* User chat bubble links (light background) */
body .pp-drawer .pp-chat-user .pp-chat-bubble a,
body .pp-drawer .pp-chat-user .pp-chat-bubble a:link,
body .pp-drawer .pp-chat-user .pp-chat-bubble a:visited {
    color: #333;
}

body .pp-drawer .pp-chat-user .pp-chat-bubble a:hover,
body .pp-drawer .pp-chat-user .pp-chat-bubble a:focus,
body .pp-drawer .pp-chat-user .pp-chat-bubble a:active {
    color: #000;
}

/* Chat bubble list styling for better readability */
body .pp-drawer .pp-chat-bubble ul,
body .pp-drawer .pp-chat-bubble ol {
    margin: 8px 0;
    padding-left: 20px;
    line-height: 1.6;
}

body .pp-drawer .pp-chat-bubble li {
    margin-bottom: 6px;
    line-height: 1.2;
    font-size:0.9rem;
}

body .pp-drawer .pp-chat-bubble p {
    margin: 8px 0;
    line-height: 1.2;
}

body .pp-drawer .pp-chat-bubble p:first-child {
    margin-top: 0;
}

body .pp-drawer .pp-chat-bubble p:last-child {
    margin-bottom: 0;
}
/* Chat Thinking Animation Styles */
.pp-chat-thinking {
    display: flex;
    align-items: center;
    padding: 0;
    margin-bottom: 8px;
}

.pp-chat-thinking .pp-chat-bubble {
    background: #2a2a2a;
    color: #aaa;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: pp-thinking-pulse 2s ease-in-out infinite;
}

.pp-thinking-text {
    font-style: italic;
    font-size: 0.9rem;
}

.pp-thinking-dots {
    display: flex;
    gap: 3px;
}

.pp-thinking-dot {
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #666;
    animation: pp-thinking-bounce 1.4s ease-in-out infinite both;
}

.pp-thinking-dot:nth-child(1) {
    animation-delay: -0.32s;
}

.pp-thinking-dot:nth-child(2) {
    animation-delay: -0.16s;
}

.pp-thinking-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes pp-thinking-bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes pp-thinking-pulse {
    0%, 100% {
        opacity: 0.7;
        transform: scale(1);
    }
    50% {
        opacity: 0.9;
        transform: scale(1.02);
    }
}

/* Typing indicator animation */
.pp-chat-typing {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    margin-bottom: 8px;
}

.pp-chat-typing .pp-chat-bubble {
    background: #2a2a2a;
    padding: 8px 12px;
    animation: pp-typing-fade 1.5s ease-in-out infinite;
}

.pp-typing-indicator {
    display: flex;
    gap: 2px;
    align-items: center;
}

.pp-typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #888;
    animation: pp-typing-wave 1.4s linear infinite;
}

.pp-typing-dot:nth-child(1) {
    animation-delay: 0s;
}

.pp-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.pp-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes pp-typing-wave {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-8px);
        opacity: 1;
    }
}

@keyframes pp-typing-fade {
    0%, 100% {
        opacity: 0.6;
    }
    50% {
        opacity: 0.8;
    }
}
