#opnv-prompt-library {
    display: grid;
    grid-template-columns: 280px 1fr;
    grid-template-rows: auto 1fr;
    gap: 16px;
    height: 100%;
    padding: 16px;
    background: #f8fafc;
    box-sizing: border-box;
}

.opnv-lib-filters {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.opnv-lib-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 12px;
}

.opnv-lib-tab {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.opnv-lib-tab:hover {
    background: #f1f5f9;
    color: #1e293b;
}

.opnv-lib-tab.active {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

.opnv-trending-badge {
    background: #fef2f2;
    color: #ef4444;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Social Proof Banner */
.opnv-top-banner {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.opnv-top-banner strong {
    color: #92400e;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.opnv-top-banner ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    gap: 12px;
    overflow-x: auto;
}

.opnv-top-banner li {
    font-size: 11px;
    background: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #fde68a;
    white-space: nowrap;
    color: #b45309;
    font-weight: 600;
}

.opnv-lib-search-row {
    display: flex;
    gap: 12px;
}

.opnv-lib-search {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
}

.opnv-lib-search:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34, 113, 177, 0.1);
}

.opnv-lib-select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    background: #fff;
    cursor: pointer;
}

#opnv-lib-sidebar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

#opnv-lib-list {
    flex: 1;
}

.opnv-tpl-item {
    padding: 12px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s;
}

.opnv-tpl-item:hover {
    background: #f1f5f9;
}

.opnv-tpl-item.active {
    background: #eff6ff;
    border-left: 4px solid #2271b1;
}

.opnv-tpl-item.pinned-fav {
    outline: 1px solid rgba(34, 113, 177, 0.2);
    background: rgba(34, 113, 177, 0.03);
}

.opnv-tpl-title {
    font-weight: 600;
    font-size: 13px;
    color: #1e293b;
    margin-bottom: 4px;
}

.opnv-tpl-meta {
    font-size: 11px;
    color: #64748b;
    display: flex;
    gap: 8px;
}

#opnv-lib-content {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.opnv-lib-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.opnv-lib-preview-title {
    font-weight: 700;
    font-size: 16px;
    color: #0f172a;
}

#opnv-prompt-output {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: none;
    background: #fdfdfd;
    color: #334155;
    outline: none;
}

#opnv-prompt-output:focus {
    border-color: #2271b1;
    background: #fff;
}

.opnv-lib-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Intelligent Builder Extensions */
.opnv-builder-box {
    grid-column: span 2;
    position: relative;
    margin-bottom: 8px;
}

#opnv-lib-suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 240px;
    overflow-y: auto;
}

.opnv-suggestion-item {
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.opnv-suggestion-item:last-child {
    border-bottom: none;
}

.opnv-suggestion-item:hover {
    background: #eff6ff;
}

.opnv-badge {
    padding: 2px 6px;
    font-size: 9px;
    font-weight: 800;
    border-radius: 4px;
    text-transform: uppercase;
}

.opnv-badge-pro {
    background: #2271b1;
    color: #fff;
}

.opnv-badge-free {
    background: #10b981;
    color: #fff;
}

.opnv-copy-mini, .opnv-fav-mini {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
    font-size: 14px;
    padding: 2px;
}

.opnv-copy-mini:hover, .opnv-fav-mini:hover {
    opacity: 1;
}

.opnv-tpl-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Section Styles */
.opnv-section {
    padding: 6px 0;
}

.opnv-section-title {
    font-size: 10px;
    font-weight: 800;
    color: #64748b;
    padding: 8px 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #f1f5f9;
}

.opnv-section-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 8px 0;
}

.opnv-lib-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.opnv-lib-btn-secondary {
    background: #fff;
    border-color: #e2e8f0;
    color: #475569;
}

.opnv-lib-btn-secondary:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.opnv-lib-btn-primary {
    background: #2271b1;
    color: #fff;
}

.opnv-lib-btn-primary:hover {
    background: #135e96;
}

/* Modal styles for variables if needed */
.opnv-vars-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (max-width: 800px) {
    #opnv-prompt-library {
        grid-template-columns: 1fr;
    }
    #opnv-lib-sidebar {
        max-height: 200px;
    }
}
