#wp-admin-bar-agenticwp-chat .ab-item {
    padding: 0 12px !important;
    display: flex !important;
    align-items: center !important;
}

#wp-admin-bar-agenticwp-chat .agenticwp-admin-bar-icon {
    margin-right: 6px;
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

#wp-admin-bar-agenticwp-chat .agenticwp-admin-bar-icon svg {
    display: block;
}

#wpadminbar #wp-admin-bar-top-secondary {
    display: flex !important;
}

#wpadminbar #wp-admin-bar-top-secondary #wp-admin-bar-agenticwp-chat {
    order: -1;
    display: block;
}

.agenticwp-chat-panel {
    position: fixed;
    top: 32px;
    right: 20px;
    width: 700px;
    height: 450px;
    max-width: 100%;
    background-color: var(--agenticwp-bg-panel);
    backdrop-filter: var(--agenticwp-backdrop-blur);
    -webkit-backdrop-filter: var(--agenticwp-backdrop-blur);
    border: 1px solid var(--agenticwp-border);
    border-radius: var(--agenticwp-border-radius);
    box-shadow: var(--agenticwp-shadow);
    z-index: 999990; /* Below admin bar (1000000) but above everything else */
    display: none;
    flex-direction: column;
    overflow: hidden; /* Prevent sidebar overflow */
}

.agenticwp-chat-panel.agenticwp-dragging {
    opacity: 0.8;
    z-index: 999995; /* Higher z-index during drag */
    user-select: none;
}

.agenticwp-chat-panel[aria-hidden="false"] {
    display: flex;
}

.agenticwp-chat-header {
    background-color: var(--agenticwp-bg-panel);
    backdrop-filter: var(--agenticwp-backdrop-blur);
    -webkit-backdrop-filter: var(--agenticwp-backdrop-blur);
    padding: 10px 12px;
    border-bottom: 1px solid var(--agenticwp-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.agenticwp-drag-handle {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: move;
    flex: 1;
    user-select: none;
}

.agenticwp-header-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
}

.agenticwp-chat-logo {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    object-fit: cover;
}

.agenticwp-chat-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--agenticwp-text);
    margin: 0;
}

.agenticwp-chat-close {
    background: none;
    border: none;
    color: var(--agenticwp-text);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}

.agenticwp-chat-close:hover {
    background: rgba(255,255,255,0.1);
}

.agenticwp-chat-close:focus {
    outline: 2px solid var(--agenticwp-primary);
    outline-offset: 2px;
}

.agenticwp-chat-clear {
    background-color: var(--agenticwp-primary);
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-right: 8px;
    transition: background-color 0.15s ease-in-out;
}

.agenticwp-chat-clear:hover {
    background-color: var(--agenticwp-primary-hover);
}

.agenticwp-chat-clear:focus {
    outline: 2px solid var(--agenticwp-primary);
    outline-offset: 2px;
}

.agenticwp-chat-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

.agenticwp-messages-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0; /* Allow flexbox shrinking */
}

.agenticwp-actions-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 280px;
    background-color: #fff;
    border-left: 1px solid var(--agenticwp-border);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    z-index: 10;
}

.agenticwp-actions-sidebar.is-open {
    transform: translateX(0);
}

.agenticwp-actions-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--agenticwp-space-md);
    border-bottom: 1px solid var(--agenticwp-border);
    background-color: var(--agenticwp-bg-secondary);
}

.agenticwp-actions-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--agenticwp-text-primary);
}

.agenticwp-actions-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--agenticwp-radius-sm);
    color: var(--agenticwp-text-secondary);
    cursor: pointer;
    transition: var(--agenticwp-transition);
}

.agenticwp-actions-close:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--agenticwp-text-primary);
}

.agenticwp-actions-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--agenticwp-space-sm);
}

.agenticwp-actions-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--agenticwp-space-lg);
    color: var(--agenticwp-text-secondary);
    gap: var(--agenticwp-space-sm);
}

.agenticwp-actions-category {
    margin-bottom: var(--agenticwp-space-md);
}

.agenticwp-actions-category-title {
    margin: 0 0 var(--agenticwp-space-xs) 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--agenticwp-text-secondary);
    letter-spacing: 0.5px;
}

.agenticwp-actions-list {
    display: flex;
    flex-direction: column;
    gap: var(--agenticwp-space-xs);
}

.agenticwp-action-button {
    display: flex;
    align-items: center;
    gap: var(--agenticwp-space-sm);
    width: 100%;
    padding: var(--agenticwp-space-sm);
    background: var(--agenticwp-bg-white);
    border: 1px solid var(--agenticwp-border);
    border-radius: var(--agenticwp-radius);
    text-align: left;
    cursor: pointer;
    transition: var(--agenticwp-transition);
    font-size: 13px;
}

.agenticwp-action-button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: var(--agenticwp-primary);
    transform: translateY(-1px);
}

.agenticwp-action-button:focus {
    outline: 2px solid var(--agenticwp-primary);
    outline-offset: 2px;
}

.agenticwp-action-button .dashicons {
    color: var(--agenticwp-primary);
    font-size: 16px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.agenticwp-action-name {
    font-weight: 500;
    color: var(--agenticwp-text-primary);
}

.agenticwp-actions-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--agenticwp-space-lg);
    color: var(--agenticwp-text-secondary);
    gap: var(--agenticwp-space-sm);
}

.agenticwp-actions-error .dashicons {
    color: var(--agenticwp-warning);
    font-size: 24px;
}

@media screen and (max-width: 600px) {
    .agenticwp-actions-sidebar {
        width: 100%;
        z-index: 100;
        box-shadow: var(--agenticwp-shadow-lg);
    }

    .agenticwp-actions-sidebar::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: -1;
    }

    .agenticwp-actions-sidebar.is-open::before {
        opacity: 1;
        visibility: visible;
    }
}

@media screen and (max-width: 520px) {
    .agenticwp-input-area {
        padding: var(--agenticwp-space-sm);
    }

    .agenticwp-actions-toggle {
        width: 32px;
        height: 32px;
    }
}

@media screen and (max-width: 900px) {
    .agenticwp-chat-panel:not([style*="left"]) {
        width: calc(100vw - 40px);
        max-width: 600px;
        height: 400px;
        right: 20px;
    }
}

@media screen and (max-width: 782px) {
    .agenticwp-chat-panel:not([style*="left"]) {
        top: 46px; /* Mobile admin bar is taller */
        right: 10px;
        width: calc(100vw - 20px);
        max-width: 500px;
        height: 350px;
    }
}

@media screen and (max-width: 600px) {
    .agenticwp-chat-panel:not([style*="left"]) {
        right: 5px;
        width: calc(100vw - 10px);
        height: 300px;
    }
}

@media (max-width: 520px) {
    .agenticwp-chat-panel:not([style*="left"]) {
        width: calc(100vw - 40px);
        height: calc(100vh - 140px);
        bottom: 90px;
        right: 20px;
        left: 20px;
    }
}