/* ============================================================================
   Mako Standalone Chat Page
   Full-screen conversation UI at GET /mako
   ============================================================================ */

/* Hide site footer and chat FAB on full-screen chat page */
body:has(.mako-chat-page) > footer,
body:has(.mako-chat-page) .mako-fab {
    display: none;
}

/* -- Page layout -- */
.mako-chat-page {
    display: flex;
    flex-direction: row;
    min-height: calc(100dvh - var(--nav-height, 57px));
    background: var(--bg, #0a0a0f);
}

.mako-chat-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    max-width: 100%;
    height: calc(100dvh - var(--nav-height, 57px));
}

/* -- Conversation Sidebar -- */
.mako-sidebar {
    width: 260px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--card-bg, #111118);
    border-right: 1px solid var(--border, #1e1e2a);
    height: calc(100dvh - var(--nav-height, 57px));
    overflow: hidden;
}

.mako-sidebar-header {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border, #1e1e2a);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mako-sidebar-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: var(--text-muted, #8b8ba0);
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.mako-sidebar-close:hover {
    background: var(--hover-bg, rgba(255,255,255,0.06));
    color: var(--text, #e5e5ef);
}

.mako-sidebar-overlay {
    display: none;
}

.mako-sidebar-new {
    appearance: none;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: var(--primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.mako-sidebar-new:hover {
    background: var(--primary-hover, #2563eb);
}

.mako-sidebar-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--border, #1e1e2a) transparent;
}

.mako-sidebar-list::-webkit-scrollbar { width: 4px; }
.mako-sidebar-list::-webkit-scrollbar-track { background: transparent; }
.mako-sidebar-list::-webkit-scrollbar-thumb { background: var(--border, #1e1e2a); border-radius: 2px; }

.mako-sidebar-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.625rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
    transition: background 0.1s;
}

.mako-sidebar-item:hover {
    background: var(--hover-bg, #16161f);
}

.mako-sidebar-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 2px solid var(--primary, #3b82f6);
}

.mako-sidebar-item-title {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text, #e5e5ef);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 1.5rem;
}

.mako-sidebar-item-time {
    font-size: 0.6875rem;
    color: var(--text-muted, #8b8ba0);
}

.mako-sidebar-item-delete {
    appearance: none;
    position: absolute;
    right: 0.5rem;
    top: 0.5rem;
    width: 1.25rem;
    height: 1.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted, #8b8ba0);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 3px;
    padding: 0;
}

.mako-sidebar-item-delete:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.mako-sidebar-item:hover .mako-sidebar-item-delete {
    display: inline-flex;
}

/* Sidebar toggle button */
.mako-sidebar-toggle {
    appearance: none;
    display: none;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    border: none;
    color: var(--text-muted, #8b8ba0);
    cursor: pointer;
    border-radius: 6px;
    flex-shrink: 0;
}

.mako-sidebar-toggle:hover {
    background: var(--hover-bg, #16161f);
    color: var(--text, #e5e5ef);
}

/* -- Header (mobile only — sidebar toggle) -- */
.mako-chat-header {
    display: none;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--border, #1e1e2a);
    flex-shrink: 0;
}

.mako-chat-header-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text, #e5e5ef);
}

/* -- Header logo (floating mako logo) -- */
.mako-header-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3));
    animation: mako-float 3s ease-in-out infinite;
    border-radius: 6px;
}

/* -- Messages area -- */
.mako-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border, #1e1e2a) transparent;
}

.mako-chat-messages::-webkit-scrollbar { width: 4px; }
.mako-chat-messages::-webkit-scrollbar-track { background: transparent; }
.mako-chat-messages::-webkit-scrollbar-thumb { background: var(--border, #1e1e2a); border-radius: 2px; }

/* -- Welcome screen -- */
.mako-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1;
    padding: 2rem 1rem;
    gap: 0.75rem;
}

.mako-chat-welcome-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: 16px;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.25));
    animation: mako-float 3s ease-in-out infinite;
}

@keyframes mako-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.mako-chat-welcome h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text, #e5e5ef);
    margin: 0;
}

.mako-chat-welcome p {
    font-size: 0.875rem;
    color: var(--text-muted, #8b8ba0);
    margin: 0;
}

/* -- Message bubbles -- */
.mako-msg {
    display: flex;
    gap: 0.5rem;
    max-width: 85%;
}

.mako-msg.user {
    align-self: flex-end;
    justify-content: flex-end;
}

.mako-msg.assistant,
.mako-msg.error {
    align-self: flex-start;
}

/* User bubble */
.mako-msg-bubble.user {
    padding: 0.625rem 0.875rem;
    border-radius: 14px;
    border-bottom-right-radius: 4px;
    background: var(--primary, #3b82f6);
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Assistant bubble */
.mako-msg-bubble.ai {
    padding: 0.625rem 0.875rem;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    background: var(--hover-bg, #16161f);
    color: var(--text, #e5e5ef);
    font-size: 0.8125rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    min-width: 0;
}

/* Error bubble */
.mako-msg-bubble.error {
    padding: 0.625rem 0.875rem;
    border-radius: 14px;
    border-bottom-left-radius: 4px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-size: 0.8125rem;
    line-height: 1.6;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Avatar */
.mako-msg-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.mako-msg-avatar.ai {
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary, #3b82f6);
}

/* Markdown content in messages */
.mako-msg-bubble.ai p {
    margin: 0 0 0.375rem;
}

.mako-msg-bubble.ai p:last-child {
    margin-bottom: 0;
}

.mako-msg-bubble.ai pre {
    background: var(--bg, #0a0a0f);
    border: 1px solid var(--border, #1e1e2a);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.mako-msg-bubble.ai code {
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'Cascadia Code', monospace);
    font-size: 0.8em;
    background: rgba(59, 130, 246, 0.1);
    padding: 0.0625rem 0.3125rem;
    border-radius: 3px;
}

.mako-msg-bubble.ai pre code {
    background: none;
    padding: 0;
}

/* SurfDoc content within assistant bubbles — override full-page surfdoc styles */
.mako-msg-bubble.ai .surfdoc {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-size: 0.8125rem;
    line-height: 1.6;
    overflow-x: hidden;
}

.mako-msg-bubble.ai .surfdoc h1 {
    font-size: 1.125rem;
    margin: 0.75rem 0 0.5rem;
}

.mako-msg-bubble.ai .surfdoc h2 {
    font-size: 1rem;
    margin: 0.625rem 0 0.375rem;
    padding-bottom: 0.25rem;
}

.mako-msg-bubble.ai .surfdoc h3 {
    font-size: 0.9375rem;
    margin: 0.5rem 0 0.25rem;
}

.mako-msg-bubble.ai .surfdoc p {
    margin: 0.375rem 0;
}

.mako-msg-bubble.ai .surfdoc p:first-child {
    margin-top: 0;
}

.mako-msg-bubble.ai .surfdoc p:last-child {
    margin-bottom: 0;
}

.mako-msg-bubble.ai .surfdoc ul,
.mako-msg-bubble.ai .surfdoc ol {
    margin: 0.375rem 0;
    padding-left: 1.25rem;
}

.mako-msg-bubble.ai .surfdoc pre {
    background: var(--bg, #0a0a0f);
    border: 1px solid var(--border, #1e1e2a);
    border-radius: 6px;
    padding: 0.625rem 0.875rem;
    overflow-x: auto;
    font-size: 0.75rem;
    line-height: 1.5;
    margin: 0.5rem 0;
}

.mako-msg-bubble.ai .surfdoc code {
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'Cascadia Code', monospace);
    font-size: 0.8em;
}

.mako-msg-bubble.ai .surfdoc pre code {
    background: none;
    padding: 0;
}

/* Hide surfdoc nav/chrome inside chat bubbles */
.mako-msg-bubble.ai .surfdoc-nav,
.mako-msg-bubble.ai .surfdoc-section-alt {
    display: none;
}

/* Strategy badge — hidden by default */
.mako-strategy-badge {
    display: none;
}

/* Save to Docs button */
.mako-save-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    margin-top: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--primary, #3b82f6);
    background: transparent;
    border: 1px solid var(--border, #1e1e2a);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.mako-save-btn:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary, #3b82f6);
}

.mako-save-btn.saved {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    cursor: default;
}

.mako-save-btn.saved:hover {
    background: transparent;
}

/* Action buttons container */
.mako-action-buttons {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 0.375rem;
    flex-wrap: wrap;
}

.mako-action-buttons .mako-save-btn {
    margin-top: 0;
}

/* Deploy as Site button */
.mako-deploy-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.3125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #a78bfa;
    background: transparent;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.mako-deploy-btn:hover {
    background: rgba(167, 139, 250, 0.08);
    border-color: #a78bfa;
}

.mako-deploy-btn.deploying {
    opacity: 0.7;
    cursor: wait;
    color: #a78bfa;
    border-color: rgba(167, 139, 250, 0.3);
}

.mako-deploy-btn.deployed {
    color: #22c55e;
    border-color: rgba(34, 197, 94, 0.3);
    cursor: default;
}

.mako-deploy-btn.deployed:hover {
    background: transparent;
}

/* Deploy spinner animation */
@keyframes mako-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.mako-deploy-btn .mako-spin {
    animation: mako-spin 1s linear infinite;
}

/* Preview link after deploy */
.mako-preview-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 500;
    color: #a78bfa;
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s;
}

.mako-preview-link:hover {
    background: rgba(167, 139, 250, 0.08);
    text-decoration: underline;
}

/* Limit warning */
.mako-limit-warning {
    font-size: 0.6875rem;
    color: var(--text-muted, #8b8ba0);
    background: rgba(234, 179, 8, 0.08);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    text-align: center;
}

/* Site edited notice */
.mako-site-edited-notice {
    font-size: 0.75rem;
    color: var(--text-muted, #8b8ba0);
    margin-top: 0.25rem;
}

.mako-site-edited-notice a {
    color: var(--primary, #3b82f6);
    text-decoration: underline;
}

/* -- Typing indicator (inside messages area, below last message) -- */
.mako-chat-typing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    font-size: 0.75rem;
    color: var(--text-muted, #8b8ba0);
}

.mako-chat-typing.hidden {
    display: none;
}

.mako-typing-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--hover-bg, #16161f);
    border-radius: 14px;
    border-bottom-left-radius: 4px;
}

.mako-chat-typing-dots {
    display: flex;
    gap: 3px;
}

.mako-chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-muted, #8b8ba0);
    animation: mako-chat-bounce 1.2s ease-in-out infinite;
}

.mako-chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.mako-chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes mako-chat-bounce {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

/* -- Input area -- */
.mako-chat-input-area {
    flex-shrink: 0;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border, #1e1e2a);
}

.mako-chat-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    border: 1px solid var(--border, #1e1e2a);
    border-radius: 12px;
    background: var(--card-bg, #111118);
    padding: 0.5rem 0.5rem 0.5rem 0.875rem;
    transition: border-color 0.15s;
}

.mako-chat-input-wrap:focus-within {
    border-color: var(--primary, #3b82f6);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.mako-chat-input {
    flex: 1;
    border: none;
    background: transparent;
    color: var(--text, #e5e5ef);
    font-family: var(--font-sans, var(--font));
    font-size: 0.875rem;
    line-height: 1.5;
    outline: none;
    resize: none;
    min-height: 1.5rem;
    max-height: 200px;
    padding: 0.125rem 0;
}

.mako-chat-input::placeholder {
    color: var(--text-muted, #8b8ba0);
}

.mako-chat-send {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: var(--primary, #3b82f6);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
}

.mako-chat-send:hover {
    background: var(--primary-hover, #2563eb);
}

.mako-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

#mako-image-input {
    display: none;
}

.mako-chat-image-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    padding: 0;
    background: transparent;
    color: var(--text-muted, #8b8ba0);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
    flex-shrink: 0;
}

.mako-chat-image-btn:hover {
    color: var(--text, #e5e5ef);
    background: var(--hover-bg, rgba(255,255,255,0.06));
}

/* -- Image preview strip -- */
.mako-image-preview-strip {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 0;
    overflow-x: auto;
    flex-wrap: wrap;
}

.mako-image-preview-strip.hidden {
    display: none;
}

.mako-image-preview-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border, #1e1e2a);
    flex-shrink: 0;
}

.mako-image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mako-image-preview-item .mako-image-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.mako-image-preview-item .mako-image-remove:hover {
    background: rgba(220,38,38,0.8);
}

.mako-image-preview-item.uploading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* -- Chat message images -- */
.mako-msg-images {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.mako-msg-images img {
    max-width: 240px;
    max-height: 200px;
    border-radius: 8px;
    object-fit: contain;
    cursor: pointer;
    transition: opacity 0.15s;
}

.mako-msg-images img:hover {
    opacity: 0.85;
}

.mako-chat-disclaimer {
    font-size: 0.6875rem;
    color: var(--text-muted, #8b8ba0);
    text-align: center;
    margin-top: 0.5rem;
}

/* -- Mobile responsive -- */
@media (max-width: 640px) {
    .mako-chat-page {
        min-height: calc(100dvh - var(--nav-height, 57px));
    }

    .mako-chat-container {
        max-width: 100%;
    }

    .mako-chat-header {
        display: flex;
        padding: 0.5rem 0.75rem;
    }

    .mako-chat-messages {
        padding: 1rem;
    }

    .mako-chat-input-area {
        padding: 0.75rem 1rem;
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
    }

    .mako-msg {
        max-width: 92%;
    }

    .mako-chat-welcome-logo {
        width: 56px;
        height: 56px;
    }

    .mako-chat-welcome h2 {
        font-size: 1.125rem;
    }

    /* Sidebar: hidden by default on mobile, overlay when toggled */
    .mako-sidebar {
        position: fixed;
        left: 0;
        top: var(--nav-height, 49px);
        bottom: 0;
        z-index: 100;
        transform: translateX(-100%);
        transition: transform 0.2s ease;
    }

    .mako-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
    }

    /* Overlay to dismiss sidebar on mobile */
    .mako-sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        top: var(--nav-height, 49px);
        background: rgba(0, 0, 0, 0.5);
        z-index: 99;
    }

    .mako-sidebar-overlay.open {
        display: block;
    }

    /* Show toggle + close buttons on mobile */
    .mako-sidebar-toggle {
        display: inline-flex;
    }

    .mako-sidebar-close {
        display: inline-flex;
    }
}

/* ============================================================================
   Develop Mode — Pipeline Job Cards
   ============================================================================ */

/* -- Job Card -- */
.develop-job-card {
    background: var(--card-bg, #111118);
    border: 1px solid var(--border, #1e1e2a);
    border-radius: 12px;
    padding: 1rem;
    margin: 0.5rem 0;
    max-width: 85%;
    align-self: flex-start;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.develop-job-header {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
}

.develop-job-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text, #e5e5ef);
}

.develop-job-repo {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--text-muted, #8b8ba0);
    background: rgba(59, 130, 246, 0.08);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* -- Phase Bar -- */
.develop-phase-bar {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 0.5rem 0;
    overflow-x: auto;
}

.develop-phase {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.develop-phase.pending {
    color: var(--text-muted, #8b8ba0);
    opacity: 0.5;
}

.develop-phase.active {
    color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.1);
    animation: develop-pulse 2s ease-in-out infinite;
}

.develop-phase.complete {
    color: #22c55e;
}

.develop-phase.failed {
    color: #ef4444;
}

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

.develop-phase-icon {
    font-size: 0.75rem;
    line-height: 1;
}

.develop-phase-label {
    font-weight: 600;
}

.develop-phase-meta {
    font-size: 0.625rem;
    color: var(--text-muted, #8b8ba0);
    font-weight: 400;
}

.develop-phase-connector {
    width: 1rem;
    height: 1px;
    background: var(--border, #1e1e2a);
    flex-shrink: 0;
}

/* -- Agent List -- */
.develop-agents {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.develop-agents-toggle {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted, #8b8ba0);
    cursor: pointer;
    user-select: none;
    padding: 0.125rem 0;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.develop-agents-toggle::before {
    content: '\25BE'; /* down arrow */
    font-size: 0.5625rem;
    transition: transform 0.15s;
}

.develop-agents-toggle.collapsed::before {
    transform: rotate(-90deg);
}

.develop-agents-list {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    overflow: hidden;
    transition: max-height 0.2s;
}

.develop-agents-list.collapsed {
    max-height: 0;
    overflow: hidden;
}

.develop-agent-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.1875rem 0.375rem;
    font-size: 0.6875rem;
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'Cascadia Code', monospace);
    border-radius: 3px;
}

.develop-agent-row.running {
    color: var(--primary, #3b82f6);
    background: rgba(59, 130, 246, 0.04);
}

.develop-agent-row.complete {
    color: #22c55e;
}

.develop-agent-row.failed {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

.develop-agent-row.queued {
    color: var(--text-muted, #8b8ba0);
    opacity: 0.6;
}

.develop-agent-icon {
    width: 0.875rem;
    text-align: center;
    flex-shrink: 0;
}

.develop-agent-name {
    font-weight: 600;
    min-width: 5rem;
}

.develop-agent-status {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 400;
}

.develop-agent-time {
    color: var(--text-muted, #8b8ba0);
    font-weight: 400;
    flex-shrink: 0;
}

/* -- Artifacts -- */
.develop-artifacts {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.develop-artifact-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    color: var(--primary, #3b82f6);
    text-decoration: none;
    border-radius: 4px;
    transition: background 0.15s;
}

.develop-artifact-link:hover {
    background: rgba(59, 130, 246, 0.08);
    text-decoration: underline;
}

.develop-artifact-icon {
    font-size: 0.75rem;
}

.develop-artifact-title {
    font-weight: 500;
}

.develop-artifact-type {
    font-size: 0.625rem;
    color: var(--text-muted, #8b8ba0);
    background: rgba(255, 255, 255, 0.04);
    padding: 0.0625rem 0.25rem;
    border-radius: 3px;
}

/* -- Approval Gate -- */
.develop-approval {
    background: rgba(59, 130, 246, 0.06);
    border: 1px solid rgba(59, 130, 246, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.develop-approval-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--primary, #3b82f6);
}

.develop-approval-title.paused {
    color: #eab308;
}

.develop-approval-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.develop-approval-row {
    font-size: 0.75rem;
    color: var(--text, #e5e5ef);
}

.develop-approval-row span {
    color: var(--text-muted, #8b8ba0);
}

.develop-approval-buttons {
    display: flex;
    gap: 0.375rem;
    margin-top: 0.25rem;
}

.develop-approval-btn {
    appearance: none;
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.develop-approval-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

.develop-approval-btn.start {
    background: var(--primary, #3b82f6);
    color: #fff;
}

.develop-approval-btn.start:hover:not(:disabled) {
    background: var(--primary-hover, #2563eb);
}

.develop-approval-btn.adjust {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text, #e5e5ef);
    border: 1px solid var(--border, #1e1e2a);
}

.develop-approval-btn.adjust:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
}

.develop-approval-btn.cancel {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.develop-approval-btn.cancel:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.18);
}

/* -- Error Display -- */
.develop-error {
    border-top: 1px solid rgba(239, 68, 68, 0.2);
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.develop-error-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: #ef4444;
}

.develop-error-row {
    font-size: 0.6875rem;
    color: #ef4444;
    display: flex;
    gap: 0.375rem;
    padding: 0.1875rem 0.375rem;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 3px;
}

.develop-error-row.conflict {
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'Cascadia Code', monospace);
    color: #eab308;
    background: rgba(234, 179, 8, 0.05);
}

.develop-error-agent {
    font-weight: 600;
    flex-shrink: 0;
}

.develop-error-msg {
    flex: 1;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* -- PR Card -- */
.develop-pr-card {
    display: block;
    background: rgba(167, 139, 250, 0.06);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 8px;
    padding: 0.75rem;
    text-decoration: none;
    transition: all 0.15s;
    margin-top: 0.25rem;
}

.develop-pr-card:hover {
    background: rgba(167, 139, 250, 0.1);
    border-color: rgba(167, 139, 250, 0.35);
}

.develop-pr-card-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.375rem;
}

.develop-pr-card-icon {
    font-size: 0.875rem;
}

.develop-pr-card-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.develop-pr-card-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text, #e5e5ef);
    margin-bottom: 0.25rem;
}

.develop-pr-card-desc {
    font-size: 0.6875rem;
    color: var(--text-muted, #8b8ba0);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.develop-pr-card-url {
    font-size: 0.625rem;
    font-family: var(--font-mono, 'SF Mono', 'Fira Code', 'Cascadia Code', monospace);
    color: #a78bfa;
    opacity: 0.7;
}

/* -- Completion Card -- */
.develop-completion {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.15);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.develop-completion-header {
    font-size: 0.8125rem;
    font-weight: 700;
    color: #22c55e;
}

.develop-completion-summary {
    font-size: 0.75rem;
    color: var(--text, #e5e5ef);
    line-height: 1.5;
}

.develop-completion-stats {
    display: flex;
    gap: 0.75rem;
}

.develop-completion-stat {
    font-size: 0.6875rem;
    color: var(--text-muted, #8b8ba0);
}

.develop-completion-stat strong {
    color: var(--text, #e5e5ef);
}

.develop-completion-pr {
    display: inline-flex;
    align-items: center;
    font-size: 0.6875rem;
    font-weight: 600;
    color: #a78bfa;
    text-decoration: none;
    margin-top: 0.125rem;
}

.develop-completion-pr:hover {
    text-decoration: underline;
}

/* -- Mobile responsive develop cards -- */
@media (max-width: 640px) {
    .develop-job-card {
        max-width: 100%;
    }

    .develop-phase-bar {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .develop-phase {
        padding: 0.1875rem 0.375rem;
        font-size: 0.625rem;
    }

    .develop-agent-name {
        min-width: 3.5rem;
    }
}
