:root {
    /* Color variables */
    --primary-color: #6a82fb;
    --primary-hover: #5a6fd8;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --purple-color: #6f42c1;
    --background-dark: #1a1a1a;
    --background-medium: #2d2d2d;
    --background-light: #3a3a3a;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --text-muted: #ccc;
    --border-color: #555;
    --border-light: #444;
    
    /* Font size variables */
    --font-size-small: 0.9rem;
    --font-size-base: 1rem;
    --font-size-large: 1.1rem;
    --font-size-xl: 1.3rem;
}

/* Pulsating animation for Responses tab text */
@keyframes textPulse {
    0% {
        color: var(--text-primary);
    }
    50% {
        color: var(--success-color);
    }
    100% {
        color: var(--text-primary);
    }
}

.tab-pulsating {
    animation: textPulse 1.5s ease-in-out infinite;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Global utility classes */

/* Font size utility classes */
.font-small { font-size: var(--font-size-small); }
.font-base { font-size: var(--font-size-base); }
.font-large { font-size: var(--font-size-large); }
.font-xl { font-size: var(--font-size-xl); }

/* Form utility classes */
.required-indicator { color: var(--danger-color); }
.form-input-padding { padding: 6px; }

/* Interactive fields section */
.interactive-fields-section {
    margin-top: 16px;
    padding: 16px;
    background: var(--background-dark);
    border-radius: 8px;
    border: 1px solid var(--border-light);
}

body {
    background: var(--background-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 0;
}

.container {
    width: 100%;
    max-width: 950px;
    background: var(--background-medium);
    border-radius: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: visible;
    margin: 0;
}

header {
    background: var(--background-light);
    color: white;
    padding: 6px 20px;
    text-align: left;
}

header > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

h1 {
    font-size: 1.4rem;
    margin-bottom: 3px;
    font-weight: 700;
}

.version {
    font-size: 0.8rem;
    font-weight: 400;
    opacity: 0.7;
    margin-top: 2px;
}

.header-links {
    display: flex;
    flex-wrap: nowrap;
    gap: 15px;
    margin-left: 20px;
}

/* Desktop: Put header links below title */
@media (min-width: 480px) {
    .header-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
        margin-left: 0;
        margin-top: 0;
    }
    
    header h1 {
        margin-bottom: 0 !important;
    }
}

/* Mobile: Keep two-row layout like desktop */
@media (max-width: 479px) {
    .header-links {
        display: flex;
        flex-wrap: nowrap;
        gap: 10px;
        margin-left: 0;
        margin-top: 0;
    }
    
    h1 {
        margin-bottom: 0;
    }
    
    .header-bottom-row {
        margin-top: 8px;
    }
    
    .version {
        font-size: 0.7rem;
    }
    
    .header-container {
        gap: 2px !important;
    }
}

.header-links a {
    color: #999;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.header-links a:hover {
    color: #e0e0e0;
    text-decoration: underline;
}

.header-links a.active {
    color: #e0e0e0;
    font-weight: 600;
}

.main-content {
    padding: 0;
    display: block;
    gap: 0;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    background: #2d2d2d;
    border-radius: 0;
    overflow: hidden;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
    border-bottom: 2px solid #555;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Mobile: Tabs stick to bottom when scrolling and add bottom padding */
@media (max-width: 479px) {
    .main-content {
        padding-bottom: 80px;
    }
    
    .tab-navigation {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        border-top: 2px solid #555;
        border-bottom: none;
        box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.3);
        display: flex;
        width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* Internet Explorer 10+ */
    }
    
    /* Hide scrollbar for Chrome, Safari and Opera */
    .tab-navigation::-webkit-scrollbar {
        display: none;
    }
    
    /* Mobile tab buttons - standard desktop size with horizontal scrolling */
    .tab-navigation .tab-button {
        padding: 10px 20px !important;
        font-size: 1rem !important;
        flex: 0 0 auto !important;
        min-width: fit-content;
        white-space: nowrap;
    }
    
    /* Tab scroll arrow - fixed to right edge */
    .tab-scroll-arrow {
        position: fixed;
        bottom: 1px;
        right: -6px; /* Move closer to the right edge */
        width: 30px;
        height: 44px; /* Match tab navigation height (10px top + 10px bottom + font height) */
        background: transparent;
        border: none;
        color: #999;
        cursor: pointer;
        font-size: 1.2rem;
        font-weight: bold;
        transition: all 0.3s ease;
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .tab-scroll-arrow:hover {
        color: #e0e0e0;
        background: transparent;
    }
    
    .tab-scroll-arrow:active {
        background: transparent;
    }
    
    .tab-scroll-arrow.hidden {
        opacity: 0;
        pointer-events: none;
    }
}

/* Hide scroll arrows on desktop */
@media (min-width: 480px) {
    .tab-scroll-arrow {
        display: none !important;
    }
}

.tab-button {
    flex: 1;
    padding: 10px 20px;
    border: none;
    background: #2d2d2d;
    color: #999;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, border-bottom-color 0.3s;
    border-bottom: 2px solid transparent;
}

.tab-button:hover {
    color: #e0e0e0;
}

.tab-button.active {
    background: var(--background-light);
    color: var(--text-primary);
    border-bottom-color: var(--primary-color);
}

.tab-button:not(.active) {
    border-bottom-color: transparent;
}

/* Tab Content */
.tab-content {
    background: #2d2d2d;
    border-radius: 0;
    min-height: 500px;
}

.tab-panel {
    display: none;
    padding: 15px;
}

@media (min-width: 480px) {
    .tab-panel {
        padding: 20px;
    }
}

/* Extra bottom spacing for response, pinned, and rag tabs to prevent scrollbar jitter */
#home-content,
#response-content,
#pinned-content,
#rag-content,
#tools-content,
#help-content,
#updates-content {
    padding-bottom: 100vh;
}

@media (max-width: 479px) {
    #home-content,
    #response-content,
    #pinned-content,
    #rag-content,
    #tools-content,
    #help-content,
    #updates-content {
        padding-bottom: 80vh;
    }
}

.tab-panel.active {
    display: block;
}

/* Adjust primary section for tab layout */
.tab-panel .primary-section {
    gap: 20px;
}

/* Common Card Pattern */
.card {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}


.card-error {
    background: #2d2d2d;
    border: 1px solid #dc3545;
}

/* Universal Button Color Variants */
.btn-info { background: #17a2b8 !important; color: white !important; }
.btn-purple { background: #6f42c1 !important; color: white !important; }
.btn-success { background: #28a745 !important; color: white !important; }
.btn-danger { background: #dc3545 !important; color: white !important; }

/* Consolidated Button Styles */
.btn-suggest {
    background: #17a2b8 !important;
    color: white !important;
    padding: 6px 12px !important;
    font-size: 0.9rem !important;
    white-space: nowrap !important;
    align-self: flex-start !important;
    margin-top: 0 !important;
}


.btn-accept {
    background: #28a745 !important;
    color: white !important;
}

.btn-publish {
    background: #17a2b8 !important;
    color: white !important;
}

.btn-copy {
    background: #6c757d !important;
    color: white !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
}

.btn-send {
    background: #28a745 !important;
    color: white !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
}

/* Button Utility Classes */
.btn-no-margin { margin: 0 !important; }
.btn-margin-top { margin-top: 10px !important; }
.btn-padding-sm { padding: 8px 16px !important; }
.btn-font-sm { font-size: 0.9rem !important; }



.response-content-container {
    padding: 5px;
    margin: 20px 20px;
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 8px;
    height: 60px;
    overflow: hidden;
}

.response-content {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 12px 15px;
    min-height: 50px;
    height: 50px;
    color: #e0e0e0;
    line-height: 1.4;
    display: flex;
    align-items: center;
    justify-content: center;
}


/* Comprehensive markdown content styling */
.markdown-content {
    line-height: 1.7;
    color: #e0e0e0;
    overflow-x: auto;
    font-size: 1rem;
    max-width: 100%;
}

/* Dark scrollbars for all markdown content */
.markdown-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.markdown-content::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.markdown-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Firefox scrollbar styling for markdown content */
.markdown-content {
    scrollbar-width: thin;
    scrollbar-color: #555 #2d2d2d;
}

.markdown-content h1 {
    color: #e0e0e0;
    font-size: 1.5rem;
    margin: 20px 0 15px 0;
    border-bottom: 2px solid #555;
    padding-bottom: 8px;
    font-weight: 700;
}

.markdown-content h2 {
    color: #e0e0e0;
    font-size: 1.3rem;
    margin: 18px 0 12px 0;
    border-bottom: 1px solid #555;
    padding-bottom: 5px;
    font-weight: 600;
}

.markdown-content h3 {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin: 15px 0 10px 0;
    font-weight: 600;
}

.markdown-content h4 {
    color: #e0e0e0;
    font-size: 1rem;
    margin: 12px 0 8px 0;
    font-weight: 600;
}

.markdown-content h5 {
    color: #e0e0e0;
    font-size: 0.9rem;
    margin: 10px 0 6px 0;
    font-weight: 600;
}

.markdown-content h6 {
    color: #e0e0e0;
    font-size: 0.85rem;
    margin: 8px 0 4px 0;
    font-weight: 600;
}

.markdown-content p {
    margin: 12px 0;
    line-height: 1.7;
    text-align: justify;
}

.markdown-content strong {
    color: #fff;
    font-weight: bold;
}

.markdown-content em {
    color: #ccc;
    font-style: italic;
}

.markdown-content code {
    background: #1a1a1a;
    color: #6a82fb;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid #333;
}

.markdown-content pre {
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* Dark scrollbars for markdown content */
.markdown-content pre::-webkit-scrollbar,
.markdown-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.markdown-content pre::-webkit-scrollbar-track,
.markdown-content::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.markdown-content pre::-webkit-scrollbar-thumb,
.markdown-content::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.markdown-content pre::-webkit-scrollbar-thumb:hover,
.markdown-content::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Firefox scrollbar styling for markdown content */
.markdown-content pre,
.markdown-content {
    scrollbar-width: thin;
    scrollbar-color: #555 #2d2d2d;
}

.markdown-content pre code {
    background: none;
    color: #e0e0e0;
    padding: 0;
    border-radius: 0;
    border: none;
    font-size: 0.9rem;
}

.markdown-content a {
    color: #8bb4ff;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.markdown-content a:hover {
    color: #a8c7ff;
    text-decoration: underline;
}

.markdown-content a:visited {
    color: #b894ff;
}

.markdown-content ul, .markdown-content ol {
    margin: 12px 0;
    padding-left: 24px;
}

.markdown-content li {
    margin: 8px 0;
    line-height: 1.6;
}

/* Improve nested list spacing */
.markdown-content ul ul, .markdown-content ol ol, .markdown-content ul ol, .markdown-content ol ul {
    margin: 6px 0;
    padding-left: 20px;
}

.markdown-content blockquote {
    border-left: 4px solid #6a82fb;
    margin: 15px 0;
    padding: 10px 15px;
    background: #2a2a2a;
    color: #ccc;
    font-style: italic;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 6px;
    overflow: hidden;
}

/* Dark scrollbars for markdown tables */
.markdown-content table::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.markdown-content table::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

.markdown-content table::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.markdown-content table::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* Firefox scrollbar styling for markdown tables */
.markdown-content table {
    scrollbar-width: thin;
    scrollbar-color: #555 #2d2d2d;
}

.markdown-content th, .markdown-content td {
    border: 1px solid #555;
    padding: 8px 12px;
    text-align: left;
}

.markdown-content th {
    background: #3a3a3a;
    color: #e0e0e0;
    font-weight: 600;
}

.markdown-content td {
    color: #e0e0e0;
}

.markdown-content tr:nth-child(even) {
    background: #333;
}

.markdown-content hr {
    border: none;
    height: 1px;
    background: #555;
    margin: 20px 0;
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    margin: 10px 0;
}

/* Response history markdown links - keep existing specific styles */
#response-history-section .markdown-content a {
    color: #8bb4ff;
    text-decoration: underline;
}

#response-history-section .markdown-content a:hover {
    color: #a8c7ff;
    text-decoration: underline;
}

#response-history-section .markdown-content a:visited {
    color: #b894ff;
}

/* Help content specific improvements */
#help-content .markdown-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

/* Better spacing for help content sections */
#help-content .markdown-content h2 {
    margin-top: 32px;
    margin-bottom: 16px;
    padding-top: 8px;
}

#help-content .markdown-content h3 {
    margin-top: 24px;
    margin-bottom: 12px;
    color: #f0f0f0;
}

#help-content .markdown-content h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #e8e8e8;
}

/* Improve code block readability in help */
#help-content .markdown-content pre {
    background: #1e1e1e;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}

#help-content .markdown-content code {
    background: #2a2a2a;
    color: #7dd3fc;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid #444;
}

/* Better table of contents styling */
#help-content .markdown-content h2:first-of-type {
    margin-top: 0;
    padding-top: 0;
}

/* Improve blockquote styling for help content */
#help-content .markdown-content blockquote {
    border-left: 4px solid #7dd3fc;
    background: #2a2a2a;
    color: #d0d0d0;
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 0 6px 6px 0;
}

/* Better emphasis for important text */
#help-content .markdown-content strong {
    color: #ffffff;
    font-weight: 600;
}

/* Improve horizontal rule visibility */
#help-content .markdown-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(to right, transparent, #555, transparent);
    margin: 32px 0;
}


@media (min-width: 480px) {
    header { padding: 8px; }
    h1 { font-size: 1.6rem; margin-bottom: 4px; }
    .main-content { padding: 0; gap: 40px; }
}

@media (max-width: 479px) {
    header > div {
        flex-direction: row;
        gap: 15px;
        text-align: left;
        align-items: center;
    }
    
    header > div > div:first-child {
        flex: 1;
    }
    
    header > div > div:last-child {
        flex: 0 0 auto;
    }
    
    header #clear-all-settings-btn {
    width: 100%;
        max-width: 200px;
        justify-content: center;
        text-align: center;
    }
}

/* Primary Section - Two Column Layout */
.primary-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

@media (min-width: 1024px) {
    .primary-section {
        grid-template-columns: 1.5fr 1fr;
        gap: 40px;
    }
}

/* Prompt Workspace */
.prompt-workspace {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #555;
    overflow: hidden;
}

.workspace-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 1px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.workspace-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}


.btn-workspace {
    padding: 4px 8px;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 24px;
}

.btn-workspace:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}


.prompt-container {
    padding: 20px;
}

.prompt-input-wrapper {
    position: relative;
}

.character-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 0.8rem;
    color: #999;
    background: rgba(26, 26, 26, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.character-counter.warning {
    color: #17a2b8;
}

.character-counter.danger {
    color: #dc3545;
}

/* Published prompt character counter styling */
.interactive-fields-section .character-counter {
    position: relative;
    font-size: 0.8rem;
    color: #999;
    background: rgba(26, 26, 26, 0.9);
    padding: 2px 6px;
    border-radius: 4px;
    pointer-events: none;
}

.interactive-fields-section .character-counter.warning {
    color: #17a2b8;
}

.interactive-fields-section .character-counter.danger {
    color: #dc3545;
}

/* Markdown styling for local result modal */
#local-result-content h1 {
    color: #e0e0e0;
    font-size: 1.5rem;
    margin: 15px 0 10px 0;
    border-bottom: 2px solid #555;
    padding-bottom: 5px;
}

#local-result-content h2 {
    color: #e0e0e0;
    font-size: 1.3rem;
    margin: 12px 0 8px 0;
    border-bottom: 1px solid #555;
    padding-bottom: 3px;
}

#local-result-content h3 {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin: 10px 0 6px 0;
}

#local-result-content strong {
    color: #fff;
    font-weight: bold;
}

#local-result-content em {
    color: #ccc;
    font-style: italic;
}

#local-result-content code {
    background: #1a1a1a;
    color: #6a82fb;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

#local-result-content pre {
    background: #1a1a1a;
    border: 1px solid #555;
    border-radius: 6px;
    padding: 12px;
    margin: 10px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

#local-result-content pre code {
    background: none;
    color: #e0e0e0;
    padding: 0;
    border-radius: 0;
}

#local-result-content a {
    color: #8bb4ff;
    text-decoration: underline;
}

#local-result-content a:hover {
    color: #a8c7ff;
}

/* Image styling for local result modal */
#local-result-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    margin: 10px 0;
}

#field-inputs-container {
    margin-top: 15px;
}

/* Action Panel */
.action-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.action-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #555;
    padding: 20px;
}

.action-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.action-header .action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
    text-align: center;
}

.action-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0 0 15px 0;
    text-align: center;
}

.refresh-btn {
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    width: 36px;
    height: 36px;
}

.refresh-btn:hover {
    background: #555;
    border-color: #777;
}

.refresh-icon {
    font-size: 16px;
    font-weight: bold;
}

.model-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.model-grid > div {
    text-align: center;
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .model-grid {
        grid-template-columns: 1fr 1fr;
    }
}



.save-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #555;
    padding: 20px;
}

.btn-save {
    width: 100%;
    padding: 15px 20px;
    border: none;
    border-radius: 8px;
    background: #6a82fb;
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-save:hover {
    opacity: 0.8;
}


.field-input-group {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 8px;
    padding: 10px;
    background: #1a1a1a;
    border-radius: 6px;
    border: 1px solid #555;
}

.field-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-input-group label {
    font-size: 0.9rem;
    color: #e0e0e0;
    margin: 0;
    margin-bottom: 4px;
}

.field-input-group input,
.field-input-group textarea {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #2d2d2d;
    color: #e0e0e0;
    font-size: 0.9rem;
    font-family: inherit;
}

.field-input-group input:focus,
.field-input-group textarea:focus {
    outline: none;
    border-color: #6a82fb;
}

.field-input-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.4;
}


.remove-field-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: opacity 0.2s;
    flex: 0 0 auto;
    min-width: 40px;
}

.remove-field-btn:hover {
    opacity: 0.8;
}

@media (max-width: 479px) {
    .import-fields-btn,
    .clear-fields-btn {
        width: 100% !important;
        margin: 0 !important;
        justify-content: center !important;
    }
    
    .field-inputs-container > div:last-child {
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    /* Edit Published Prompt modal field responsiveness */
    #edit-published-fields-container .field-input-row {
        flex-direction: row;
        gap: 8px;
    }
    
    #edit-published-fields-container .remove-field-btn {
        min-width: 44px;
        height: 44px;
        padding: 8px;
        font-size: 1rem;
        flex-shrink: 0;
    }
    
    #edit-published-fields-container .field-input-row input,
    #edit-published-fields-container .field-input-row textarea {
        flex: 1;
        min-height: 44px;
    }
    
    /* Fix Required Fields header and counter alignment on mobile */
    #edit-published-fields-container > div:first-child {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px;
    }
    
    #edit-published-fields-container > div:first-child h4 {
        text-align: left !important;
        margin-bottom: 0 !important;
        flex: 1;
    }
    
    #edit-published-fields-container > div:first-child .character-counter {
        flex-shrink: 0;
        font-size: 0.8rem !important;
        padding: 2px 6px !important;
    }
    
    /* Fix Pinned Prompts Required Fields header and counter alignment on mobile */
    .pinned-fields-container > div:first-child {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 8px;
    }
    
    .pinned-fields-container > div:first-child h4 {
        text-align: left !important;
        margin-bottom: 0 !important;
        flex: 1;
    }
    
    .pinned-fields-container > div:first-child .character-counter {
        flex-shrink: 0;
        font-size: 0.8rem !important;
        padding: 2px 6px !important;
    }
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 1rem;
}

#prompt-input {
    min-height: 300px;
    height: calc(100vh - 400px);
    max-height: 600px;
    background: #1a1a1a;
    box-sizing: border-box;
}


 @media (min-width: 480px) {
     label { margin-bottom: 10px; font-size: 1.1rem; }
     #prompt-input {
         min-height: 350px;
         height: calc(100vh - 350px);
         max-height: 700px;
     }
 }
 
 @media (max-width: 479px) {
     #prompt-input { 
         min-height: 125px;
         height: calc(50vh - 150px);
         max-height: 250px;
     }
 }


.btn-base {
    padding: 4px 6px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 0.7rem;
    cursor: pointer;
    transition: opacity 0.2s;
    display: flex;
   align-items: center;
   justify-content: flex-start;
    text-align: left;
     min-height: 24px;
}

.btn-base:hover { opacity: 0.8; }

/* Add more space between icon and text on all devices */
.btn-base .btn-icon {
    margin-right: 6px;
}

 @media (min-width: 480px) {
    .btn-base { padding: 4px 8px; font-size: 0.7rem; min-height: 28px; border-radius: 8px; }
 }

/* Model Button Styles */
.model-btn {
    background: #667eea;
}

.image-model-btn {
    background: #9b59b6;
}

/* Private Models Button Styles */
.private-model-btn {
    background: #667eea;
}

.private-model-btn:hover {
    background: #5a6fd8;
}

.private-model-btn.loaded {
    background: #27ae60;
}

.private-model-btn.loaded:hover {
    background: #229954;
}

/* Model wrapper for checkbox and button */
.model-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.model-wrapper .model-checkbox {
    margin: 0;
    flex-shrink: 0;
}

.model-wrapper .model-btn {
    flex: 1;
    text-align: left;
}



.saved-prompts-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #555;
    overflow: hidden;
}

.saved-prompts-header {
    background: #2a2a2a;
    padding: 20px;
    border-bottom: 1px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-prompts-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.saved-prompts-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.action-group {
    display: flex;
    gap: 8px;
}

.btn-action-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    background: #6c757d;
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-action-small.btn-success {
    background: #28a745;
}

.btn-action-small.btn-danger {
    background: #dc3545;
}

.btn-danger:hover {
    background: #c82333;
    opacity: 0.9;
}

/* Loaded Prompt State */
.loaded-prompt-state {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.loaded-prompt-indicator {
    color: #999;
    font-size: 0.8rem;
}

.loaded-prompt-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.action-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.action-buttons-container .btn-save,
#reset-prompt-btn {
    padding: 8px 16px;
    font-size: 0.9rem;
    height: auto;
    min-height: 36px;
}

@media (max-width: 768px) {
    .action-buttons-container {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-buttons-container .btn-save {
        flex: none;
        margin-bottom: 0;
    }
    
    #reset-prompt-btn {
        margin-top: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@media (max-width: 479px) {
    .primary-section {
        gap: 12px;
    }
    
    .workspace-header {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
    }
    
    .workspace-title {
        margin: 0;
        text-align: left;
        padding-left: 0;
    }
    
    .prompt-container {
        padding: 15px;
    }
    
    .prompt-container div[style*="margin-top: 15px"] {
        margin: 15px 0 !important;
    }
    
    .prompt-container div[style*="margin-top: 15px"] .btn-workspace {
        width: 100% !important;
        padding: 4px 10px !important;
        font-size: 0.8rem !important;
        text-align: center !important;
        justify-content: center !important;
        min-height: 28px !important;
    }
    
    .action-section {
        padding: 15px;
    }
    
    .save-section {
        padding: 15px;
    }
    
    
    /* Mobile Button Adjustments */
    .btn-save {
        padding: 12px 15px;
        font-size: 1rem;
    }
    
    .saved-prompts-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    
    .saved-prompts-actions {
        justify-content: stretch;
    }
    
    .action-group {
        flex: 1;
    }
    
    .btn-action-small {
        flex: 1;
    text-align: center;
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    /* Header buttons - prevent text wrapping on mobile */
    header .btn-action-small {
        flex: none;
        white-space: nowrap;
        min-width: auto;
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .saved-prompts-filters {
        padding: 15px;
        gap: 12px;
    }
    
    .saved-prompts-list {
        padding: 15px;
    }
    
    .saved-prompt-item {
        padding: 15px;
    }
}

.saved-prompts-list {
    padding: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.empty-state h4 {
    font-size: 1.2rem;
    color: #e0e0e0;
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.8;
}

.no-saved-prompts {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #555;
    margin: 10px 0;
}

/* No Pinned Prompts card should match pinned prompt card size */
#no-pinned-prompts {
    min-height: 150px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 8px;
    margin: 0;
    transition: all 0.3s ease;
}

#no-published-prompts {
    display: none;
}

.saved-prompt-item {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}


.saved-prompt-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.saved-prompt-title-container {
    flex: 1;
    min-width: 0;
    margin-right: 15px;
}

.saved-prompt-title {
    /* Word wrapping handled by .text-wrap utility */
    /* This rule intentionally left minimal for utility class usage */
    display: block;
}

.saved-prompt-description {
    font-size: 0.9rem;
    color: #ccc;
    margin-top: 4px;
    margin-bottom: 8px;
    line-height: 1.4;
}


.saved-prompt-text {
    font-size: 0.95rem;
    color: #e0e0e0;
    line-height: 1.4;
    word-wrap: break-word;
    background: #1a1a1a;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #444;
    margin-top: 8px;
}

.btn-expand-prompt {
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.btn-expand-prompt:hover {
    background: #555;
    border-color: #777;
}

/* Consolidated expand icon styles */
.expand-icon {
    transition: transform 0.2s;
    font-size: 0.8rem;
}

.btn-expand-prompt.expanded .expand-icon {
    transform: rotate(180deg);
}


 .saved-prompt-date {
     font-size: 0.8rem;
     color: #999;
 }

 .saved-prompt-fields {
     margin: 8px 0;
     font-size: 0.85rem;
 }

 .saved-prompt-fields strong {
     color: #e0e0e0;
     font-weight: 600;
 }

.run-count-item {
    display: inline-block;
    background: #3a3a3a;
    color: #28a745;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px 4px 2px 0;
    border: 1px solid #555;
    white-space: nowrap;
    font-weight: 600;
}

/* Social Media Post Card Styles */
.social-post-card {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 12px;
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* RAG Volume Card Styles - Consistent with Saved Prompts */
.volume-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.volume-name {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.1rem;
    font-weight: 600;
}

.volume-date {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
}

.volume-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.volume-description {
    color: #ccc;
    margin-bottom: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.volume-stats {
    display: flex;
    gap: 16px;
    margin: 12px 0;
}

.volume-stats .meta-item {
    display: inline-block;
    background: #3a3a3a;
    color: #28a745;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    margin: 2px 4px 2px 0;
    border: 1px solid #555;
    white-space: nowrap;
    font-weight: 600;
}

.volume-stats .meta-item .status-complete {
    color: #28a745;
}

.volume-stats .meta-item .status-processing {
    color: #ffc107;
}

.volume-stats .meta-item .status-needs-update {
    color: #dc3545;
}

.volume-stats .meta-item .status-not-embedded {
    color: #6c757d;
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #444;
    background: #3a3a3a;
}

/* Simplified header for saved prompts (no avatar/author) */
.social-post-card .post-header {
    background: #2a2a2a;
}

.social-post-card .saved-prompt-date {
    font-size: 0.8rem;
    color: #999;
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6a82fb, #9b59b6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.1rem;
    text-transform: uppercase;
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 600;
    color: #e0e0e0;
    font-size: 0.95rem;
}

.post-time {
    font-size: 0.8rem;
    color: #999;
}

.post-category {
    display: flex;
    align-items: center;
}

.post-content {
    padding: 0 20px 20px 20px;
}

/* Fix Response cards markdown content - prevent extra padding/margins on desktop */
#response-history-section .social-post-card .post-content .markdown-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: -15px !important;   /* Maintain inline style value */
    margin-right: -15px !important;  /* Maintain inline style value */
    max-width: none !important;
    width: auto !important;
    box-sizing: border-box !important;
}

.post-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0 0 12px 0;
    line-height: 1.3;
}

.post-description {
    font-size: 1rem;
    color: #ccc;
    margin: 0 0 16px 0;
    line-height: 1.5;
}

/* Read More functionality styles */
.description-text {
    display: inline;
}

.description-preview,
.description-full {
    display: inline;
}

.read-more-btn {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    margin-left: 4px;
    padding: 0;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.read-more-btn:hover {
    color: #5a6fd8;
    text-decoration: none;
}

.read-more-btn:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    border-radius: 2px;
}

.post-prompt-preview {
    margin: 16px 0;
}

.post-prompt-preview .btn-expand-prompt {
    background: #444;
    color: #e0e0e0;
    border: 1px solid #666;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    width: 100%;
    justify-content: center;
}

.post-prompt-preview .btn-expand-prompt:hover {
    background: #555;
    border-color: #777;
}

.post-prompt-preview .saved-prompt-text {
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
    color: #e0e0e0;
    line-height: 1.6;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}


.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px;
    border-top: 1px solid #444;
    background: #2a2a2a;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: #ccc;
}

.run-count-item {
    margin-left: auto;
    background: none;
    border: none;
    padding: 0;
}

.meta-icon {
    font-size: 1rem;
}

.meta-text {
    font-weight: 500;
}

.post-actions {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    border-top: 1px solid #444;
    background: #2a2a2a;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
    min-height: 40px;
    height: 40px;
    box-sizing: border-box;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.primary-btn {
    background: #28a745;
    color: white;
}

.primary-btn:hover {
    background: #218838;
}

.secondary-btn {
    background: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background: #5a6268;
}

.danger-btn {
    background: #dc3545;
    color: white;
}

.danger-btn:hover {
    background: #c82333;
}

.info-btn {
    background: #17a2b8;
    color: white;
}

.info-btn:hover {
    background: #138496;
}

/* Consolidated button icon styles */
.btn-icon {
    font-size: 0.9rem;
}

/* Saved prompt checkbox styling for social post cards */
.social-post-card .saved-prompt-checkbox {
    margin: 16px 0;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #444;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.social-post-card .saved-prompt-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #17a2b8;
}

.social-post-card .saved-prompt-checkbox label {
    color: #e0e0e0;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

/* Response meta styling in header */
.response-meta {
    display: flex;
    gap: 12px;
    align-items: center;
}

.response-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #ccc;
}

.response-meta .meta-icon {
    font-size: 0.9rem;
}

.response-meta .meta-text {
    font-weight: 500;
}

/* Mobile responsive adjustments for social post cards */
@media (max-width: 479px) {
    .social-post-card {
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .post-header {
        padding: 0 16px 12px 16px;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }
    
    .response-meta {
        flex-direction: row;
        gap: 8px;
        align-items: center;
        flex-wrap: wrap;
    }
    
    .response-meta .meta-item {
        font-size: 0.75rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .author-info {
        width: 100%;
    }
    
    .post-category {
        align-self: flex-end;
        margin-top: 0;
        flex-shrink: 0;
        white-space: nowrap;
    }
    
    .post-content {
        padding: 0 16px 16px 16px;
    }
    
    /* Fix Response cards markdown content - prevent extra padding/margins on mobile */
    #response-history-section .social-post-card .post-content .markdown-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: -15px !important;   /* Maintain inline style value */
        margin-right: -15px !important;  /* Maintain inline style value */
        max-width: none !important;
        width: auto !important;
        box-sizing: border-box !important;
    }
    
    .post-title {
        font-size: 1.1rem;
    }
    
    .post-meta {
        padding: 12px 16px;
        gap: 12px;
    }
    
    .meta-item {
        font-size: 0.8rem;
    }
    
    .post-actions {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        padding: 12px 16px;
        font-size: 0.95rem;
        min-height: 44px;
        height: 44px;
    }
    
    /* RAG Volume Cards Mobile Responsiveness */
    .rag-volumes-list .social-post-card {
        margin-bottom: 16px;
        border-radius: 8px;
    }
    
    .rag-volumes-list .post-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .rag-volumes-list .volume-meta {
        width: 100%;
    }
    
    .rag-volumes-list .volume-name {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .rag-volumes-list .volume-date {
        font-size: 0.75rem;
    }
    
    .rag-volumes-list .volume-actions {
        width: 100%;
        justify-content: stretch;
        gap: 8px;
    }
    
    .rag-volumes-list .volume-actions .action-btn {
        flex: 1;
        min-width: 0;
        font-size: 0.85rem;
        padding: 10px 12px;
        min-height: 40px;
        height: 40px;
    }
    
    .rag-volumes-list .post-content {
        padding: 0 16px 16px 16px;
    }
    
    .rag-volumes-list .volume-description {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 10px;
    }
    
    .rag-volumes-list .volume-stats {
        flex-direction: column;
        gap: 8px;
        margin: 10px 0;
    }
    
    .rag-volumes-list .volume-stats .meta-item {
        font-size: 0.7rem;
        padding: 4px 8px;
        margin: 2px 0;
        width: fit-content;
    }
    
    .rag-volumes-list .post-meta {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
        align-items: flex-start;
    }
    
    .rag-volumes-list .post-actions {
        padding: 12px 16px;
        flex-direction: column;
        gap: 8px;
    }
    
    .rag-volumes-list .post-actions .action-btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 12px 16px;
        min-height: 44px;
        height: 44px;
    }
    
    /* Test Similarity Search Mobile Layout */
    .rag-volumes-list .search-input-group {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin: 12px 0;
    }
    
    .rag-volumes-list .search-input-group .search-input {
        width: 100%;
        padding: 10px 12px;
        font-size: 0.9rem;
        border: 1px solid #555;
        border-radius: 6px;
        background: #2d2d2d;
        color: #e0e0e0;
        box-sizing: border-box;
    }
    
    .rag-volumes-list .search-input-group .search-input:focus {
        outline: none;
        border-color: #6a82fb;
        box-shadow: 0 0 0 2px rgba(106, 130, 251, 0.2);
    }
    
    .rag-volumes-list .search-input-group .btn-action-small {
        width: 100%;
        font-size: 0.9rem;
        padding: 12px 16px;
        min-height: 44px;
        height: 44px;
        justify-content: center;
    }
    
    /* Search Results Mobile Layout */
    .rag-volumes-list .search-results {
        margin: 12px 0;
    }
    
    .rag-volumes-list .search-results-header {
        display: flex;
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
        padding: 12px 0;
        border-bottom: 1px solid #444;
    }
    
    .rag-volumes-list .search-results-header .results-count {
        font-size: 0.9rem;
        color: #e0e0e0;
        font-weight: 500;
    }
    
    .rag-volumes-list .search-results-header .btn-action-small {
        width: 100%;
        font-size: 0.85rem;
        padding: 10px 16px;
        min-height: 40px;
        height: 40px;
        justify-content: center;
    }
    
    .rag-volumes-list .search-result-item {
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 6px;
        padding: 12px;
        margin-bottom: 10px;
    }
    
    .rag-volumes-list .search-result-header {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 8px;
    }
    
    .rag-volumes-list .search-result-document {
        font-size: 0.9rem;
        font-weight: 600;
        color: #e0e0e0;
    }
    
    .rag-volumes-list .search-result-similarity {
        font-size: 0.8rem;
        padding: 4px 8px;
        border-radius: 4px;
        width: fit-content;
    }
    
    .rag-volumes-list .search-result-text {
        font-size: 0.85rem;
        line-height: 1.4;
        color: #ccc;
        margin-bottom: 8px;
    }
    
    .rag-volumes-list .search-result-meta {
        font-size: 0.75rem;
        color: #999;
    }
}

.saved-prompt-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.saved-prompt-actions .btn-action-small {
    flex: 1;
    min-width: 80px;
    text-align: center;
}

@media (max-width: 479px) {
    .saved-prompt-actions {
        flex-direction: column;
    }
    
    .saved-prompt-actions .btn-action-small {
        flex: none;
    }
    
    /* Mobile styles for saved prompt meta-actions buttons - ONLY for workspace saved prompts */
    #saved-prompts-list .saved-prompt-item .post-meta .meta-actions {
        flex-direction: row;
        gap: 8px;
        width: 100%;
    }
    
    #saved-prompts-list .saved-prompt-item .post-meta .meta-actions .action-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }
}

.saved-prompt-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.saved-prompt-checkbox input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.saved-prompt-checkbox label {
    font-size: 0.85rem;
    color: #999;
    cursor: pointer;
    margin: 0;
}



/* Legacy modal styles - kept for backward compatibility */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-content {
    background-color: #2d2d2d;
    margin: 10% auto;
    padding: 20px;
    border-radius: 12px;
    width: 95%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@media (min-width: 480px) {
    .modal-content { margin: 5% auto; padding: 30px; border-radius: 15px; width: 90%; }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #555;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.close {
    color: #999;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover { color: #e0e0e0; }

.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #e0e0e0;
    font-size: 1rem;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.form-select:focus {
    outline: none;
    border-color: #6a82fb;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    flex-direction: column;
}

@media (min-width: 480px) {
    .modal-actions { flex-direction: row; gap: 15px; margin-top: 25px; }
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

@media (min-width: 480px) {
    .btn { padding: 12px 24px; border-radius: 8px; font-size: 1rem; }
}

.btn-primary { background: var(--primary-color); color: white; }
.btn-secondary { background: var(--secondary-color); color: white; }
.btn:hover { opacity: 0.8; }

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 8px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid #555;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #555;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    color: #e0e0e0;
    font-size: 1.3rem;
    font-weight: 600;
}

.modal-close-btn {
    background: none;
    border: none;
    color: #aaa;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.modal-close-btn:hover {
    background: #444;
    color: #fff;
}

.modal-body {
    padding: 20px;
}

.modal-field {
    margin-bottom: 20px;
}

.modal-field:last-child {
    margin-bottom: 0;
}

.modal-field label {
    display: block;
    margin-bottom: 8px;
    color: #e0e0e0;
    font-weight: 500;
}

.modal-field input,
.modal-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #555;
    border-radius: 4px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 14px;
    box-sizing: border-box;
}

.modal-field input:focus,
.modal-field textarea:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 2px rgba(106, 130, 251, 0.2);
}

.modal-field textarea {
    min-height: 80px;
    resize: vertical;
}


.modal-footer {
    padding: 20px;
    border-top: 1px solid #555;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer .btn {
    min-width: 80px;
}

/* Section Field Expand Icon */
.field-input-wrapper-with-expand {
    position: relative;
    width: 100%;
}

.field-expand-icon {
    position: absolute;
    top: 8px;
    right: 8px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 16px;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    opacity: 0.7;
}

.field-expand-icon:hover {
    background: none;
    color: #fff;
    border: none;
}

/* Section Expand Modal */
.section-expand-modal .modal-content {
    max-width: 80vw;
    max-height: 90vh;
    width: 80vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.section-expand-modal .modal-body {
    flex: 1;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.section-expand-textarea {
    width: 100%;
    height: 100%;
    padding: 20px;
    border: none;
    border-radius: 0;
    background: #1a1a1a;
    color: #e0e0e0;
    font-size: 16px;
    font-family: inherit;
    resize: none;
    box-sizing: border-box;
}

.section-expand-textarea:focus {
    outline: none;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    background: #555;
    color: #e0e0e0;
}


.saved-prompt-title {
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 5px;
    font-size: 1rem;
}

/* Search Filters Header */
.saved-prompts-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #555;
    background: #2a2a2a;
    cursor: pointer;
    transition: background-color 0.2s;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.filters-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.saved-prompts-filters-header:hover {
    background: #333;
}

/* RAG Volume Header - dedicated styling for RAG tab */
.rag-volume-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 20px;
    border-bottom: 1px solid #555;
    background: #2a2a2a;
    cursor: default; /* No hover effect needed */
}

.rag-volume-header .section-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.rag-volume-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* RAG Volumes Section - dedicated styling */
.rag-volumes-section {
    background: #1a1a1a;
    border-radius: 12px;
    border: 1px solid #555;
    overflow: hidden;
}

/* Tool Calls Section - integrated with workspace */
.tool-calls-container {
    margin-top: 20px;
    padding: 20px;
}

.tool-calls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.tool-calls-header .section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.tool-calls-list {
    margin-bottom: 15px;
}

.no-tool-calls {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 8px;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #555;
    margin: 10px 0;
}

.no-tool-calls h4 {
    margin: 0 0 5px 0;
    font-size: 1rem;
}

.no-tool-calls p {
    margin: 0;
    font-size: 0.9rem;
}

.workspace-tool-card {
    background: #2d2d2d;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    transition: all 0.2s;
}

.workspace-tool-card:hover {
    border-color: #666;
    background: #333;
}

.workspace-tool-card .tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.workspace-tool-card .tool-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.workspace-tool-card .tool-function {
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    color: #999;
    margin-top: 4px;
}

.workspace-tool-card .tool-remove {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.workspace-tool-card .tool-remove:hover {
    background: #c82333;
}

/* Mobile responsive styles for tool calls */
@media (max-width: 479px) {
    .tool-calls-container {
        padding: 15px;
    }
    
    .tool-calls-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .workspace-tool-card .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .workspace-tool-card .tool-function {
        font-size: 0.8rem;
    }
}

.rag-volumes-list {
    padding: 20px;
}

.no-rag-volumes {
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 20px;
    background: #2d2d2d;
    border-radius: 8px;
    border: 1px solid #555;
    margin: 10px 0;
}

.filters-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
}

.toggle-filters-btn {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.toggle-filters-btn:hover {
    background: #444;
    color: #fff;
}

.toggle-icon {
    transition: transform 0.3s ease;
    font-size: 0.9rem;
}

.toggle-filters-btn.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* Filter Group Styling */
.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-label {
    font-size: 0.9rem;
    color: #b0b0b0;
    font-weight: 500;
    white-space: nowrap;
}

.filter-select {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 150px;
    transition: all 0.3s ease;
}

.filter-select:hover {
    border-color: #6a82fb;
    background: #404040;
}

.filter-select:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 2px rgba(106, 130, 251, 0.2);
    background: #404040;
}

.filter-select option {
    background: #3a3a3a;
    color: #e0e0e0;
}

/* Library selection modal select styling */
#library-select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.3s;
}

#library-select:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.1);
}

#library-select option {
    background: #2d2d2d;
    color: #e0e0e0;
}

.saved-prompts-filters {
    padding: 20px;
    border-bottom: 1px solid #555;
    display: flex;
    gap: 15px;
    flex-direction: column;
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 200px; /* Set a reasonable max-height for smooth transition */
}

.saved-prompts-filters.collapsed {
    max-height: 0;
    padding: 0 20px;
    border-bottom: none;
    opacity: 0;
}

.saved-prompts-bulk-actions {
    padding: 20px 20px 16px 20px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
}

@media (min-width: 480px) {
    .saved-prompts-filters {
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
    }
    
    .saved-prompts-bulk-actions {
        justify-content: flex-end;
    }
}

/* Mobile-specific styling for library filters */
@media (max-width: 479px) {
    .saved-prompts-filters {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 10px;
        align-items: center;
    }
    
    .filter-group {
        grid-column: 1;
        grid-row: 1;
        min-width: 0;
    }
    
    .filter-select {
        min-width: 120px;
    }
    
    #manage-libraries-header-btn {
        grid-column: 2;
        grid-row: 1;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    #run-library-btn {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
    }
    
    /* Fix search box width for all filter sections on mobile */
    #published-search-filters,
    #saved-search-filters,
    #response-search-filters,
    #tools-search-filters {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
    }
    
    #published-search-filters .search-box,
    #saved-search-filters .search-box,
    #response-search-filters .search-box,
    #tools-search-filters .search-box {
        width: 100% !important;
        flex: none !important;
    }
    
    #published-search-filters .category-filter,
    #saved-search-filters .category-filter,
    #response-search-filters .group-by-filter {
        width: 100% !important;
    }
}

@media (max-width: 479px) {
    /* Edge-to-edge layout on mobile */
    body {
        margin: 0;
        padding: 0;
    }
    
    .container {
        margin: 0 !important;
        border-radius: 0 !important;
        max-width: 100% !important;
    }
    
    header {
        border-radius: 0 !important;
        padding: 8px 0 !important;
    }
    
    header > div {
        padding: 0 !important;
    }
    
    /* Header button container - allow horizontal scrolling if needed */
    header > div > div:last-child {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 6px;
    }
    
    .main-content {
        padding: 0 !important;
        margin: 0;
    }
    
    .tab-navigation {
        border-radius: 0 !important;
    }
    
    .tab-content {
        border-radius: 0 !important;
    }
    
    .tab-panel {
        padding: 0 !important;
    }
    
    .primary-section {
        padding: 0 !important;
        gap: 1px;
    }
    
    .prompt-workspace {
        border-radius: 0 !important;
    }
    
    .workspace-header {
        padding: 20px 0 !important;
        border-radius: 0 !important;
        border-bottom: 2px solid #555 !important;
    }
    
    .prompt-container {
        padding: 20px 0 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    .action-panel {
        padding: 1px 0 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    .action-section {
        padding: 20px !important;
        border-radius: 12px !important;
        border: 1px solid #555 !important;
        background: #1a1a1a !important;
    }
    
    .save-section {
        padding: 20px 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    .saved-prompts-section {
        border-radius: 0 !important;
        border-left: none;
        border-right: none;
        margin: 0;
        border-top: 2px solid #555 !important;
    }
    
    .saved-prompts-header {
        padding: 20px 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    
    .response-header {
        padding: 20px 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #444 !important;
    }
    
    .saved-prompts-header {
        padding: 20px 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #444 !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 15px !important;
    }
    
    .saved-prompts-title {
        text-align: center !important;
    }
    
    .saved-prompts-filters-header {
        padding: 15px 0 !important;
        border-bottom: 1px solid #333 !important;
    }
    
    .saved-prompts-filters {
        padding: 20px 0 !important;
        border-bottom: 1px solid #333 !important;
    }
    
    .saved-prompts-filters.collapsed {
        padding: 0 !important;
        border-bottom: none !important;
    }
    
    /* Mobile-specific collapsed state - only applied when .collapsed class is present */
    .saved-prompts-filters.collapsed {
        max-height: 0 !important;
        padding: 0 20px !important;
        border-bottom: none !important;
        opacity: 0 !important;
    }
    
    .toggle-filters-btn.collapsed .toggle-icon {
        transform: rotate(-90deg) !important;
    }
    
    .saved-prompts-list {
        padding: 20px 0 !important;
    }
    
    .saved-prompts-bulk-actions {
        flex-direction: column;
        gap: 8px;
        padding: 20px 0 !important;
        border-top: 1px solid #333 !important;
    }
    
    .saved-prompts-bulk-actions .btn-action-small {
        width: 100%;
    text-align: center;
    }
    
    /* Check/Uncheck buttons row - keeps them together on mobile */
    .check-uncheck-buttons-row {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .check-uncheck-buttons-row .btn-action-small {
        flex: 1;
        width: auto;
    }
    
    /* Import/Export buttons row - keeps them together on mobile */
    .import-export-buttons-row {
        display: flex;
        gap: 8px;
        width: 100%;
    }
    
    .import-export-buttons-row .btn-action-small {
        flex: 1;
        width: auto;
    }
    
    .saved-prompts-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .saved-prompts-actions .btn-action-small {
        width: 100%;
        text-align: center;
    }
    
    .response-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
        padding: 15px;
    }
    
    .response-actions {
        justify-content: stretch;
    }
    
    .response-actions .btn-action-small {
        flex: 1;
        text-align: center;
    }
    
    .response-content-container {
        padding: 10px 0 !important;
        height: auto !important;
        margin: 20px 0 !important;  /* Remove horizontal margin */
        background: #1a1a1a !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    .response-content {
        min-height: auto;
        padding: 10px 0 !important;
        border-radius: 0 !important;
        border: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        height: auto !important;
    }
    
    /* Make results-container go edge to edge on mobile */
    #results-container {
        margin-left: -20px !important;
        margin-right: -20px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    
    
    .card {
        padding: 20px 0 !important;
        margin-bottom: 20px !important;
        border-radius: 0 !important;
        border: 1px solid #555 !important;
    }
    
    .saved-prompt-item {
        padding: 20px 0 !important;
        margin-bottom: 20px !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #333 !important;
    }
    
    .saved-prompt-title-row {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
    }
    
    .saved-prompt-title-container {
        margin-right: 10px !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .empty-state {
        padding: 40px 0 !important;
    }
    
    .no-saved-prompts {
        padding: 20px 0 !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #333 !important;
    }
    
    .field-inputs-container {
        padding: 20px 0 !important;
        margin: 0 !important;
        border-bottom: 1px solid #333 !important;
    }
    
    
    
    /* Mobile responsive card header */
    .card-header {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .card-header > div {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        align-items: center;
        width: auto;
    }
    
    .card-header strong {
        font-size: 0.9rem;
        margin-bottom: 0;
    }
    
    /* Mobile button styling in card headers */
    .card-header button {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
        min-width: auto !important;
        flex: 1;
        text-align: center;
    }
    
    .card-header span {
        font-size: 0.8rem;
        white-space: nowrap;
    }
    
    /* Mobile Modal Styles */
    .modal-overlay {
        padding: 10px;
        align-items: flex-start;
        padding-top: 20px;
    }
    
    .modal-content {
        max-height: 90vh;
        border-radius: 0;
        margin: 0;
    }
    
    /* Section Expand Modal Mobile Styles */
    .section-expand-modal .modal-content {
        width: 100vw !important;
        height: calc(100vh - 30px) !important;
        max-width: 100vw !important;
        max-height: calc(100vh - 30px) !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .section-expand-modal .modal-overlay {
        padding: 0 !important;
        align-items: stretch !important;
    }
    
    /* Publish modal specific mobile adjustments */
    #publish-modal .modal-content {
        max-height: 85vh;
        margin: 0;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-header h3 {
        font-size: 1.1rem;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .modal-footer {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }
    
    .modal-footer .btn {
        width: 100%;
        min-width: auto;
    }
    
    /* View Documents Modal Mobile Responsiveness */
    #view-documents-modal .modal-content {
        max-width: 95% !important;
        max-height: 90vh;
        margin: 0;
        border-radius: 0;
    }
    
    #view-documents-modal .modal-header {
        padding: 15px;
        border-bottom: 1px solid #555;
    }
    
    #view-documents-modal .modal-header h3 {
        font-size: 1.1rem;
        margin: 0;
        color: #e0e0e0;
    }
    
    #view-documents-modal .modal-body {
        padding: 15px;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    #view-documents-modal .documents-list {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    #view-documents-modal .document-item {
        background: #2d2d2d;
        border: 1px solid #555;
        border-radius: 8px;
        padding: 12px;
        margin-bottom: 10px;
    }
    
    #view-documents-modal .document-header {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-bottom: 8px;
    }
    
    #view-documents-modal .document-name {
        font-size: 0.95rem;
        font-weight: 600;
        color: #e0e0e0;
        line-height: 1.3;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
    }
    
    #view-documents-modal .document-meta {
        display: flex;
        flex-direction: column;
        gap: 4px;
        font-size: 0.8rem;
        color: #999;
    }
    
    #view-documents-modal .document-stats {
        display: flex;
        flex-direction: column;
        gap: 6px;
        margin: 8px 0;
    }
    
    #view-documents-modal .stat-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.8rem;
        color: #ccc;
    }
    
    #view-documents-modal .stat-label {
        font-weight: 500;
    }
    
    #view-documents-modal .stat-value {
        color: #28a745;
        font-weight: 600;
    }
    
    #view-documents-modal .document-actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        margin-top: 12px;
    }
    
    #view-documents-modal .document-actions .btn {
        width: 100%;
        font-size: 0.85rem;
        padding: 10px 16px;
        min-height: 40px;
        height: 40px;
        justify-content: center;
    }
    
    /* Document preview text overflow handling */
    #view-documents-modal .document-preview,
    #view-documents-modal .document-content,
    #view-documents-modal .document-text {
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        line-height: 1.4;
    }
    
    #view-documents-modal .document-preview-text {
        background: #1a1a1a;
        border: 1px solid #444;
        border-radius: 6px;
        padding: 10px;
        margin: 8px 0;
        word-wrap: break-word;
        word-break: break-word;
        overflow-wrap: break-word;
        white-space: pre-wrap;
        max-width: 100%;
        box-sizing: border-box;
        overflow: hidden;
        line-height: 1.4;
        color: #e0e0e0;
        font-size: 0.85rem;
    }
    
    #view-documents-modal .no-documents {
        padding: 20px;
        text-align: center;
    }
    
    #view-documents-modal .no-documents .empty-state {
        padding: 20px 0;
    }
    
    #view-documents-modal .no-documents .empty-icon {
        font-size: 2.5rem;
        margin-bottom: 12px;
    }
    
    #view-documents-modal .no-documents h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        color: #e0e0e0;
    }
    
    #view-documents-modal .no-documents p {
        font-size: 0.9rem;
        color: #999;
        margin: 0;
    }
    
    #view-documents-modal .modal-footer {
        padding: 15px;
        border-top: 1px solid #555;
    }
    
    #view-documents-modal .modal-footer .btn {
        width: 100%;
        font-size: 0.9rem;
        padding: 12px 16px;
        min-height: 44px;
        height: 44px;
    }
}

.search-box {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-box input {
    width: 100%;
    padding-right: 35px;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.clear-search-btn:hover {
    background: #555;
    color: #e0e0e0;
}

/* Fix response history search button positioning */
.response-content-container .search-box {
    position: relative;
}



input[type="text"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.3s;
}

input[type="text"]:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.1);
}

input[type="text"]::placeholder {
    color: #999;
}

textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.3s;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.1);
}

textarea::placeholder {
    color: #999;
}

/* Dark mode scrollbar for all textareas */
textarea::-webkit-scrollbar,
#prompt-input::-webkit-scrollbar,
.field-input-group textarea::-webkit-scrollbar,
.modal-field textarea::-webkit-scrollbar {
    width: 8px;
}

textarea::-webkit-scrollbar-track,
#prompt-input::-webkit-scrollbar-track,
.field-input-group textarea::-webkit-scrollbar-track,
.modal-field textarea::-webkit-scrollbar-track {
    background: #2d2d2d;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb,
#prompt-input::-webkit-scrollbar-thumb,
.field-input-group textarea::-webkit-scrollbar-thumb,
.modal-field textarea::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

textarea::-webkit-scrollbar-thumb:hover,
#prompt-input::-webkit-scrollbar-thumb:hover,
.field-input-group textarea::-webkit-scrollbar-thumb:hover,
.modal-field textarea::-webkit-scrollbar-thumb:hover {
    background: #666;
}

input[type="file"] {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.3s;
    cursor: pointer;
}

input[type="file"]:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.1);
}

input[type="file"]::-webkit-file-upload-button {
    background: #6a82fb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
    transition: all 0.2s;
}

input[type="file"]::-webkit-file-upload-button:hover {
    background: #5a6fd8;
}

input[type="file"]::-moz-file-upload-button {
    background: #6a82fb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    margin-right: 12px;
}

.category-filter {
    flex: 0 0 auto;
}

.group-by-filter {
    flex: 0 0 auto;
}

@media (min-width: 480px) {
    .category-filter {
        min-width: 200px;
    }
    
    .group-by-filter {
        min-width: 180px;
    }
}

.category-filter select,
.group-by-filter select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #555;
    border-radius: 8px;
    font-size: 0.9rem;
    background-color: #2d2d2d;
    color: #e0e0e0;
    transition: all 0.3s;
}

.category-filter select:focus,
.group-by-filter select:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 3px rgba(106, 130, 251, 0.1);
}

/* Universal Suggestion Modal Styles */
.suggestion-modal-content {
    max-width: 600px;
}

.suggestion-display {
    min-height: auto;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    text-align: left;
    font-weight: 400;
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
}

.suggestion-display.title {
    font-weight: 500;
    line-height: 1.4;
}

.suggestion-text {
    color: #e0e0e0;
    font-size: 1rem;
    line-height: 1.5;
    white-space: pre-wrap;
}

.suggestion-text.title {
    line-height: 1.4;
}

/* Suggest Button Styles */
#suggest-title-btn,
#suggest-description-btn,
#suggest-publish-title-btn,
#suggest-publish-description-btn {
    transition: all 0.2s ease;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    white-space: nowrap;
    min-width: 80px;
}

#suggest-title-btn:hover,
#suggest-description-btn:hover,
#suggest-publish-title-btn:hover,
#suggest-publish-description-btn:hover {
    background: #138496 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(23, 162, 184, 0.3);
}

#suggest-title-btn:active,
#suggest-description-btn:active,
#suggest-publish-title-btn:active,
#suggest-publish-description-btn:active {
    transform: translateY(0);
}

/* Mobile responsive styles for suggest button */
@media (max-width: 479px) {
    /* Mobile tab button styles are now handled in the main mobile section above */
    
    #suggest-title-btn,
    #suggest-description-btn,
    #suggest-publish-title-btn,
    #suggest-publish-description-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
        min-width: 70px;
    }
    
    .modal-field div[style*="display: flex"] {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-field div[style*="display: flex"] input,
    .modal-field div[style*="display: flex"] textarea {
        width: 100%;
    }
    
    .modal-field div[style*="display: flex"] button {
        width: 100%;
        justify-content: center;
    }
    
    /* Universal suggestion modal mobile adjustments */
    .suggestion-modal-content {
        max-width: 95%;
    }
    
    .suggestion-display {
        min-height: 80px;
        font-size: 0.9rem;
    }
    
    .suggestion-display.title {
        min-height: 50px;
    }
}

/* Response History Specific Styles */
#response-history-section {
    margin-top: 40px;
}

#response-history-section .saved-prompt-item {
    margin-bottom: 20px;
}

#response-history-section .post-title {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

#response-history-section .post-description {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

/* Mobile-specific Read More styles */
@media (max-width: 479px) {
    .read-more-btn {
        font-size: 0.85rem;
        margin-left: 2px;
    }
    
    .post-description {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

#response-history-section .saved-prompt-text {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    max-height: 100px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

#response-history-section .saved-prompt-text img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

#response-history-section .meta-item {
    font-size: 0.8rem;
}

#response-history-section .action-btn {
    font-size: 0.85rem;
    padding: 8px 12px;
}

#response-history-section .post-prompt-preview {
    margin-bottom: 15px;
}

#response-history-section .post-prompt-preview .btn-expand-prompt {
    margin-bottom: 10px;
    margin-right: 10px;
    display: inline-block;
}

/* Mobile responsive for response history */
@media (max-width: 479px) {
    #response-history-section .saved-prompt-text {
        font-size: 0.8rem;
        max-height: 80px;
    }
    
    #response-history-section .action-btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
}

/* Model Row and Checkbox Styles */
.model-row {
    display: grid;
    grid-template-columns: auto 1fr 1fr auto;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.model-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    appearance: none;
    background-color: #000000;
    border: 2px solid #666;
    border-radius: 4px;
    position: relative;
}

.model-checkbox:hover {
    border-color: #888;
}

.model-checkbox:checked {
    background-color: #000000;
    border-color: #666;
}

.model-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

/* Mobile responsive adjustments */
@media (max-width: 479px) {
    .model-row {
        grid-template-columns: auto 1fr;
        gap: 12px;
        margin-bottom: 12px;
    }
    
    .model-checkbox {
        width: 18px;
        height: 18px;
        justify-self: start;
    }
}

/* Pinned Prompts Grid Layout */
#pinned-prompts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    padding: 20px 0;
}

.pinned-prompt-card {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 150px;
    transition: all 0.3s ease;
}

.pinned-prompt-card:not(.has-fields) {
    min-height: 220px;
}

.pinned-prompt-card.has-fields {
    min-height: 220px;
}

.pinned-prompt-card.fields-expanded {
    min-height: auto;
    aspect-ratio: unset;
}


.pinned-prompt-header {
    margin-bottom: 10px;
}

.pinned-prompt-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e0e0e0;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-prompt-meta {
    margin-bottom: 15px;
    flex-grow: 1;
}

.pinned-meta-item {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pinned-prompt-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pinned-prompt-actions .action-btn {
    font-size: 0.8rem;
    padding: 8px 12px;
    min-height: auto;
}

.pinned-prompt-actions .btn-action-small {
    font-size: 0.75rem;
    padding: 6px 10px;
}

/* Pinned Prompt Reorder Buttons */
.pinned-prompt-reorder {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #444;
}

.pinned-reorder-btn {
    background: #444;
    border: 1px solid #666;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
}

.pinned-reorder-btn:hover {
    background: #555;
    border-color: #777;
    transform: translateY(-1px);
}

.pinned-reorder-btn:disabled {
    background: #333;
    border-color: #444;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.pinned-reorder-btn:disabled:hover {
    background: #333;
    border-color: #444;
    transform: none;
}

/* CSS arrows for pinned reorder buttons - consistent across all devices */
.pinned-reorder-btn.move-left-btn::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #e0e0e0;
    margin: 0;
}

.pinned-reorder-btn.move-right-btn::before {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 8px solid #e0e0e0;
    margin: 0;
}

.pinned-reorder-btn:disabled.move-left-btn::before {
    border-right-color: #666;
}

.pinned-reorder-btn:disabled.move-right-btn::before {
    border-left-color: #666;
}

/* Pinned Prompt Fields */
.pinned-prompt-fields {
    margin: 10px 0;
}

.pinned-fields-toggle-btn {
    background: #3a3a3a;
    border: 1px solid #555;
    color: #e0e0e0;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.pinned-fields-toggle-btn:hover {
    background: #4a4a4a;
    border-color: #6a82fb;
}

.pinned-fields-container {
    margin-top: 8px;
    padding: 10px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 4px;
}

.pinned-field-input {
    margin-bottom: 10px;
}

.pinned-field-input:last-child {
    margin-bottom: 0;
}

.pinned-field-label {
    display: block;
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 4px;
    font-weight: 500;
}

.pinned-field-text-input,
.pinned-field-file-input {
    width: 100%;
    padding: 6px 8px;
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 3px;
    color: #e0e0e0;
    font-size: 0.7rem;
    box-sizing: border-box;
}

.pinned-field-text-input:focus,
.pinned-field-file-input:focus {
    outline: none;
    border-color: #6a82fb;
    box-shadow: 0 0 0 2px rgba(106, 130, 251, 0.2);
}

.pinned-field-file-input {
    cursor: pointer;
}

.pinned-fields-toggle-btn .toggle-icon {
    font-size: 0.6rem;
    transition: transform 0.3s ease;
}

/* Mobile responsive adjustments for pinned prompts */
@media (max-width: 479px) {
    #pinned-prompts-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .pinned-prompt-card {
        min-height: 180px;
        padding: 12px;
    }
    
    .pinned-prompt-card:not(.has-fields) {
        min-height: 180px;
    }
    
    .pinned-prompt-card.has-fields {
        min-height: 180px;
    }
    
    #no-pinned-prompts {
        min-height: 120px;
        padding: 12px;
        margin: 0;
    }
    
    .pinned-prompt-title {
        font-size: 0.8rem;
    }
    
    .pinned-meta-item {
        font-size: 0.7rem;
    }
    
    .pinned-prompt-actions .action-btn {
        font-size: 0.75rem;
        padding: 6px 10px;
    }
    
    .pinned-prompt-actions .btn-action-small {
        font-size: 0.7rem;
        padding: 5px 8px;
    }
}

/* Mobile utility classes */
@media (max-width: 479px) {
    .mobile-full-width { width: 100% !important; }
    .mobile-stack { flex-direction: column !important; }
    .mobile-center { text-align: center !important; }
    .mobile-padding { padding: 15px !important; }
    .mobile-margin { margin: 15px 0 !important; }
    .mobile-font-small { font-size: 0.8rem !important; }
    
    /* Center section titles on mobile for About, Privacy, Terms tabs */
    #about-content .saved-prompts-filters-header,
    #privacy-content .saved-prompts-filters-header,
    #terms-content .saved-prompts-filters-header {
        justify-content: center !important;
    }
    
    #about-content .section-title,
    #privacy-content .section-title,
    #terms-content .section-title {
        text-align: center !important;
    }
    
    /* Fix mobile scrolling - disable horizontal scrolling on code blocks to prevent touch interference */
    .markdown-content pre {
        overflow-x: visible !important;
        white-space: pre-wrap !important;
        word-wrap: break-word !important;
        word-break: break-all !important;
        touch-action: pan-y !important;
    }
    
    .markdown-content {
        touch-action: pan-y !important;
    }
    
    /* Mobile-specific help content improvements */
    #help-content .markdown-content {
        font-size: 1rem;
        line-height: 1.7;
        padding: 0 10px;
    }
    
    #help-content .markdown-content h2 {
        font-size: 1.4rem;
        margin-top: 28px;
        margin-bottom: 14px;
    }
    
    #help-content .markdown-content h3 {
        font-size: 1.2rem;
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    #help-content .markdown-content pre {
        padding: 15px;
        font-size: 0.9rem;
        margin: 15px 0;
    }
}

/* Tools Tab Styles */
.tool-card {
    background: #2d2d2d;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #444;
}

.tool-name {
    color: #e0e0e0;
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.tool-id {
    background: #667eea;
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-description {
    margin-bottom: 15px;
}

.tool-description p {
    color: #b0b0b0;
    line-height: 1.5;
    margin: 0;
}

.tool-details {
    display: grid;
    gap: 10px;
}

.tool-parameter {
    color: #d0d0d0;
    font-size: 0.9rem;
}

.tool-parameter strong {
    color: #e0e0e0;
    font-weight: 600;
}

.tool-url {
    background: #1a1a1a;
    color: #667eea;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    word-break: break-all;
}

.tool-parameters {
    margin-top: 10px;
}

.tool-parameters strong {
    color: #e0e0e0;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.tool-parameters ul {
    margin: 0;
    padding-left: 20px;
    list-style-type: disc;
}

.tool-parameters li {
    color: #d0d0d0;
    margin-bottom: 5px;
    line-height: 1.4;
}

.tool-parameters .required {
    color: #ff6b6b;
    font-weight: bold;
    margin-left: 4px;
}


/* Tool Form Styles */
.tool-form {
    margin: 20px 0;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.tool-form h5 {
    color: #e0e0e0;
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 600;
}

.tool-parameter-field {
    margin-bottom: 15px;
}

.tool-parameter-field label {
    display: block;
    color: #d0d0d0;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.tool-parameter-field .required {
    color: #ff6b6b;
    font-weight: bold;
    margin-left: 4px;
}

.tool-input {
    width: 100%;
    padding: 8px 12px;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
}

.tool-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.tool-input::placeholder {
    color: #888;
}

.tool-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.tool-run-btn, .tool-clear-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tool-run-btn {
    background: #667eea;
    color: white;
}

.tool-run-btn:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.tool-clear-btn {
    background: #6c757d;
    color: white;
}

.tool-clear-btn:hover {
    background: #5a6268;
}

/* Tool Results Styles */
.tool-results {
    margin: 20px 0;
    padding: 15px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.tool-results h5 {
    color: #e0e0e0;
    margin: 0 0 15px 0;
    font-size: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tool-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    font-size: 0.9rem;
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #333;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tool-result-success {
    background: #1a2a1a;
    border: 1px solid #2a4a2a;
    border-radius: 6px;
    padding: 12px;
}

.tool-result-success h6 {
    color: #4ade80;
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.tool-result-error {
    background: #2a1a1a;
    border: 1px solid #4a2a2a;
    border-radius: 6px;
    padding: 12px;
}

.tool-result-error h6 {
    color: #ff6b6b;
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
}

.tool-result-error p {
    color: #ff9999;
    margin: 0;
    font-size: 0.9rem;
}

.tool-result-json {
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 12px;
    color: #e0e0e0;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Mobile responsive styles for tool response */
@media (max-width: 479px) {
    .tool-response-mobile {
        max-height: 60px !important;
        height: 60px !important;
        font-size: 11px !important;
        padding: 6px !important;
    }
    
    /* Mobile Python code container adjustments */
    .python-code-container {
        margin: 6px 0 !important;
    }
    
    .tool-python-code {
        font-size: 0.75rem !important;
        padding: 8px !important;
        line-height: 1.3 !important;
    }
    
    /* Mobile Python Processing header adjustments */
    .tool-parameter .tool-parameter:has(.python-code-container) > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
    }
    
    .tool-parameter .tool-parameter:has(.python-code-container) .btn-expand-prompt {
        font-size: 0.8rem !important;
        padding: 6px 10px !important;
        align-self: flex-end !important;
    }
}

/* Mobile responsive styles for tools */
@media (max-width: 479px) {
    .tool-card {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .tool-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .tool-name {
        font-size: 1.1rem;
    }
    
    .tool-id {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .tool-parameter {
        font-size: 0.85rem;
    }
    
    .tool-url {
        font-size: 0.8rem;
        word-break: break-all;
    }
    
    .tool-parameters ul {
        padding-left: 15px;
    }
    
    .tool-parameters li {
        font-size: 0.85rem;
    }
    
    .tool-form {
        padding: 12px;
        margin: 15px 0;
    }
    
    .tool-actions {
        flex-direction: column;
        gap: 8px;
    }
    
    .tool-run-btn, .tool-clear-btn {
        width: 100%;
        justify-content: center;
    }
    
    .tool-results {
        padding: 12px;
        margin: 15px 0;
    }
    
    .tool-result-json {
        font-size: 0.75rem;
        padding: 8px;
    }
}

/* Python Code Styling */
.python-code-container {
    margin: 8px 0;
    border: 1px solid #555;
    border-radius: 6px;
    overflow: hidden;
    background: #1f2937;
    display: block;
    transition: all 0.3s ease;
}

/* Collapsed state for Python code container */
.python-code-container.python-code-collapsed {
    display: none;
}

/* Python Processing header with toggle button */
.tool-parameter .tool-parameter:has(.python-code-container) {
    margin-bottom: 15px;
}

.tool-parameter .tool-parameter:has(.python-code-container) > div:first-child {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.tool-parameter .tool-parameter:has(.python-code-container) strong {
    color: #e0e0e0;
    font-weight: 600;
    margin: 0;
}

.tool-python-code {
    margin: 0;
    padding: 12px;
    background: #1f2937;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    color: #f9fafb;
    white-space: pre-wrap;
    word-wrap: break-word;
    display: block;
}

/* Python code styling - no scrollbars needed since content auto-sizes */

.tool-python-code code {
    background: transparent;
    padding: 0;
    border: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

/* Syntax highlighting for Python code */
.tool-python-code .language-python {
    color: #f9fafb;
}

/* Python code styling - no scrollbars needed since content auto-sizes */

/* Injector UI Components */
.tool-inject-section {
    margin-top: 12px;
    padding: 8px;
    background: var(--background-dark);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.tool-inject-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.tool-inject-fields {
    margin-top: 12px;
    padding: 12px;
    background: var(--background-dark);
    border-radius: 6px;
    border: 1px solid var(--border-light);
}

.tool-inject-field {
    margin-bottom: 8px;
}

.tool-inject-field label {
    display: block;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.tool-inject-input {
    width: 100%;
    padding: 6px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--background-medium);
    color: var(--text-primary);
    font-size: 0.8rem;
}

.tool-inject-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(106, 130, 251, 0.2);
}

/* Injectors meta tag styling */
.meta-item .meta-text[style*="color: #8b5cf6"] {
    color: #8b5cf6 !important;
    font-weight: 600;
}

     /* RAG Tab Styles */
     .volume-card {
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
        transition: all 0.2s ease;
    }
    
    .volume-card:hover {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }
    
    .volume-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .volume-name {
        margin: 0;
        color: #e0e0e0;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .volume-actions {
        display: flex;
        gap: 8px;
    }
    
    .volume-description {
        color: #888;
        margin-bottom: 12px;
        font-size: 0.9rem;
    }
    
    .volume-stats {
        display: flex;
        gap: 16px;
        font-size: 0.8rem;
        color: #666;
    }
    
    .document-count {
        color: #667eea;
    }
    
    .volume-created {
        color: #888;
    }
    
    /* Manage Volumes Modal Styles */
    .volume-management-card {
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
        transition: all 0.2s ease;
    }
    
    .volume-management-card:hover {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }
    
    .volume-settings {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
        margin: 12px 0;
        padding: 12px;
        background: #0f0f0f;
        border-radius: 6px;
    }
    
    .setting-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.9rem;
    }
    
    .setting-label {
        color: #888;
        font-weight: 500;
    }
    
    .setting-value {
        color: #e0e0e0;
        font-weight: 600;
    }
    
    .form-range {
        width: 100%;
        height: 6px;
        border-radius: 3px;
        background: #333;
        outline: none;
        -webkit-appearance: none;
        appearance: none;
    }
    
    .form-range::-webkit-slider-thumb {
        -webkit-appearance: none;
        appearance: none;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #667eea;
        cursor: pointer;
    }
    
    .form-range::-moz-range-thumb {
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #667eea;
        cursor: pointer;
        border: none;
    }
    
    /* Document Upload Styles */
    .upload-zone {
        border: 2px dashed #667eea;
        border-radius: 8px;
        padding: 40px 20px;
        text-align: center;
        background: #0f0f0f;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .upload-zone:hover {
        border-color: #8b9cf7;
        background: #1a1a1a;
    }
    
    .upload-zone.dragover {
        border-color: #8b9cf7;
        background: #1a1a1a;
        transform: scale(1.02);
    }
    
    .upload-icon {
        font-size: 3rem;
        margin-bottom: 16px;
    }
    
    .upload-zone h4 {
        margin: 0 0 8px 0;
        color: #e0e0e0;
    }
    
    .upload-zone p {
        margin: 0 0 20px 0;
        color: #888;
    }
    
    .selected-files {
        margin-top: 20px;
    }
    
    .selected-files h4 {
        color: #e0e0e0;
        margin: 0 0 12px 0;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .file-list {
        max-height: 200px;
        overflow-y: auto;
        border: 1px solid #333;
        border-radius: 6px;
        padding: 12px;
        background: #0f0f0f;
    }
    
    .file-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #222;
    }
    
    .file-item:last-child {
        border-bottom: none;
    }
    
    .file-info {
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .file-icon {
        font-size: 1.2rem;
    }
    
    .file-name {
        color: #e0e0e0;
        font-weight: 500;
    }
    
    .file-size {
        color: #888;
        font-size: 0.9rem;
    }
    
    .remove-file {
        background: #dc3545;
        color: white;
        border: none;
        border-radius: 4px;
        padding: 4px 8px;
        cursor: pointer;
        font-size: 0.8rem;
    }
    
    .remove-file:hover {
        background: #c82333;
    }
    
    .processing-status {
        margin-top: 20px;
        padding: 20px;
        background: #0f0f0f;
        border-radius: 8px;
        border: 1px solid #333;
    }
    
    .processing-status h4 {
        color: #e0e0e0;
        margin: 0 0 12px 0;
        font-size: 1rem;
        font-weight: 600;
    }
    
    .progress-bar {
        width: 100%;
        height: 8px;
        background: #333;
        border-radius: 4px;
        overflow: hidden;
        margin: 12px 0;
    }
    
    .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #667eea, #8b9cf7);
        width: 0%;
        transition: width 0.3s ease;
    }
    
    .processing-details {
        color: #888;
        font-size: 0.9rem;
    }
    
    /* Document List Styles */
    .document-item {
        background: #1a1a1a;
        border: 1px solid #333;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
        transition: all 0.2s ease;
    }
    
    .document-item:hover {
        border-color: #667eea;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }
    
    .document-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 12px;
    }
    
    .document-name {
        margin: 0;
        color: #e0e0e0;
        font-size: 1.1rem;
        font-weight: 600;
    }
    
    .document-actions {
        display: flex;
        gap: 8px;
    }
    
    .document-details {
        display: flex;
        gap: 16px;
        margin-bottom: 12px;
        font-size: 0.9rem;
    }
    
    .document-type {
        color: #667eea;
        font-weight: 600;
    }
    
    .document-size {
        color: #888;
    }
    
    .document-chunks {
        color: #888;
    }
    
    .document-created {
        color: #888;
    }
    
    .document-preview {
        background: #0f0f0f;
        border-radius: 6px;
        padding: 12px;
        border: 1px solid #222;
    }
    
    .preview-text {
        color: #ccc;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    /* Embedding Status Styles */
    .embedding-status {
        font-size: 0.9rem;
        font-weight: 600;
        padding: 4px 8px;
        border-radius: 4px;
        display: inline-block;
    }
    
    .embedding-status.not-embedded {
        background: #ff4444;
        color: white;
    }
    
    .embedding-status.needs-update {
        background: #ff8800;
        color: white;
    }
    
    .embedding-status.generating {
        background: #0088ff;
        color: white;
    }
    
    .embedding-status.partial {
        background: #ffaa00;
        color: white;
    }
    
    .embedding-status.complete {
        background: #00aa44;
        color: white;
    }
    
    /* Volume Search Styles */
    .volume-search {
        margin-top: 16px;
        padding: 16px;
        background: #1a1a1a;
        border-radius: 8px;
        border: 1px solid #333;
    }
    
    .search-header h5 {
        margin: 0 0 12px 0;
        color: #fff;
        font-size: 1rem;
    }
    
    .search-input-group {
        display: flex;
        gap: 8px;
        margin-bottom: 12px;
    }
    
    .search-input {
        flex: 1;
        padding: 8px 12px;
        border: 1px solid #444;
        border-radius: 4px;
        background: #2a2a2a;
        color: #fff;
        font-size: 0.9rem;
    }
    
    .search-input:focus {
        outline: none;
        border-color: #007bff;
    }
    
    .search-results {
        margin-top: 12px;
    }
    
    .search-results-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .results-count {
        color: #ccc;
        font-size: 0.9rem;
    }
    
    .search-results-list {
        max-height: 300px;
        overflow-y: auto;
    }
    
    .search-result-item {
        background: #2a2a2a;
        border: 1px solid #444;
        border-radius: 6px;
        padding: 12px;
        margin-bottom: 8px;
    }
    
    .search-result-item:last-child {
        margin-bottom: 0;
    }
    
    .search-result-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 8px;
    }
    
    .search-result-document {
        font-weight: 600;
        color: #007bff;
        font-size: 0.9rem;
    }
    
    .search-result-similarity {
        background: #007bff;
        color: white;
        padding: 2px 6px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
    }
    
    .search-result-text {
        color: #ccc;
        font-size: 0.9rem;
        line-height: 1.4;
    }
    
    .search-result-meta {
        margin-top: 8px;
        font-size: 0.8rem;
        color: #888;
    }
    
    /* Progress Modal Styles */
    .progress-info {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .progress-info h4 {
        margin: 0 0 8px 0;
        color: #e0e0e0;
    }
    
    .progress-info p {
        margin: 0;
        color: #888;
    }
    
    .progress-details {
        margin-top: 12px;
        color: #666;
        font-size: 0.9rem;
        text-align: center;
    }