/* ============================================================================
   RECIPE BUILDER FULLSCREEN LAYOUT STYLES
   Fullscreen mode layout, 50/50 grid, and fullscreen-specific styling.
   
   Dependencies: variables.css (for CSS custom properties)
   ============================================================================ */

/* ----------------------------------------------------------------------------
   FULLSCREEN CONTAINER
   ---------------------------------------------------------------------------- */

.rb-fullscreen-container {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
    height: calc(100vh - 120px);
    min-height: 500px;
    max-height: calc(100vh - 120px);
    overflow: hidden;
}

/* Grid children need to stretch to fill their areas */
.rb-fullscreen-container>.rb-layout-left,
.rb-fullscreen-container>.rb-layout-right {
    min-height: 0;
    height: 100%;
}

/* ----------------------------------------------------------------------------
   LAYOUT MODE - FULLSCREEN
   ---------------------------------------------------------------------------- */

.rb-layout-fullscreen {
    flex-direction: row;
}

.rb-layout-fullscreen .rb-layout-left {
    flex: 0 0 66%;
    border-right: 1px solid var(--rb-border-dark);
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.rb-layout-fullscreen .rb-layout-right {
    flex: 0 0 33%;
    padding-left: 0.5rem;
    padding-right: 0.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* ----------------------------------------------------------------------------
   FULLSCREEN CONVERSATION PANEL
   ---------------------------------------------------------------------------- */

.rb-layout-fullscreen .rb-conversation-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* Conversation panel - input always at bottom */
.rb-layout-fullscreen .rb-conversation-panel {
    justify-content: flex-start;
}

/* No messages state - welcome message centered, input at bottom */
.rb-layout-fullscreen .rb-conversation-panel.no-messages .rb-conversation-thread {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rb-layout-fullscreen .rb-conversation-panel.no-messages .rb-input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--rb-border-dark);
    padding-top: 0.75rem;
}

/* Has messages state - chat style with input at bottom */
.rb-layout-fullscreen .rb-conversation-panel.has-messages .rb-conversation-thread {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
}

.rb-layout-fullscreen .rb-conversation-panel.has-messages .rb-input-area {
    flex-shrink: 0;
    border-top: 1px solid var(--rb-border-dark);
    margin-top: 0;
    padding-top: 0.75rem;
}

/* ----------------------------------------------------------------------------
   FULLSCREEN EFFECTS PANEL - FLIPPED: workspace (top 2/3) + effects (bottom 1/3) + footer
   ---------------------------------------------------------------------------- */

/* Effects panel container - flex column layout */
.rb-layout-fullscreen .rb-effects-panel,
.rb-layout-fullscreen .rb-layout-right.rb-effects-panel,
.rb-layout-right.rb-effects-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

/* Flipped layout: workspace at top, effects drawer in middle, footer pinned at bottom */
.rb-effects-panel-flipped {
    display: flex;
    flex-direction: column;
}

/* Effect workspace - grows to fill available space */
.rb-effects-panel-flipped>.rb-effect-workspace {
    flex: 1 1 auto;
    min-height: 200px;
    overflow: hidden;
    border-bottom: none;
    margin: 0;
}

/* Effects content area - the drawer that expands/collapses */
/* Min height ~15rem = space for ~7 condensed effect cards */
.rb-effects-panel-flipped>.rb-effects-content {
    flex: 0 0 15rem;
    max-height: 50%;
    min-height: 15rem;
    height: 15rem;
    overflow: hidden;
    transition: max-height 0.3s ease, min-height 0.3s ease, height 0.3s ease, flex 0.3s ease;
    /* Drawer styling - grey-blue tint with fade to darker at bottom */
    background: linear-gradient(to bottom,
            rgba(50, 65, 85, 0.5) 0%,
            rgba(50, 65, 85, 0.5) 60%,
            rgba(35, 45, 60, 0.7) 85%,
            rgba(25, 35, 50, 0.85) 100%);
    border-top: 1px solid rgba(80, 100, 130, 0.6);
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-direction: column;
}

/* Make the effects-main scrollable and align content to top */
.rb-effects-panel-flipped>.rb-effects-content>.rb-effects-main,
.rb-fullscreen-container .rb-effects-main {
    overflow-y: auto !important;
    overflow-x: hidden;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 100%;
    display: block;
    padding-top: 0;
}

/* Effects list (simple layout) - the drawer */
/* Min height ~15rem = space for ~7 condensed effect cards */
.rb-effects-panel-flipped>.rb-effects-list {
    flex: 0 0 auto;
    max-height: 50%;
    min-height: 15rem;
    height: 15rem;
    overflow-y: auto;
    transition: max-height 0.3s ease, min-height 0.3s ease, height 0.3s ease;
    /* Drawer styling - grey-blue tint with fade to darker at bottom */
    background: linear-gradient(to bottom,
            rgba(50, 65, 85, 0.5) 0%,
            rgba(50, 65, 85, 0.5) 60%,
            rgba(35, 45, 60, 0.7) 85%,
            rgba(25, 35, 50, 0.85) 100%);
    border-top: 1px solid rgba(80, 100, 130, 0.6);
    border-radius: 6px 6px 0 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

/* Effects footer - ALWAYS pinned at very bottom */
.rb-effects-footer {
    flex: 0 0 auto !important;
    border-top: 1px solid var(--rb-border-dark);
    border-bottom: none !important;
    z-index: 10;
}

/* ----------------------------------------------------------------------------
   COLLAPSIBLE EFFECTS DRAWER
   The effects list acts as a drawer that slides up from the footer bar.
   When collapsed, shows ~1.5 rows with a fade toward the footer (bottom).
   ---------------------------------------------------------------------------- */

/* Drawer toggle button - top right corner */
.rb-drawer-toggle-btn {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    padding: 0.15rem 0.4rem;
    font-size: 0.55rem;
    line-height: 1;
    background: rgba(70, 85, 110, 0.6);
    border: 1px solid rgba(100, 120, 150, 0.4);
    border-radius: 3px;
    color: rgba(150, 170, 200, 0.9);
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 5;
}

.rb-drawer-toggle-btn:hover {
    background: rgba(80, 100, 130, 0.8);
    color: rgba(200, 220, 255, 1);
}

/* Effects content wrapper - drawer behavior */
.rb-effects-content,
.rb-effects-list {
    position: relative;
    transition: max-height 0.3s ease, flex 0.3s ease;
}

/* Ensure drawer toggle button stays visible when collapsed */
.rb-effects-collapsed .rb-drawer-toggle-btn {
    z-index: 10;
}

/* Fade overlay - covers bottom of drawer, fading toward footer */
.rb-effects-fade-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(to bottom,
            rgba(30, 40, 55, 0.4) 0%,
            rgba(30, 40, 55, 0.85) 30%,
            rgba(30, 40, 55, 1) 50%);
}

/* Collapsed state - drawer partially closed, shows ~1.5 rows */
.rb-effects-content.rb-effects-collapsed,
.rb-effects-list.rb-effects-collapsed {
    max-height: 3rem !important;
    min-height: 3rem !important;
    height: 3rem !important;
    overflow: hidden !important;
}

.rb-effects-collapsed:hover .rb-effects-fade-overlay {
    opacity: 0.7;
}

/* Show fade overlay when collapsed */
.rb-effects-collapsed .rb-effects-fade-overlay {
    opacity: 1;
}

/* Disable scrolling in collapsed state */
.rb-effects-collapsed .rb-effects-main {
    overflow: hidden !important;
}

/* Legacy non-flipped styles (fallback) */
.rb-effects-panel:not(.rb-effects-panel-flipped)>.rb-effects-header {
    flex: 0 0 auto;
}

.rb-effects-panel:not(.rb-effects-panel-flipped)>.rb-effects-content {
    flex: 0 0 33% !important;
    max-height: 33%;
    overflow: hidden;
    border-bottom: 1px solid var(--rb-border-dark);
}

.rb-effects-panel:not(.rb-effects-panel-flipped)>.rb-effects-list {
    flex: 0 0 33% !important;
    max-height: 33%;
    overflow-y: auto;
    border-bottom: 1px solid var(--rb-border-dark);
}

/* Effect workspace - default styling with row layout for sidebar */
.rb-effect-workspace {
    flex: 1 1 auto;
    display: flex;
    flex-direction: row;
    min-height: 0;
    overflow: hidden;
    background: var(--rb-bg-base);
}

.rb-effect-workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--rb-border-dark);
    flex-shrink: 0;
}

.rb-effect-workspace-title {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--rb-text-secondary);
}

.rb-effect-workspace-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.rb-effect-workspace-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--rb-text-muted);
    font-size: 0.85rem;
    text-align: center;
    padding: 1rem;
}

.rb-effect-workspace-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
    opacity: 0.5;
}

/* ----------------------------------------------------------------------------
   EFFECT SIDEBAR MENU - Simple parameter name list (20% of workspace)
   ---------------------------------------------------------------------------- */

.rb-workspace-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Parameter diff viewer fills the workspace */
.rb-workspace-main>.rb-param-diff-viewer {
    flex: 1;
    width: 100%;
}

/* Center content only when showing empty state */
.rb-workspace-main:has(.rb-effect-workspace-empty) {
    align-items: center;
    justify-content: center;
}

/* Sidebar - 20% width on the left */
.rb-effect-sidebar {
    flex: 0 0 20%;
    max-width: 180px;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background: rgba(20, 28, 40, 0.6);
    border-right: 1px solid var(--rb-border-dark, #334155);
}

.rb-effect-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.625rem;
    height: 1.75rem;
    background: rgba(30, 41, 59, 0.8);
    border-bottom: 1px solid var(--rb-border-dark, #334155);
    flex-shrink: 0;
}

.rb-effect-sidebar-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-effect-sidebar-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: transparent;
    border: none;
    border-radius: 2px;
    color: var(--rb-text-muted, #64748b);
    cursor: pointer;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rb-effect-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99;
    background: transparent;
}

.rb-sidebar-filter-wrapper {
    position: relative;
    margin-left: auto;
}

.rb-sidebar-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    border-radius: 3px;
    color: var(--rb-text-muted, #64748b);
    cursor: pointer;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.rb-sidebar-filter-btn:hover,
.rb-sidebar-filter-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-sidebar-filter-flyout {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    min-width: 160px;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

.rb-sidebar-filter-flyout.open {
    display: block;
}

.rb-sidebar-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--rb-text-secondary, #94a3b8);
    cursor: pointer;
    user-select: none;
}

.rb-sidebar-filter-option input[type="checkbox"] {
    cursor: pointer;
    accent-color: var(--rb-accent-blue, #3b82f6);
}

.rb-sidebar-filter-option:hover {
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-effect-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0;
}

/* Simple parameter name (non-table) */
.rb-menu-param-name {
    padding: 0.375rem 0.625rem;
    font-size: 0.7rem;
    color: var(--rb-text-secondary, #94a3b8);
}

/* Section for table parameters */
.rb-menu-section {
    margin-bottom: 0.25rem;
}

.rb-menu-section-header {
    padding: 0.375rem 0.625rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--rb-accent-blue, #93c5fd);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Collapsible menu item */
.rb-menu-item-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3rem 0.625rem 0.3rem 0.875rem;
    cursor: pointer;
    user-select: none;
}

.rb-menu-item-header:hover {
    background: rgba(59, 130, 246, 0.08);
}

.rb-menu-item--expanded>.rb-menu-item-header {
    background: rgba(59, 130, 246, 0.1);
}

.rb-menu-item-toggle {
    font-size: 0.5rem;
    color: var(--rb-text-muted, #64748b);
    width: 10px;
    flex-shrink: 0;
}

.rb-menu-item-title {
    font-size: 0.68rem;
    color: var(--rb-text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Nested field names (shown when item is expanded) */
.rb-menu-item-fields {
    display: none;
    padding-left: 1.5rem;
}

.rb-menu-item--expanded .rb-menu-item-fields {
    display: block;
}

.rb-menu-field-name {
    padding: 0.2rem 0.625rem;
    font-size: 0.62rem;
    color: var(--rb-text-muted, #64748b);
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.rb-menu-field-name:hover {
    background: var(--rb-surface-hover, rgba(255, 255, 255, 0.05));
}

.rb-menu-field-name.rb-param-new-effect {
    color: #4ade80;
    font-weight: 600;
}

.rb-menu-field-name.rb-param-new-effect:hover {
    color: #86efac;
}

.rb-menu-field-name.rb-param-pending-update {
    color: #fbbf24;
    font-weight: 600;
}

.rb-menu-field-name.rb-param-pending-update:hover {
    color: #fcd34d;
}

/* Selected field in sidebar */
.rb-menu-field-name.rb-menu-field--selected {
    background: rgba(255, 255, 255, 0.08);
    border-left: 2px solid var(--rb-text-muted, #64748b);
    padding-left: calc(0.625rem - 2px);
}

.rb-menu-field-name.rb-menu-field--selected:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Empty state */
.rb-menu-empty {
    padding: 0.5rem 0.625rem;
    font-size: 0.65rem;
    color: var(--rb-text-muted, #64748b);
    font-style: italic;
}

/* ----------------------------------------------------------------------------
   PARAMETER PENDING STATUS INDICATORS
   Yellow for pending updates, green for new effects
   ---------------------------------------------------------------------------- */

/* Pending update indicator - yellow/amber */
.rb-param-pending-update {
    color: #fbbf24 !important;
    font-weight: 600 !important;
}

.rb-param-pending-update:hover {
    color: #fcd34d !important;
}

/* New effect indicator - green */
.rb-param-new-effect {
    color: #4ade80 !important;
    font-weight: 600 !important;
}

.rb-param-new-effect:hover {
    color: #86efac !important;
}

/* Pending dot indicator */
.rb-param-pending-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-left: 0.375rem;
    vertical-align: middle;
    animation: rb-pending-pulse 2s ease-in-out infinite;
}

@keyframes rb-pending-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Clickable parameter names */
.rb-menu-param-clickable {
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, outline 0.15s ease;
    border-radius: 3px;
    margin: 0 0.25rem;
    padding: 0.375rem 0.5rem !important;
}

.rb-menu-param-clickable:hover {
    background: rgba(59, 130, 246, 0.15);
}

.rb-menu-param-clickable:focus-visible {
    outline: 2px solid var(--rb-accent-blue, #3b82f6);
    outline-offset: 2px;
}

/* Selected parameter */
.rb-menu-param-selected,
.rb-menu-section-selected>.rb-menu-section-header {
    background: rgba(59, 130, 246, 0.25) !important;
    border-left: 2px solid var(--rb-accent-blue, #3b82f6);
}

/* Sidebar status badges */
.rb-sidebar-status-badge {
    font-size: 0.55rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-left: auto;
    margin-right: 0.5rem;
}

.rb-sidebar-status-new {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.3);
}

.rb-sidebar-status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

/* Sidebar border indicators */
.rb-effect-sidebar--new {
    border-left: 3px solid #4ade80;
}

.rb-effect-sidebar--pending {
    border-left: 3px solid #fbbf24;
}

.rb-effect-sidebar--approved {
    border-left: 3px solid #60a5fa;
}

.rb-effect-sidebar--invalid {
    border-left: 3px solid #ef4444;
}

.rb-sidebar-status-approved {
    background: rgba(96, 165, 250, 0.2);
    color: #60a5fa;
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
}

/* ----------------------------------------------------------------------------
   PARAMETER DIFF VIEWER
   Shows old vs new values with diff highlighting
   ---------------------------------------------------------------------------- */

.rb-param-diff-viewer {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.rb-param-diff-viewer--new {
    background: linear-gradient(135deg, rgba(74, 222, 128, 0.05) 0%, transparent 50%);
}

.rb-param-diff-viewer--pending {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.05) 0%, transparent 50%);
}

.rb-param-diff-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--rb-surface, #0f172a);
    border-bottom: 1px solid var(--rb-border-dark, #334155);
}

.rb-param-diff-nav {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rb-param-nav-btn {
    padding: 0.125rem 0.375rem;
    font-size: 0.65rem;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--rb-surface-elevated, #1e293b);
    color: var(--rb-text-secondary, #94a3b8);
    border: 1px solid var(--rb-border, rgba(255, 255, 255, 0.1));
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.rb-param-nav-btn:hover {
    background: var(--rb-surface-hover, #334155);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-param-approve-all {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
    border-color: rgba(74, 222, 128, 0.3);
}

.rb-param-approve-all:hover {
    background: rgba(74, 222, 128, 0.25);
    color: #86efac;
}

.rb-param-reject-all {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
}

.rb-param-reject-all:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.rb-param-diff-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    min-width: 0;
}

.rb-param-diff-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-param-diff-description {
    display: none;
}

.rb-param-status-badge {
    font-size: 0.55rem;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
}

.rb-param-status-new {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    border: 1px solid rgba(74, 222, 128, 0.4);
}

.rb-param-status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.4);
}

.rb-param-status-approved {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.4);
}

/* Approved parameter in sidebar */
.rb-param-approved {
    color: var(--rb-text-secondary, #94a3b8);
}

.rb-param-approved-check {
    color: #60a5fa;
    font-size: 0.7rem;
    margin-left: 0.25rem;
}

/* Invalid parameter in sidebar (required field with empty value) */
.rb-param-invalid {
    color: #ef4444;
}

.rb-param-invalid-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    margin-left: 6px;
    vertical-align: middle;
}

.rb-param-status-invalid {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Approved parameter viewer - neutral styling */
.rb-param-diff-viewer--approved {
    background: transparent;
}

.rb-param-diff-viewer--approved .rb-code-line {
    background: transparent;
    border-left: var(--rb-viewer-status-border-width, 3px) solid transparent;
}

.rb-param-diff-viewer--approved .rb-line-content {
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-param-diff-viewer--approved .rb-code-editor-container {
    border-left: var(--rb-viewer-status-border-width, 3px) solid transparent;
}

.rb-param-diff-viewer--approved .rb-param-scalar-input {
    background: transparent;
    color: var(--rb-text-primary, #e2e8f0);
    border-color: transparent;
    transition: all 0.15s ease;
}

.rb-param-diff-viewer--approved .rb-param-scalar-input:hover {
    background-color: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.3);
}

.rb-param-diff-viewer--approved .rb-param-scalar-input:focus {
    outline: none;
    background-color: rgba(51, 65, 85, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.rb-param-diff-viewer--approved .rb-param-scalar-input::-webkit-inner-spin-button,
.rb-param-diff-viewer--approved .rb-param-scalar-input::-webkit-outer-spin-button {
    opacity: 0;
    transition: opacity 0.15s ease;
}

.rb-param-diff-viewer--approved .rb-param-scalar-input:hover::-webkit-inner-spin-button,
.rb-param-diff-viewer--approved .rb-param-scalar-input:hover::-webkit-outer-spin-button,
.rb-param-diff-viewer--approved .rb-param-scalar-input:focus::-webkit-inner-spin-button,
.rb-param-diff-viewer--approved .rb-param-scalar-input:focus::-webkit-outer-spin-button {
    opacity: 1;
}

.rb-param-bool-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.15s ease;
}

.rb-param-bool-label:hover {
    background-color: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.3);
}

.rb-param-bool-input {
    width: 1rem;
    height: 1rem;
    accent-color: var(--rb-text-secondary, #94a3b8);
    cursor: pointer;
}

.rb-param-bool-text {
    color: var(--rb-text-primary, #e2e8f0);
    font-size: 0.85rem;
}

.rb-param-diff-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

/* Section labels - hidden by default since header shows context */
.rb-param-section-label {
    display: none;
}

.rb-param-section-label--old {
    color: #f87171;
}

.rb-param-section-label--new {
    color: #4ade80;
}

/* Current value display - fills available space */
.rb-param-current-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(30, 41, 59, 0.5);
    border-left: var(--rb-viewer-status-border-width, 3px) solid rgba(148, 163, 184, 0.3);
    border-radius: 0;
    padding: var(--rb-viewer-content-padding, 0.75rem);
    overflow-y: auto;
}

.rb-param-current-value,
.rb-param-old-value,
.rb-param-new-value {
    font-size: 0.85rem;
    color: var(--rb-text-primary, #e2e8f0);
    word-break: break-word;
}

/* Editable scalar input for number/integer fields in diff viewer */
.rb-param-scalar-input {
    width: 100%;
    padding: 0.5rem 0.625rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
    background: var(--rb-diff-added-bg, rgba(74, 222, 128, 0.15));
    color: var(--rb-diff-added-text, #86efac);
    border: 1px solid var(--rb-diff-added-border, rgba(74, 222, 128, 0.4));
    border-radius: 4px;
    cursor: text;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.rb-param-scalar-input:focus {
    outline: none;
    border-color: var(--rb-diff-added-text, #86efac);
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.2);
}

.rb-param-scalar-input:hover {
    border-color: var(--rb-diff-added-text, #86efac);
}

/* New effect section - fills available space */
.rb-param-new-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(74, 222, 128, 0.08);
    border-left: var(--rb-viewer-status-border-width, 3px) solid rgba(74, 222, 128, 0.4);
    border-radius: 0;
    padding: var(--rb-viewer-content-padding, 0.75rem);
    overflow-y: auto;
}

/* Replace diff (old → new) */
.rb-param-diff-replace {
    display: flex;
    align-items: stretch;
    gap: 0.75rem;
}

.rb-param-diff-old,
.rb-param-diff-new {
    flex: 1;
    padding: 0.75rem;
    border-radius: 6px;
    min-width: 0;
}

.rb-param-diff-old {
    background: rgba(248, 113, 113, 0.08);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.rb-param-diff-new {
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
}

.rb-param-diff-arrow {
    display: flex;
    align-items: center;
    font-size: 1.25rem;
    color: var(--rb-text-muted, #64748b);
    padding: 0 0.25rem;
}

/* Line diff display */
.rb-param-diff-lines-container,
.rb-param-diff-words-container {
    background: rgba(30, 41, 59, 0.5);
    border-radius: 6px;
    padding: 0.75rem;
}

.rb-param-diff-lines {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.8rem;
    line-height: 1.5;
    max-height: 300px;
    overflow-y: auto;
}

.rb-param-diff-words {
    font-size: 0.85rem;
    line-height: 1.6;
    word-break: break-word;
}

/* Value type styling */
.rb-param-empty {
    color: var(--rb-text-muted, #64748b);
    font-style: italic;
}

.rb-param-array {
    color: var(--rb-accent-blue, #93c5fd);
}

.rb-param-json {
    font-family: 'SF Mono', Monaco, monospace;
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem;
    border-radius: 4px;
    overflow-x: auto;
    white-space: pre-wrap;
    margin: 0;
}

.rb-param-complex {
    color: var(--rb-text-muted, #64748b);
    font-style: italic;
}

.rb-param-bool {
    font-weight: 600;
}

.rb-param-bool--true {
    color: #4ade80;
}

.rb-param-bool--false {
    color: #f87171;
}

.rb-param-text {
    white-space: pre-wrap;
}

.rb-param-text--long {
    max-height: 200px;
    overflow-y: auto;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* Diff viewer actions - fixed footer bar */
.rb-param-diff-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: row-reverse;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--rb-surface, #0f172a);
    border-top: 1px solid var(--rb-border-dark, #334155);
}

.rb-param-action {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.rb-param-action-approve {
    background: linear-gradient(135deg, #059669, #10b981);
    color: white;
}

.rb-param-action-approve:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.rb-param-action-reject {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.rb-param-action-reject:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: rgba(239, 68, 68, 0.5);
}

.rb-param-action-reject--disabled,
.rb-param-action-reject:disabled {
    opacity: 0.25;
    cursor: not-allowed;
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border-color: rgba(100, 116, 139, 0.2);
}

.rb-param-action-reject--disabled:hover,
.rb-param-action-reject:disabled:hover {
    background: rgba(100, 116, 139, 0.1);
    border-color: rgba(100, 116, 139, 0.2);
    transform: none;
    box-shadow: none;
}

.rb-param-action:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

.rb-effect-sidebar-close:focus-visible {
    outline: 2px solid var(--rb-accent-blue, #3b82f6);
    outline-offset: 1px;
}

/* Error state */
.rb-param-diff-error {
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
    color: #f87171;
    text-align: center;
}

/* ----------------------------------------------------------------------------
   MULTISELECT CHIPS
   For multiselect parameters showing values as editable chips
   ---------------------------------------------------------------------------- */

.rb-multiselect-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.rb-multiselect-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    min-height: 1.75rem;
    align-items: center;
}

.rb-multiselect-chips--readonly {
    gap: 0.25rem;
}

.rb-multiselect-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
}

.rb-multiselect-chip--readonly {
    padding: 0.125rem 0.375rem;
    font-size: 0.7rem;
    background: rgba(148, 163, 184, 0.15);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.25);
}

.rb-multiselect-chip--added {
    background: rgba(74, 222, 128, 0.2);
    color: #86efac;
    border-color: rgba(74, 222, 128, 0.4);
}

.rb-multiselect-chip--removed {
    background: rgba(248, 113, 113, 0.15);
    color: #fca5a5;
    border-color: rgba(248, 113, 113, 0.3);
    text-decoration: line-through;
    opacity: 0.7;
}

.rb-multiselect-chip-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    height: 1rem;
    padding: 0;
    margin-left: 0.125rem;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: inherit;
    font-size: 0.75rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.rb-multiselect-chip-remove:hover {
    opacity: 1;
    background: rgba(239, 68, 68, 0.3);
}

.rb-multiselect-dropdown {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    background: var(--rb-surface-elevated, #1e293b);
    color: var(--rb-text-secondary, #94a3b8);
    border: 1px dashed rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    cursor: pointer;
    width: auto;
    max-width: 150px;
}

.rb-multiselect-dropdown:hover {
    border-color: rgba(59, 130, 246, 0.5);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-multiselect-dropdown:focus {
    outline: none;
    border-color: var(--rb-accent-blue, #3b82f6);
}

.rb-param-empty--inline {
    font-size: 0.75rem;
    font-style: italic;
}

.rb-multiselect-diff {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.5rem;
}

.rb-multiselect-diff .rb-param-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rb-text-muted, #64748b);
    margin-bottom: 0.25rem;
}

/* ----------------------------------------------------------------------------
   DROPDOWN DIFF VIEWER
   For resolver-backed parameters showing old value (red) and dropdown (green)
   ---------------------------------------------------------------------------- */

.rb-param-diff-dropdown {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
}

.rb-param-diff-old-line,
.rb-param-diff-new-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
}

.rb-param-diff-old-line {
    background: var(--rb-diff-removed-bg, rgba(248, 113, 113, 0.08));
    border-left: var(--rb-viewer-status-border-width, 3px) solid var(--rb-diff-removed-border, #f87171);
}

.rb-param-diff-new-line {
    background: var(--rb-diff-added-bg, rgba(74, 222, 128, 0.08));
    border-left: var(--rb-viewer-status-border-width, 3px) solid var(--rb-diff-added-border, #4ade80);
}

.rb-param-diff-dropdown .rb-diff-line-prefix {
    flex-shrink: 0;
    width: 1rem;
    font-weight: 600;
    text-align: center;
    user-select: none;
}

.rb-param-diff-old-line .rb-diff-line-prefix {
    color: var(--rb-diff-removed-text, #fca5a5);
}

.rb-param-diff-new-line .rb-diff-line-prefix {
    color: var(--rb-diff-added-text, #86efac);
}

.rb-param-old-value-inline {
    color: var(--rb-diff-removed-text, #fca5a5);
    text-decoration: line-through;
    opacity: 0.9;
}

.rb-param-new-value-inline {
    color: var(--rb-diff-added-text, #86efac);
}

.rb-param-diff-select-inline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.85rem;
}

.rb-param-diff-select-inline .rb-diff-dropdown-select {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    max-width: none;
    width: auto;
}

/* Dropdown select styling in diff viewer */
.rb-diff-dropdown-select {
    flex: 1;
    min-width: 150px;
    max-width: 300px;
    padding: 0.375rem 0.625rem;
    font-family: inherit;
    font-size: 0.85rem;
    background: var(--rb-diff-added-bg, rgba(74, 222, 128, 0.15));
    color: var(--rb-diff-added-text, #86efac);
    border: 1px solid var(--rb-diff-added-border, rgba(74, 222, 128, 0.4));
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2386efac' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    padding-right: 1.75rem;
}

.rb-diff-dropdown-select:hover {
    background-color: rgba(74, 222, 128, 0.25);
    border-color: rgba(74, 222, 128, 0.6);
}

.rb-diff-dropdown-select:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.3);
    border-color: rgba(74, 222, 128, 0.7);
}

.rb-diff-dropdown-select option {
    background: var(--rb-surface, #0f172a);
    color: var(--rb-text-primary, #e2e8f0);
    padding: 0.5rem;
}

/* New effect dropdown variant - only shows the green new value line */
.rb-param-diff-dropdown--new {
    padding: 0.5rem 0.75rem;
}

.rb-param-diff-dropdown--new .rb-param-diff-new-line {
    background: transparent;
    border-left: none;
    padding: 0.25rem 0;
}

.rb-param-diff-dropdown--new .rb-diff-dropdown-select {
    max-width: none;
    width: 100%;
}

/* Select-inline diff: old (red) and new (green) dropdown overrides */
.rb-param-diff-select-inline .rb-diff-dropdown-select.rb-diff-dropdown-select--old {
    background-color: var(--rb-diff-removed-bg, rgba(248, 113, 113, 0.15));
    border-color: var(--rb-diff-removed-border, #f87171);
    color: var(--rb-diff-removed-text, #fca5a5);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23fca5a5' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
}

.rb-param-diff-select-inline .rb-diff-dropdown-select.rb-diff-dropdown-select--new {
    background-color: var(--rb-diff-added-bg, rgba(74, 222, 128, 0.15));
    border-color: var(--rb-diff-added-border, #4ade80);
    color: var(--rb-diff-added-text, #86efac);
}

/* Parameter dropdown (non-diff context) - looks like text until clicked */
/* Custom combobox (text input + dropdown list) */
.rb-combobox {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 100%;
}

.rb-combobox > input {
    flex: 1;
    min-width: 0;
    padding-right: 1.75rem;
}

.rb-combobox-toggle {
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--rb-text-secondary, #94a3b8);
    cursor: pointer;
    padding: 0.25rem 0.375rem;
    font-size: 0.7rem;
    line-height: 1;
    opacity: 0.7;
}

.rb-combobox-toggle:hover {
    opacity: 1;
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-combobox-listbox {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    max-height: 220px;
    overflow-y: auto;
    margin: 2px 0 0 0;
    padding: 0;
    list-style: none;
    background: var(--rb-surface, #0f172a);
    border: 1px solid var(--rb-border, rgba(148, 163, 184, 0.2));
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.rb-combobox--open > .rb-combobox-listbox {
    display: block;
}

.rb-combobox-option {
    padding: 0.375rem 0.625rem;
    font-size: 0.85rem;
    color: var(--rb-text-primary, #e2e8f0);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-combobox-option:hover {
    background: rgba(59, 130, 246, 0.25);
}

.rb-combobox-separator {
    height: 1px;
    margin: 0.25rem 0.5rem;
    background: var(--rb-border, rgba(148, 163, 184, 0.2));
    list-style: none;
    pointer-events: none;
}

.rb-combobox-option--dim {
    color: var(--rb-text-secondary, #64748b);
}

.rb-combobox-option--dim:hover {
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-combobox-empty {
    padding: 0.5rem 0.625rem;
    font-size: 0.8rem;
    color: var(--rb-text-secondary, #64748b);
    font-style: italic;
}

.rb-combobox > input.rb-diff-dropdown-select,
.rb-combobox > input.rb-param-dropdown-select {
    background-image: none;
    appearance: none;
    -webkit-appearance: none;
    cursor: text;
}

.rb-combobox > input.rb-diff-dropdown-select:hover,
.rb-combobox > input.rb-param-dropdown-select:hover,
.rb-combobox > input.rb-diff-dropdown-select:focus,
.rb-combobox > input.rb-param-dropdown-select:focus {
    background-image: none;
}

.rb-param-dropdown-select {
    min-width: 60px;
    max-width: 100%;
    padding: 0.25rem 0.5rem;
    font-family: inherit;
    font-size: 0.85rem;
    background: transparent;
    color: var(--rb-text-primary, #e2e8f0);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    appearance: none;
    /* Subtle dropdown indicator on hover */
    background-image: none;
    background-repeat: no-repeat;
    background-position: right 0.375rem center;
    padding-right: 0.5rem;
}

/* Show dropdown indicator on hover */
.rb-param-dropdown-select:hover {
    background-color: rgba(51, 65, 85, 0.4);
    border-color: rgba(148, 163, 184, 0.3);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    padding-right: 1.5rem;
}

/* Active/focused state shows full dropdown styling */
.rb-param-dropdown-select:focus {
    outline: none;
    background-color: rgba(51, 65, 85, 0.6);
    border-color: rgba(99, 102, 241, 0.5);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%236366f1' d='M2 4l4 4 4-4'/%3E%3C/svg%3E");
    padding-right: 1.5rem;
}

.rb-param-dropdown-select option {
    background: var(--rb-surface, #0f172a);
    color: var(--rb-text-primary, #e2e8f0);
    padding: 0.5rem;
}

/* ----------------------------------------------------------------------------
   PANEL SELECTOR DROPDOWN
   ---------------------------------------------------------------------------- */

.rb-panel-selector {
    position: relative;
    display: inline-block;
}

.rb-panel-selector-btn {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    color: var(--rb-text-primary, #e2e8f0);
    font-size: 0.85rem;
    transition: all 0.15s ease;
}

.rb-panel-selector-btn:hover {
    background: rgba(51, 65, 85, 0.5);
    border-color: rgba(148, 163, 184, 0.3);
}

.rb-panel-selector-arrow {
    font-size: 0.7rem;
    opacity: 0.6;
    transition: transform 0.15s ease;
}

.rb-panel-selector-menu--open + .rb-panel-selector-arrow,
.rb-panel-selector-btn:focus .rb-panel-selector-arrow {
    transform: rotate(180deg);
}

.rb-panel-selector-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    min-width: 160px;
    background: var(--rb-surface-dark, #1e293b);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.15s ease;
    z-index: 1000;
    overflow: hidden;
}

.rb-panel-selector-menu--open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.rb-panel-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.625rem 0.75rem;
    background: transparent;
    border: none;
    color: var(--rb-text-primary, #e2e8f0);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s ease;
}

.rb-panel-option:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.15);
}

.rb-panel-option--active {
    background: rgba(99, 102, 241, 0.2);
    color: var(--rb-accent, #818cf8);
}

.rb-panel-option--active::before {
    content: '✓';
    position: absolute;
    right: 0.75rem;
    font-size: 0.75rem;
}

.rb-panel-option--disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.rb-panel-option-icon {
    font-size: 0.9rem;
}

.rb-panel-option-badge {
    margin-left: auto;
    padding: 0.125rem 0.375rem;
    background: rgba(148, 163, 184, 0.2);
    border-radius: 3px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rb-text-secondary, #94a3b8);
}

/* ----------------------------------------------------------------------------
   WORKSPACE TOPBAR (view dropdown, top-right of main content)
   ---------------------------------------------------------------------------- */

.rb-workspace-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.5rem;
    height: 1.75rem;
    flex-shrink: 0;
    gap: 0.5rem;
    border-bottom: 1px solid var(--rb-border-dark, #334155);
    background: var(--rb-surface, #0f172a);
}

.rb-workspace-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.rb-workspace-topbar-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-text-primary, #e2e8f0);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rb-workspace-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.rb-chunk-nav-inline {
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 0;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--rb-text-secondary, #94a3b8);
    background: rgba(100, 116, 139, 0.2);
    border-radius: 3px;
    white-space: nowrap;
    margin-right: 0.25rem;
}

.rb-chunk-nav-inline-count {
    padding: 0 0.3rem;
}

.rb-chunk-nav-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--rb-text-secondary, #94a3b8);
    cursor: pointer;
    font-size: 0.75rem;
    line-height: 1;
    border-radius: 3px;
    transition: background var(--rb-transition-fast, 150ms) ease;
}

.rb-chunk-nav-inline-btn:hover {
    background: rgba(100, 116, 139, 0.4);
    color: var(--rb-text-primary, #e2e8f0);
}

/* ----------------------------------------------------------------------------
   EFFECT VIEW DROPDOWN
   ---------------------------------------------------------------------------- */

.rb-view-dropdown {
    padding: 0.125rem 0.3rem;
    font-size: 0.6rem;
    border: 1px solid var(--rb-border-dark, #334155);
    border-radius: 3px;
    background: var(--rb-bg-deep, #0f172a);
    color: var(--rb-text-tertiary, #64748b);
    cursor: pointer;
    outline: none;
}

.rb-view-dropdown:hover {
    border-color: rgba(148, 163, 184, 0.4);
    color: var(--rb-text-secondary, #94a3b8);
}

.rb-view-dropdown:focus {
    border-color: var(--rb-accent, #818cf8);
}

.rb-view-dropdown option {
    background: var(--rb-bg-surface, #1e293b);
    color: var(--rb-text-primary, #e2e8f0);
}

/* ----------------------------------------------------------------------------
   GROUP HEADERS (for grouped-table views)
   ---------------------------------------------------------------------------- */

.rb-menu-group-header {
    padding: 0.375rem 0.75rem 0.25rem;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rb-text-tertiary, #64748b);
    border-top: 1px solid var(--rb-border-dark, #334155);
    margin-top: 0.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: background 0.15s ease;
    user-select: none;
}

.rb-menu-group-header:hover {
    background: rgba(59, 130, 246, 0.08);
}

.rb-menu-group:first-child > .rb-menu-group-header {
    margin-top: 0;
    border-top: none;
}

.rb-menu-group-header .rb-menu-item-toggle {
    font-size: 0.5rem;
    color: var(--rb-text-muted, #64748b);
    width: 10px;
    flex-shrink: 0;
}

.rb-menu-group-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rb-menu-group--collapsed .rb-menu-group-content {
    display: none;
}

/* ----------------------------------------------------------------------------
   AGGREGATE PANEL
   ---------------------------------------------------------------------------- */

.rb-aggregate-panel {
    overflow-y: auto;
    flex: 1;
}

.rb-aggregate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--rb-border-dark, #334155);
}

.rb-aggregate-header-left {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.rb-aggregate-title {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--rb-text-primary, #e2e8f0);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rb-aggregate-count {
    color: var(--rb-text-muted, #64748b);
    font-size: 0.7rem;
}

.rb-aggregate-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rb-aggregate-action-btn {
    font-size: 0.7rem;
    cursor: pointer;
    opacity: 0.5;
    background: none;
    border: 1px solid currentColor;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    transition: opacity 0.15s, border-color 0.15s;
}

.rb-aggregate-action-btn:hover {
    opacity: 1;
}

.rb-aggregate-action-btn--add {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
}

.rb-aggregate-action-btn--add:hover {
    border-color: #22c55e;
}

.rb-aggregate-action-btn--delete {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.rb-aggregate-action-btn--delete:hover {
    border-color: #ef4444;
}

/* Card-list layout */
.rb-aggregate-card-list {
    padding: 0.25rem 0;
}

.rb-aggregate-card {
    margin: 0.25rem 0.5rem;
    border: 1px solid var(--rb-border-dark, #334155);
    border-radius: 6px;
    overflow: hidden;
}

.rb-aggregate-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.5rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--rb-border-dark, #334155);
}

.rb-aggregate-card-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rb-text-secondary, #94a3b8);
}

.rb-aggregate-delete-btn {
    opacity: 0.3;
    cursor: pointer;
    font-size: 0.7rem;
    background: none;
    border: none;
    color: var(--rb-text-muted, #64748b);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    transition: opacity 0.15s, color 0.15s;
}

.rb-aggregate-delete-btn:hover {
    opacity: 1;
    color: #ef4444;
}

.rb-aggregate-card-fields {
    padding: 0.25rem 0.5rem;
}

.rb-aggregate-card-field {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.2rem 0;
    font-size: 0.72rem;
}

.rb-aggregate-field-label {
    color: var(--rb-text-muted, #64748b);
    font-size: 0.65rem;
    min-width: 4rem;
    flex-shrink: 0;
}

.rb-aggregate-field-value {
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-aggregate-field-diff {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.rb-aggregate-old-value {
    text-decoration: line-through;
    color: #ef4444;
    opacity: 0.6;
    font-size: 0.7rem;
}

.rb-aggregate-new-value {
    color: #22c55e;
    font-size: 0.7rem;
}

/* Chat-thread layout */
.rb-chat-thread {
    padding: 0.25rem 0.5rem;
}

.rb-chat-message {
    padding: 0.625rem 0.5rem;
    margin: 0.375rem 0;
    border: 1px solid var(--rb-border-dark, #334155);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.01);
}

.rb-chat-message:first-child {
    margin-top: 0;
}

.rb-chat-message:last-child {
    margin-bottom: 0;
}

.rb-chat-message--pending {
    background: rgba(251, 191, 36, 0.04);
}

.rb-chat-message--new {
    background: rgba(74, 222, 128, 0.03);
    border-left: 3px solid var(--rb-diff-added-border, #10b981);
}

.rb-chat-message--edited {
    background: rgba(251, 191, 36, 0.04);
    border-left: 3px solid #fbbf24;
}

.rb-chat-message-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.125rem;
}

.rb-chat-message-topbar-left {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rb-chat-sort-label {
    color: var(--rb-text-muted, #64748b);
    font-size: 0.65rem;
    font-weight: 500;
}

.rb-chat-message-topbar-right {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.rb-chat-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.25rem;
}

.rb-chat-meta-left {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex: 1;
}

.rb-chat-meta-stacked {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.25rem;
}

.rb-chat-sender {
    color: #93c5fd;
    font-weight: 600;
    font-size: 0.75rem;
}

.rb-chat-sender[contenteditable]:focus {
    outline: 1px solid var(--rb-accent-blue, #3b82f6);
    border-radius: 3px;
    padding: 0 0.125rem;
}

.rb-chat-sender-select {
    color: #93c5fd;
    font-weight: 600;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.0625rem 0.25rem;
    cursor: pointer;
    max-width: 10rem;
    transition: border-color 0.15s;
}

.rb-chat-sender-select:hover,
.rb-chat-sender-select:focus {
    border-color: var(--rb-accent-blue, #3b82f6);
    outline: none;
    background: rgba(59, 130, 246, 0.08);
}

.rb-chat-sender-select option {
    background: var(--rb-surface, #1e293b);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-chat-offset {
    color: var(--rb-text-muted, #64748b);
    font-size: 0.65rem;
}

.rb-chat-offset-input {
    color: var(--rb-text-muted, #64748b);
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.375rem;
    width: 4.5rem;
    text-align: right;
    transition: border-color 0.15s;
}

.rb-chat-offset-input:hover,
.rb-chat-offset-input:focus {
    border-color: var(--rb-accent-blue, #3b82f6);
    outline: none;
    background: rgba(59, 130, 246, 0.08);
}

.rb-chat-delete {
    opacity: 0.25;
    cursor: pointer;
    font-size: 0.65rem;
    background: none;
    border: none;
    color: var(--rb-text-muted, #64748b);
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
    transition: opacity 0.15s, color 0.15s;
}

.rb-chat-delete:hover {
    opacity: 1;
    color: #ef4444;
}

/* Per-field accept/reject (visible on hover) */
.rb-chat-field-actions {
    display: inline-flex;
    gap: 0.125rem;
    opacity: 0;
    transition: opacity 0.15s;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.rb-chat-field-diff:hover .rb-chat-field-actions,
.rb-chat-body-diff:hover > .rb-chat-field-actions {
    opacity: 1;
}

.rb-chat-field-accept,
.rb-chat-field-reject {
    background: none;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.65rem;
    padding: 0.0625rem 0.25rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}

.rb-chat-field-accept {
    color: #22c55e;
}

.rb-chat-field-accept:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
}

.rb-chat-field-reject {
    color: #ef4444;
}

.rb-chat-field-reject:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* Per-row bulk accept/reject */
.rb-chat-row-actions {
    display: flex;
    gap: 0.25rem;
}

.rb-chat-row-btn {
    font-size: 0.65rem !important;
    padding: 0.15rem 0.4rem !important;
}

.rb-chat-row-accept,
.rb-chat-row-reject {
    background: var(--rb-surface, #1e293b);
    border: 1px solid var(--rb-border-dark, #334155);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.rb-chat-row-accept {
    color: #22c55e;
}

.rb-chat-row-accept:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: #22c55e;
}

.rb-chat-row-reject {
    color: #ef4444;
}

.rb-chat-row-reject:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* Field diff layout within chat -- stacked old/new rows */
.rb-chat-field-diff {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.rb-chat-diff-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
}

.rb-chat-diff-row--old {
    background: var(--rb-diff-removed-bg, rgba(127, 29, 29, 0.4));
    border-left: 3px solid var(--rb-diff-removed-border, #ef4444);
    color: var(--rb-diff-removed-text, #fca5a5);
    opacity: 0.8;
}

.rb-chat-diff-row--new {
    background: var(--rb-diff-added-bg, rgba(6, 78, 59, 0.4));
    border-left: 3px solid var(--rb-diff-added-border, #10b981);
    color: var(--rb-diff-added-text, #86efac);
}

.rb-chat-diff-prefix {
    font-weight: 700;
    font-size: 0.8rem;
    width: 1rem;
    flex-shrink: 0;
    text-align: center;
    color: inherit;
}

.rb-chat-diff-value {
    flex: 1;
    min-width: 0;
}

.rb-chat-diff-value select {
    color: inherit;
    font-weight: 600;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.0625rem 0.25rem;
    max-width: 100%;
}

.rb-chat-diff-row--old .rb-chat-diff-value select {
    pointer-events: none;
    opacity: 0.7;
}

.rb-chat-diff-row--new .rb-chat-diff-value select:hover,
.rb-chat-diff-row--new .rb-chat-diff-value select:focus {
    border-color: var(--rb-diff-added-border, #10b981);
    outline: none;
}

.rb-chat-diff-value select option {
    background: var(--rb-surface, #1e293b);
    color: var(--rb-text-primary, #e2e8f0);
}

.rb-chat-diff-value input[type="number"] {
    color: inherit;
    font-size: 0.75rem;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 0.125rem 0.25rem;
    width: 4rem;
}

.rb-chat-diff-row--new .rb-chat-diff-value input:hover,
.rb-chat-diff-row--new .rb-chat-diff-value input:focus {
    border-color: var(--rb-diff-added-border, #10b981);
    outline: none;
}

.rb-chat-diff-value [contenteditable] {
    min-height: 1.2em;
}

.rb-chat-diff-row--new .rb-chat-diff-value [contenteditable]:focus {
    outline: 1px solid var(--rb-diff-added-border, #10b981);
    border-radius: 3px;
}

.rb-chat-body {
    color: var(--rb-text-primary, #e2e8f0);
    font-size: 0.8rem;
    padding: 0.125rem 0;
    min-height: 1.2em;
    line-height: 1.5;
    border-radius: 3px;
}

.rb-chat-body[contenteditable]:focus {
    outline: 1px solid var(--rb-accent-blue, #3b82f6);
    padding: 0.125rem 0.25rem;
}

.rb-chat-body-diff {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.rb-chat-body--pending-old {
    text-decoration: line-through;
    color: #ef4444;
    opacity: 0.5;
    font-size: 0.75rem;
}

.rb-chat-body--pending-new {
    background: rgba(34, 197, 94, 0.06);
    border-left: 2px solid #22c55e;
    padding-left: 0.375rem;
}

.rb-aggregate-empty {
    padding: 2rem;
    text-align: center;
    color: var(--rb-text-muted, #64748b);
}

/* ----------------------------------------------------------------------------
   JSON OUTPUT VIEWER
   ---------------------------------------------------------------------------- */

.rb-workspace-main--json {
    flex: 1;
}

.rb-json-output-viewer {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.rb-json-output-viewer > .rb-diff-lines,
.rb-json-output-viewer > .rb-param-diff-dropdown,
.rb-json-output-viewer > .rb-param-diff-select-inline {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.rb-json-output-viewer > pre {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.rb-json-output-content {
    flex: 1;
    overflow: auto;
    padding: 0.75rem;
    margin: 0;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--rb-text-primary, #e2e8f0);
    background: var(--rb-bg-deep, #0f172a);
    white-space: pre;
    tab-size: 2;
}


/* Editable JSON view -- preserve indentation, sync scroll */
.rb-json-editable .rb-line-content {
    white-space: pre;
}

.rb-json-editable .rb-line-prefix {
    user-select: none;
}

/* Make line numbers and code scroll together in JSON view */
.rb-param-diff-viewer > .rb-code-editor-container:has(.rb-json-editable) {
    overflow: auto;
}

.rb-param-diff-viewer > .rb-code-editor-container:has(.rb-json-editable) .rb-line-numbers {
    overflow-y: visible;
    position: sticky;
    left: 0;
}

.rb-param-diff-viewer > .rb-code-editor-container:has(.rb-json-editable) .rb-code-content {
    overflow: visible;
}

.rb-json-output-actions {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--rb-border-dark, #334155);
    flex-shrink: 0;
}

/* Loading state */

.rb-json-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 3rem;
    color: var(--rb-text-tertiary, #64748b);
    font-size: 0.8rem;
}

.rb-json-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--rb-border-dark, #334155);
    border-top-color: var(--rb-accent, #818cf8);
    border-radius: 50%;
    animation: rb-json-spin 0.6s linear infinite;
}

@keyframes rb-json-spin {
    to { transform: rotate(360deg); }
}