/* ==================== */
/* GB Studio Tab        */
/* ==================== */

.studio-layout {
    flex: 1;
    min-height: 0;
    margin: 0 20px 16px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    border-radius: 16px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--shadow-card);
}

.studio-view {
    display: none;
    height: 100%;
}

.studio-view.active {
    display: flex;
    flex-direction: column;
}

/* Idea Prompt View */
.studio-idea-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 40px 32px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.studio-idea-avatar {
    width: 80px;
    height: 98px;
    border-radius: 16px;
    object-fit: cover;
    margin-bottom: 16px;
    /* Shadow & border applied via Avatar Depth System */
}

.studio-idea-header {
    text-align: center;
    margin-bottom: 32px;
}

.studio-idea-title {
    font-size: 28px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.studio-idea-subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
}

.studio-idea-input-area {
    width: 100%;
}

.studio-idea-input {
    width: 100%;
    padding: 18px 20px;
    font-size: 15px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 14px;
    background: linear-gradient(180deg, #f6f7f8 0%, #eff0f2 100%);
    resize: vertical;
    min-height: 120px;
    transition: border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    color: var(--color-text);
    box-sizing: border-box;
}

.studio-idea-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.studio-idea-input::placeholder {
    color: var(--color-text-faint);
}

.studio-idea-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    justify-content: center;
}

.studio-start-btn {
    padding: 12px 32px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.studio-start-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
}

.studio-start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.studio-gallery-btn {
    padding: 12px 24px;
    background: white;
    color: #4f46e5;
    border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.studio-gallery-btn:hover {
    background: #f5f3ff;
    border-color: var(--color-primary);
}

/* ==================== */
/* Studio Landing Flipper */
/* ==================== */

.studio-idea-view {
    perspective: 1800px;
}

#studio.tab-panel.active {
    display: flex;
    flex-direction: column;
}

.studio-landing-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 0 0;
    margin-bottom: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    flex-shrink: 0;
}

.studio-landing-toolbar.hidden {
    display: none;
}

.studio-flip-wrapper {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.studio-flip-label {
    font-size: 19px;
    color: var(--color-text-muted);
    letter-spacing: 0.02em;
}

/* Flipper — the rotating wrapper */
.studio-flipper {
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    min-height: 0;
}

.studio-flipper.flipped {
    transform: rotateY(180deg);
}

/* Front face — pathway cards */
.studio-flip-front {
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Back face — submissions pipeline */
.studio-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: rotateY(180deg);
    overflow-y: auto;
    pointer-events: none;
}

/* When flipped, enable back face events and disable front */
.studio-flipper.flipped .studio-flip-back {
    pointer-events: auto;
}

.studio-flipper.flipped .studio-flip-front {
    pointer-events: none;
}

/* Pipeline container (backside content) */
.studio-pipeline-container {
    padding: 24px 32px;
    max-width: 900px;
    margin: 0 auto;
}

.studio-pipeline-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.studio-pipeline-filters {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.studio-pipeline-filter-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.studio-pipeline-filter-tab:hover {
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--color-text);
}

.studio-pipeline-filter-tab.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.studio-pipeline-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.studio-pipeline-empty {
    text-align: center;
    padding: 60px 32px;
    color: var(--color-text-faint);
    font-size: 15px;
}

.studio-pipeline-empty.hidden {
    display: none;
}

/* Pipeline submission cards */
.studio-pipeline-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.studio-pipeline-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(79, 70, 229, 0.2);
}

.studio-pipeline-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-pipeline-type-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(79, 70, 229, 0.08);
    color: #4f46e5;
}

.studio-pipeline-type-badge.badge-agent {
    background: rgba(139, 92, 246, 0.08);
    color: #7c3aed;
}

.studio-pipeline-type-badge.badge-tool {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.studio-pipeline-type-badge.badge-change {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

.studio-pipeline-status {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}

.studio-pipeline-status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.studio-pipeline-status-reviewing {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.studio-pipeline-status-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.studio-pipeline-status-implementing {
    background: rgba(139, 92, 246, 0.1);
    color: #7c3aed;
}

.studio-pipeline-status-active {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.studio-pipeline-status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.studio-pipeline-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
}

.studio-pipeline-card-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.studio-pipeline-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-faint);
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.studio-pipeline-card-author {
    font-weight: 500;
    color: #4f46e5;
}

/* Workspace View */
.studio-workspace-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    padding-right: 180px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    flex-shrink: 0;
}

.studio-back-btn {
    padding: 6px 14px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.studio-back-btn:hover {
    background: var(--color-bg-muted);
    color: var(--color-text);
}

.studio-workspace-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.studio-workspace-actions {
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}

.studio-save-btn {
    padding: 8px 20px;
    background: white;
    color: var(--color-text-muted);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.studio-save-btn:hover {
    background: var(--color-bg-muted);
    transform: translateY(-1px);
}

.studio-save-draft-btn {
    padding: 8px 16px;
    background: white;
    color: var(--color-text-muted);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.studio-save-draft-btn:hover {
    background: var(--color-bg-muted);
    color: var(--color-text);
    border-color: rgba(0, 0, 0, 0.2);
}

/* Split Pane */
.studio-split-pane {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.studio-chat-panel {
    width: 32%;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
}

.studio-resize-handle {
    width: 6px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.studio-resize-handle:hover,
.studio-resize-handle.active {
    background: rgba(79, 70, 229, 0.15);
}

.studio-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 300px;
    background: var(--color-bg);
}

/* Chat Messages */
.studio-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Studio chat input — now inherits from .tool-prompt-bar */
.studio-chat-input-area { /* layout overridden by .tool-prompt-bar */ }
.studio-chat-input { /* styling inherited from .tool-prompt-bar textarea */ }
.studio-chat-send-btn { /* styling inherited from .tool-prompt-bar .prompt-send-btn */ }

/* Studio Chat Bubbles */
.studio-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

.studio-msg-avatar {
    width: 32px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    margin-top: 2px;
}

.studio-msg {
    max-width: 90%;
    animation: messageSlide 0.3s ease-out;
}

.studio-msg-row .studio-msg {
    animation: none;
    max-width: calc(100% - 42px);
}

/* @keyframes messageSlide — defined above (line ~4820), removed duplicate */

.studio-msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(224, 231, 255, 0.8) 0%, rgba(199, 210, 254, 0.6) 100%);
    padding: 10px 14px;
    border-radius: 14px 14px 4px 14px;
    font-size: 14px;
    color: var(--color-text);
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.studio-msg-assistant {
    align-self: flex-start;
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
    padding: 12px 16px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    color: var(--color-text);
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
    line-height: 1.6;
}

.studio-msg-assistant pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 14px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 12px;
    margin: 8px 0;
    line-height: 1.5;
}

.studio-msg-assistant code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 12px;
}

.studio-msg-assistant p {
    margin: 6px 0;
}

.studio-msg-assistant strong {
    font-weight: 600;
}

/* Preview Panel */
.studio-preview-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: var(--color-bg-subtle);
    flex-shrink: 0;
}

.studio-preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.studio-refresh-btn {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}

.studio-refresh-btn:hover {
    background: var(--color-bg-muted);
    color: #4f46e5;
}

.studio-preview-iframe {
    flex: 1;
    border: none;
    width: 100%;
    background: white;
}

/* Gallery View */
.studio-gallery-header {
    padding: 24px 32px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.studio-gallery-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.studio-gallery-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-top: 2px;
}

.studio-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.studio-gallery-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 14px;
    padding: 20px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.04);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-gallery-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 8px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(79, 70, 229, 0.2);
}

.studio-gallery-card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
}

.studio-gallery-card-desc {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.studio-gallery-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-faint);
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.studio-gallery-card-author {
    font-weight: 500;
    color: #4f46e5;
}

.studio-gallery-empty {
    text-align: center;
    padding: 60px 32px;
    color: var(--color-text-faint);
    font-size: 15px;
}

.studio-gallery-empty.hidden {
    display: none;
}

/* ==================== */
/* Studio Pathways (Landing Page) */
/* ==================== */
.studio-pathways {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 800px;
    margin: 0 auto 32px;
}

.studio-pathways-4 {
    grid-template-columns: repeat(2, 1fr);
    max-width: 640px;
}

.studio-pathway-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.studio-pathway-card:hover {
    border-color: rgba(79, 70, 229, 0.3);
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12);
    transform: translateY(-2px);
}

.studio-pathway-card:active {
    transform: translateY(0);
}

.studio-pathway-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0.04) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    color: #4f46e5;
}

.studio-pathway-card h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 8px;
}

.studio-pathway-card p {
    font-size: 13px;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.5;
}

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

@media (max-width: 560px) {
    .studio-pathways {
        grid-template-columns: 1fr;
    }
}

/* ==================== */
/* Agent Builder */
/* ==================== */

.studio-ab-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.studio-ab-chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.studio-ab-chat-panel .tool-prompt-bar {
    max-width: 680px;
    width: 100%;
    align-self: center;
}

.studio-ab-spec-panel {
    width: 380px;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    flex-shrink: 0;
}

.studio-ab-spec-panel.hidden {
    display: none;
}

.studio-ab-spec-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.studio-ab-spec-placeholder {
    color: var(--color-text-faint);
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

/* Step Indicator */
.studio-ab-step-indicator {
    display: flex;
    gap: 6px;
    align-items: center;
}

.studio-ab-step-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin-right: 6px;
    white-space: nowrap;
}

.studio-ab-step {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid rgba(0, 0, 0, 0.1);
    color: var(--color-text-faint);
    background: var(--color-bg);
    transition: all 0.3s ease;
}

.studio-ab-step.active {
    border-color: var(--color-primary);
    background: var(--color-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.studio-ab-step.completed {
    border-color: #22c55e;
    background: #22c55e;
    color: white;
}

.studio-ab-step.active.discussing {
    animation: discuss-pulse 2s ease-in-out infinite;
}

@keyframes discuss-pulse {
    0%, 100% { box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3); }
    50% { box-shadow: 0 2px 16px rgba(79, 70, 229, 0.6); }
}

/* "Ready to continue" button for discuss phases */
.studio-ab-continue-btn {
    display: none;
    margin: 8px auto 0;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: 1px solid var(--color-primary);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.studio-ab-continue-btn:hover {
    background: var(--color-primary);
    color: white;
}

/* Agent Builder toolbar & file attach */
.studio-ab-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.studio-ab-attach-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b6b6b;
    transition: all 0.15s ease;
}

.studio-ab-attach-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text);
}

.studio-ab-file-preview {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 8px;
}

/* ── Agent Builder — Upload Step (Step 1) ── */
.studio-ab-describe-step {
    display: none; /* shown by JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 40px;
    gap: 24px;
    overflow-y: auto;
}

.studio-ab-describe-textarea {
    width: 100%;
    max-width: 600px;
    min-height: 140px;
    padding: 16px;
    border: 1.5px solid var(--color-border, #e2e8f0);
    border-radius: 12px;
    background: var(--color-bg-secondary, #f8fafc);
    color: var(--color-text);
    font-size: 14px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s;
}

.studio-ab-describe-textarea:focus {
    outline: none;
    border-color: var(--color-primary, #4f46e5);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.studio-ab-describe-textarea::placeholder {
    color: var(--color-text-faint, #94a3b8);
}

.studio-ab-upload-step {
    display: none; /* shown by JS */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 32px 40px;
    gap: 20px;
    overflow-y: auto;
}

.studio-ab-upload-intro {
    max-width: 600px;
    text-align: center;
}

.studio-ab-upload-heading {
    font-size: 22px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 10px;
}

.studio-ab-upload-subtext {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

.studio-ab-upload-timeframe {
    font-size: 13px;
    color: var(--color-text-faint);
    margin: 8px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.studio-ab-upload-timeframe::before {
    content: '\23F1';
}

/* Saved drafts section */
.studio-ab-drafts {
    width: 100%;
    max-width: 600px;
}

.studio-ab-drafts-heading {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
    margin: 0 0 10px;
}

.studio-ab-draft-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.studio-ab-draft-item:hover {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.02);
}

.studio-ab-draft-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}

.studio-ab-draft-meta {
    font-size: 12px;
    color: var(--color-text-faint);
    margin-top: 2px;
}

.studio-ab-draft-delete {
    background: none;
    border: none;
    color: var(--color-text-faint);
    cursor: pointer;
    padding: 4px 6px;
    font-size: 18px;
    line-height: 1;
    border-radius: 4px;
    transition: all 0.2s;
}

.studio-ab-draft-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.08);
}

.studio-ab-upload-dropzone {
    width: 100%;
    max-width: 600px;
    min-height: 260px;
    border: 2px dashed rgba(0, 0, 0, 0.14);
    border-radius: 20px;
    background: #fafbfc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    padding: 40px 32px;
    text-align: center;
}

.studio-ab-upload-dropzone.dragover {
    border-color: var(--color-primary, #4f46e5);
    background: rgba(79, 70, 229, 0.04);
}

.studio-ab-upload-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.studio-ab-upload-hint {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0;
    max-width: 380px;
    line-height: 1.5;
}

.studio-ab-upload-browse-btn {
    margin-top: 8px;
    padding: 8px 22px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: white;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    color: var(--color-text);
    transition: all 0.15s;
}

.studio-ab-upload-browse-btn:hover {
    background: var(--color-primary, #4f46e5);
    color: white;
    border-color: var(--color-primary, #4f46e5);
}

.studio-ab-upload-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: 600px;
    justify-content: center;
}

.studio-ab-upload-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #ededf4;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    color: var(--color-text);
}

.studio-ab-upload-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 16px;
    line-height: 1;
    padding: 0 0 0 4px;
}

.studio-ab-next-step-btn {
    padding: 12px 36px;
    background: var(--color-primary, #4f46e5);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.studio-ab-next-step-btn:hover {
    background: #3730a3;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* Review Brief UI */
.review-brief-container {
    margin-top: 12px;
}

.review-brief-tabs {
    display: flex;
    gap: 2px;
    border-bottom: 1px solid var(--color-border, rgba(0,0,0,0.1));
    margin-bottom: 12px;
    overflow-x: auto;
}

.review-brief-tab {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--color-text-muted, #888);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.review-brief-tab:hover {
    color: var(--color-text, #333);
}

.review-brief-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.review-brief-panel {
    display: none;
}

.review-brief-panel.active {
    display: block;
}

.review-brief-section {
    background: var(--color-bg-subtle, rgba(0,0,0,0.02));
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 10px;
}

.review-brief-section-title {
    font-size: 12px;
    font-weight: 700;
    margin: 0 0 6px 0;
    color: var(--color-text, #333);
}

.review-brief-section ul {
    margin: 4px 0 0 16px;
    padding: 0;
    font-size: 12px;
    line-height: 1.5;
}

.review-brief-section li {
    margin-bottom: 4px;
}

.review-brief-card {
    padding: 6px 8px;
    margin-bottom: 6px;
    background: var(--color-bg, #fff);
    border-radius: 6px;
    font-size: 12px;
    line-height: 1.4;
    border: 1px solid var(--color-border, rgba(0,0,0,0.06));
}

.concern-section {
    background: rgba(239, 68, 68, 0.04);
    border-left: 3px solid rgba(239, 68, 68, 0.3);
}

.missing-section {
    background: rgba(234, 179, 8, 0.04);
    border-left: 3px solid rgba(234, 179, 8, 0.3);
}

.suggestion-section {
    background: rgba(59, 130, 246, 0.04);
    border-left: 3px solid rgba(59, 130, 246, 0.3);
}

.aio-prompt-section {
    background: rgba(79, 70, 229, 0.04);
    border-left: 3px solid rgba(79, 70, 229, 0.3);
}

.concern-badge-count {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.concern-badge-high {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    text-transform: uppercase;
}

.concern-badge-medium {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(234, 179, 8, 0.1);
    color: #ca8a04;
    text-transform: uppercase;
}

.concern-badge-low {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
    text-transform: uppercase;
}

.review-brief-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.review-brief-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(79, 70, 229, 0.08);
    color: var(--color-primary);
    text-transform: capitalize;
}

.review-brief-muted {
    color: var(--color-text-muted, #888);
    font-size: 11px;
}

.review-brief-empty {
    color: var(--color-text-muted, #888);
    font-size: 12px;
    font-style: italic;
    padding: 8px 0;
}

.review-brief-footer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border, rgba(0,0,0,0.08));
}

.aio-context-area {
    margin-bottom: 10px;
}

.aio-context-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted, #888);
    margin-bottom: 4px;
}

.aio-context-notes {
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    font-size: 12px;
    font-family: inherit;
    border: 1px solid var(--color-border, rgba(0,0,0,0.1));
    border-radius: 8px;
    background: var(--color-bg, #fff);
    color: var(--color-text, #333);
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.aio-context-notes:focus {
    outline: none;
    border-color: var(--color-primary);
}

.review-action-primary {
    background: var(--color-primary) !important;
    color: white !important;
    border-radius: 6px;
    font-weight: 600;
}

.review-action-primary:hover {
    opacity: 0.9;
}

.review-action-secondary {
    background: transparent !important;
    color: var(--color-primary) !important;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
}

.review-action-danger {
    background: transparent !important;
    color: #dc2626 !important;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 6px;
}

.review-action-danger:hover {
    background: rgba(239, 68, 68, 0.05) !important;
}

/* Clickable Option Buttons */
.studio-ab-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.studio-ab-option-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: white;
    border: 1px solid rgba(79, 70, 229, 0.2);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.studio-ab-option-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.04);
    transform: translateX(4px);
}

.studio-ab-option-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.studio-ab-option-btn.selected {
    border-color: var(--color-primary);
    background: rgba(79, 70, 229, 0.08);
    opacity: 1;
    font-weight: 600;
}

.studio-ab-option-btn.something-else {
    border-style: dashed;
    border-color: rgba(0, 0, 0, 0.15);
    color: var(--color-text-muted);
    font-style: italic;
    background: var(--color-bg-secondary);
}

.studio-ab-option-btn.something-else:hover:not(:disabled) {
    border-color: var(--color-primary);
    border-style: dashed;
    color: var(--color-text);
    background: rgba(79, 70, 229, 0.04);
}

/* ==================== */
/* Specialist Messages (Agent Manager, Tool Manager) */
/* ==================== */

.studio-specialist-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: messageSlide 0.3s ease-out;
}

.studio-specialist-avatar {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.studio-msg-specialist {
    align-self: flex-start;
    background: linear-gradient(180deg, #fefefe 0%, #f9fafb 100%);
    padding: 12px 16px;
    border-radius: 4px 14px 14px 14px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--color-text);
    max-width: calc(100% - 42px);
}

.studio-specialist-name {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.studio-specialist-content {
    font-size: 13.5px;
    line-height: 1.6;
}

.studio-specialist-content p {
    margin: 0 0 8px 0;
}

.studio-specialist-content p:last-child {
    margin-bottom: 0;
}

.studio-specialist-content strong {
    color: var(--color-text);
}

/* Specialist "entering" indicator */
.studio-specialist-entering {
    animation: messageSlide 0.3s ease-out;
}

.studio-specialist-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 12px;
    color: var(--specialist-color, #8b5cf6);
    background: color-mix(in srgb, var(--specialist-color, #8b5cf6) 5%, transparent);
    border-radius: 20px;
    border: 1px solid color-mix(in srgb, var(--specialist-color, #8b5cf6) 15%, transparent);
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Spec Card (in messages) */
.studio-ab-spec-card {
    background: linear-gradient(180deg, #f0fdf4 0%, #ecfdf5 100%);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.7;
}

.studio-ab-spec-card strong {
    color: #15803d;
}

/* Test Card */
.studio-ab-test-card {
    background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.7;
}

/* Submission Card */
.studio-ab-submission-card {
    background: linear-gradient(180deg, #fefce8 0%, #fef9c3 100%);
    border: 1px solid rgba(234, 179, 8, 0.3);
    border-radius: 12px;
    padding: 16px 20px;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.7;
}

/* ==================== */
/* Improve Agent View */
/* ==================== */

.studio-ia-layout {
    flex: 1;
    overflow-y: auto;
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

.studio-ia-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.studio-ia-section-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}

.studio-ia-completion {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-muted);
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.04);
}

.studio-ia-completion.complete {
    background: rgba(34, 197, 94, 0.1);
    color: #15803d;
}

.studio-ia-completion.partial {
    background: rgba(234, 179, 8, 0.1);
    color: #a16207;
}

.studio-ia-spec-fields {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.studio-ia-field {
    padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
    transition: all 0.2s ease;
}

.studio-ia-field.filled {
    border-color: rgba(34, 197, 94, 0.15);
}

.studio-ia-field.empty {
    border-color: rgba(0, 0, 0, 0.04);
    background: var(--color-bg);
}

.studio-ia-field-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.studio-ia-field-status {
    font-size: 13px;
    color: #22c55e;
}

.studio-ia-field.empty .studio-ia-field-status {
    color: var(--color-text-faint);
}

.studio-ia-field-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
}

.studio-ia-field-value {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    padding-left: 22px;
}

.studio-ia-field-empty {
    font-style: italic;
    color: var(--color-text-faint);
}

/* Training Log */
.studio-ia-log-section {
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 24px;
}

.studio-ia-log-count {
    font-size: 12px;
    color: var(--color-text-muted);
}

.studio-ia-log-empty {
    color: var(--color-text-faint);
    font-size: 13px;
    text-align: center;
    padding: 24px;
}

.studio-ia-log-entries {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.studio-ia-log-entry {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
}

.studio-ia-log-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.studio-ia-log-entry-type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-primary);
}

.studio-ia-log-entry-date {
    font-size: 11px;
    color: var(--color-text-faint);
}

.studio-ia-log-entry-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    margin: 0 0 4px;
}

.studio-ia-log-entry-content {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0 0 6px;
}

.studio-ia-log-entry-source {
    font-size: 11px;
    color: var(--color-text-faint);
}

/* Agent Spec Badge (on agent cards in Manage tab) */
.agent-spec-badge {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-muted);
    margin-left: 8px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
    white-space: nowrap;
    vertical-align: middle;
}

.agent-spec-badge:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--color-text);
    transform: scale(1.04);
}

.agent-spec-badge.complete {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.agent-spec-badge.complete:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #047857;
}

/* Agent Spec Overlay */
.spec-overlay-field {
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    background: white;
    transition: border-color 0.2s ease;
}

.spec-overlay-field.filled {
    border-left: 3px solid #10b981;
}

.spec-overlay-field.empty {
    border-left: 3px solid rgba(0, 0, 0, 0.08);
    opacity: 0.7;
}

.spec-overlay-field-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.spec-overlay-field-status {
    font-size: 13px;
    color: #10b981;
    flex-shrink: 0;
}

.spec-overlay-field.empty .spec-overlay-field-status {
    color: var(--color-text-faint);
}

.spec-overlay-field-value {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.6;
    padding-left: 21px;
    white-space: pre-wrap;
}

/* Spec Overlay Training Log Entries */
.spec-overlay-log-entry {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.spec-overlay-log-entry:last-child {
    border-bottom: none;
}

.spec-overlay-log-type {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
}

.spec-overlay-log-date {
    font-size: 11px;
    color: var(--color-text-faint);
    margin-left: auto;
    flex-shrink: 0;
}

/* ==================== */
/* Tool Picker */
/* ==================== */
.studio-tool-picker-container {
    padding: 32px;
    max-width: 800px;
    margin: 0 auto;
    overflow-y: auto;
    flex: 1;
}

.studio-tool-picker-search {
    position: relative;
    margin-top: 20px;
}

.studio-tool-picker-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-faint);
    pointer-events: none;
}

.studio-tool-picker-search-input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--color-text-primary);
    background: #fff;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.studio-tool-picker-search-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.studio-tool-picker-search-input::placeholder {
    color: var(--color-text-faint);
}

.studio-tool-picker-grid {
    margin-top: 16px;
}

/* Studio picker section titles */
.studio-picker-section {
    margin-bottom: 24px;
}

.studio-picker-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
    margin: 0 0 12px 4px;
}

.studio-picker-agent-grid,
.studio-picker-tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

/* Agent picker card — slightly different styling */
.studio-agent-picker-card {
    border-left: 3px solid var(--color-primary);
}

.studio-picker-card-icon {
    display: flex;
    align-items: center;
    color: var(--color-primary);
    flex-shrink: 0;
}

.studio-tool-picker-card {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.studio-tool-picker-card:hover {
    border-color: rgba(79, 70, 229, 0.3);
    background: rgba(79, 70, 229, 0.02);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
}

.studio-tool-picker-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
}

.studio-tool-picker-card-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--color-text-secondary);
    text-transform: capitalize;
    white-space: nowrap;
}

.studio-tool-picker-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--color-text-faint);
}

/* ==================== */
/* Change Request Form */
/* ==================== */
.studio-change-request-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    background: #fff;
    flex-shrink: 0;
}

.studio-change-request-actions {
    margin-left: auto;
}

.studio-cr-submit-btn {
    padding: 8px 24px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: none;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 2px 6px rgba(79, 70, 229, 0.25);
    transition: all 0.2s ease;
}

.studio-cr-submit-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
    transform: translateY(-1px);
}

.studio-change-request-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(100vh - 200px);
}

.studio-cr-sections {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.studio-cr-field {
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    padding: 16px 20px;
    transition: border-color 0.2s ease;
}

.studio-cr-field.changed {
    border-color: rgba(79, 70, 229, 0.4);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
}

.studio-cr-field-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.studio-cr-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0;
}

.studio-cr-field-current-tag {
    font-size: 11px;
    color: var(--color-text-faint);
    font-weight: 500;
}

.studio-cr-field-current-tag.empty {
    font-style: italic;
}

.studio-cr-field-textarea {
    width: 100%;
    min-height: 60px;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: var(--color-bg-muted);
    resize: vertical;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.studio-cr-field-textarea:focus {
    outline: none;
    border-color: #4f46e5;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.studio-cr-notes {
    margin-bottom: 24px;
}

.studio-cr-notes h4,
.studio-cr-attachments h4 {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 10px;
}

.studio-cr-notes textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    color: var(--color-text-primary);
    background: #fff;
    resize: vertical;
    box-sizing: border-box;
}

.studio-cr-notes textarea:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.studio-cr-upload-label {
    cursor: pointer;
    display: inline-block;
}

.studio-cr-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.studio-cr-upload-btn:hover {
    background: var(--color-bg-muted);
    border-color: rgba(0, 0, 0, 0.2);
}

.studio-cr-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.studio-cr-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-bg-muted);
    border-radius: 8px;
    font-size: 13px;
}

.studio-cr-file-name {
    font-weight: 600;
    color: var(--color-text-primary);
}

.studio-cr-file-size {
    color: var(--color-text-faint);
    font-size: 12px;
}

.studio-cr-file-remove {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--color-text-faint);
    padding: 0 4px;
    line-height: 1;
}

.studio-cr-file-remove:hover {
    color: #ef4444;
}

/* ==================== */
/* Gallery Filter Tabs */
/* ==================== */
.gallery-filter-tabs {
    display: flex;
    gap: 4px;
    padding: 0 24px 16px;
}

.gallery-filter-tab {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: var(--color-text-secondary);
    transition: all 0.2s ease;
}

.gallery-filter-tab:hover {
    background: var(--color-bg-muted);
}

.gallery-filter-tab.active {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

/* Change Request Gallery Cards */
.gallery-cr-card {
    border-left: 3px solid #4f46e5;
}

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

.gallery-cr-type-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4f46e5;
}

.gallery-cr-status {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    text-transform: capitalize;
}

.gallery-cr-status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.gallery-cr-status-reviewed {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.gallery-cr-status-implemented {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

/* ==================== */
/* Change Request Detail Overlay */
/* ==================== */
.cr-detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.cr-detail-overlay.active {
    opacity: 1;
}

.cr-detail-modal {
    background: #fff;
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.cr-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cr-detail-header h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.cr-detail-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-faint);
    padding: 0;
    line-height: 1;
}

.cr-detail-close:hover {
    color: var(--color-text-primary);
}

.cr-detail-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cr-detail-note {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.cr-detail-note h4,
.cr-detail-fields h4,
.cr-detail-attachments h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-faint);
    margin: 0 0 8px;
}

.cr-detail-note p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: var(--color-text-primary);
}

.cr-detail-fields {
    padding: 16px 24px;
}

.cr-detail-field {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.cr-detail-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.cr-detail-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 8px;
}

.cr-detail-diff {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cr-detail-old,
.cr-detail-new {
    font-size: 13px;
    line-height: 1.5;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: pre-wrap;
    word-break: break-word;
}

.cr-detail-old {
    background: rgba(239, 68, 68, 0.06);
    color: #991b1b;
}

.cr-detail-new {
    background: rgba(34, 197, 94, 0.06);
    color: #166534;
}

.cr-diff-tag {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-right: 8px;
    padding: 1px 6px;
    border-radius: 4px;
}

.cr-detail-old .cr-diff-tag {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.cr-detail-new .cr-diff-tag {
    background: rgba(34, 197, 94, 0.12);
    color: #16a34a;
}

.cr-detail-attachments {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.cr-detail-attachment {
    display: inline-block;
    padding: 4px 10px;
    background: var(--color-bg-muted);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: 6px;
    margin-bottom: 4px;
}

/* ==================== */
/* Pipeline Review Overlay (Agent Spec detail) */
/* ==================== */

.pipeline-review-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.pipeline-review-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.pipeline-review-modal {
    background: #fff;
    border-radius: 16px;
    max-width: 680px;
    width: 92%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.pipeline-review-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.pipeline-review-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pipeline-review-header-left h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    color: var(--color-text);
}

.pipeline-review-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-faint);
    padding: 0;
    line-height: 1;
}

.pipeline-review-close:hover {
    color: var(--color-text);
}

.pipeline-review-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 24px;
    font-size: 13px;
    color: var(--color-text-muted);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-wrap: wrap;
}

.pipeline-review-body {
    padding: 20px 24px;
}

.pipeline-review-field {
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.pipeline-review-field:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.pipeline-review-field-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-faint);
    margin-bottom: 6px;
}

.pipeline-review-field-value {
    font-size: 14px;
    line-height: 1.6;
    color: var(--color-text);
    white-space: pre-wrap;
    word-break: break-word;
}

.pipeline-review-notes {
    padding: 16px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(59, 130, 246, 0.04);
}

.pipeline-review-notes h4 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-faint);
    margin: 0 0 8px;
}

.pipeline-review-notes p {
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    color: var(--color-text);
}

/* AIO Review Actions */
.pipeline-review-actions {
    padding: 20px 24px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: rgba(0, 0, 0, 0.015);
}

.pipeline-review-notes-input {
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    background: white;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.pipeline-review-notes-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pipeline-review-action-btns {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.pipeline-review-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.pipeline-review-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pipeline-review-btn-approve {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

.pipeline-review-btn-approve:hover:not(:disabled) {
    background: rgba(16, 185, 129, 0.15);
}

.pipeline-review-btn-changes {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.pipeline-review-btn-changes:hover:not(:disabled) {
    background: rgba(245, 158, 11, 0.15);
}

.pipeline-review-btn-reject {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.pipeline-review-btn-reject:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.15);
}

/* Submission Notification Icons */
.submission-notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 10px;
    font-weight: 700;
    flex-shrink: 0;
}

.submission-notif-approved {
    background: rgba(16, 185, 129, 0.15);
    color: #059669;
}

.submission-notif-rejected {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.submission-notif-changes {
    background: rgba(245, 158, 11, 0.15);
    color: #d97706;
}

.submission-notif-new {
    background: rgba(139, 92, 246, 0.15);
    color: #7c3aed;
}

.submission-notif-architect {
    background: rgba(99, 102, 241, 0.15);
    color: #6366f1;
}

.architect-summary-body {
    white-space: pre-wrap;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary, #6b7280);
    padding: 8px 0 4px;
}

/* ==================== */
/* Implementation Queue (AIP-only) */
/* ==================== */

.impl-queue-subtitle {
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.impl-queue-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.impl-queue-loading,
.impl-queue-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--color-text-faint);
    font-size: 14px;
}

.impl-queue-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.06);
    padding: 16px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.impl-queue-card:hover {
    border-color: rgba(79, 70, 229, 0.15);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.impl-queue-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.impl-queue-card-info {
    flex: 1;
    min-width: 0;
}

.impl-queue-card-company {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
}

.impl-queue-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    margin: 4px 0 0;
}

.impl-queue-card-details {
    margin-bottom: 12px;
}

.impl-queue-card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--color-text-faint);
    flex-wrap: wrap;
}

.impl-queue-block-reason {
    font-size: 13px;
    color: #dc2626;
    background: rgba(239, 68, 68, 0.06);
    padding: 8px 12px;
    border-radius: 8px;
    margin-top: 8px;
}

.impl-queue-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.impl-queue-action-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: white;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
    color: var(--color-text-muted);
}

.impl-queue-action-btn:hover {
    border-color: rgba(79, 70, 229, 0.3);
    color: var(--color-text);
}

.impl-queue-start-btn {
    color: #059669;
    border-color: rgba(16, 185, 129, 0.3);
}

.impl-queue-start-btn:hover {
    background: rgba(16, 185, 129, 0.08);
}

.impl-queue-complete-btn {
    color: #4f46e5;
    border-color: rgba(79, 70, 229, 0.3);
}

.impl-queue-complete-btn:hover {
    background: rgba(79, 70, 229, 0.08);
}

.impl-queue-block-btn {
    color: #dc2626;
    border-color: rgba(239, 68, 68, 0.3);
}

.impl-queue-block-btn:hover {
    background: rgba(239, 68, 68, 0.08);
}

.impl-queue-unblock-btn {
    color: #d97706;
    border-color: rgba(245, 158, 11, 0.3);
}

.impl-queue-unblock-btn:hover {
    background: rgba(245, 158, 11, 0.08);
}

/* Save Modal */
.studio-save-modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

.studio-save-modal.hidden {
    display: none;
}

.studio-save-modal-content {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.studio-save-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 20px;
}

.studio-save-field {
    margin-bottom: 16px;
}

.studio-save-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
}

.studio-save-field input,
.studio-save-field textarea {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s ease;
    color: var(--color-text);
    box-sizing: border-box;
}

.studio-save-field input:focus,
.studio-save-field textarea:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.studio-save-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.studio-save-confirm-btn {
    flex: 1;
    padding: 11px 20px;
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.studio-save-confirm-btn:hover {
    background: linear-gradient(135deg, #4338ca 0%, #3730a3 100%);
}

.studio-save-cancel-btn {
    padding: 11px 20px;
    background: white;
    color: var(--color-text-muted);
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.studio-save-cancel-btn:hover {
    background: var(--color-bg-muted);
}

/* Studio Typing Indicator */
.studio-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 0;
}

.studio-typing-indicator span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #9ca3af;
    animation: studioTypingBounce 1.4s infinite ease-in-out both;
}

.studio-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.studio-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
.studio-typing-indicator span:nth-child(3) { animation-delay: 0s; }

@keyframes studioTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 768px) {
    .studio-split-pane {
        flex-direction: column;
    }
    .studio-chat-panel {
        width: 100% !important;
        min-width: 0;
        height: 50%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }
    .studio-resize-handle {
        display: none;
    }
    .studio-preview-panel {
        min-width: 0;
    }
    .studio-gallery-grid {
        grid-template-columns: 1fr;
    }
    .studio-pipeline-grid {
        grid-template-columns: 1fr;
    }
    .studio-pipeline-container {
        padding: 24px 20px;
    }
    .studio-idea-container {
        padding: 40px 20px;
    }
    .studio-landing-toolbar {
        padding: 12px 20px 0;
    }
}

