      /* Page-specific overrides */
      .split {
        display: flex;
        flex: 1;
        overflow: hidden;
      }
      
      /* Delete button on project cards */
      .btn-delete-project {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        border-radius: 6px;
        border: none;
        background: rgba(244, 67, 54, 0.1);
        color: #f44336;
        cursor: pointer;
        opacity: 0;
        transition: opacity 0.2s, background 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10;
      }
      .project-card:hover .btn-delete-project {
        opacity: 1;
      }
      .btn-delete-project:hover {
        background: #f44336;
        color: white;
      }
      .gutter {
        background: var(--bg-panel);
        flex-shrink: 0;
      }
      .gutter-horizontal {
        width: 1px;
        cursor: col-resize;
      }
      .gutter-horizontal:hover {
        background: var(--accent-primary);
        width: 3px;
        margin: 0 -1px;
      }

      #ace-editor {
        width: 100%;
        height: 100%;
        font-size: 14px;
      }

      .pdf-page {
        margin-bottom: 16px;
        box-shadow: var(--shadow-lg);
      }
      .pdf-page canvas {
        display: block;
      }

      /* Title editing */
      .project-title {
        background: transparent;
        border: none;
        color: var(--text-primary);
        font-size: var(--text-sm);
        font-weight: 500;
        outline: none;
        padding: 4px 8px;
        border-radius: var(--radius-sm);
      }
      .project-title:hover {
        background: var(--bg-hover);
      }
      .project-title:focus {
        background: var(--bg-input);
      }

      /* Compile button states */
      .btn-compile.compiling {
        pointer-events: none;
        opacity: 0.7;
      }
      .btn-compile.compiling .fa-sync {
        animation: spin 1s linear infinite;
      }

      /* AI typing indicator */
      .ai-typing::after {
        content: "●●●";
        animation: typing 1.5s infinite;
      }
      @keyframes typing {
        0%,
        100% {
          opacity: 0.2;
        }
        50% {
          opacity: 1;
        }
      }

      /* Preview zoom controls */
      .zoom-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: var(--text-xs);
        color: var(--text-secondary);
      }

      /* Dashboard styles */
      .dashboard-container {
        max-width: 1200px;
        margin: 0 auto;
        padding: 48px 24px;
      }
      .project-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
        margin-top: 32px;
      }
      @media (max-width: 1024px) {
        .project-grid {
          grid-template-columns: repeat(2, 1fr);
        }
      }
      @media (max-width: 640px) {
        .project-grid {
          grid-template-columns: 1fr;
        }
      }
      .project-card {
        background: var(--bg-panel);
        border: 1px solid var(--border-subtle);
        border-radius: var(--radius-lg);
        padding: 24px;
        cursor: pointer;
        transition: all var(--transition-fast);
      }
      .project-card:hover {
        border-color: var(--accent-primary);
        transform: translateY(-2px);
        box-shadow: var(--shadow-glow);
      }
      .project-card-preview {
        height: 140px;
        background: var(--bg-code);
        border-radius: var(--radius-md);
        margin-bottom: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-muted);
      }

      /* Modal */
      .modal-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(4px);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: var(--z-modal);
      }
      .modal-content {
        background: var(--bg-panel);
        border-radius: var(--radius-xl);
        padding: 32px;
        width: 100%;
        max-width: 400px;
        animation: slideUp var(--transition-normal);
      }
      
      /* Prism-style bottom floating pagination */
      .preview-panel {
        position: relative;
      }
      .pdf-pagination-overlay {
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        align-items: center;
        gap: 12px;
        background: rgba(30, 30, 35, 0.9);
        backdrop-filter: blur(8px);
        padding: 8px 16px;
        border-radius: 100px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.4);
        z-index: 10;
      }
      .pdf-nav-btn {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        border: none;
        background: rgba(255,255,255,0.1);
        color: white;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
      }
      .pdf-nav-btn:hover {
        background: var(--accent-primary);
        transform: scale(1.1);
      }
      .pdf-page-indicator {
        color: white;
        font-size: 14px;
        font-weight: 500;
        min-width: 50px;
        text-align: center;
      }
      
      /* Sidebar Tabs - Prism Style */
      .sidebar-tabs {
        display: flex;
        gap: 8px;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-subtle);
      }
      .sidebar-tab {
        flex: 1;
        padding: 8px 12px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 13px;
        font-weight: 500;
        cursor: pointer;
        border-radius: var(--radius-md);
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
      }
      .sidebar-tab:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
      }
      .sidebar-tab.active {
        background: var(--accent-primary);
        color: white;
      }
      .sidebar-tab-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      .sidebar-tab-content:not(.active) {
        display: none;
      }
      
      /* Chat History List */
      .chat-history-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 0 4px;
      }
      .chat-message {
        padding: 10px 12px;
        border-radius: var(--radius-md);
        font-size: 12px;
        line-height: 1.5;
        max-width: 100%;
        word-wrap: break-word;
      }
      .chat-message.user {
        background: var(--accent-primary);
        color: white;
        margin-left: 16px;
        border-bottom-right-radius: 4px;
      }
      .chat-message.assistant {
        background: var(--bg-hover);
        color: var(--text-primary);
        margin-right: 16px;
        border-bottom-left-radius: 4px;
      }
      .chat-message .message-role {
        font-size: 10px;
        font-weight: 600;
        margin-bottom: 4px;
        opacity: 0.7;
      }
      .chat-message.user .message-role {
        color: rgba(255,255,255,0.8);
      }
      
      /* Proposed Changes Panel - Prism Style (Enhanced) */
      .proposed-changes {
        background: #fafafa;
        border: 1px solid #e8e8e8;
        border-radius: 12px;
        margin: 12px 0;
        overflow: hidden;
        box-shadow: 0 1px 4px rgba(0,0,0,0.04);
      }
      /* Dark mode override */
      @media (prefers-color-scheme: dark) {
        .proposed-changes {
          background: var(--bg-code);
          border-color: var(--border-subtle);
        }
      }
      .proposed-changes-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 16px;
        cursor: pointer;
        font-size: 14px;
        font-weight: 600;
        color: #374151;
        background: transparent;
        transition: background 0.15s ease;
      }
      .proposed-changes-header:hover {
        background: rgba(0,0,0,0.02);
      }
      .proposed-changes-header .chevron {
        transition: transform 0.2s ease;
        color: #9ca3af;
        font-size: 12px;
      }
      .proposed-changes.collapsed .chevron {
        transform: rotate(-90deg);
      }
      .proposed-changes.collapsed .proposed-changes-list {
        display: none;
      }
      .proposed-changes-list {
        border-top: 1px solid #e8e8e8;
      }
      .file-diff-row {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        gap: 10px;
        font-size: 14px;
        color: #1f2937;
        border-bottom: 1px solid #f3f4f6;
      }
      .file-diff-row:last-child {
        border-bottom: none;
      }
      .file-diff-row:hover {
        background: rgba(99, 102, 241, 0.04);
      }
      .file-diff-row .file-icon {
        color: #6b7280;
        font-size: 13px;
        font-weight: 500;
        flex-shrink: 0;
      }
      .file-diff-row .file-name {
        font-family: 'JetBrains Mono', monospace;
        font-size: 13px;
        color: #374151;
        flex-shrink: 0;
      }
      .file-diff-row .file-desc {
        color: #6b7280;
        font-size: 14px;
        flex: 1;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      .file-diff-row .diff-stats {
        display: flex;
        gap: 8px;
        font-size: 13px;
        font-family: 'JetBrains Mono', monospace;
        flex-shrink: 0;
      }
      .diff-add { color: #22c55e; font-weight: 500; }
      .diff-remove { color: #ef4444; font-weight: 500; }
      
      /* AI Explanation Text */
      .ai-explanation {
        padding: 12px;
        font-size: 13px;
        line-height: 1.6;
        color: var(--text-primary);
      }
      .ai-explanation code {
        background: var(--bg-code);
        padding: 2px 6px;
        border-radius: 4px;
        font-family: 'JetBrains Mono', monospace;
        font-size: 12px;
      }
      
      /* Unified AI Chat Container - Messages + Input as one unit */
      /* Centered under the editor pane (between sidebar and preview) */
      .ai-chat-container {
        position: fixed;
        bottom: 24px;
        /* Center calculation: 
           - Sidebar is ~200px
           - Preview pane is ~50% of viewport
           - Editor takes remaining space
           - Center the chat in the editor area
        */
        left: calc(200px + 12px);  /* sidebar width + gap */
        width: calc(50% - 200px - 48px);  /* Fill editor width minus padding */
        min-width: 320px;
        max-width: 500px;
        min-height: 64px;
        max-height: calc(100vh - 100px);
        background: var(--bg-sidebar);
        border-radius: var(--radius-lg);
        box-shadow: 0 4px 24px rgba(0,0,0,0.3);
        overflow: hidden;
        z-index: 100;
        display: flex;
        flex-direction: column;
        transition: height 0.2s ease;
      }
      
      /* Collapsed state - only input visible */
      .ai-chat-container.collapsed {
        height: 64px;
      }
      .ai-chat-container.collapsed .chat-messages-wrapper,
      .ai-chat-container.collapsed .chat-resize-handle {
        display: none;
      }
      
      /* Expanded state */
      .ai-chat-container.expanded {
        height: 400px;
      }
      .chat-resize-handle {
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: ns-resize;
        background: var(--bg-sidebar);
        flex-shrink: 0;
        border-bottom: 1px solid var(--border-default);
        user-select: none;
      }
      .chat-resize-handle:active {
        background: var(--bg-tertiary);
      }
      .resize-grip {
        width: 48px;
        height: 5px;
        background: var(--border-default);
        border-radius: 3px;
        transition: background 0.15s;
        position: relative;
      }
      .resize-grip::after {
        content: '⋮⋮';
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        color: var(--text-tertiary);
        font-size: 10px;
        letter-spacing: 2px;
        top: -8px;
      }
      .chat-resize-handle:hover .resize-grip {
        background: var(--accent-primary);
      }
      .chat-resize-handle:hover .resize-grip::after {
        color: var(--accent-primary);
      }
      
      /* Messages wrapper - contains scrollable message area */
      .chat-messages-wrapper {
        flex: 1;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        min-height: 0;
      }
      
      .chat-panel-messages {
        flex: 1;
        overflow-y: auto;
        padding: 12px 16px;
        display: flex;
        flex-direction: column;
        gap: 12px;
      }
      
      /* Gradient fade at top */
      .chat-panel-messages::before {
        content: '';
        position: sticky;
        top: 0;
        left: 0;
        right: 0;
        height: 20px;
        background: linear-gradient(to bottom, var(--bg-sidebar), transparent);
        pointer-events: none;
        flex-shrink: 0;
      }
      
      /* Input bar at bottom of container */
      .chat-input-bar {
        flex-shrink: 0;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--bg-sidebar);
        border-top: 1px solid var(--border-default);
      }
      
      .chat-input-bar input {
        flex: 1;
        background: var(--bg-tertiary);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        padding: 10px 14px;
        color: var(--text-primary);
        font-size: 14px;
      }
      .chat-input-bar input:focus {
        outline: none;
        border-color: var(--accent-primary);
      }
      .chat-input-bar input::placeholder {
        color: var(--text-tertiary);
      }
      
      .chat-action-btn {
        width: 36px;
        height: 36px;
        border-radius: var(--radius-md);
        background: transparent;
        border: none;
        color: var(--text-secondary);
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.15s;
      }
      .chat-action-btn:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
      }
      .chat-action-btn.primary {
        background: var(--accent-primary);
        color: white;
      }
      .chat-action-btn.primary:hover {
        filter: brightness(1.1);
      }
      
      /* Chat message bubbles in panel */
      .chat-panel-msg {
        max-width: 85%;
        padding: 10px 14px;
        border-radius: var(--radius-md);
        font-size: 13px;
        line-height: 1.5;
      }
      .chat-panel-msg.user {
        align-self: flex-end;
        background: var(--accent-primary);
        color: white;
        border-bottom-right-radius: 4px;
      }
      .chat-panel-msg.assistant {
        align-self: flex-start;
        background: var(--bg-hover);
        color: var(--text-primary);
        border-bottom-left-radius: 4px;
      }
      .chat-panel-msg .msg-role {
        font-size: 10px;
        font-weight: 600;
        margin-bottom: 4px;
        opacity: 0.7;
      }
      
      /* Thinking Animation */
      .thinking-dots {
        display: inline-flex;
        gap: 3px;
      }
      .thinking-dots span {
        width: 6px;
        height: 6px;
        background: var(--accent-primary);
        border-radius: 50%;
        animation: thinking-bounce 1.4s infinite ease-in-out both;
      }
      .thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
      .thinking-dots span:nth-child(2) { animation-delay: -0.16s; }
      .thinking-dots span:nth-child(3) { animation-delay: 0s; }
      @keyframes thinking-bounce {
        0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
        40% { transform: scale(1); opacity: 1; }
      }
      
      /* Streaming Cursor Animation */
      .streaming-cursor {
        animation: cursor-blink 0.7s steps(1) infinite;
        color: var(--accent-primary);
        font-weight: normal;
      }
      @keyframes cursor-blink {
        0%, 50% { opacity: 1; }
        51%, 100% { opacity: 0; }
      }
      
      /* Agent Tool Call UI */
      .tool-call-card {
        background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(59,130,246,0.05));
        border: 1px solid var(--accent-primary);
        border-radius: var(--radius-lg);
        padding: 12px 16px;
        margin: 8px 0;
        max-width: 95%;
        align-self: flex-start;
      }
      .tool-call-header {
        display: flex;
        align-items: center;
        gap: 8px;
        font-weight: 600;
        font-size: 13px;
        color: var(--accent-primary);
        margin-bottom: 8px;
      }
      .tool-call-header .tool-icon {
        font-size: 16px;
      }
      .tool-call-header .tool-status {
        margin-left: auto;
        font-size: 11px;
        padding: 2px 6px;
        border-radius: 4px;
        background: rgba(99,102,241,0.2);
      }
      .tool-call-header .tool-status.running {
        background: rgba(251,191,36,0.2);
        color: #fbbf24;
      }
      .tool-call-header .tool-status.done {
        background: rgba(16,185,129,0.2);
        color: #10b981;
      }
      .tool-call-args {
        font-size: 11px;
        color: var(--text-tertiary);
        padding: 6px 8px;
        background: var(--bg-code);
        border-radius: var(--radius-md);
        font-family: var(--font-mono);
        margin-bottom: 8px;
        word-break: break-all;
      }
      .tool-call-result {
        font-size: 12px;
        color: var(--text-secondary);
        line-height: 1.5;
      }
      .tool-call-result ul {
        margin: 4px 0;
        padding-left: 16px;
      }
      .tool-call-result li {
        margin: 2px 0;
      }
      .tool-call-result a {
        color: var(--accent-primary);
        text-decoration: none;
      }
      .tool-call-result a:hover {
        text-decoration: underline;
      }
      .tool-call-result pre {
        background: var(--bg-code);
        padding: 8px;
        border-radius: var(--radius-md);
        overflow-x: auto;
        font-size: 11px;
        max-height: 200px;
      }
      .tool-call-actions {
        display: flex;
        gap: 8px;
        margin-top: 8px;
      }
      .tool-action-btn {
        padding: 4px 12px;
        font-size: 11px;
        border-radius: var(--radius-md);
        border: 1px solid var(--border-default);
        background: var(--bg-hover);
        color: var(--text-primary);
        cursor: pointer;
        transition: all 0.15s;
      }
      .tool-action-btn:hover {
        background: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
      }
      .tool-action-btn.primary {
        background: var(--accent-primary);
        color: white;
        border-color: var(--accent-primary);
      }
      
      /* Tool Progress Animation */
      @keyframes toolPulse {
        0%, 100% { opacity: 1; }
        50% { opacity: 0.5; }
      }
      .tool-call-card.loading .tool-call-header {
        animation: toolPulse 1.5s ease-in-out infinite;
      }

      /* File Menu Dropdown - Prism Style */
      .file-menu-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background: var(--bg-elevated);
        border: 1px solid var(--border-default);
        border-radius: var(--radius-md);
        box-shadow: 0 8px 24px rgba(0,0,0,0.4);
        min-width: 160px;
        z-index: 100;
        overflow: hidden;
      }
      .file-menu-dropdown button {
        display: flex;
        align-items: center;
        gap: 10px;
        width: 100%;
        padding: 10px 14px;
        border: none;
        background: transparent;
        color: var(--text-primary);
        font-size: 13px;
        text-align: left;
        cursor: pointer;
        transition: background 0.15s ease;
      }
      .file-menu-dropdown button:hover {
        background: var(--bg-hover);
      }
      .file-menu-dropdown button i {
        width: 16px;
        color: var(--text-tertiary);
      }
      .file-menu-dropdown.hidden {
        display: none;
      }
      
      /* Preview Tabs - Prism Style */
      .preview-tabs {
        display: flex;
        align-items: center;
        padding: 8px 12px;
        background: var(--bg-sidebar);
        border-bottom: 1px solid var(--border-subtle);
        gap: 4px;
      }
      .preview-tab {
        padding: 6px 12px;
        border: none;
        background: transparent;
        color: var(--text-secondary);
        font-size: 13px;
        cursor: pointer;
        border-radius: var(--radius-md);
        display: flex;
        align-items: center;
        gap: 6px;
        transition: all 0.15s ease;
      }
      .preview-tab:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
      }
      .preview-tab.active {
        background: var(--bg-hover);
        color: var(--text-primary);
        font-weight: 500;
      }
      .preview-tab-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      
      /* Logs Panel */
      .logs-panel {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
      }
      .logs-header {
        padding: 12px 16px;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-primary);
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
      }
      .logs-content {
        flex: 1;
        padding: 16px;
        margin: 0;
        font-family: 'JetBrains Mono', monospace;
        font-size: 12px;
        line-height: 1.6;
        color: var(--text-secondary);
        background: var(--bg-primary);
        overflow: auto;
        white-space: pre-wrap;
        word-break: break-all;
      }
      
      /* Settings Modal - Prism Style */
      .settings-sidebar {
        width: 140px;
        background: var(--bg-elevated);
        border-right: 1px solid var(--border-subtle);
        padding: 16px 0;
        flex-shrink: 0;
      }
      .settings-nav-item {
        padding: 10px 16px;
        font-size: 13px;
        color: var(--text-secondary);
        cursor: pointer;
        transition: all 0.15s ease;
      }
      .settings-nav-item:hover {
        background: var(--bg-hover);
        color: var(--text-primary);
      }
      .settings-nav-item.active {
        background: var(--accent-primary);
        color: white;
      }
      .settings-content {
        flex: 1;
        padding: 24px;
        overflow-y: auto;
      }
      .settings-header {
        font-size: 20px;
        font-weight: 600;
        margin-bottom: 24px;
        color: var(--text-primary);
      }
      .settings-section h3 {
        font-size: 14px;
        font-weight: 600;
        margin-bottom: 16px;
        color: var(--text-primary);
      }
      .settings-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid var(--border-subtle);
      }
      .settings-item-info {
        flex: 1;
      }
      .settings-item-label {
        display: block;
        font-size: 14px;
        font-weight: 500;
        color: var(--text-primary);
        margin-bottom: 4px;
      }
      .settings-item-desc {
        display: block;
        font-size: 12px;
        color: var(--text-tertiary);
      }
      
      /* Toggle Switch */
      .toggle-switch {
        position: relative;
        display: inline-block;
        width: 44px;
        height: 24px;
        flex-shrink: 0;
      }
      .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
      }
      .toggle-slider {
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--bg-hover);
        transition: 0.3s;
        border-radius: 24px;
      }
      .toggle-slider:before {
        position: absolute;
        content: "";
        height: 18px;
        width: 18px;
        left: 3px;
        bottom: 3px;
        background-color: white;
        transition: 0.3s;
        border-radius: 50%;
      }
      input:checked + .toggle-slider {
        background-color: var(--accent-primary);
      }
      input:checked + .toggle-slider:before {
        transform: translateX(20px);
      }
