@in-the-loop-labs/pair-review 1.6.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +77 -4
  2. package/package.json +1 -1
  3. package/plugin/.claude-plugin/plugin.json +1 -1
  4. package/plugin/skills/review-requests/SKILL.md +4 -1
  5. package/plugin-code-critic/.claude-plugin/plugin.json +1 -1
  6. package/plugin-code-critic/skills/analyze/SKILL.md +4 -3
  7. package/public/css/pr.css +1875 -144
  8. package/public/js/CONVENTIONS.md +16 -0
  9. package/public/js/components/AIPanel.js +66 -0
  10. package/public/js/components/AnalysisConfigModal.js +2 -2
  11. package/public/js/components/ChatPanel.js +2952 -0
  12. package/public/js/components/CouncilProgressModal.js +28 -18
  13. package/public/js/components/KeyboardShortcuts.js +3 -0
  14. package/public/js/components/PanelGroup.js +723 -0
  15. package/public/js/components/PreviewModal.js +3 -8
  16. package/public/js/components/StatusIndicator.js +2 -2
  17. package/public/js/components/Toast.js +22 -1
  18. package/public/js/components/VoiceCentricConfigTab.js +2 -2
  19. package/public/js/index.js +8 -0
  20. package/public/js/local.js +25 -682
  21. package/public/js/modules/analysis-history.js +19 -66
  22. package/public/js/modules/comment-manager.js +57 -19
  23. package/public/js/modules/diff-context.js +176 -0
  24. package/public/js/modules/diff-renderer.js +30 -0
  25. package/public/js/modules/file-comment-manager.js +126 -105
  26. package/public/js/modules/file-list-merger.js +64 -0
  27. package/public/js/modules/panel-resizer.js +25 -6
  28. package/public/js/modules/suggestion-manager.js +40 -125
  29. package/public/js/pr.js +974 -178
  30. package/public/js/repo-settings.js +36 -6
  31. package/public/js/utils/category-emoji.js +44 -0
  32. package/public/js/utils/time.js +32 -0
  33. package/public/local.html +107 -71
  34. package/public/pr.html +107 -71
  35. package/public/repo-settings.html +32 -0
  36. package/src/ai/analyzer.js +8 -4
  37. package/src/ai/claude-provider.js +22 -11
  38. package/src/ai/copilot-provider.js +39 -9
  39. package/src/ai/cursor-agent-provider.js +36 -7
  40. package/src/ai/gemini-provider.js +17 -4
  41. package/src/ai/prompts/config.js +7 -1
  42. package/src/ai/provider-availability.js +1 -1
  43. package/src/ai/provider.js +25 -37
  44. package/src/ai/stream-parser.js +1 -1
  45. package/src/chat/CONVENTIONS.md +18 -0
  46. package/src/chat/pi-bridge.js +491 -0
  47. package/src/chat/prompt-builder.js +262 -0
  48. package/src/chat/session-manager.js +619 -0
  49. package/src/config.js +14 -0
  50. package/src/database.js +322 -15
  51. package/src/main.js +4 -17
  52. package/src/routes/analyses.js +721 -0
  53. package/src/routes/chat.js +655 -0
  54. package/src/routes/config.js +29 -8
  55. package/src/routes/context-files.js +223 -0
  56. package/src/routes/local.js +225 -1133
  57. package/src/routes/mcp.js +39 -30
  58. package/src/routes/pr.js +410 -52
  59. package/src/routes/reviews.js +1035 -0
  60. package/src/routes/shared.js +5 -30
  61. package/src/server.js +34 -12
  62. package/src/sse/review-events.js +46 -0
  63. package/src/utils/auto-context.js +88 -0
  64. package/src/utils/category-emoji.js +33 -0
  65. package/src/utils/diff-file-list.js +57 -0
  66. package/public/js/components/ProgressModal.js +0 -705
  67. package/src/routes/analysis.js +0 -1600
  68. package/src/routes/comments.js +0 -534
package/public/css/pr.css CHANGED
@@ -629,6 +629,12 @@
629
629
  --ai-border: rgba(217, 119, 6, 0.3);
630
630
  --ai-text: #92400e;
631
631
 
632
+ /* Chat Identity - Blue accent for chat panel */
633
+ --chat-primary: #2563eb;
634
+ --chat-subtle: rgba(37, 99, 235, 0.08);
635
+ --chat-border: rgba(37, 99, 235, 0.2);
636
+ --chat-text: #1e40af;
637
+
632
638
  /* Category colors for AI suggestions */
633
639
  --category-bug: #dc2626;
634
640
  --category-bug-bg: #fef2f2;
@@ -720,6 +726,12 @@
720
726
  --ai-border: rgba(245, 158, 11, 0.3);
721
727
  --ai-text: #fcd34d;
722
728
 
729
+ /* Chat Identity - Blue accent for dark theme */
730
+ --chat-primary: #60a5fa;
731
+ --chat-subtle: rgba(96, 165, 250, 0.1);
732
+ --chat-border: rgba(96, 165, 250, 0.2);
733
+ --chat-text: #93c5fd;
734
+
723
735
  /* Category colors for dark theme */
724
736
  --category-bug: #f87171;
725
737
  --category-bug-bg: rgba(248, 113, 113, 0.1);
@@ -1346,8 +1358,9 @@
1346
1358
  white-space: nowrap;
1347
1359
  }
1348
1360
 
1349
- /* File header comment button */
1350
- .file-header-comment-btn {
1361
+ /* File header comment button and file header chat button */
1362
+ .file-header-comment-btn,
1363
+ .file-header-chat-btn {
1351
1364
  display: flex;
1352
1365
  align-items: center;
1353
1366
  justify-content: center;
@@ -1363,26 +1376,31 @@
1363
1376
  flex-shrink: 0;
1364
1377
  }
1365
1378
 
1366
- .file-header-comment-btn:hover {
1379
+ .file-header-comment-btn:hover,
1380
+ .file-header-chat-btn:hover {
1367
1381
  background-color: var(--color-accent-bg, rgba(9, 105, 218, 0.1));
1368
1382
  border-color: var(--color-accent-primary, #0969da);
1369
1383
  color: var(--color-accent-primary, #0969da);
1370
1384
  }
1371
1385
 
1372
- .file-header-comment-btn:active {
1386
+ .file-header-comment-btn:active,
1387
+ .file-header-chat-btn:active {
1373
1388
  background-color: var(--color-accent-bg, rgba(9, 105, 218, 0.15));
1374
1389
  }
1375
1390
 
1376
- .file-header-comment-btn svg {
1391
+ .file-header-comment-btn svg,
1392
+ .file-header-chat-btn svg {
1377
1393
  width: 16px;
1378
1394
  height: 16px;
1379
1395
  }
1380
1396
 
1381
- [data-theme="dark"] .file-header-comment-btn {
1397
+ [data-theme="dark"] .file-header-comment-btn,
1398
+ [data-theme="dark"] .file-header-chat-btn {
1382
1399
  color: #8b949e;
1383
1400
  }
1384
1401
 
1385
- [data-theme="dark"] .file-header-comment-btn:hover {
1402
+ [data-theme="dark"] .file-header-comment-btn:hover,
1403
+ [data-theme="dark"] .file-header-chat-btn:hover {
1386
1404
  background-color: rgba(56, 139, 253, 0.15);
1387
1405
  border-color: #58a6ff;
1388
1406
  color: #58a6ff;
@@ -1734,8 +1752,9 @@ tr.newly-expanded .d2h-code-line-ctn {
1734
1752
  animation: slideUp 0.3s ease;
1735
1753
  overflow: visible;
1736
1754
  word-break: break-word;
1737
- /* Viewport-based max-width: total viewport minus sidebar, AI panel, and minimal padding */
1738
- max-width: calc(100vw - var(--sidebar-width) - var(--ai-panel-width) - 64px);
1755
+ /* Viewport-based max-width: total viewport minus sidebar, right panel group, and padding.
1756
+ --right-panel-group-width is set by PanelGroup.js (sum for horizontal, max for vertical). */
1757
+ max-width: calc(100vw - var(--sidebar-width) - var(--right-panel-group-width, 0px) - 64px);
1739
1758
  box-sizing: border-box;
1740
1759
  }
1741
1760
 
@@ -2293,6 +2312,19 @@ tr.newly-expanded .d2h-code-line-ctn {
2293
2312
  background: rgba(248, 81, 73, 0.15);
2294
2313
  }
2295
2314
 
2315
+ /* Chat button: neutral style, blue on hover (matches Edit button) */
2316
+ .ai-action-chat {
2317
+ background: var(--color-bg-elevated, #1e2329);
2318
+ color: var(--color-text-secondary, #8b949e);
2319
+ border: 1px solid var(--color-border-default, rgba(255, 255, 255, 0.1));
2320
+ }
2321
+
2322
+ .ai-action-chat:hover {
2323
+ background: var(--color-accent-light, rgba(56, 139, 253, 0.15));
2324
+ color: var(--color-accent-primary, #58a6ff);
2325
+ border-color: var(--color-accent-primary, #58a6ff);
2326
+ }
2327
+
2296
2328
  /* Icon styling inside action buttons */
2297
2329
  .ai-action svg {
2298
2330
  width: 12px;
@@ -2453,6 +2485,34 @@ tr.newly-expanded .d2h-code-line-ctn {
2453
2485
  fill: var(--color-text-primary);
2454
2486
  }
2455
2487
 
2488
+ /* Chat button in collapsed suggestion bar - icon only, transparent */
2489
+ .btn-collapsed-chat {
2490
+ color: var(--color-text-tertiary, #6e7681);
2491
+ background-color: transparent;
2492
+ border: none;
2493
+ padding: 2px;
2494
+ font-size: 12px;
2495
+ cursor: pointer;
2496
+ display: inline-flex;
2497
+ align-items: center;
2498
+ justify-content: center;
2499
+ border-radius: 4px;
2500
+ min-height: 24px;
2501
+ min-width: 24px;
2502
+ transition: color 150ms ease, background 150ms ease;
2503
+ }
2504
+
2505
+ .btn-collapsed-chat:hover {
2506
+ color: var(--color-accent-primary, #58a6ff);
2507
+ background-color: var(--color-accent-light, rgba(56, 139, 253, 0.15));
2508
+ }
2509
+
2510
+ .btn-collapsed-chat svg {
2511
+ width: 14px;
2512
+ height: 14px;
2513
+ fill: currentColor;
2514
+ }
2515
+
2456
2516
  /* Dark theme adjustments for AI suggestions - matches prototype styling */
2457
2517
  [data-theme="dark"] .ai-suggestion {
2458
2518
  background: #181c23; /* Exact prototype --bg-tertiary value */
@@ -2481,7 +2541,7 @@ tr.newly-expanded .d2h-code-line-ctn {
2481
2541
  background-color: var(--color-bg-secondary);
2482
2542
  }
2483
2543
 
2484
- /* Progress Modal Styles */
2544
+ /* Modal Styles */
2485
2545
  .modal-overlay {
2486
2546
  position: fixed;
2487
2547
  top: 0;
@@ -2556,102 +2616,6 @@ tr.newly-expanded .d2h-code-line-ctn {
2556
2616
  overflow-y: auto;
2557
2617
  }
2558
2618
 
2559
- .progress-levels {
2560
- display: flex;
2561
- flex-direction: column;
2562
- gap: 16px;
2563
- }
2564
-
2565
- .progress-level {
2566
- display: flex;
2567
- align-items: flex-start;
2568
- gap: 12px;
2569
- }
2570
-
2571
- .level-icon {
2572
- width: 20px;
2573
- height: 20px;
2574
- display: flex;
2575
- align-items: center;
2576
- justify-content: center;
2577
- margin-top: 2px;
2578
- }
2579
-
2580
- .level-icon .icon {
2581
- font-size: 14px;
2582
- display: flex;
2583
- align-items: center;
2584
- justify-content: center;
2585
- width: 16px;
2586
- height: 16px;
2587
- }
2588
-
2589
- .level-icon .icon.pending {
2590
- color: #656d76;
2591
- }
2592
-
2593
- .level-icon .icon.active {
2594
- color: var(--ai-primary, #d97706);
2595
- }
2596
-
2597
- .level-icon .icon.completed {
2598
- color: #1a7f37;
2599
- }
2600
-
2601
- .level-icon .icon.error {
2602
- color: #cf222e;
2603
- }
2604
-
2605
- .level-icon .icon.cancelled {
2606
- color: #9e6a03;
2607
- }
2608
-
2609
- .level-content {
2610
- flex: 1;
2611
- min-width: 0;
2612
- }
2613
-
2614
- .level-title {
2615
- font-size: 14px;
2616
- font-weight: 600;
2617
- color: var(--color-text-primary, #24292f);
2618
- margin-bottom: 4px;
2619
- }
2620
-
2621
- .level-status {
2622
- font-size: 13px;
2623
- color: var(--color-text-secondary, #656d76);
2624
- margin-bottom: 6px;
2625
- }
2626
-
2627
- .level-stream-snippet {
2628
- font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
2629
- font-size: 12px;
2630
- color: var(--color-text-tertiary, #8b949e);
2631
- background: var(--color-bg-subtle, #f6f8fa);
2632
- border-radius: 4px;
2633
- padding: 3px 6px;
2634
- margin-top: 4px;
2635
- max-width: 100%;
2636
- white-space: nowrap;
2637
- overflow: hidden;
2638
- text-overflow: ellipsis;
2639
- }
2640
-
2641
- .level-files {
2642
- display: flex;
2643
- gap: 16px;
2644
- font-size: 13px;
2645
- }
2646
-
2647
- .files-analyzed {
2648
- color: #1a7f37;
2649
- }
2650
-
2651
- .files-remaining {
2652
- color: #656d76;
2653
- }
2654
-
2655
2619
  .modal-footer {
2656
2620
  padding: 16px 24px 24px 24px;
2657
2621
  display: flex;
@@ -3724,6 +3688,50 @@ tr:hover .add-comment-btn {
3724
3688
  opacity: 1;
3725
3689
  }
3726
3690
 
3691
+ /* Gutter chat button — matches .add-comment-btn style */
3692
+ .chat-line-btn {
3693
+ position: absolute;
3694
+ right: 12px; /* Left of the + button at right: -12px */
3695
+ top: 50%;
3696
+ transform: translateY(-50%);
3697
+ width: 22px;
3698
+ height: 22px;
3699
+ background: linear-gradient(180deg, #0969da 0%, #0860ca 100%);
3700
+ color: #fff;
3701
+ border: none;
3702
+ border-radius: 6px;
3703
+ cursor: pointer;
3704
+ opacity: 0;
3705
+ transition: opacity 0.1s ease, transform 0.1s ease, box-shadow 0.1s ease;
3706
+ z-index: 20;
3707
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.08);
3708
+ display: flex;
3709
+ align-items: center;
3710
+ justify-content: center;
3711
+ pointer-events: auto;
3712
+ padding: 0;
3713
+ }
3714
+
3715
+ .chat-line-btn svg {
3716
+ width: 12px;
3717
+ height: 12px;
3718
+ }
3719
+
3720
+ .chat-line-btn:hover {
3721
+ background: linear-gradient(180deg, #0860ca 0%, #0757b8 100%);
3722
+ transform: translateY(-50%) scale(1.08);
3723
+ box-shadow: 0 2px 6px rgba(9, 105, 218, 0.35), 0 1px 3px rgba(0, 0, 0, 0.1);
3724
+ }
3725
+
3726
+ .chat-line-btn:active {
3727
+ transform: translateY(-50%) scale(0.96);
3728
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
3729
+ }
3730
+
3731
+ tr:hover .chat-line-btn {
3732
+ opacity: 1;
3733
+ }
3734
+
3727
3735
  /* Line range selection */
3728
3736
  .line-range-selected,
3729
3737
  tr.line-range-selected,
@@ -3985,8 +3993,9 @@ tr.line-range-start .d2h-code-line-ctn {
3985
3993
  position: relative;
3986
3994
  overflow: hidden;
3987
3995
  word-break: break-word;
3988
- /* Viewport-based max-width: total viewport minus sidebar, AI panel, and minimal padding */
3989
- max-width: calc(100vw - var(--sidebar-width) - var(--ai-panel-width) - 64px);
3996
+ /* Viewport-based max-width: total viewport minus sidebar, right panel group, and padding.
3997
+ --right-panel-group-width is set by PanelGroup.js (sum for horizontal, max for vertical). */
3998
+ max-width: calc(100vw - var(--sidebar-width) - var(--right-panel-group-width, 0px) - 64px);
3990
3999
  box-sizing: border-box;
3991
4000
  }
3992
4001
 
@@ -4141,21 +4150,12 @@ tr.line-range-start .d2h-code-line-ctn {
4141
4150
  }
4142
4151
 
4143
4152
 
4144
- .user-comment-timestamp {
4145
- color: #656d76;
4146
- font-size: 11px;
4147
- font-weight: 500;
4148
- background: rgba(139, 92, 246, 0.05);
4149
- padding: 2px 6px;
4150
- border-radius: 10px;
4151
- margin-left: auto;
4152
- margin-right: 6px;
4153
- }
4154
4153
 
4155
4154
  .user-comment-actions {
4156
4155
  display: flex;
4157
4156
  align-items: center;
4158
4157
  gap: 4px;
4158
+ margin-left: auto;
4159
4159
  }
4160
4160
 
4161
4161
  /* Hide edit/delete buttons when in editing mode */
@@ -4163,6 +4163,7 @@ tr.line-range-start .d2h-code-line-ctn {
4163
4163
  display: none;
4164
4164
  }
4165
4165
 
4166
+ .btn-chat-comment,
4166
4167
  .btn-edit-comment,
4167
4168
  .btn-delete-comment {
4168
4169
  background: transparent;
@@ -4176,16 +4177,29 @@ tr.line-range-start .d2h-code-line-ctn {
4176
4177
  align-items: center;
4177
4178
  }
4178
4179
 
4180
+ [data-theme="dark"] .btn-chat-comment,
4179
4181
  [data-theme="dark"] .btn-edit-comment,
4180
4182
  [data-theme="dark"] .btn-delete-comment {
4181
4183
  color: #c9d1d9;
4182
4184
  }
4183
4185
 
4186
+ .btn-chat-comment svg,
4184
4187
  .btn-edit-comment svg,
4185
4188
  .btn-delete-comment svg {
4186
4189
  fill: currentColor;
4187
4190
  }
4188
4191
 
4192
+ .btn-chat-comment svg {
4193
+ width: 14px;
4194
+ height: 14px;
4195
+ }
4196
+
4197
+ .btn-chat-comment:hover {
4198
+ background: var(--color-accent-light, rgba(139, 92, 246, 0.1));
4199
+ border-color: var(--color-accent-primary, #8b5cf6);
4200
+ color: var(--color-accent-primary, #8b5cf6);
4201
+ }
4202
+
4189
4203
  .btn-edit-comment:hover {
4190
4204
  background: rgba(139, 92, 246, 0.1);
4191
4205
  border-color: #8b5cf6;
@@ -4212,6 +4226,12 @@ tr.line-range-start .d2h-code-line-ctn {
4212
4226
  display: none;
4213
4227
  }
4214
4228
 
4229
+ /* File-comment-card editing puts the textarea inside .user-comment-body,
4230
+ so we must keep the body visible (the content is already replaced). */
4231
+ .file-comment-card.editing-mode .user-comment-body {
4232
+ display: block;
4233
+ }
4234
+
4215
4235
  .user-comment-edit-form,
4216
4236
  .comment-edit-textarea {
4217
4237
  width: 100%;
@@ -4298,6 +4318,12 @@ tr.line-range-start .d2h-code-line-ctn {
4298
4318
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.2);
4299
4319
  }
4300
4320
 
4321
+ [data-theme="dark"] .btn-chat-comment:hover {
4322
+ background: rgba(167, 139, 250, 0.15);
4323
+ border-color: #a78bfa;
4324
+ color: #a78bfa;
4325
+ }
4326
+
4301
4327
  [data-theme="dark"] .btn-edit-comment:hover {
4302
4328
  background: rgba(167, 139, 250, 0.15);
4303
4329
  border-color: #a78bfa;
@@ -4316,6 +4342,7 @@ tr.line-range-start .d2h-code-line-ctn {
4316
4342
  margin-top: 8px;
4317
4343
  }
4318
4344
 
4345
+
4319
4346
  /* Review Submission Panel */
4320
4347
  .review-panel {
4321
4348
  position: fixed;
@@ -4489,11 +4516,6 @@ tr.line-range-start .d2h-code-line-ctn {
4489
4516
  border-bottom-color: rgba(167, 139, 250, 0.1);
4490
4517
  }
4491
4518
 
4492
- [data-theme="dark"] .user-comment-timestamp {
4493
- background: rgba(167, 139, 250, 0.1);
4494
- color: #8b949e;
4495
- }
4496
-
4497
4519
  [data-theme="dark"] .user-comment-body {
4498
4520
  color: #e6edf3;
4499
4521
  }
@@ -5069,6 +5091,12 @@ tr.line-range-start .d2h-code-line-ctn {
5069
5091
  border: 1px solid #bf8700;
5070
5092
  }
5071
5093
 
5094
+ .toast-info {
5095
+ background-color: #0969da;
5096
+ color: white;
5097
+ border: 1px solid #0550ae;
5098
+ }
5099
+
5072
5100
  .toast-content {
5073
5101
  display: flex;
5074
5102
  align-items: center;
@@ -5111,6 +5139,11 @@ tr.line-range-start .d2h-code-line-ctn {
5111
5139
  border-color: #d29922;
5112
5140
  }
5113
5141
 
5142
+ [data-theme="dark"] .toast-info {
5143
+ background-color: #1f6feb;
5144
+ border-color: #58a6ff;
5145
+ }
5146
+
5114
5147
  /* Loading spinner for buttons */
5115
5148
  .loading-spinner-small {
5116
5149
  width: 16px;
@@ -5563,6 +5596,41 @@ tr.line-range-start .d2h-code-line-ctn {
5563
5596
  color: var(--color-text-muted);
5564
5597
  }
5565
5598
 
5599
+ .analysis-history-chat-btn {
5600
+ width: 22px;
5601
+ height: 22px;
5602
+ padding: 0;
5603
+ margin-left: auto;
5604
+ border: 1px solid transparent;
5605
+ box-sizing: border-box;
5606
+ border-radius: 4px;
5607
+ background: transparent;
5608
+ color: var(--color-fg-muted);
5609
+ cursor: pointer;
5610
+ display: inline-flex;
5611
+ align-items: center;
5612
+ justify-content: center;
5613
+ opacity: 0;
5614
+ transition: opacity 0.15s ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
5615
+ flex-shrink: 0;
5616
+ }
5617
+
5618
+ /* Show on hover of parent item or when item is previewing */
5619
+ .analysis-history-item:hover .analysis-history-chat-btn,
5620
+ .analysis-history-item.previewing .analysis-history-chat-btn {
5621
+ opacity: 1;
5622
+ }
5623
+
5624
+ .analysis-history-chat-btn:hover {
5625
+ color: var(--color-accent-hover, #1f6feb);
5626
+ border-color: var(--color-accent-hover, #1f6feb);
5627
+ }
5628
+
5629
+ .analysis-history-chat-btn svg {
5630
+ width: 14px;
5631
+ height: 14px;
5632
+ }
5633
+
5566
5634
  /* ============================================
5567
5635
  Generated Files Styles
5568
5636
  ============================================ */
@@ -5634,6 +5702,7 @@ tr.line-range-start .d2h-code-line-ctn {
5634
5702
  --header-height: 64px;
5635
5703
  --sidebar-width: 260px;
5636
5704
  --ai-panel-width: 320px;
5705
+ --chat-panel-width: 0px;
5637
5706
 
5638
5707
  /* Transitions */
5639
5708
  --transition-fast: 0.1s ease;
@@ -6081,6 +6150,7 @@ body:not([data-theme="dark"]) .theme-icon-light {
6081
6150
  gap: 10px;
6082
6151
  flex: 1;
6083
6152
  min-width: 0;
6153
+ overflow: hidden;
6084
6154
  }
6085
6155
 
6086
6156
  .toolbar-separator {
@@ -6367,6 +6437,9 @@ body:not([data-theme="dark"]) .theme-icon-light {
6367
6437
  position: relative;
6368
6438
  overflow: hidden;
6369
6439
  transition: all 0.3s ease;
6440
+ display: inline-flex;
6441
+ align-items: center;
6442
+ gap: 6px;
6370
6443
  }
6371
6444
 
6372
6445
  #analyze-btn::before {
@@ -6453,6 +6526,54 @@ body:not([data-theme="dark"]) .theme-icon-light {
6453
6526
  color: #1c1917;
6454
6527
  }
6455
6528
 
6529
+ /* Review panel toggle button - orange/amber AI identity */
6530
+ #ai-panel-toggle svg {
6531
+ color: var(--ai-primary, #d97706);
6532
+ }
6533
+
6534
+ #ai-panel-toggle:hover {
6535
+ background: var(--ai-subtle, rgba(217, 119, 6, 0.08));
6536
+ border-color: var(--ai-border, rgba(217, 119, 6, 0.3));
6537
+ color: var(--ai-primary, #d97706);
6538
+ }
6539
+
6540
+ [data-theme="dark"] #ai-panel-toggle svg {
6541
+ color: var(--ai-primary, #f59e0b);
6542
+ }
6543
+
6544
+ [data-theme="dark"] #ai-panel-toggle:hover {
6545
+ background: var(--ai-subtle, rgba(245, 158, 11, 0.1));
6546
+ border-color: var(--ai-border, rgba(245, 158, 11, 0.3));
6547
+ color: var(--ai-primary, #f59e0b);
6548
+ }
6549
+
6550
+ /* Chat toggle button - icon-only, blue chat identity */
6551
+ #chat-toggle-btn .chat-icon {
6552
+ color: #3b82f6;
6553
+ }
6554
+
6555
+ #chat-toggle-btn.active {
6556
+ background: rgba(59, 130, 246, 0.1);
6557
+ border-color: #3b82f6;
6558
+ }
6559
+
6560
+ #chat-toggle-btn.active .chat-icon {
6561
+ color: #2563eb;
6562
+ }
6563
+
6564
+ [data-theme="dark"] #chat-toggle-btn .chat-icon {
6565
+ color: #60a5fa;
6566
+ }
6567
+
6568
+ [data-theme="dark"] #chat-toggle-btn.active {
6569
+ background: rgba(59, 130, 246, 0.15);
6570
+ border-color: #3b82f6;
6571
+ }
6572
+
6573
+ [data-theme="dark"] #chat-toggle-btn.active .chat-icon {
6574
+ color: #60a5fa;
6575
+ }
6576
+
6456
6577
  .main-layout .diff-container {
6457
6578
  flex: 1;
6458
6579
  min-width: 0; /* Prevent flex item from expanding beyond container */
@@ -6473,6 +6594,7 @@ body:not([data-theme="dark"]) .theme-icon-light {
6473
6594
  overflow: visible;
6474
6595
  flex-shrink: 0;
6475
6596
  transition: width var(--transition-default), opacity var(--transition-default);
6597
+ position: relative; /* Needed for absolute resize-handle positioning (see "Resize Handles" section below) */
6476
6598
  }
6477
6599
 
6478
6600
  .ai-panel.collapsed {
@@ -6481,6 +6603,13 @@ body:not([data-theme="dark"]) .theme-icon-light {
6481
6603
  overflow: hidden;
6482
6604
  }
6483
6605
 
6606
+ .right-panel-group[class*="layout-v-"] .ai-panel.collapsed {
6607
+ flex: 0 0 0;
6608
+ height: 0;
6609
+ min-height: 0;
6610
+ overflow: hidden;
6611
+ }
6612
+
6484
6613
  /* --------------------------------------------------------------------------
6485
6614
  Resize Handles for Panels
6486
6615
  -------------------------------------------------------------------------- */
@@ -6497,7 +6626,7 @@ body:not([data-theme="dark"]) .theme-icon-light {
6497
6626
 
6498
6627
  .resize-handle:hover,
6499
6628
  .resize-handle.dragging {
6500
- background: var(--border-color);
6629
+ background: var(--color-border-primary);
6501
6630
  }
6502
6631
 
6503
6632
  .resize-handle-right {
@@ -6513,8 +6642,23 @@ body:not([data-theme="dark"]) .theme-icon-light {
6513
6642
  position: relative;
6514
6643
  }
6515
6644
 
6516
- .ai-panel {
6645
+ /* Ensure AI panel content children stack below the resize handle.
6646
+ overflow-y:auto on children like .findings-summary creates implicit stacking
6647
+ contexts that can paint over the absolutely-positioned resize-handle (z-index:10).
6648
+ Explicitly place content children at z-index:1 so the handle stays on top. */
6649
+ .ai-panel > *:not(.resize-handle) {
6517
6650
  position: relative;
6651
+ z-index: 1;
6652
+ }
6653
+
6654
+ /* Dropdown must overlay sibling panel sections */
6655
+ .ai-panel > .analysis-context {
6656
+ z-index: 2;
6657
+ }
6658
+
6659
+ /* When dropdown is open, lift above resize-handle (z-index:10) */
6660
+ .ai-panel > .analysis-context.open {
6661
+ z-index: 11;
6518
6662
  }
6519
6663
 
6520
6664
  /* Prevent text selection during drag */
@@ -6537,26 +6681,299 @@ body.resizing * {
6537
6681
  display: flex;
6538
6682
  }
6539
6683
 
6540
- /* Ensure toggle button shows when panel is collapsed via responsive rules */
6541
- @media (max-width: 900px) {
6542
- #ai-panel-toggle {
6543
- display: flex;
6544
- }
6684
+ /* Hide Chat panel toggle button when panel is visible */
6685
+ #chat-toggle-btn {
6686
+ display: none;
6545
6687
  }
6546
6688
 
6547
- /* Dark theme toolbar button overrides */
6548
- [data-theme="dark"] .toolbar-actions .btn-icon {
6549
- background: var(--color-bg-tertiary);
6550
- border-color: var(--color-border-secondary);
6551
- color: var(--color-text-secondary);
6689
+ .main-layout:has(.chat-panel--closed) #chat-toggle-btn {
6690
+ display: flex;
6552
6691
  }
6553
6692
 
6554
- [data-theme="dark"] .toolbar-actions .btn-icon:hover {
6555
- background: var(--color-bg-elevated);
6556
- color: var(--color-text-primary);
6693
+ /* Ensure toggle buttons show when panels are collapsed via responsive rules */
6694
+ @media (max-width: 900px) {
6695
+ #ai-panel-toggle,
6696
+ #chat-toggle-btn {
6697
+ display: flex;
6698
+ }
6557
6699
  }
6558
6700
 
6559
- .ai-panel-header {
6701
+ /* --------------------------------------------------------------------------
6702
+ Right Panel Group (Review + Chat)
6703
+ -------------------------------------------------------------------------- */
6704
+ .right-panel-group {
6705
+ display: flex;
6706
+ flex-direction: row;
6707
+ flex-shrink: 0;
6708
+ height: 100%;
6709
+ overflow: visible;
6710
+ position: relative;
6711
+ }
6712
+
6713
+ /* Make the container wrapper transparent to flex layout so .chat-panel
6714
+ becomes a direct flex child — required for order and flex rules to work. */
6715
+ #chat-panel-container {
6716
+ display: contents;
6717
+ }
6718
+
6719
+ /* When both panels are hidden */
6720
+ .right-panel-group.group-collapsed {
6721
+ width: 0;
6722
+ overflow: hidden;
6723
+ }
6724
+
6725
+ /* Horizontal layouts */
6726
+ .right-panel-group.layout-h-review-chat { flex-direction: row; }
6727
+ .right-panel-group.layout-h-review-chat .ai-panel { order: 1; }
6728
+ .right-panel-group.layout-h-review-chat .chat-panel { order: 2; }
6729
+
6730
+ .right-panel-group.layout-h-chat-review { flex-direction: row; }
6731
+ .right-panel-group.layout-h-chat-review .ai-panel { order: 2; }
6732
+ .right-panel-group.layout-h-chat-review .chat-panel { order: 1; }
6733
+
6734
+ /* Vertical layouts — group takes the wider of the two panel widths,
6735
+ so collapsing one panel doesn't hide the other. */
6736
+ .right-panel-group.layout-v-review-chat,
6737
+ .right-panel-group.layout-v-chat-review {
6738
+ flex-direction: column;
6739
+ width: max(var(--ai-panel-width), var(--chat-panel-width));
6740
+ }
6741
+
6742
+ .right-panel-group.layout-v-review-chat .ai-panel { order: 0; }
6743
+ .right-panel-group.layout-v-review-chat .panel-group-divider { order: 1; }
6744
+ .right-panel-group.layout-v-review-chat .chat-panel { order: 2; }
6745
+ .right-panel-group.layout-v-chat-review .ai-panel { order: 2; }
6746
+ .right-panel-group.layout-v-chat-review .panel-group-divider { order: 1; }
6747
+ .right-panel-group.layout-v-chat-review .chat-panel { order: 0; }
6748
+
6749
+ /* In vertical mode, children fill width and split height */
6750
+ .right-panel-group[class*="layout-v-"] .ai-panel,
6751
+ .right-panel-group[class*="layout-v-"] .chat-panel {
6752
+ width: 100% !important;
6753
+ flex: 1 1 0;
6754
+ min-height: 0;
6755
+ }
6756
+
6757
+ /* In vertical mode, chat panel has top border instead of left */
6758
+ .right-panel-group[class*="layout-v-"] .chat-panel {
6759
+ border-left: none;
6760
+ border-top: 1px solid var(--color-border-primary);
6761
+ }
6762
+
6763
+ /* Hide per-panel horizontal resize handles in vertical mode (group handle replaces them) */
6764
+ .right-panel-group[class*="layout-v-"] .chat-panel__resize-handle {
6765
+ display: none;
6766
+ }
6767
+
6768
+ .right-panel-group[class*="layout-v-"] .ai-panel > .resize-handle {
6769
+ display: none;
6770
+ }
6771
+
6772
+ /* When only one panel is visible in vertical mode, restore its own resize handle */
6773
+ .right-panel-group[class*="layout-v-"].chat-only .chat-panel__resize-handle {
6774
+ display: block;
6775
+ }
6776
+
6777
+ .right-panel-group[class*="layout-v-"].review-only .ai-panel > .resize-handle {
6778
+ display: block;
6779
+ }
6780
+
6781
+ /* Full-height group resize handle (shown only in vertical layouts) */
6782
+ .panel-group-resize-handle {
6783
+ display: none;
6784
+ }
6785
+
6786
+ .right-panel-group[class*="layout-v-"] .panel-group-resize-handle {
6787
+ display: block;
6788
+ position: absolute;
6789
+ top: 0;
6790
+ bottom: 0;
6791
+ }
6792
+
6793
+ /* Hide group resize handle when only one panel is visible — per-panel handle takes over */
6794
+ .right-panel-group[class*="layout-v-"].chat-only .panel-group-resize-handle,
6795
+ .right-panel-group[class*="layout-v-"].review-only .panel-group-resize-handle {
6796
+ display: none;
6797
+ }
6798
+
6799
+ /* Vertical resize divider between panels (hidden by default in horizontal layouts) */
6800
+ .panel-group-divider {
6801
+ display: none;
6802
+ height: 6px;
6803
+ cursor: row-resize;
6804
+ z-index: 10;
6805
+ background: transparent;
6806
+ transition: background-color var(--transition-fast);
6807
+ flex-shrink: 0;
6808
+ }
6809
+
6810
+ .panel-group-divider:hover,
6811
+ .panel-group-divider.dragging {
6812
+ background: var(--color-border-primary);
6813
+ }
6814
+
6815
+ /* Show vertical divider only in vertical layouts */
6816
+ .right-panel-group[class*="layout-v-"] .panel-group-divider {
6817
+ display: block;
6818
+ }
6819
+
6820
+ /* Layout Popover */
6821
+ .layout-popover {
6822
+ position: fixed;
6823
+ z-index: 1100;
6824
+ background: var(--color-bg-primary);
6825
+ border: 1px solid var(--color-border-default);
6826
+ border-radius: 8px;
6827
+ box-shadow: 0 4px 12px rgba(0,0,0,0.08), 0 8px 24px rgba(0,0,0,0.12);
6828
+ padding: 8px;
6829
+ opacity: 0;
6830
+ transform: translateY(-4px);
6831
+ transition: opacity 0.15s ease, transform 0.15s ease;
6832
+ pointer-events: none;
6833
+ }
6834
+
6835
+ .layout-popover--visible {
6836
+ opacity: 1;
6837
+ transform: translateY(0);
6838
+ pointer-events: auto;
6839
+ }
6840
+
6841
+ .layout-popover__grid {
6842
+ display: grid;
6843
+ grid-template-columns: 1fr;
6844
+ gap: 6px;
6845
+ }
6846
+
6847
+ .layout-popover__thumb {
6848
+ position: relative;
6849
+ width: 80px;
6850
+ height: 52px;
6851
+ padding: 0;
6852
+ background: var(--color-bg-subtle);
6853
+ border: 2px solid var(--color-border-default);
6854
+ border-radius: 6px;
6855
+ cursor: pointer;
6856
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
6857
+ }
6858
+
6859
+ .layout-popover__thumb:hover {
6860
+ border-color: var(--color-text-secondary);
6861
+ }
6862
+
6863
+ .layout-popover__thumb--active {
6864
+ border-color: #3b82f6;
6865
+ box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.3);
6866
+ }
6867
+
6868
+ .layout-popover__badge {
6869
+ position: absolute;
6870
+ top: 2px;
6871
+ right: 2px;
6872
+ width: 14px;
6873
+ height: 14px;
6874
+ display: flex;
6875
+ align-items: center;
6876
+ justify-content: center;
6877
+ font-size: 9px;
6878
+ font-weight: 600;
6879
+ color: var(--color-text-tertiary);
6880
+ background: var(--color-bg-primary);
6881
+ border-radius: 3px;
6882
+ line-height: 1;
6883
+ z-index: 1;
6884
+ }
6885
+
6886
+ .layout-popover__preview {
6887
+ display: flex;
6888
+ width: 100%;
6889
+ height: 100%;
6890
+ border-radius: 4px;
6891
+ overflow: hidden;
6892
+ gap: 1px;
6893
+ }
6894
+
6895
+ .layout-popover__preview--h {
6896
+ flex-direction: row;
6897
+ }
6898
+
6899
+ .layout-popover__preview--v {
6900
+ flex-direction: column;
6901
+ }
6902
+
6903
+ .layout-popover__pane {
6904
+ flex: 1;
6905
+ display: flex;
6906
+ align-items: center;
6907
+ justify-content: center;
6908
+ }
6909
+
6910
+ .layout-popover__pane--review {
6911
+ background: rgba(245, 158, 11, 0.1);
6912
+ border-left: 2px solid #f59e0b;
6913
+ }
6914
+
6915
+ .layout-popover__preview--v .layout-popover__pane--review {
6916
+ border-left: none;
6917
+ border-top: 2px solid #f59e0b;
6918
+ }
6919
+
6920
+ .layout-popover__pane--chat {
6921
+ background: rgba(59, 130, 246, 0.1);
6922
+ border-left: 2px solid #3b82f6;
6923
+ }
6924
+
6925
+ .layout-popover__preview--v .layout-popover__pane--chat {
6926
+ border-left: none;
6927
+ border-top: 2px solid #3b82f6;
6928
+ }
6929
+
6930
+ .layout-popover__pane--review svg {
6931
+ color: #f59e0b;
6932
+ }
6933
+
6934
+ .layout-popover__pane--chat svg {
6935
+ color: #3b82f6;
6936
+ }
6937
+
6938
+ /* Dark theme adjustments */
6939
+ [data-theme="dark"] .layout-popover {
6940
+ background: #0d1117;
6941
+ border-color: #30363d;
6942
+ box-shadow: 0 4px 12px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
6943
+ }
6944
+
6945
+ [data-theme="dark"] .layout-popover__thumb {
6946
+ background: #161b22;
6947
+ border-color: #30363d;
6948
+ }
6949
+
6950
+ [data-theme="dark"] .layout-popover__thumb:hover {
6951
+ border-color: #8b949e;
6952
+ }
6953
+
6954
+ [data-theme="dark"] .layout-popover__thumb--active {
6955
+ border-color: #58a6ff;
6956
+ box-shadow: 0 0 0 2px rgba(88, 166, 255, 0.4);
6957
+ }
6958
+
6959
+ [data-theme="dark"] .layout-popover__badge {
6960
+ background: #0d1117;
6961
+ color: #8b949e;
6962
+ }
6963
+
6964
+ /* Dark theme toolbar button overrides */
6965
+ [data-theme="dark"] .toolbar-actions .btn-icon {
6966
+ background: var(--color-bg-tertiary);
6967
+ border-color: var(--color-border-secondary);
6968
+ color: var(--color-text-secondary);
6969
+ }
6970
+
6971
+ [data-theme="dark"] .toolbar-actions .btn-icon:hover {
6972
+ background: var(--color-bg-elevated);
6973
+ color: var(--color-text-primary);
6974
+ }
6975
+
6976
+ .ai-panel-header {
6560
6977
  display: flex;
6561
6978
  align-items: center;
6562
6979
  justify-content: space-between;
@@ -7658,6 +8075,7 @@ body.resizing * {
7658
8075
  display: flex;
7659
8076
  align-items: stretch;
7660
8077
  position: relative;
8078
+ min-height: 56px; /* Accommodate stacked chat + action buttons */
7661
8079
  }
7662
8080
 
7663
8081
  .finding-item-wrapper .finding-item {
@@ -7683,6 +8101,32 @@ body.resizing * {
7683
8101
  opacity: 1;
7684
8102
  }
7685
8103
 
8104
+ /* Chat action button - upper-right corner of finding items */
8105
+ .finding-chat-action {
8106
+ position: absolute;
8107
+ top: 4px;
8108
+ right: 4px;
8109
+ display: flex;
8110
+ opacity: 0;
8111
+ transition: opacity 150ms ease;
8112
+ z-index: 1;
8113
+ }
8114
+
8115
+ .finding-item-wrapper:hover .finding-chat-action,
8116
+ .finding-item-wrapper:focus-within .finding-chat-action {
8117
+ opacity: 1;
8118
+ }
8119
+
8120
+ /* Chat quick-action button - blue accent on hover */
8121
+ .quick-action-chat {
8122
+ color: var(--color-text-tertiary, #6e7681);
8123
+ }
8124
+
8125
+ .quick-action-chat:hover {
8126
+ background: var(--color-accent-light, rgba(56, 139, 253, 0.15));
8127
+ color: var(--color-accent-primary, #58a6ff);
8128
+ }
8129
+
7686
8130
  .quick-action-btn {
7687
8131
  width: 24px;
7688
8132
  height: 24px;
@@ -8124,7 +8568,9 @@ body.resizing * {
8124
8568
  }
8125
8569
 
8126
8570
  @media (max-width: 900px) {
8127
- .ai-panel {
8571
+ .right-panel-group,
8572
+ .ai-panel,
8573
+ .chat-panel {
8128
8574
  display: none;
8129
8575
  }
8130
8576
 
@@ -9240,8 +9686,8 @@ body.resizing * {
9240
9686
  }
9241
9687
 
9242
9688
  .btn-icon:hover {
9243
- color: var(--danger-fg, #cf222e);
9244
- border-color: var(--danger-fg, #cf222e);
9689
+ color: var(--color-text-primary);
9690
+ border-color: var(--color-border-secondary);
9245
9691
  }
9246
9692
 
9247
9693
  .btn-ghost {
@@ -9603,8 +10049,8 @@ body.resizing * {
9603
10049
 
9604
10050
  [data-theme="dark"] .btn-icon:hover {
9605
10051
  background: var(--color-bg-elevated, #1e2329);
9606
- color: var(--color-danger, #f85149);
9607
- border-color: var(--color-danger, #f85149);
10052
+ color: var(--color-text-primary, #e6edf3);
10053
+ border-color: var(--color-border-secondary, #484f58);
9608
10054
  }
9609
10055
 
9610
10056
  [data-theme="dark"] .add-voice-btn {
@@ -10289,3 +10735,1288 @@ body.resizing * {
10289
10735
  [data-theme="dark"] .emoji-picker-popup::-webkit-scrollbar-thumb:hover {
10290
10736
  background-color: var(--color-text-tertiary, #6e7681);
10291
10737
  }
10738
+
10739
+ /* ==========================================================================
10740
+ Chat Panel
10741
+ ========================================================================== */
10742
+
10743
+ .chat-panel {
10744
+ width: var(--chat-panel-width, 400px);
10745
+ height: 100%;
10746
+ background: var(--color-bg-primary);
10747
+ border-left: 1px solid var(--color-border-primary);
10748
+ display: none;
10749
+ flex-direction: column;
10750
+ flex-shrink: 0;
10751
+ overflow: hidden;
10752
+ position: relative;
10753
+ }
10754
+
10755
+ /* Chat Panel Resize Handle */
10756
+ .chat-panel__resize-handle {
10757
+ position: absolute;
10758
+ top: 0;
10759
+ left: -3px;
10760
+ width: 6px;
10761
+ height: 100%;
10762
+ cursor: col-resize;
10763
+ z-index: 10;
10764
+ transition: background-color var(--transition-fast);
10765
+ }
10766
+
10767
+ .chat-panel__resize-handle:hover,
10768
+ .chat-panel__resize-handle.dragging {
10769
+ background: var(--color-border-primary);
10770
+ }
10771
+
10772
+ /* Disable width transition during active resize drag */
10773
+ .chat-panel--resizing {
10774
+ transition: none;
10775
+ }
10776
+
10777
+ .chat-panel--open {
10778
+ display: flex;
10779
+ }
10780
+
10781
+ .chat-panel--closed {
10782
+ display: none;
10783
+ }
10784
+
10785
+ /* Chat Panel Header */
10786
+ .chat-panel__header {
10787
+ display: flex;
10788
+ align-items: center;
10789
+ justify-content: space-between;
10790
+ padding: 12px 16px;
10791
+ border-bottom: 1px solid var(--chat-border);
10792
+ background: linear-gradient(to bottom, var(--chat-subtle), transparent);
10793
+ flex-shrink: 0;
10794
+ }
10795
+ /* Session picker wrapper */
10796
+ .chat-panel__session-picker {
10797
+ position: relative;
10798
+ flex: 1;
10799
+ min-width: 0;
10800
+ }
10801
+
10802
+ .chat-panel__session-picker-btn {
10803
+ display: flex;
10804
+ align-items: center;
10805
+ gap: 8px;
10806
+ font-size: 13px;
10807
+ font-weight: 600;
10808
+ color: var(--chat-text);
10809
+ background: transparent;
10810
+ border: none;
10811
+ border-radius: 6px;
10812
+ padding: 4px 8px;
10813
+ cursor: pointer;
10814
+ transition: background 0.15s ease;
10815
+ max-width: 100%;
10816
+ }
10817
+
10818
+ .chat-panel__session-picker-btn:hover {
10819
+ background: var(--color-bg-tertiary, rgba(128, 128, 128, 0.1));
10820
+ }
10821
+
10822
+ .chat-panel__session-picker-btn svg:first-child {
10823
+ color: var(--chat-primary);
10824
+ flex-shrink: 0;
10825
+ }
10826
+
10827
+ .chat-panel__title-text {
10828
+ overflow: hidden;
10829
+ text-overflow: ellipsis;
10830
+ white-space: nowrap;
10831
+ }
10832
+
10833
+ .chat-panel__chevron-sep {
10834
+ opacity: 0.4;
10835
+ font-size: 13px;
10836
+ }
10837
+
10838
+ .chat-panel__chevron {
10839
+ flex-shrink: 0;
10840
+ opacity: 0.5;
10841
+ }
10842
+
10843
+ /* Session dropdown flyout */
10844
+ .chat-panel__session-dropdown {
10845
+ position: absolute;
10846
+ top: calc(100% + 4px);
10847
+ left: 0;
10848
+ right: 0;
10849
+ background: var(--color-bg-primary, #fff);
10850
+ border: 1px solid var(--color-border-primary, #d0d7de);
10851
+ border-radius: 8px;
10852
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
10853
+ max-height: 300px;
10854
+ overflow-y: auto;
10855
+ z-index: 100;
10856
+ padding: 4px;
10857
+ }
10858
+
10859
+ .chat-panel__session-empty {
10860
+ padding: 16px;
10861
+ text-align: center;
10862
+ color: var(--color-text-tertiary);
10863
+ font-size: 12px;
10864
+ }
10865
+
10866
+ .chat-panel__session-item {
10867
+ display: flex;
10868
+ flex-direction: column;
10869
+ gap: 2px;
10870
+ width: 100%;
10871
+ padding: 8px 12px;
10872
+ border: none;
10873
+ background: transparent;
10874
+ text-align: left;
10875
+ border-radius: 6px;
10876
+ cursor: pointer;
10877
+ transition: background 0.15s ease;
10878
+ position: relative;
10879
+ }
10880
+
10881
+ .chat-panel__session-item:hover {
10882
+ background: var(--color-bg-tertiary, rgba(128, 128, 128, 0.08));
10883
+ }
10884
+
10885
+ .chat-panel__session-item--active {
10886
+ background: var(--color-bg-secondary, #f6f8fa);
10887
+ }
10888
+
10889
+ .chat-panel__session-item--active::before {
10890
+ content: '';
10891
+ position: absolute;
10892
+ left: 0;
10893
+ top: 4px;
10894
+ bottom: 4px;
10895
+ width: 3px;
10896
+ border-radius: 2px;
10897
+ background: var(--chat-primary, #0969da);
10898
+ }
10899
+
10900
+ .chat-panel__session-preview {
10901
+ font-size: 13px;
10902
+ font-weight: 500;
10903
+ color: var(--color-text-primary, #1f2328);
10904
+ overflow: hidden;
10905
+ text-overflow: ellipsis;
10906
+ white-space: nowrap;
10907
+ }
10908
+
10909
+ .chat-panel__session-meta {
10910
+ font-size: 11px;
10911
+ color: var(--color-text-tertiary, #656d76);
10912
+ }
10913
+
10914
+ /* Dark theme overrides */
10915
+ [data-theme="dark"] .chat-panel__session-dropdown {
10916
+ background: var(--color-bg-primary, #0d1117);
10917
+ border-color: var(--color-border-primary, #30363d);
10918
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
10919
+ }
10920
+
10921
+ [data-theme="dark"] .chat-panel__session-item--active {
10922
+ background: var(--color-bg-secondary, #161b22);
10923
+ }
10924
+
10925
+ [data-theme="dark"] .chat-panel__session-preview {
10926
+ color: var(--color-text-primary, #e6edf3);
10927
+ }
10928
+
10929
+ .chat-panel__actions {
10930
+ display: flex;
10931
+ align-items: center;
10932
+ gap: 4px;
10933
+ }
10934
+
10935
+ .chat-panel__new-btn,
10936
+ .chat-panel__close-btn {
10937
+ display: flex;
10938
+ align-items: center;
10939
+ justify-content: center;
10940
+ width: 28px;
10941
+ height: 28px;
10942
+ border: none;
10943
+ background: transparent;
10944
+ color: var(--color-text-tertiary);
10945
+ border-radius: 6px;
10946
+ cursor: pointer;
10947
+ transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
10948
+ }
10949
+
10950
+ .chat-panel__new-btn {
10951
+ border: 1px solid var(--color-border-primary);
10952
+ background: var(--color-bg-secondary);
10953
+ color: var(--color-text-secondary);
10954
+ }
10955
+
10956
+ .chat-panel__new-btn:hover {
10957
+ background: var(--color-bg-tertiary);
10958
+ border-color: var(--color-text-tertiary);
10959
+ color: var(--color-text-primary);
10960
+ }
10961
+
10962
+ .chat-panel__close-btn:hover {
10963
+ background: var(--color-bg-tertiary);
10964
+ color: var(--color-text-primary);
10965
+ }
10966
+
10967
+ /* Chat Messages Area */
10968
+ .chat-panel__messages-wrapper {
10969
+ flex: 1;
10970
+ position: relative;
10971
+ overflow: hidden;
10972
+ display: flex;
10973
+ flex-direction: column;
10974
+ min-height: 0;
10975
+ }
10976
+
10977
+ .chat-panel__messages {
10978
+ flex: 1;
10979
+ overflow-y: auto;
10980
+ padding: 16px;
10981
+ display: flex;
10982
+ flex-direction: column;
10983
+ gap: 12px;
10984
+ }
10985
+
10986
+ .chat-panel__messages::-webkit-scrollbar {
10987
+ width: 6px;
10988
+ }
10989
+
10990
+ .chat-panel__messages::-webkit-scrollbar-track {
10991
+ background: transparent;
10992
+ }
10993
+
10994
+ .chat-panel__messages::-webkit-scrollbar-thumb {
10995
+ background-color: var(--color-border-primary);
10996
+ border-radius: 3px;
10997
+ }
10998
+
10999
+ /* New Content Pill */
11000
+ .chat-panel__new-content-pill {
11001
+ position: absolute;
11002
+ bottom: 8px;
11003
+ left: 50%;
11004
+ transform: translateX(-50%);
11005
+ z-index: 10;
11006
+ padding: 4px 14px;
11007
+ font-size: 12px;
11008
+ font-weight: 500;
11009
+ line-height: 1.4;
11010
+ color: var(--color-text-primary);
11011
+ background: var(--color-bg-secondary);
11012
+ border: 1px solid var(--color-border-primary);
11013
+ border-radius: 20px;
11014
+ cursor: pointer;
11015
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
11016
+ opacity: 0;
11017
+ animation: chat-pill-fade-in 0.15s ease-out forwards;
11018
+ white-space: nowrap;
11019
+ }
11020
+
11021
+ .chat-panel__new-content-pill:hover {
11022
+ background: var(--color-bg-tertiary);
11023
+ border-color: var(--color-border-secondary);
11024
+ }
11025
+
11026
+ @keyframes chat-pill-fade-in {
11027
+ from { opacity: 0; transform: translateX(-50%) translateY(4px); }
11028
+ to { opacity: 1; transform: translateX(-50%) translateY(0); }
11029
+ }
11030
+
11031
+ [data-theme="dark"] .chat-panel__new-content-pill {
11032
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
11033
+ }
11034
+
11035
+ /* Empty State */
11036
+ .chat-panel__empty {
11037
+ display: flex;
11038
+ flex-direction: column;
11039
+ align-items: center;
11040
+ justify-content: center;
11041
+ text-align: center;
11042
+ padding: 40px 20px;
11043
+ color: var(--color-text-tertiary);
11044
+ gap: 12px;
11045
+ flex: 1;
11046
+ }
11047
+
11048
+ .chat-panel__empty svg {
11049
+ opacity: 0.4;
11050
+ }
11051
+
11052
+ .chat-panel__empty p {
11053
+ font-size: 13px;
11054
+ line-height: 1.5;
11055
+ max-width: 260px;
11056
+ }
11057
+
11058
+ /* Message Bubbles */
11059
+ .chat-panel__message {
11060
+ display: flex;
11061
+ flex-direction: column;
11062
+ max-width: 85%;
11063
+ }
11064
+
11065
+ .chat-panel__message--user {
11066
+ align-self: flex-end;
11067
+ }
11068
+
11069
+ .chat-panel__message--assistant {
11070
+ align-self: flex-start;
11071
+ }
11072
+
11073
+ .chat-panel__message--error {
11074
+ align-self: center;
11075
+ max-width: 100%;
11076
+ }
11077
+
11078
+ .chat-panel__bubble {
11079
+ padding: 8px 12px;
11080
+ border-radius: 12px;
11081
+ font-size: 13px;
11082
+ line-height: 1.5;
11083
+ word-wrap: break-word;
11084
+ overflow-wrap: break-word;
11085
+ }
11086
+
11087
+ /* User bubble */
11088
+ .chat-panel__message--user .chat-panel__bubble {
11089
+ background: var(--color-accent-primary);
11090
+ color: #ffffff;
11091
+ border-bottom-right-radius: 4px;
11092
+ white-space: pre-wrap;
11093
+ }
11094
+
11095
+ /* Assistant bubble */
11096
+ .chat-panel__message--assistant .chat-panel__bubble {
11097
+ position: relative;
11098
+ background: var(--color-bg-secondary);
11099
+ border: 1px solid var(--color-border-primary);
11100
+ color: var(--color-text-primary);
11101
+ border-bottom-left-radius: 4px;
11102
+ }
11103
+
11104
+ /* Copy button on assistant messages */
11105
+ .chat-panel__copy-btn {
11106
+ display: none;
11107
+ position: absolute;
11108
+ top: 4px;
11109
+ right: 4px;
11110
+ width: 24px;
11111
+ height: 24px;
11112
+ align-items: center;
11113
+ justify-content: center;
11114
+ padding: 0;
11115
+ border: none;
11116
+ border-radius: 4px;
11117
+ background: var(--color-bg-tertiary);
11118
+ color: var(--color-text-secondary);
11119
+ cursor: pointer;
11120
+ z-index: 1;
11121
+ }
11122
+
11123
+ .chat-panel__message--assistant:hover .chat-panel__copy-btn {
11124
+ display: flex;
11125
+ }
11126
+
11127
+ .chat-panel__copy-btn:hover {
11128
+ background: var(--color-border-primary);
11129
+ color: var(--color-text-primary);
11130
+ }
11131
+
11132
+ .chat-panel__copy-btn--success {
11133
+ display: flex;
11134
+ color: var(--color-success, #2da44e);
11135
+ }
11136
+
11137
+ /* Markdown content inside assistant bubbles */
11138
+ .chat-panel__message--assistant .chat-panel__bubble p {
11139
+ margin: 0 0 8px 0;
11140
+ }
11141
+
11142
+ .chat-panel__message--assistant .chat-panel__bubble p:last-of-type {
11143
+ margin-bottom: 0;
11144
+ }
11145
+
11146
+ .chat-panel__message--assistant .chat-panel__bubble code {
11147
+ font-family: 'JetBrains Mono', 'SFMono-Regular', 'Consolas', monospace;
11148
+ font-size: 12px;
11149
+ background: var(--color-bg-tertiary);
11150
+ padding: 1px 4px;
11151
+ border-radius: 3px;
11152
+ }
11153
+
11154
+ .chat-panel__message--assistant .chat-panel__bubble pre {
11155
+ margin: 8px 0;
11156
+ padding: 8px;
11157
+ background: var(--color-bg-tertiary);
11158
+ border-radius: 6px;
11159
+ overflow-x: auto;
11160
+ }
11161
+
11162
+ .chat-panel__message--assistant .chat-panel__bubble pre code {
11163
+ background: transparent;
11164
+ padding: 0;
11165
+ }
11166
+
11167
+ .chat-panel__message--assistant .chat-panel__bubble ul,
11168
+ .chat-panel__message--assistant .chat-panel__bubble ol {
11169
+ margin: 4px 0;
11170
+ padding-left: 20px;
11171
+ }
11172
+
11173
+ /* Chat file links (auto-linked file:line references in assistant messages) */
11174
+ .chat-file-link {
11175
+ display: inline;
11176
+ font-family: 'JetBrains Mono', 'SFMono-Regular', 'Consolas', monospace;
11177
+ font-size: 12px;
11178
+ color: var(--color-accent, #0969da);
11179
+ text-decoration: none;
11180
+ background: var(--color-bg-tertiary);
11181
+ padding: 1px 5px;
11182
+ border-radius: 3px;
11183
+ cursor: pointer;
11184
+ transition: background 0.15s, color 0.15s;
11185
+ word-break: break-all;
11186
+ -webkit-box-decoration-break: clone;
11187
+ box-decoration-break: clone;
11188
+ }
11189
+
11190
+ .chat-file-link:hover {
11191
+ background: var(--color-bg-accent-subtle, rgba(9, 105, 218, 0.1));
11192
+ text-decoration: underline;
11193
+ }
11194
+
11195
+ .chat-file-link__icon {
11196
+ display: inline;
11197
+ vertical-align: text-bottom;
11198
+ opacity: 0.6;
11199
+ }
11200
+
11201
+ /* Highlight flash when navigating to a line from a chat file link */
11202
+ .chat-file-link--highlight {
11203
+ animation: chat-file-link-flash 2s ease-out;
11204
+ }
11205
+
11206
+ @keyframes chat-file-link-flash {
11207
+ 0% { background-color: rgba(227, 179, 65, 0.25); }
11208
+ 100% { background-color: transparent; }
11209
+ }
11210
+
11211
+ .chat-file-link--loading {
11212
+ opacity: 0.6;
11213
+ pointer-events: none;
11214
+ }
11215
+ .chat-file-link--loading::after {
11216
+ content: '';
11217
+ display: inline-block;
11218
+ width: 10px;
11219
+ height: 10px;
11220
+ margin-left: 4px;
11221
+ border: 1.5px solid currentColor;
11222
+ border-top-color: transparent;
11223
+ border-radius: 50%;
11224
+ animation: chat-file-link-spin 0.6s linear infinite;
11225
+ }
11226
+ @keyframes chat-file-link-spin {
11227
+ to { transform: rotate(360deg); }
11228
+ }
11229
+
11230
+ /* Gutter arrow for "already here" micro-feedback */
11231
+ .chat-gutter-arrow {
11232
+ position: absolute;
11233
+ left: -2px;
11234
+ top: 50%;
11235
+ transform: translateY(-50%);
11236
+ color: #e3b341;
11237
+ font-size: 20px;
11238
+ font-weight: bold;
11239
+ pointer-events: none;
11240
+ transition: opacity 0.3s ease;
11241
+ z-index: 2;
11242
+ }
11243
+
11244
+ .chat-gutter-arrow--fade {
11245
+ opacity: 0;
11246
+ }
11247
+
11248
+ [data-theme="dark"] .chat-gutter-arrow {
11249
+ color: #e3b341;
11250
+ }
11251
+
11252
+ /* Error bubble */
11253
+ .chat-panel__error-bubble {
11254
+ display: flex;
11255
+ align-items: center;
11256
+ gap: 8px;
11257
+ padding: 8px 12px;
11258
+ background: rgba(208, 36, 47, 0.08);
11259
+ border: 1px solid rgba(208, 36, 47, 0.2);
11260
+ color: var(--color-danger);
11261
+ border-radius: 8px;
11262
+ font-size: 12px;
11263
+ }
11264
+
11265
+ /* Streaming / Typing Indicator */
11266
+ .chat-panel__typing-indicator {
11267
+ display: inline-flex;
11268
+ align-items: center;
11269
+ gap: 4px;
11270
+ padding: 4px 0;
11271
+ }
11272
+
11273
+ .chat-panel__typing-indicator span {
11274
+ width: 6px;
11275
+ height: 6px;
11276
+ background: var(--color-text-tertiary);
11277
+ border-radius: 50%;
11278
+ animation: chat-typing 1.2s ease-in-out infinite;
11279
+ }
11280
+
11281
+ .chat-panel__typing-indicator span:nth-child(2) {
11282
+ animation-delay: 0.2s;
11283
+ }
11284
+
11285
+ .chat-panel__typing-indicator span:nth-child(3) {
11286
+ animation-delay: 0.4s;
11287
+ }
11288
+
11289
+ @keyframes chat-typing {
11290
+ 0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
11291
+ 30% { opacity: 1; transform: scale(1); }
11292
+ }
11293
+
11294
+ /* Blinking cursor during streaming */
11295
+ .chat-panel__cursor {
11296
+ display: inline-block;
11297
+ width: 2px;
11298
+ height: 14px;
11299
+ background: var(--color-text-primary);
11300
+ margin-left: 2px;
11301
+ vertical-align: text-bottom;
11302
+ animation: chat-cursor-blink 0.8s step-end infinite;
11303
+ }
11304
+
11305
+ @keyframes chat-cursor-blink {
11306
+ 0%, 100% { opacity: 1; }
11307
+ 50% { opacity: 0; }
11308
+ }
11309
+
11310
+ /* Thinking indicator (shown below content when agent is processing) */
11311
+ .chat-panel__thinking {
11312
+ padding: 4px 0 0;
11313
+ }
11314
+
11315
+ /* Empty response fallback */
11316
+ .chat-panel__empty-response {
11317
+ color: var(--color-text-tertiary);
11318
+ font-size: 12px;
11319
+ }
11320
+
11321
+ /* Tool use badge */
11322
+ .chat-panel__tool-badge {
11323
+ display: flex;
11324
+ align-items: center;
11325
+ gap: 4px;
11326
+ padding: 2px 8px;
11327
+ margin-bottom: 4px;
11328
+ background: var(--color-bg-tertiary);
11329
+ border: 1px solid var(--color-border-primary);
11330
+ border-radius: 10px;
11331
+ font-size: 11px;
11332
+ color: var(--color-text-tertiary);
11333
+ max-width: 100%;
11334
+ }
11335
+
11336
+ .chat-panel__tool-badge svg {
11337
+ color: var(--color-text-tertiary);
11338
+ }
11339
+
11340
+ .chat-panel__tool-args {
11341
+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace);
11342
+ color: var(--color-text-quaternary, var(--color-text-tertiary));
11343
+ overflow: hidden;
11344
+ text-overflow: ellipsis;
11345
+ white-space: nowrap;
11346
+ opacity: 0.8;
11347
+ border-left: 1px solid var(--color-border-primary);
11348
+ padding-left: 5px;
11349
+ min-width: 0;
11350
+ flex: 1;
11351
+ }
11352
+
11353
+ .chat-panel__tool-spinner {
11354
+ display: inline-block;
11355
+ width: 10px;
11356
+ height: 10px;
11357
+ border: 1.5px solid var(--color-border-primary);
11358
+ border-top-color: var(--color-accent-primary);
11359
+ border-radius: 50%;
11360
+ animation: spin 0.8s linear infinite;
11361
+ }
11362
+
11363
+ /* Chat Panel Context Card */
11364
+ .chat-panel__context-card {
11365
+ display: flex;
11366
+ align-items: center;
11367
+ gap: 6px;
11368
+ padding: 6px 12px;
11369
+ margin: 4px 12px;
11370
+ background: var(--color-bg-tertiary);
11371
+ border: 1px solid var(--color-border-primary);
11372
+ border-radius: 8px;
11373
+ font-size: 11px;
11374
+ color: var(--color-text-tertiary);
11375
+ overflow: hidden;
11376
+ }
11377
+
11378
+ .chat-panel__context-card svg {
11379
+ flex-shrink: 0;
11380
+ color: var(--color-accent-primary);
11381
+ }
11382
+
11383
+ .chat-panel__context-label {
11384
+ font-weight: 600;
11385
+ text-transform: uppercase;
11386
+ letter-spacing: 0.5px;
11387
+ flex-shrink: 0;
11388
+ }
11389
+
11390
+ .chat-panel__context-title {
11391
+ overflow: hidden;
11392
+ text-overflow: ellipsis;
11393
+ white-space: nowrap;
11394
+ color: var(--color-text-secondary);
11395
+ }
11396
+
11397
+ .chat-panel__context-file {
11398
+ flex-shrink: 0;
11399
+ font-family: var(--font-mono, 'SFMono-Regular', Consolas, monospace);
11400
+ color: var(--color-text-tertiary);
11401
+ font-size: 10px;
11402
+ }
11403
+
11404
+ .chat-panel__context-remove {
11405
+ display: none;
11406
+ align-items: center;
11407
+ justify-content: center;
11408
+ width: 16px;
11409
+ height: 16px;
11410
+ margin-left: auto;
11411
+ padding: 0;
11412
+ border: none;
11413
+ border-radius: 50%;
11414
+ background: var(--color-bg-secondary);
11415
+ color: var(--color-text-tertiary);
11416
+ font-size: 12px;
11417
+ line-height: 1;
11418
+ cursor: pointer;
11419
+ flex-shrink: 0;
11420
+ transition: background 0.15s ease, color 0.15s ease;
11421
+ }
11422
+
11423
+ .chat-panel__context-card:hover .chat-panel__context-remove {
11424
+ display: flex;
11425
+ }
11426
+
11427
+ .chat-panel__context-remove:hover {
11428
+ background: var(--color-danger, #d1242f);
11429
+ color: #ffffff;
11430
+ }
11431
+
11432
+ .chat-panel__toast {
11433
+ position: absolute;
11434
+ top: 44px;
11435
+ left: 8px;
11436
+ right: 8px;
11437
+ z-index: 10;
11438
+ padding: 6px 12px;
11439
+ border-radius: 6px;
11440
+ background: var(--color-attention-subtle, #fff8c5);
11441
+ color: var(--color-attention-fg, #6f5e00);
11442
+ border: 1px solid var(--color-attention-muted, #d4a72c);
11443
+ font-size: 12px;
11444
+ text-align: center;
11445
+ animation: toast-slide-in 0.2s ease-out;
11446
+ }
11447
+
11448
+ [data-theme="dark"] .chat-panel__toast {
11449
+ background: var(--color-attention-subtle, #3b2e00);
11450
+ color: var(--color-attention-fg, #e3b341);
11451
+ border-color: var(--color-attention-muted, #7d6600);
11452
+ }
11453
+
11454
+ .chat-panel__toast--dismissing {
11455
+ animation: toast-fade-out 0.3s ease-out forwards;
11456
+ }
11457
+
11458
+ @keyframes toast-slide-in {
11459
+ from { opacity: 0; transform: translateY(-8px); }
11460
+ to { opacity: 1; transform: translateY(0); }
11461
+ }
11462
+
11463
+ @keyframes toast-fade-out {
11464
+ from { opacity: 1; }
11465
+ to { opacity: 0; }
11466
+ }
11467
+
11468
+ .chat-panel__context-title code {
11469
+ padding: 1px 4px;
11470
+ background: var(--color-bg-secondary);
11471
+ border-radius: 3px;
11472
+ font-size: 10px;
11473
+ font-family: var(--font-mono, ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace);
11474
+ }
11475
+
11476
+ /* Context card tooltip */
11477
+ .chat-panel__ctx-tooltip {
11478
+ position: fixed;
11479
+ z-index: 9999;
11480
+ width: 300px;
11481
+ max-height: 300px;
11482
+ overflow-y: auto;
11483
+ background: var(--color-bg-primary, #0d1117);
11484
+ border: 1px solid var(--color-border-primary, rgba(255, 255, 255, 0.1));
11485
+ border-radius: 8px;
11486
+ box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
11487
+ pointer-events: none;
11488
+ }
11489
+
11490
+ .chat-panel__ctx-tooltip-header {
11491
+ display: flex;
11492
+ align-items: center;
11493
+ gap: 6px;
11494
+ padding: 8px 12px;
11495
+ border-bottom: 1px solid var(--color-border-secondary, rgba(255, 255, 255, 0.06));
11496
+ }
11497
+
11498
+ .chat-panel__ctx-tooltip-type {
11499
+ font-size: 0.6875rem;
11500
+ font-weight: 600;
11501
+ text-transform: uppercase;
11502
+ letter-spacing: 0.05em;
11503
+ color: var(--color-text-tertiary, #6e7681);
11504
+ }
11505
+
11506
+ .chat-panel__ctx-tooltip-title {
11507
+ font-size: 0.75rem;
11508
+ font-weight: 600;
11509
+ color: var(--color-text-primary, #e6edf3);
11510
+ overflow: hidden;
11511
+ text-overflow: ellipsis;
11512
+ white-space: nowrap;
11513
+ }
11514
+
11515
+ .chat-panel__ctx-tooltip-body {
11516
+ padding: 8px 12px;
11517
+ font-size: 0.8125rem;
11518
+ line-height: 1.6;
11519
+ color: var(--color-text-secondary, #8b949e);
11520
+ }
11521
+
11522
+ .chat-panel__ctx-tooltip-body p {
11523
+ margin: 0 0 6px;
11524
+ }
11525
+
11526
+ .chat-panel__ctx-tooltip-body p:last-child {
11527
+ margin-bottom: 0;
11528
+ }
11529
+
11530
+ .chat-panel__ctx-tooltip-body code {
11531
+ padding: 2px 6px;
11532
+ background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
11533
+ border-radius: 3px;
11534
+ font-size: 0.75rem;
11535
+ }
11536
+
11537
+ .chat-panel__ctx-tooltip-body pre {
11538
+ margin: 6px 0;
11539
+ padding: 6px 10px;
11540
+ background: var(--color-bg-tertiary, rgba(255, 255, 255, 0.04));
11541
+ border-radius: 6px;
11542
+ overflow-x: auto;
11543
+ }
11544
+
11545
+ .chat-panel__ctx-tooltip-body pre code {
11546
+ padding: 0;
11547
+ background: none;
11548
+ }
11549
+
11550
+ .chat-panel__ctx-tooltip-body ul,
11551
+ .chat-panel__ctx-tooltip-body ol {
11552
+ margin: 4px 0 6px;
11553
+ padding-left: 20px;
11554
+ }
11555
+
11556
+ .chat-panel__ctx-tooltip-body li {
11557
+ margin: 2px 0;
11558
+ }
11559
+
11560
+ /* Chat Action Bar */
11561
+ .chat-panel__action-bar {
11562
+ display: flex;
11563
+ gap: 8px;
11564
+ padding: 8px 16px;
11565
+ border-top: 1px solid var(--color-border-primary);
11566
+ background: var(--color-bg-secondary);
11567
+ flex-shrink: 0;
11568
+ }
11569
+
11570
+ .chat-panel__action-btn {
11571
+ display: inline-flex;
11572
+ align-items: center;
11573
+ gap: 6px;
11574
+ padding: 6px 12px;
11575
+ border: 1px solid var(--color-border-primary);
11576
+ border-radius: 6px;
11577
+ background: var(--color-bg-primary);
11578
+ color: var(--color-text-secondary);
11579
+ font-size: 12px;
11580
+ font-family: inherit;
11581
+ cursor: pointer;
11582
+ transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
11583
+ }
11584
+
11585
+ .chat-panel__action-btn:hover:not(:disabled) {
11586
+ background: var(--color-bg-tertiary);
11587
+ border-color: var(--color-text-tertiary);
11588
+ color: var(--color-text-primary);
11589
+ }
11590
+
11591
+ .chat-panel__action-btn:disabled {
11592
+ opacity: 0.4;
11593
+ cursor: not-allowed;
11594
+ }
11595
+
11596
+ .chat-panel__action-btn svg {
11597
+ flex-shrink: 0;
11598
+ }
11599
+
11600
+ .chat-panel__action-btn--adopt {
11601
+ background: var(--color-accent-primary, #2f81f7);
11602
+ border-color: var(--color-accent-primary, #2f81f7);
11603
+ color: #ffffff;
11604
+ }
11605
+
11606
+ .chat-panel__action-btn--adopt:hover:not(:disabled) {
11607
+ background: var(--color-accent-hover, #388bfd);
11608
+ border-color: var(--color-accent-hover, #388bfd);
11609
+ color: #ffffff;
11610
+ }
11611
+
11612
+ .chat-panel__action-btn--update {
11613
+ background: var(--color-accent-primary, #2f81f7);
11614
+ border-color: var(--color-accent-primary, #2f81f7);
11615
+ color: #ffffff;
11616
+ }
11617
+
11618
+ .chat-panel__action-btn--update:hover:not(:disabled) {
11619
+ background: var(--color-accent-hover, #388bfd);
11620
+ border-color: var(--color-accent-hover, #388bfd);
11621
+ color: #ffffff;
11622
+ }
11623
+
11624
+ .chat-panel__action-btn--create-comment {
11625
+ background: var(--color-accent-primary, #2f81f7);
11626
+ border-color: var(--color-accent-primary, #2f81f7);
11627
+ color: #ffffff;
11628
+ }
11629
+
11630
+ .chat-panel__action-btn--create-comment:hover:not(:disabled) {
11631
+ background: var(--color-accent-hover, #388bfd);
11632
+ border-color: var(--color-accent-hover, #388bfd);
11633
+ color: #ffffff;
11634
+ }
11635
+
11636
+ .chat-panel__action-btn--dismiss-suggestion,
11637
+ .chat-panel__action-btn--dismiss-comment {
11638
+ background: var(--color-danger, #d1242f);
11639
+ border-color: var(--color-danger, #d1242f);
11640
+ color: #ffffff;
11641
+ }
11642
+
11643
+ .chat-panel__action-btn--dismiss-suggestion:hover:not(:disabled),
11644
+ .chat-panel__action-btn--dismiss-comment:hover:not(:disabled) {
11645
+ background: var(--color-danger-hover, #b91c1c);
11646
+ border-color: var(--color-danger-hover, #b91c1c);
11647
+ color: #ffffff;
11648
+ }
11649
+
11650
+ .chat-panel__action-bar-dismiss {
11651
+ margin-left: auto;
11652
+ display: inline-flex;
11653
+ align-items: center;
11654
+ justify-content: center;
11655
+ background: none;
11656
+ border: none;
11657
+ color: var(--color-text-tertiary);
11658
+ cursor: pointer;
11659
+ padding: 4px;
11660
+ border-radius: 4px;
11661
+ line-height: 1;
11662
+ transition: background 0.15s ease, color 0.15s ease;
11663
+ }
11664
+
11665
+ .chat-panel__action-bar-dismiss:hover {
11666
+ background: var(--color-bg-tertiary);
11667
+ color: var(--color-text-primary);
11668
+ }
11669
+
11670
+ /* Chat Input Area */
11671
+ .chat-panel__input-area {
11672
+ display: flex;
11673
+ flex-direction: column;
11674
+ margin: 0 12px 12px;
11675
+ border: 1px solid var(--color-border-primary);
11676
+ border-radius: 8px;
11677
+ background: var(--color-bg-primary);
11678
+ flex-shrink: 0;
11679
+ transition: border-color 0.15s ease, box-shadow 0.15s ease;
11680
+ }
11681
+
11682
+ .chat-panel__input-area:focus-within {
11683
+ border-color: var(--color-accent-primary);
11684
+ box-shadow: 0 0 0 2px var(--color-accent-light);
11685
+ }
11686
+
11687
+ .chat-panel__input {
11688
+ min-height: 36px;
11689
+ max-height: 120px;
11690
+ padding: 8px 12px 4px;
11691
+ border: none;
11692
+ background: transparent;
11693
+ color: var(--color-text-primary);
11694
+ font-family: inherit;
11695
+ font-size: 13px;
11696
+ line-height: 1.4;
11697
+ resize: none;
11698
+ outline: none;
11699
+ overflow-y: hidden;
11700
+ box-sizing: border-box;
11701
+ }
11702
+
11703
+ .chat-panel__input::placeholder {
11704
+ color: var(--color-text-tertiary);
11705
+ }
11706
+
11707
+ .chat-panel__input-footer {
11708
+ display: flex;
11709
+ align-items: center;
11710
+ justify-content: space-between;
11711
+ padding: 4px 8px 6px 12px;
11712
+ }
11713
+
11714
+ .chat-panel__input-hint {
11715
+ font-size: 11px;
11716
+ color: var(--color-text-tertiary);
11717
+ user-select: none;
11718
+ }
11719
+
11720
+ .chat-panel__input-actions {
11721
+ display: flex;
11722
+ align-items: center;
11723
+ gap: 4px;
11724
+ }
11725
+
11726
+ .chat-panel__send-btn {
11727
+ display: flex;
11728
+ align-items: center;
11729
+ justify-content: center;
11730
+ width: 28px;
11731
+ height: 28px;
11732
+ border: none;
11733
+ background: var(--color-accent-primary);
11734
+ color: #ffffff;
11735
+ border-radius: 6px;
11736
+ cursor: pointer;
11737
+ flex-shrink: 0;
11738
+ transition: background 0.15s ease, opacity 0.15s ease;
11739
+ }
11740
+
11741
+ .chat-panel__send-btn:hover:not(:disabled) {
11742
+ background: var(--color-accent-hover);
11743
+ }
11744
+
11745
+ .chat-panel__send-btn:disabled {
11746
+ opacity: 0.4;
11747
+ cursor: not-allowed;
11748
+ }
11749
+
11750
+ .chat-panel__stop-btn {
11751
+ display: flex;
11752
+ align-items: center;
11753
+ justify-content: center;
11754
+ width: 28px;
11755
+ height: 28px;
11756
+ border: none;
11757
+ border-radius: 6px;
11758
+ background: var(--color-danger, #d1242f);
11759
+ color: white;
11760
+ cursor: pointer;
11761
+ flex-shrink: 0;
11762
+ transition: background 0.15s;
11763
+ }
11764
+
11765
+ .chat-panel__stop-btn:hover {
11766
+ opacity: 0.85;
11767
+ }
11768
+
11769
+ /* Dark theme adjustments */
11770
+ [data-theme="dark"] .chat-panel {
11771
+ box-shadow: -4px 0 16px rgba(0, 0, 0, 0.3);
11772
+ }
11773
+
11774
+ [data-theme="dark"] .chat-panel__message--user .chat-panel__bubble {
11775
+ background: var(--color-accent-primary);
11776
+ }
11777
+
11778
+ [data-theme="dark"] .chat-panel__error-bubble {
11779
+ background: rgba(248, 81, 73, 0.1);
11780
+ border-color: rgba(248, 81, 73, 0.2);
11781
+ }
11782
+
11783
+ /* Responsive: narrower on small screens */
11784
+ @media (max-width: 768px) {
11785
+ .chat-panel {
11786
+ width: 100% !important;
11787
+ }
11788
+ }
11789
+
11790
+ /* ==========================================================================
11791
+ Context Files
11792
+ Pinned non-diff file ranges shown below the diff for review context
11793
+ ========================================================================== */
11794
+
11795
+ /* Context badge for sidebar and diff header */
11796
+ .context-badge {
11797
+ display: inline-flex;
11798
+ align-items: center;
11799
+ padding: 1px 6px;
11800
+ font-size: 10px;
11801
+ font-weight: 600;
11802
+ color: #bf6a02;
11803
+ border: 1px solid #bf6a02;
11804
+ border-radius: 3px;
11805
+ text-transform: uppercase;
11806
+ letter-spacing: 0.5px;
11807
+ white-space: nowrap;
11808
+ }
11809
+
11810
+ [data-theme="dark"] .context-badge {
11811
+ color: #e09b3d;
11812
+ border-color: #e09b3d;
11813
+ }
11814
+
11815
+ /* Smaller context badge in file navigator */
11816
+ .file-item .context-badge {
11817
+ font-size: 9px;
11818
+ padding: 0px 4px;
11819
+ opacity: 0.7;
11820
+ }
11821
+
11822
+ /* Smaller context badge in diff panel header */
11823
+ .context-file-header .context-badge {
11824
+ font-size: 9px;
11825
+ padding: 0px 4px;
11826
+ }
11827
+
11828
+ .d2h-file-wrapper.context-file {
11829
+ border-left: 3px solid var(--color-accent-primary, #0969da);
11830
+ margin-bottom: 24px;
11831
+ overflow-x: auto;
11832
+ max-width: 100%;
11833
+ background: var(--color-bg-subtle, #f6f8fa);
11834
+ }
11835
+
11836
+ .context-file-header {
11837
+ display: flex;
11838
+ align-items: center;
11839
+ gap: 8px;
11840
+ background: var(--color-bg-secondary);
11841
+ padding: 8px 12px;
11842
+ border-bottom: 1px solid var(--color-border-primary);
11843
+ font-weight: 600;
11844
+ font-size: 14px;
11845
+ }
11846
+
11847
+ /* Override flex: 1 so the file name doesn't push the badge away */
11848
+ .context-file-header .d2h-file-name {
11849
+ flex: none;
11850
+ }
11851
+
11852
+ /* Push viewed checkbox (and everything after it) to the right */
11853
+ .context-file-header .file-viewed-label {
11854
+ margin-left: auto;
11855
+ }
11856
+
11857
+ .context-file-badge {
11858
+ display: inline-flex;
11859
+ align-items: center;
11860
+ padding: 2px 8px;
11861
+ font-size: 11px;
11862
+ font-weight: 500;
11863
+ color: var(--color-accent-primary, #0969da);
11864
+ background: var(--color-accent-lighter, rgba(9, 105, 218, 0.08));
11865
+ border-radius: 12px;
11866
+ font-family: var(--font-mono, 'JetBrains Mono', monospace);
11867
+ white-space: nowrap;
11868
+ }
11869
+
11870
+ /* Label is now a tooltip on the CONTEXT badge (title attribute) */
11871
+
11872
+ .context-file-dismiss {
11873
+ display: flex;
11874
+ align-items: center;
11875
+ justify-content: center;
11876
+ width: 24px;
11877
+ height: 24px;
11878
+ padding: 0;
11879
+ background: transparent;
11880
+ border: 1px solid transparent;
11881
+ border-radius: 4px;
11882
+ cursor: pointer;
11883
+ color: var(--color-text-tertiary);
11884
+ transition: background-color 0.15s, color 0.15s;
11885
+ flex-shrink: 0;
11886
+ }
11887
+
11888
+ .context-file-dismiss:hover {
11889
+ background: var(--color-bg-tertiary);
11890
+ color: var(--color-danger, #cf222e);
11891
+ }
11892
+
11893
+ /* Context chunk header (range label + per-chunk dismiss) */
11894
+ .context-chunk-header td {
11895
+ padding: 4px 12px;
11896
+ font-size: 11px;
11897
+ color: var(--color-text-secondary);
11898
+ border-top: 1px dashed var(--color-border-secondary, #d0d7de);
11899
+ }
11900
+
11901
+ .context-range-label {
11902
+ font-family: var(--font-mono, 'JetBrains Mono', monospace);
11903
+ }
11904
+
11905
+ .context-chunk-dismiss {
11906
+ display: inline-flex;
11907
+ align-items: center;
11908
+ justify-content: center;
11909
+ width: 18px;
11910
+ height: 18px;
11911
+ border: none;
11912
+ background: transparent;
11913
+ color: var(--color-text-tertiary);
11914
+ cursor: pointer;
11915
+ font-size: 14px;
11916
+ margin-left: 8px;
11917
+ border-radius: 3px;
11918
+ vertical-align: middle;
11919
+ }
11920
+
11921
+ .context-chunk-dismiss:hover {
11922
+ background: var(--color-bg-tertiary);
11923
+ color: var(--color-danger, #cf222e);
11924
+ }
11925
+
11926
+ /* Separator between non-contiguous context chunks */
11927
+ .context-chunk-separator-row {
11928
+ height: 8px;
11929
+ }
11930
+
11931
+ .context-chunk-separator-cell {
11932
+ border-top: 1px dashed var(--color-border-secondary, #d0d7de);
11933
+ background: var(--color-bg-subtle, #f6f8fa);
11934
+ }
11935
+
11936
+ .file-item.context-file-item .file-name {
11937
+ font-size: 11px;
11938
+ color: var(--color-text-secondary);
11939
+ }
11940
+
11941
+ /* Highlight flash animation for scroll-to-line targeting */
11942
+ .highlight-flash {
11943
+ animation: highlightFlash 1.5s ease-out;
11944
+ }
11945
+
11946
+ @keyframes highlightFlash {
11947
+ 0% {
11948
+ background-color: var(--color-selection, #fff8c5);
11949
+ }
11950
+ 100% {
11951
+ background-color: transparent;
11952
+ }
11953
+ }
11954
+
11955
+ /* Dark theme overrides for context files */
11956
+ [data-theme="dark"] .d2h-file-wrapper.context-file {
11957
+ border-left-color: var(--color-accent-primary, #58a6ff);
11958
+ background: var(--color-bg-subtle, #161b22);
11959
+ }
11960
+
11961
+ [data-theme="dark"] .context-file-badge {
11962
+ color: var(--color-accent-primary, #58a6ff);
11963
+ background: var(--color-accent-lighter, rgba(88, 166, 255, 0.08));
11964
+ }
11965
+
11966
+ [data-theme="dark"] .context-file-dismiss:hover {
11967
+ color: var(--color-danger, #f85149);
11968
+ }
11969
+
11970
+ [data-theme="dark"] .context-chunk-dismiss:hover {
11971
+ color: var(--color-danger, #f85149);
11972
+ }
11973
+
11974
+ [data-theme="dark"] .context-chunk-separator-cell {
11975
+ background: var(--color-bg-subtle, #161b22);
11976
+ }
11977
+
11978
+ [data-theme="dark"] .chat-file-link {
11979
+ color: var(--color-accent-primary, #58a6ff);
11980
+ background: var(--color-bg-tertiary);
11981
+ }
11982
+
11983
+ [data-theme="dark"] .chat-file-link:hover {
11984
+ color: var(--color-accent-hover, #1f6feb);
11985
+ background: var(--color-bg-accent-subtle, rgba(88, 166, 255, 0.1));
11986
+ }
11987
+
11988
+ /* ─── Chat Feature Gating ──────────────────────────────────────────────────── */
11989
+
11990
+ /* Chat disabled: hide everything */
11991
+ [data-chat="disabled"] #chat-toggle-btn,
11992
+ [data-chat="disabled"] #panel-layout-toggle,
11993
+ [data-chat="disabled"] #chat-panel-container,
11994
+ [data-chat="disabled"] .file-header-chat-btn,
11995
+ [data-chat="disabled"] .ai-action-chat,
11996
+ [data-chat="disabled"] .btn-collapsed-chat,
11997
+ [data-chat="disabled"] .finding-chat-action,
11998
+ [data-chat="disabled"] .btn-chat-comment,
11999
+ [data-chat="disabled"] .analysis-history-chat-btn,
12000
+ [data-chat="disabled"] .chat-line-btn,
12001
+ [data-chat="disabled"] .btn-chat-from-comment {
12002
+ display: none !important;
12003
+ }
12004
+
12005
+ /* Chat enabled but Pi unavailable: hide all except toggle (which is disabled) */
12006
+ [data-chat="unavailable"] #panel-layout-toggle,
12007
+ [data-chat="unavailable"] #chat-panel-container,
12008
+ [data-chat="unavailable"] .file-header-chat-btn,
12009
+ [data-chat="unavailable"] .ai-action-chat,
12010
+ [data-chat="unavailable"] .btn-collapsed-chat,
12011
+ [data-chat="unavailable"] .finding-chat-action,
12012
+ [data-chat="unavailable"] .btn-chat-comment,
12013
+ [data-chat="unavailable"] .analysis-history-chat-btn,
12014
+ [data-chat="unavailable"] .chat-line-btn,
12015
+ [data-chat="unavailable"] .btn-chat-from-comment {
12016
+ display: none !important;
12017
+ }
12018
+
12019
+ [data-chat="unavailable"] #chat-toggle-btn {
12020
+ opacity: 0.4;
12021
+ cursor: not-allowed;
12022
+ }