/**
 * CoderFlow Feedback Widget Styles
 * Namespaced to prevent conflicts with host applications
 */

:root,
.profound-feedback-panel,
.profound-feedback-float-btn,
.profound-feedback-toast,
.profound-feedback-modal,
.profound-feedback-error-modal,
.profound-feedback-preview,
.profound-feedback-preview-backdrop {
  --feedback-surface: #ffffff;
  --feedback-surface-muted: #f5f7fb;
  --feedback-border: #d9deeb;
  --feedback-text: #1f2a44;
  --feedback-text-muted: #5a6480;
  --feedback-panel-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
  --feedback-accent: #3f72ff;
  --feedback-surface-hover: #e8e8e8;
  --feedback-button-glow: rgba(63, 114, 255, 0.18);
}

:root[data-theme="dark"],
.profound-feedback-panel[data-theme="dark"],
.profound-feedback-float-btn[data-theme="dark"],
.profound-feedback-toast[data-theme="dark"],
.profound-feedback-modal[data-theme="dark"],
.profound-feedback-error-modal[data-theme="dark"],
.profound-feedback-preview[data-theme="dark"],
.profound-feedback-preview-backdrop[data-theme="dark"] {
  --feedback-surface: #0f172a;
  --feedback-surface-muted: #111c2f;
  --feedback-border: #243352;
  --feedback-text: #e2e8f0;
  --feedback-text-muted: #94a3b8;
  --feedback-panel-shadow: -4px 0 22px rgba(0, 0, 0, 0.6);
  --feedback-accent: #8fb1ff;
  --feedback-surface-hover: rgba(255, 255, 255, 0.06);
  --feedback-button-glow: rgba(130, 165, 255, 0.3);
}

/* Floating button */
.profound-feedback-float-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3f72ff 0%, #3158c9 100%);
  color: white;
  border: 3px solid #f4b740;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(63, 114, 255, 0.4);
  z-index: 999998;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: none;
  user-select: none;
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.profound-feedback-float-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(63, 114, 255, 0.5);
}

.profound-feedback-float-btn:active {
  transform: scale(0.95);
}

.profound-feedback-float-btn svg {
  color: white;
  stroke: white;
  width: 24px;
  height: 24px;
}

.profound-feedback-float-btn.selecting-mode {
  background: linear-gradient(135deg, #2eb67d 0%, #25a268 100%);
  box-shadow: 0 4px 12px rgba(46, 182, 125, 0.4);
  animation: profound-pulse 2s ease-in-out infinite;
}

@keyframes profound-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes profound-feedback-flash {
  0% { transform: scale(0); opacity: 0.8; }
  100% { transform: scale(2); opacity: 0; }
}

/* Selection Buttons (Cancel/Done) */
.profound-selection-button {
  box-sizing: border-box;
  padding: 0;
  margin: 0;
}

/* Slide-out panel */
.profound-feedback-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  min-width: 360px;
  max-width: 800px;
  height: 100vh;
  background: var(--feedback-surface);
  box-shadow: var(--feedback-panel-shadow);
  z-index: 999999;
  transform: translateX(100%); /* Start off-screen to the right */
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  box-sizing: border-box;
  line-height: 1.5;
  color: var(--feedback-text);
}

.profound-feedback-panel * {
  box-sizing: border-box;
}

.profound-feedback-panel.open {
  transform: translateX(0); /* Slide in */
}

.profound-feedback-panel.resizing {
  transition: none !important; /* Disable transition during resize */
}

/* Left-side positioning */
.profound-feedback-panel.left {
  right: auto;
  left: 0;
  transform: translateX(-100%);
}

.profound-feedback-panel.left.open {
  transform: translateX(0);
}

.profound-feedback-panel.left .feedback-resize-handle {
  left: auto;
  right: 0;
  border-left: none;
  border-right: 1px solid var(--feedback-border);
}

.profound-feedback-panel.left .feedback-resize-handle:hover,
.profound-feedback-panel.left .feedback-resize-handle.active {
  border-left: none;
  border-right: 3px solid #3f72ff;
}

.profound-feedback-float-btn.dragging {
  cursor: grabbing;
  transition: none;
}

.profound-feedback-drop-target {
  position: fixed;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2px dashed #3f72ff;
  background: rgba(63, 114, 255, 0.1);
  z-index: 999997;
  display: none;
  pointer-events: none;
  box-sizing: border-box;
}

/* Resize handle */
.profound-feedback-panel .feedback-resize-handle {
  position: absolute;
  top: 0;
  left: 0;
  width: 12px;
  height: 100%;
  cursor: ew-resize;
  background: transparent;
  z-index: 1000;
  border-left: 1px solid var(--feedback-border);
  transition: background 0.2s, border-color 0.2s, border-width 0.2s;
}

.profound-feedback-panel .feedback-resize-handle:hover,
.profound-feedback-panel .feedback-resize-handle.active {
  background: rgba(63, 114, 255, 0.1);
  border-left: 3px solid #3f72ff;
}

.profound-feedback-panel.selecting {
  pointer-events: none;
  opacity: 0.5;
}

/* Header */
.profound-feedback-panel .feedback-header {
  padding: 16px 20px;
  background: var(--feedback-surface);
  border-bottom: 1px solid var(--feedback-border);
  color: var(--feedback-text);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.profound-feedback-panel .feedback-header-actions {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.profound-feedback-panel .feedback-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  flex: 1;
  letter-spacing: -0.03em;
}

.profound-feedback-panel .feedback-task-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--feedback-text);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
  padding: 2px 0;
}

/* Only show link hover style for actual links (task mode), not spans (QA mode) */
.profound-feedback-panel a.feedback-task-name:hover {
  color: #0066cc;
  text-decoration: underline;
}

.profound-feedback-panel span.feedback-task-name {
  cursor: default;
}

.profound-feedback-panel .feedback-app-badge {
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  color: var(--feedback-text-muted);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

/* Diff stats badge in header */
.profound-feedback-panel .feedback-diff-stats {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: -4px;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  line-height: 1;
}

.profound-feedback-panel .feedback-diff-stats .diff-stats-added {
  color: #1a7f37;
}

.profound-feedback-panel .feedback-diff-stats .diff-stats-deleted {
  color: #cf222e;
}

/* Dark theme diff stats */
.profound-feedback-panel[data-theme="dark"] .feedback-diff-stats .diff-stats-added {
  color: #3fb950;
}

.profound-feedback-panel[data-theme="dark"] .feedback-diff-stats .diff-stats-deleted {
  color: #f85149;
}

.profound-feedback-panel .feedback-agent-icon {
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  color: var(--feedback-text-muted);
  cursor: default;
  padding: 4px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s;
}

.profound-feedback-panel .feedback-agent-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Agent-specific colors */
.profound-feedback-panel .feedback-agent-icon[data-agent="claude"] {
  color: #D97757;
  background: #fef7f5;
  border-color: #f4d4cb;
}

.profound-feedback-panel .feedback-agent-icon[data-agent="codex"] {
  color: #10a37f;
  background: #f0fdf9;
  border-color: #c7f0e3;
}

.profound-feedback-panel .feedback-agent-icon[data-agent="gemini"] {
  color: #4285f4;
  background: #f5f9ff;
  border-color: #d0e2ff;
}

.profound-feedback-panel .feedback-agent-icon[data-agent="bob"] {
  color: #6366F1;
  background: #f5f5ff;
  border-color: #d4d4ff;
}

.profound-feedback-panel .close-btn {
  background: none;
  border: none;
  color: var(--feedback-text-muted);
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.profound-feedback-panel .close-btn svg {
  stroke: var(--feedback-text-muted);
}

.profound-feedback-panel .close-btn:hover {
  background: var(--feedback-surface-muted);
}

/* Body */
.profound-feedback-panel .feedback-body {
  flex: 1;
  padding: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Activity Feed Section */
.profound-feedback-panel .widget-activity-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 200px;
  max-height: 500px;
  border-bottom: 2px solid var(--feedback-border);
}

.profound-feedback-panel .widget-activity-header {
  padding: 12px 20px;
  background: var(--feedback-surface-muted);
  border-bottom: 1px solid var(--feedback-border);
  flex-shrink: 0;
}

.profound-feedback-panel .widget-activity-header h4 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--feedback-text);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.profound-feedback-panel .widget-activity-header .activity-count {
  background: #3f72ff;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin-left: 8px;
}

.profound-feedback-panel .activity-feed {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 12px 12px 12px;
  background: var(--feedback-surface-muted);
  min-height: 0;
}

.profound-feedback-panel .activity-placeholder {
  text-align: left;
  color: var(--feedback-text-muted);
  padding: 12px 0 8px 42px;
  font-style: italic;
}

/* Activity Timeline Items */
.profound-feedback-panel .activity-timeline-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  position: relative;
  padding: 6px 8px;
  margin-left: 8px;
}

/* User message styling */
.profound-feedback-panel .activity-feed .activity-timeline-item.user-message {
  background-color: rgba(46, 182, 125, 0.05) !important;
  border-left: 3px solid #2eb67d !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  margin-left: 8px !important;
  margin-bottom: 20px !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.user-message .activity-timeline-marker {
  border-color: #2eb67d !important;
  background: #e8f5e9 !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.user-message .activity-timeline-action {
  color: #2eb67d !important;
  font-weight: 600 !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.user-message.expandable:hover {
  background-color: rgba(46, 182, 125, 0.1) !important;
  cursor: pointer !important;
}

/* Agent response styling */
.profound-feedback-panel .activity-feed .activity-timeline-item.agent-response {
  background-color: rgba(63, 114, 255, 0.04) !important;
  border-left: 3px solid #3f72ff !important;
  border-radius: 6px !important;
  padding: 6px 8px !important;
  margin-left: 8px !important;
  margin-bottom: 20px !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.agent-response .activity-timeline-marker {
  border-color: #3f72ff !important;
  background: #e3f2fd !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.agent-response .activity-timeline-action {
  color: #3f72ff !important;
  font-weight: 600 !important;
}

.profound-feedback-panel .activity-feed .activity-timeline-item.agent-response.expandable:hover {
  background-color: rgba(63, 114, 255, 0.08) !important;
  cursor: pointer !important;
}

.profound-feedback-panel .activity-timeline-item::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 40px;
  bottom: -20px;
  width: 2px;
  background: var(--feedback-border);
}

.profound-feedback-panel .activity-timeline-item:last-child::before {
  display: none;
}

.profound-feedback-panel .activity-timeline-marker {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--feedback-surface-muted);
  border: 3px solid var(--feedback-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  z-index: 1;
  position: relative;
}

.profound-feedback-panel .activity-timeline-item.success .activity-timeline-marker {
  border-color: #2eb67d;
  background: var(--feedback-surface-muted);
}

.profound-feedback-panel .activity-timeline-item.error .activity-timeline-marker {
  border-color: #e55368;
  background: var(--feedback-surface-muted);
}

.profound-feedback-panel .activity-timeline-item.running .activity-timeline-marker {
  border-color: #3f72ff;
  background: #e3f2fd;
}

.profound-feedback-panel .activity-timeline-content {
  flex: 1;
  padding-left: 16px;
  padding-top: 4px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.profound-feedback-panel .activity-timeline-action {
  font-weight: 600;
  font-size: 14px;
  color: var(--feedback-text);
  margin-bottom: 4px;
}

.profound-feedback-panel .activity-timeline-action .expand-hint {
  color: #3f72ff;
  margin-left: 6px;
  font-size: 11px;
  font-weight: normal;
}

.profound-feedback-panel .activity-timeline-detail {
  font-size: 13px;
  color: var(--feedback-text-muted);
  line-height: 1.5;
  word-break: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profound-feedback-panel .activity-timeline-status {
  font-size: 16px;
  flex-shrink: 0;
  margin-left: 8px;
  margin-top: 8px;
}

.profound-feedback-panel .activity-timeline-item.success .activity-timeline-status {
  color: #2eb67d;
}

.profound-feedback-panel .activity-timeline-item.error .activity-timeline-status {
  color: #e55368;
}

.profound-feedback-panel .activity-timeline-item.running .activity-timeline-status {
  color: #f4b740;
}

.profound-feedback-panel .activity-timeline-item.expandable {
  cursor: pointer;
}

.profound-feedback-panel .activity-timeline-item.expandable:hover .activity-timeline-content {
  color: #3f72ff;
}

.profound-feedback-panel .activity-timeline-item.expandable:hover .activity-timeline-action {
  color: #3f72ff;
}

/* Load More button */
.profound-feedback-panel .activity-load-more {
  text-align: center;
  padding: 8px 0;
  margin-bottom: 8px;
}

.profound-feedback-panel .load-more-activity-btn {
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  color: var(--feedback-text-muted);
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.profound-feedback-panel .load-more-activity-btn:hover {
  background: var(--feedback-surface-muted);
  border-color: var(--feedback-border);
}

/* Typing indicator */
.profound-feedback-panel .activity-typing-indicator {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 12px 0 8px 42px;
}

.profound-feedback-panel .activity-typing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--feedback-text);
  opacity: 0.6;
  animation: profound-typing-bounce 1.4s infinite ease-in-out;
}

.profound-feedback-panel .activity-typing-dot:nth-child(1) {
  animation-delay: 0s;
}

.profound-feedback-panel .activity-typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.profound-feedback-panel .activity-typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes profound-typing-bounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

.profound-feedback-panel .activity-elapsed-time {
  margin-left: 8px;
  font-size: 12px;
  color: var(--feedback-text-muted);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
}

/* Feedback Input Section */
.profound-feedback-panel .widget-feedback-section {
  flex-shrink: 0;
  padding: 8px 12px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--feedback-surface);
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.profound-feedback-panel .widget-feedback-section.drag-over {
  border: 2px dashed #3f72ff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(63,114,255,0.2);
  background: rgba(63,114,255,0.05);
}

.profound-feedback-panel .widget-feedback-section.drag-over::after {
  content: 'Drop files here';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  background: #3f72ff;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
}

.profound-feedback-panel .follow-up-input-row {
  position: relative;
}

.profound-feedback-panel .inline-follow-up-textarea {
  width: 100% !important;
  min-height: 42px !important;
  max-height: 200px !important;
  height: auto;
  padding: 8px 42px 8px 10px !important;
  border: 1px solid var(--feedback-border) !important;
  border-radius: 6px !important;
  font-family: inherit !important;
  font-size: 14px !important;
  color: var(--feedback-text) !important;
  background: var(--feedback-surface) !important;
  line-height: 1.4 !important;
  resize: none !important;
  box-sizing: border-box !important;
  transition: height 0.1s ease, border-color 0.2s ease, box-shadow 0.2s ease !important;
  overflow-y: hidden;
}

.profound-feedback-panel .inline-follow-up-textarea:focus {
  outline: none !important;
  border-color: #3f72ff !important;
  box-shadow: 0 0 0 3px rgba(63,114,255,0.1) !important;
}

.profound-feedback-panel .inline-follow-up-textarea:disabled {
  opacity: 0.6 !important;
  cursor: not-allowed !important;
}

.profound-feedback-panel .inline-follow-up-submit {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: 8px;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  background: var(--feedback-surface);
  color: var(--feedback-text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profound-feedback-panel .inline-follow-up-submit:hover:not(:disabled) {
  background: rgba(63, 114, 255, 0.08);
  border-color: #3f72ff;
  color: #3f72ff;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(63, 114, 255, 0.15);
}

.profound-feedback-panel .inline-follow-up-submit:active:not(:disabled) {
  transform: translateY(-50%);
  background: rgba(63, 114, 255, 0.15);
}

.profound-feedback-panel .inline-follow-up-submit:disabled {
  background: var(--feedback-surface-muted);
  color: var(--feedback-text-muted);
  cursor: not-allowed;
  opacity: 0.4;
}

/* Markdown editor wrapper for feedback input */
.profound-feedback-panel .feedback-editor-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  background: var(--feedback-surface);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: visible; /* Allow dropdown menus to escape */
}

.profound-feedback-panel .feedback-editor-wrapper:focus-within {
  border-color: #3f72ff;
  box-shadow: 0 0 0 3px rgba(63,114,255,0.1);
}

.profound-feedback-panel .follow-up-toolbar {
  padding: 4px 6px;
  background: var(--feedback-surface-muted);
  border-bottom: 1px solid var(--feedback-border);
  display: flex;
  flex-wrap: nowrap;
  gap: 1px;
  border-radius: 3px 3px 0 0; /* Match wrapper's top corners (4px - 1px for border) */
  position: relative; /* For dropdown z-index stacking */
}

.profound-feedback-panel .follow-up-toolbar-hidden {
  display: none !important;
}

.profound-feedback-panel .follow-up-toolbar > button,
.profound-feedback-panel .follow-up-toolbar > .markdown-toolbar-dropdown > button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--feedback-text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.profound-feedback-panel .follow-up-toolbar > button svg:not(.dropdown-arrow),
.profound-feedback-panel .follow-up-toolbar > .markdown-toolbar-dropdown > button svg:not(.dropdown-arrow) {
  width: 14px;
  height: 14px;
}

.profound-feedback-panel .follow-up-toolbar .markdown-toolbar-separator {
  margin: 0 3px !important;
}

.profound-feedback-panel .follow-up-toolbar > button:hover,
.profound-feedback-panel .follow-up-toolbar > .markdown-toolbar-dropdown > button:hover {
  background: var(--feedback-surface-hover);
  color: var(--feedback-text);
}

.profound-feedback-panel .follow-up-toolbar > button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.profound-feedback-panel .follow-up-toolbar > button.active,
.profound-feedback-panel .follow-up-toolbar > .markdown-toolbar-dropdown > button.active {
  background: rgba(63, 114, 255, 0.15);
  color: #3f72ff;
}

.profound-feedback-panel .follow-up-toolbar > button.markdown-voice-btn.voice-listening {
  background: rgba(229, 83, 104, 0.2);
  color: #e55368;
  animation: profound-feedback-voice-listening-pulse 1.25s ease-in-out infinite;
}

@keyframes profound-feedback-voice-listening-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(229, 83, 104, 0.3), 0 0 8px rgba(229, 83, 104, 0.18);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(229, 83, 104, 0.14), 0 0 14px rgba(229, 83, 104, 0.28);
    transform: scale(1.06);
  }
}

@media (prefers-reduced-motion: reduce) {
  .profound-feedback-panel .follow-up-toolbar > button.markdown-voice-btn.voice-listening {
    animation: none;
  }
}

.profound-feedback-panel .follow-up-toolbar .toolbar-separator {
  width: 1px;
  height: 20px;
  background: var(--feedback-border);
  margin: 4px 4px;
}

/* Dropdown menu styles for the markdown toolbar in feedback widget */
.profound-feedback-panel .markdown-toolbar-dropdown {
  position: relative;
  display: inline-flex;
}

.profound-feedback-panel .markdown-toolbar-dropdown-btn {
  display: flex;
  align-items: center;
  gap: 2px;
}

.profound-feedback-panel .markdown-toolbar-dropdown-btn .dropdown-arrow {
  opacity: 0.6;
  margin-left: 2px;
}

.profound-feedback-panel .markdown-toolbar-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 140px;
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  margin-top: 4px;
}

.profound-feedback-panel .markdown-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  color: var(--feedback-text);
  font-size: 13px;
}

.profound-feedback-panel .markdown-dropdown-item:hover {
  background: var(--feedback-surface-muted);
}

.profound-feedback-panel .markdown-dropdown-item:first-child {
  border-radius: 4px 4px 0 0;
}

.profound-feedback-panel .markdown-dropdown-item:last-child {
  border-radius: 0 0 4px 4px;
}

.profound-feedback-panel .markdown-color-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 8px;
}

.profound-feedback-panel .markdown-color-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.profound-feedback-panel .markdown-color-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Dark theme adjustments for dropdown */
.profound-feedback-panel[data-theme="dark"] .markdown-toolbar-dropdown-menu {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.profound-feedback-panel[data-theme="dark"] .markdown-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.profound-feedback-panel .follow-up-editor-container {
  position: relative;
  flex: 1;
  min-width: 0;
}

.profound-feedback-panel .follow-up-editor-container .markdown-editor {
  min-height: 60px;
  max-height: 160px;
  padding: 8px 50px 8px 10px; /* Right padding reserves space for submit button */
  border: none;
  border-radius: 0;
  font-size: 14px;
  line-height: 1.4;
  overflow-y: auto;
  background: transparent;
  color: var(--feedback-text);
  text-align: left;
  white-space: normal !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
}

.profound-feedback-panel .follow-up-editor-container .markdown-editor:focus {
  outline: none;
}

.profound-feedback-panel .follow-up-editor-container .markdown-editor[data-placeholder]:empty:before {
  content: attr(data-placeholder);
  color: var(--feedback-text-muted);
  pointer-events: none;
}

/* Normalize markdown block spacing inside the injected widget instead of
   inheriting host-page/default browser styles. */
.profound-feedback-panel .markdown-editor > :first-child {
  margin-top: 0 !important;
}

.profound-feedback-panel .markdown-editor > :last-child {
  margin-bottom: 0 !important;
}

.profound-feedback-panel .markdown-editor p {
  margin: 8px 0 !important;
}

/* List styles for markdown editor content */
.profound-feedback-panel .markdown-editor ul,
.profound-feedback-panel .markdown-editor ol {
  margin: 8px 0 !important;
  margin-left: 0 !important;
  padding-left: 24px !important;
  text-indent: 0 !important;
  list-style-position: outside !important;
}

.profound-feedback-panel .markdown-editor ul {
  list-style-type: disc !important;
}

.profound-feedback-panel .markdown-editor ol {
  list-style-type: decimal !important;
}

.profound-feedback-panel .markdown-editor li {
  margin: 4px 0 !important;
  text-indent: 0 !important;
  margin-left: 0 !important;
}

/* QA mode: larger editor */
.profound-feedback-panel .qa-form-field .follow-up-editor-container .markdown-editor {
  min-height: 100px;
}

/* Position submit button centered relative to editor container */
.profound-feedback-panel .follow-up-input-row {
  position: relative;
}

.profound-feedback-panel .follow-up-input-row > .inline-follow-up-submit {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

/* When toolbar is visible, offset the button to center on editor area only */
.profound-feedback-panel .feedback-editor-wrapper:has(.follow-up-toolbar:not(.follow-up-toolbar-hidden)) ~ .inline-follow-up-submit {
  /* Toolbar is ~41px (6px padding * 2 + 28px button + 1px border), so offset by half */
  top: calc(50% + 20px);
}

/* Selected element info */
.profound-feedback-panel .element-info {
  padding: 12px;
  background: var(--feedback-surface-muted);
  border-left: 4px solid #3f72ff;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profound-feedback-panel .element-info strong {
  display: block;
  margin-bottom: 4px;
  color: var(--feedback-text);
}

.profound-feedback-panel .element-info .selected-elements-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 200px;
  overflow-y: auto;
}

.profound-feedback-panel .element-info .selected-element-item {
  display: flex;
  align-items: start;
  gap: 8px;
  padding: 6px;
  background: var(--feedback-surface);
  border-radius: 4px;
  border: 1px solid var(--feedback-border);
}

.profound-feedback-panel .element-info span {
  flex: 1;
  font-family: monospace;
  word-break: break-all;
}

.profound-feedback-panel .btn-mini {
  background: none;
  border: none;
  color: var(--feedback-text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

.profound-feedback-panel .btn-mini:hover {
  background: rgba(0, 0, 0, 0.1);
}

.profound-feedback-panel .feedback-body label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
  color: var(--feedback-text);
}

/* Action buttons */
.profound-feedback-panel .feedback-actions {
  display: flex;
  gap: 8px;
}

.profound-feedback-panel .btn-secondary {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: var(--feedback-text);
  box-shadow: none;
}

.profound-feedback-panel .btn-secondary svg {
  display: inline-block;
  flex-shrink: 0;
}

.profound-feedback-panel .btn-secondary:hover:not(:disabled) {
  background: var(--feedback-surface-hover);
  border-color: var(--feedback-accent);
  color: var(--feedback-text);
  box-shadow: 0 6px 18px var(--feedback-button-glow);
}

.profound-feedback-panel .btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Advanced options */
.profound-feedback-panel .advanced-options {
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  padding: 0;
}

.profound-feedback-panel .advanced-options summary {
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 500;
  background: var(--feedback-surface-muted);
  border-radius: 4px;
  transition: background 0.2s;
  color: var(--feedback-text);
}

.profound-feedback-panel .advanced-options summary:hover {
  background: var(--feedback-surface-muted);
}

.profound-feedback-panel .advanced-options[open] summary {
  border-bottom: 1px solid var(--feedback-border);
  border-radius: 4px 4px 0 0;
}

.profound-feedback-panel #context-options {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profound-feedback-panel #context-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: normal;
  margin: 0;
  cursor: pointer;
}

/* Toast notification */
.profound-feedback-toast {
  position: fixed;
  bottom: 90px;
  right: 20px;
  background: var(--feedback-text);
  color: var(--feedback-surface);
  padding: 14px 20px;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000000;
  font-size: 14px;
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profound-feedback-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Selection overlay */
#element-selection-overlay {
  box-shadow: 0 0 0 2px rgba(63, 114, 255, 0.5);
  transition: all 0.1s ease;
}

/* Persistent selection indicators */
.profound-selected-element-indicator {
  position: fixed;
  pointer-events: none;
  border: 3px solid #f4b740;
  background: rgba(244, 183, 64, 0.15);
  z-index: 999997;
  box-shadow: 0 0 0 1px rgba(244, 183, 64, 0.3), 0 4px 12px rgba(244, 183, 64, 0.4);
  transition: all 0.2s ease;
}

.profound-selected-element-indicator::after {
  content: '';
  position: absolute;
  top: -12px;
  right: -12px;
  width: 24px;
  height: 24px;
  background: #f4b740;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>');
  background-size: 14px 14px;
  background-position: center;
  background-repeat: no-repeat;
  pointer-events: auto;
  cursor: pointer;
  z-index: 1;
}

.profound-selected-element-indicator::after:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

/* Scrollbar styling - SCOPED */
.profound-feedback-panel .activity-feed::-webkit-scrollbar,
.profound-feedback-panel .feedback-body::-webkit-scrollbar,
.profound-feedback-panel .selected-elements-list::-webkit-scrollbar,
.profound-feedback-panel .attached-files-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.profound-feedback-panel .activity-feed::-webkit-scrollbar-track,
.profound-feedback-panel .feedback-body::-webkit-scrollbar-track,
.profound-feedback-panel .selected-elements-list::-webkit-scrollbar-track,
.profound-feedback-panel .attached-files-list::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.profound-feedback-panel .activity-feed::-webkit-scrollbar-thumb,
.profound-feedback-panel .feedback-body::-webkit-scrollbar-thumb,
.profound-feedback-panel .selected-elements-list::-webkit-scrollbar-thumb,
.profound-feedback-panel .attached-files-list::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4px;
}

.profound-feedback-panel .activity-feed::-webkit-scrollbar-thumb:hover,
.profound-feedback-panel .feedback-body::-webkit-scrollbar-thumb:hover,
.profound-feedback-panel .selected-elements-list::-webkit-scrollbar-thumb:hover,
.profound-feedback-panel .attached-files-list::-webkit-scrollbar-thumb:hover {
  background: #a1a1a1;
}

/* Attached files list */
.profound-feedback-panel .attached-files-list {
  margin-top: 8px;
  padding: 8px;
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  max-height: 150px;
  overflow-y: auto;
}

.profound-feedback-panel .attached-file-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  margin-bottom: 6px;
  font-size: 0.9em;
}

.profound-feedback-panel .attached-file-item:last-child {
  margin-bottom: 0;
}

.profound-feedback-panel .attached-file-item .file-name {
  flex: 1;
  font-weight: 500;
  color: var(--feedback-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.profound-feedback-panel .attached-file-item .file-size {
  color: var(--feedback-text-muted);
  font-size: 0.85em;
  font-weight: normal;
  white-space: nowrap;
}

.profound-feedback-panel .attached-file-item .remove-file-btn {
  padding: 4px;
  cursor: pointer;
  color: var(--feedback-text-muted);
  background: transparent;
  border: none;
  line-height: 1;
  border-radius: 3px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profound-feedback-panel .attached-file-item .remove-file-btn:hover {
  color: #e74c3c;
  background: var(--feedback-surface-muted);
}

.profound-feedback-panel .attached-file-edit {
  background: none;
  border: none;
  color: #3f72ff;
  cursor: pointer;
  padding: 4px 8px;
  font-size: 13px;
  transition: opacity 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.profound-feedback-panel .attached-file-edit svg {
  stroke: currentColor;
  flex-shrink: 0;
}

.profound-feedback-panel .attached-file-edit:hover {
  opacity: 0.7;
}

/* Image Editor Modal */
.profound-image-editor-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000001;
  align-items: center;
  justify-content: center;
}

.profound-image-editor-modal .image-editor-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
}

.profound-image-editor-modal .image-editor-content {
  position: relative;
  width: 98%;
  height: 96vh;
  background: var(--feedback-surface);
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
}

.profound-image-editor-modal .image-editor-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--feedback-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profound-image-editor-modal .image-editor-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.profound-image-editor-modal .image-editor-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
}

.profound-image-editor-modal #profound-image-editor-container {
  width: 100%;
  height: 100%;
}

.profound-image-editor-modal .image-editor-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--feedback-border);
  display: flex;
  gap: 12px;
  background: var(--feedback-surface-muted);
  justify-content: flex-end;
  align-items: center;
}

.profound-image-editor-modal .image-editor-footer .btn-ghost {
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  color: var(--feedback-text-muted);
  font-size: 15px;
  padding: 10px 24px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
}

.profound-image-editor-modal .image-editor-footer .btn-ghost:hover {
  background: var(--feedback-surface-muted);
  border-color: var(--feedback-border);
}

.profound-image-editor-modal .image-editor-footer .btn-primary {
  background: #5865f2;
  border: none;
  padding: 10px 24px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 6px;
  color: white;
  cursor: pointer;
}

.profound-image-editor-modal .image-editor-footer .btn-primary:hover {
  background: #4752c4;
}

/* Screenshot Loading Overlay */
.profound-screenshot-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000002;
}

.profound-screenshot-loading .loading-content {
  background: var(--feedback-surface);
  padding: 30px 40px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.profound-screenshot-loading .loading-spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 15px;
  border: 4px solid #f0f0f0;
  border-top: 4px solid #3f72ff;
  border-radius: 50%;
  animation: profound-spin 0.8s linear infinite;
}

.profound-screenshot-loading .loading-text {
  font-size: 14px;
  color: var(--feedback-text);
  font-weight: 500;
}

@keyframes profound-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Screenshot Progress Bar */
.profound-screenshot-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(63, 114, 255, 0.2);
  overflow: hidden;
  z-index: 1000003;
}

.profound-screenshot-progress::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  background: #4a7bff;
  box-shadow: 0 0 10px rgba(74, 123, 255, 0.8), 0 0 5px rgba(74, 123, 255, 0.5);
  animation: profound-indeterminate 1.2s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
}

@keyframes profound-indeterminate {
  0% { left: -40%; }
  100% { left: 100%; }
}

/* TUI Image Editor Fixes - Scoped to modal */
.profound-image-editor-modal #profound-image-editor-container * {
  box-sizing: border-box !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-header {
  display: none !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-help-menu {
  display: block !important;
  z-index: 100 !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-history-item {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.profound-image-editor-modal #profound-image-editor-container .history-item-icon,
.profound-image-editor-modal #profound-image-editor-container .history-item-checkbox {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  flex-shrink: 0 !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-controls * {
  visibility: visible !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-controls {
  z-index: 100 !important;
}

.profound-image-editor-modal #profound-image-editor-container [tooltip-content] {
  position: relative !important;
  z-index: 10 !important;
}

.profound-image-editor-modal #profound-image-editor-container [tooltip-content]::before,
.profound-image-editor-modal #profound-image-editor-container [tooltip-content]::after {
  z-index: 20 !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-item {
  position: relative !important;
  z-index: 10 !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-item::before,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-item::after {
  z-index: 20 !important;
}

.profound-image-editor-modal .image-editor-body #profound-image-editor-container {
  width: 100%;
  height: 100%;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-container {
  width: 100% !important;
  height: 100% !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-main-container,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-menu,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu-container,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-header,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-controls,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-controls-buttons,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-controls-logo {
  visibility: visible !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-main {
  top: 64px !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-wrap {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  text-align: center !important;
  padding-top: 130px !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-canvas-container {
  width: auto !important;
  max-width: 100% !important;
  margin: 0 auto !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu-container {
  z-index: 1000 !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu {
  z-index: 1000 !important;
  text-align: center !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu > div,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu * {
  z-index: inherit !important;
  visibility: visible !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu-item {
  justify-content: center !important;
  text-align: center !important;
  margin: 0 auto !important;
  display: flex !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-submenu > div {
  margin: 0 auto !important;
}

.profound-image-editor-modal #profound-image-editor-container canvas[class*="upper-canvas"] .canvas-container .rotating-point,
.profound-image-editor-modal #profound-image-editor-container .canvas-container .mtr {
  display: none !important;
  visibility: hidden !important;
}

.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-main,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-wrap,
.profound-image-editor-modal #profound-image-editor-container .tui-image-editor-canvas-container,
.profound-image-editor-modal #profound-image-editor-container .lower-canvas,
.profound-image-editor-modal #profound-image-editor-container .upper-canvas,
.profound-image-editor-modal #profound-image-editor-container canvas {
  z-index: 1 !important;
}

/* Activity Detail Modal */
.profound-feedback-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profound-feedback-modal[hidden] {
  display: none;
}

.profound-feedback-modal .modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.profound-feedback-modal .modal-content {
  position: relative;
  background: var(--feedback-surface);
  border-radius: 8px;
  border: 1px solid var(--feedback-border);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: width 0.25s ease, height 0.25s ease, max-width 0.25s ease, max-height 0.25s ease, border-radius 0.25s ease, top 0.25s ease, left 0.25s ease;
}

.profound-feedback-modal.maximized {
  padding: 0 !important;
  display: block !important;
}

.profound-feedback-modal.maximized[hidden] {
  display: none !important;
}

.profound-feedback-modal.maximized .modal-content {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  border-radius: 0;
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  z-index: 1000001;
  transition: width 0.25s ease, height 0.25s ease, max-width 0.25s ease, max-height 0.25s ease, border-radius 0.25s ease, top 0.25s ease, left 0.25s ease;
}

.profound-feedback-modal .modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--feedback-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.profound-feedback-modal .modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profound-feedback-modal .modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--feedback-text);
}

.profound-feedback-modal .modal-close {
  background: none;
  border: none;
  font-size: 28px;
  line-height: 1;
  color: var(--feedback-text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.profound-feedback-modal .modal-close:hover {
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
}
.profound-feedback-modal .icon-btn {
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: var(--feedback-text-muted);
  cursor: pointer;
  padding: 0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.profound-feedback-modal .icon-btn:hover {
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
}

.profound-feedback-modal .icon-btn.active {
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
}

.profound-feedback-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.profound-feedback-modal .modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--feedback-border);
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}
.profound-feedback-modal .activity-raw-json {
  margin-top: 20px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--feedback-border);
  background: var(--feedback-surface-muted);
}

.profound-feedback-modal .activity-raw-json-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--feedback-text-muted);
  margin-bottom: 8px;
}

.profound-feedback-modal .activity-raw-json-content {
  margin: 0;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  max-height: 300px;
}

/* Detail Modal Content Styles */
.profound-feedback-modal .user-instruction-detail {
  padding: 16px !important;
  background: rgba(46, 182, 125, 0.05) !important;
  border-radius: 6px !important;
  border-left: 3px solid #2eb67d !important;
  font-family: inherit !important;
  line-height: 1.6 !important;
  color: var(--feedback-text) !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.profound-feedback-modal .agent-response-detail {
  padding: 16px !important;
  background: rgba(63, 114, 255, 0.04) !important;
  border-radius: 6px !important;
  border-left: 3px solid #3f72ff !important;
  font-family: inherit !important;
  line-height: 1.6 !important;
  color: var(--feedback-text) !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

.profound-feedback-modal .thinking-detail {
  font-family: inherit !important;
  line-height: 1.6 !important;
  color: var(--feedback-text) !important;
  white-space: normal !important;
  word-wrap: break-word !important;
  overflow-wrap: break-word !important;
}

/* Content Typography in Modal */
.profound-feedback-modal h1,
.profound-feedback-modal h2,
.profound-feedback-modal h3,
.profound-feedback-modal h4 {
  margin: 16px 0 12px 0 !important;
  font-weight: 600 !important;
  color: var(--feedback-text) !important;
}

.profound-feedback-modal p {
  margin: 0 0 12px 0 !important;
  line-height: 1.6 !important;
}

.profound-feedback-modal ul,
.profound-feedback-modal ol,
.profound-feedback-panel .thinking-detail ul,
.profound-feedback-panel .thinking-detail ol,
.profound-feedback-panel .user-instruction-detail ul,
.profound-feedback-panel .user-instruction-detail ol,
.profound-feedback-panel .agent-response-detail ul,
.profound-feedback-panel .agent-response-detail ol,
.profound-feedback-panel .plan-detail ul,
.profound-feedback-panel .plan-detail ol {
  margin: 8px 0 12px 0 !important;
  margin-left: 0 !important;
  padding-left: 24px !important;
  text-indent: 0 !important;
  list-style-position: outside !important;
}

.profound-feedback-modal ul,
.profound-feedback-panel .thinking-detail ul,
.profound-feedback-panel .user-instruction-detail ul,
.profound-feedback-panel .agent-response-detail ul,
.profound-feedback-panel .plan-detail ul {
  list-style-type: disc !important;
}

.profound-feedback-modal ol,
.profound-feedback-panel .thinking-detail ol,
.profound-feedback-panel .user-instruction-detail ol,
.profound-feedback-panel .agent-response-detail ol,
.profound-feedback-panel .plan-detail ol {
  list-style-type: decimal !important;
}

.profound-feedback-modal li,
.profound-feedback-panel .thinking-detail li,
.profound-feedback-panel .user-instruction-detail li,
.profound-feedback-panel .agent-response-detail li,
.profound-feedback-panel .plan-detail li {
  margin: 4px 0 !important;
  text-indent: 0 !important;
  margin-left: 0 !important;
}

.profound-feedback-modal pre {
  background: #2d2d2d !important;
  color: #f8f8f2 !important;
  padding: 12px !important;
  border-radius: 4px !important;
  overflow-x: auto !important;
  margin: 12px 0 !important;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  white-space: pre-wrap !important;
  word-wrap: break-word !important;
}

.profound-feedback-modal code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
}

.profound-feedback-modal :not(pre) > code {
  background: rgba(0, 0, 0, 0.06) !important;
  padding: 2px 6px !important;
  border-radius: 3px !important;
  color: #c7254e !important;
}

/* Buttons in modal */
.profound-feedback-modal .btn-ghost {
  background: transparent;
  color: var(--feedback-text-muted);
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.profound-feedback-modal .btn-ghost:hover {
  background: var(--feedback-surface-muted);
}

/* Task Progress / Todo List (scoped for content pages) */
.profound-feedback-modal .task-progress-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 8px 4px 16px;
}

.profound-feedback-modal .task-progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profound-feedback-modal .task-progress-track {
  flex: 1;
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
}

.profound-feedback-modal .task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.profound-feedback-modal .task-progress-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--feedback-text-muted);
  min-width: 40px;
  text-align: right;
}

.profound-feedback-modal .task-todo-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: relative;
}

.profound-feedback-modal .task-todo-list::before {
  content: '';
  position: absolute;
  top: 20px;
  bottom: 20px;
  left: 25px;
  width: 2px;
  background-color: #e2e8f0;
  z-index: 0;
}

.profound-feedback-modal .task-todo-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
  z-index: 1;
  padding: 6px 10px;
  border-radius: 8px;
}

.profound-feedback-modal .task-todo-item.status-completed {
  background: rgba(46, 182, 125, 0.08);
}

.profound-feedback-modal .task-todo-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 600;
  background-color: var(--feedback-surface);
  transition: all 0.2s ease;
}

.profound-feedback-modal .task-todo-icon.icon-completed {
  background-color: #10b981;
  color: white;
  border: 2px solid #10b981;
}

.profound-feedback-modal .task-todo-icon.icon-completed svg {
  width: 16px;
  height: 16px;
}

.profound-feedback-modal .task-todo-icon.icon-in-progress {
  border: 2px solid #3b82f6;
  color: #3b82f6;
  background-color: var(--feedback-surface);
}

.profound-feedback-modal .task-todo-icon.icon-in-progress svg {
  width: 16px;
  height: 16px;
  animation: task-spin 2s linear infinite;
}

.profound-feedback-modal .task-todo-icon.icon-pending {
  border: 2px solid #e2e8f0;
  color: #94a3b8;
  background-color: var(--feedback-surface);
}

.profound-feedback-modal .task-todo-content {
  font-size: 15px;
  line-height: 1.5;
  color: var(--feedback-text);
  padding-top: 3px;
  font-weight: 500;
}

.profound-feedback-modal .task-todo-item.status-completed .task-todo-content {
  color: var(--feedback-text-muted);
}

@keyframes task-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Error Modal */
.profound-feedback-error-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000000;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(2px);
}

.profound-feedback-error-overlay.show {
  opacity: 1;
}

.profound-feedback-error-modal {
  background: var(--feedback-surface);
  border-radius: 12px;
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.profound-feedback-error-overlay.show .profound-feedback-error-modal {
  transform: scale(1);
}

.profound-feedback-error-icon {
  color: #e74c3c;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.profound-feedback-error-icon svg {
  width: 64px;
  height: 64px;
}

.profound-feedback-error-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--feedback-text);
  margin: 0 0 12px 0;
}

.profound-feedback-error-message {
  font-size: 15px;
  color: var(--feedback-text);
  line-height: 1.6;
  margin: 0 0 24px 0;
  white-space: pre-wrap;
}

.profound-feedback-error-button {
  background: linear-gradient(135deg, #3f72ff 0%, #3158c9 100%);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 32px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 12px rgba(63, 114, 255, 0.3);
}

.profound-feedback-error-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(63, 114, 255, 0.4);
}

.profound-feedback-error-button:active {
  transform: translateY(0);
}

/* Loading state for submit button */
.profound-feedback-panel .btn-loading {
  animation: profound-pulse-loading 1.5s ease-in-out infinite;
}

.profound-feedback-panel .inline-follow-up-submit.btn-loading {
  width: auto !important;
  min-width: 100px !important;
  border-radius: 18px !important;
  padding: 0 12px !important;
  font-size: 13px !important;
  /* Keep absolute positioning, but adjust position */
  right: 6px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
}

@keyframes profound-pulse-loading {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; }
}

/* Tool Detail Styling - Scoped to Modal */
.profound-feedback-modal .tool-detail {
  font-family: inherit;
  line-height: 1.5;
  color: var(--feedback-text);
}

.profound-feedback-modal .tool-section {
  margin-bottom: 16px;
}

.profound-feedback-modal .tool-section:last-child {
  margin-bottom: 0;
}

.profound-feedback-modal .tool-section-header {
  font-weight: 600;
  font-size: 13px;
  color: var(--feedback-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.profound-feedback-modal .tool-code {
  background: var(--feedback-surface-muted) !important;
  border: 1px solid var(--feedback-border) !important;
  border-radius: 4px !important;
  padding: 12px !important;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  overflow-x: auto !important;
  color: var(--feedback-text) !important;
  margin: 0 !important;
}

.profound-feedback-modal .tool-output {
  background: #2d2d2d !important;
  border: 1px solid #404040 !important;
  border-radius: 4px !important;
  padding: 12px !important;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
  overflow-x: auto !important;
  color: #f8f8f2 !important;
  margin: 0 !important;
  max-height: 400px !important;
  overflow-y: auto !important;
}

.profound-feedback-modal .file-path {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
  color: #3f72ff !important;
  background: rgba(63, 114, 255, 0.08) !important;
  padding: 6px 10px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  word-break: break-all !important;
}

.profound-feedback-modal .error-section .tool-section-header {
  color: #ef5350 !important;
}

.profound-feedback-modal .error-output {
  background: #2d1f1f !important;
  border-color: #ef5350 !important;
  color: #ff6b6b !important;
}

.profound-feedback-modal .success-message {
  color: #2eb67d !important;
  font-size: 14px !important;
  padding: 8px 12px !important;
  background: rgba(46, 182, 125, 0.1) !important;
  border-radius: 4px !important;
  border-left: 3px solid #2eb67d !important;
}

.profound-feedback-modal .exit-code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 24px !important;
  font-weight: bold !important;
  padding: 12px !important;
  border-radius: 4px !important;
  display: inline-block !important;
  min-width: 60px !important;
  text-align: center !important;
}

.profound-feedback-modal .exit-code.success {
  color: #2eb67d !important;
  background: rgba(46, 182, 125, 0.1) !important;
  border: 2px solid #2eb67d !important;
}

.profound-feedback-modal .exit-code.error {
  color: #ef5350 !important;
  background: rgba(239, 83, 80, 0.1) !important;
  border: 2px solid #ef5350 !important;
}

.profound-feedback-modal .inline-code {
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace !important;
  font-size: 13px !important;
  background: rgba(0, 0, 0, 0.06) !important;
  padding: 3px 8px !important;
  border-radius: 3px !important;
  color: #c7254e !important;
}

.profound-feedback-modal .muted-text {
  color: var(--feedback-text-muted) !important;
  font-style: italic !important;
}

/* Diff section */
.profound-feedback-modal .diff-section {
  position: relative;
}

.profound-feedback-modal .diff-section .tool-output.old-string {
  background: #2d1f1f !important;
  border-left: 3px solid #ef5350 !important;
}

.profound-feedback-modal .diff-section .tool-output.new-string {
  background: #1f2d1f !important;
  border-left: 3px solid #66bb6a !important;
}

.profound-feedback-modal .diff-section .tool-output.old-string::before {
  content: '−';
  position: absolute;
  left: -16px;
  color: #ef5350;
  font-weight: bold;
}

.profound-feedback-modal .diff-section .tool-output.new-string::before {
  content: '+';
  position: absolute;
  left: -16px;
  color: #66bb6a;
  font-weight: bold;
}

/* Side-by-side diff for Edit tool */
.profound-feedback-modal .edit-diff-summary {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 8px 12px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border-radius: 6px !important;
  font-size: 13px !important;
}

.profound-feedback-modal .edit-diff-mode {
  color: var(--feedback-text-muted) !important;
}

.profound-feedback-modal .edit-diff-stats {
  display: flex !important;
  gap: 12px !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 12px !important;
}

.profound-feedback-modal .edit-diff-removed {
  color: #ef5350 !important;
}

.profound-feedback-modal .edit-diff-added {
  color: #66bb6a !important;
}

.profound-feedback-modal .edit-diff-container {
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  font-family: "JetBrains Mono", monospace !important;
  font-size: 12px !important;
}

.profound-feedback-modal .edit-diff-header {
  display: flex !important;
  background: rgba(63, 114, 255, 0.08) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.profound-feedback-modal .edit-diff-header-left,
.profound-feedback-modal .edit-diff-header-right {
  flex: 1 !important;
  padding: 8px 14px !important;
  font-weight: 600 !important;
  font-size: 11px !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  color: var(--feedback-text-muted) !important;
}

.profound-feedback-modal .edit-diff-header-left {
  border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: rgba(239, 83, 80, 0.05) !important;
  color: #ef5350 !important;
}

.profound-feedback-modal .edit-diff-header-right {
  background: rgba(102, 187, 106, 0.05) !important;
  color: #66bb6a !important;
}

.profound-feedback-modal .edit-diff-body {
  max-height: 500px !important;
  overflow-y: auto !important;
}

.profound-feedback-modal .edit-diff-row {
  display: flex !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.profound-feedback-modal .edit-diff-row:last-child {
  border-bottom: none !important;
}

.profound-feedback-modal .edit-diff-side {
  flex: 1 !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

.profound-feedback-modal .edit-diff-left {
  border-right: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.profound-feedback-modal .edit-diff-line {
  display: flex !important;
  align-items: stretch !important;
  white-space: pre !important;
  min-height: 22px !important;
}

.profound-feedback-modal .edit-diff-line-num {
  display: inline-block !important;
  padding: 2px 8px !important;
  text-align: right !important;
  color: var(--feedback-text-muted) !important;
  background: rgba(0, 0, 0, 0.15) !important;
  user-select: none !important;
  min-width: 45px !important;
  font-size: 11px !important;
}

.profound-feedback-modal .edit-diff-prefix {
  display: inline-block !important;
  width: 16px !important;
  padding: 2px 4px !important;
  text-align: center !important;
  font-weight: bold !important;
  user-select: none !important;
}

.profound-feedback-modal .edit-diff-content {
  flex: 1 !important;
  padding: 2px 8px !important;
  white-space: pre-wrap !important;
  word-break: break-all !important;
  overflow-wrap: break-word !important;
}

/* Diff line states */
.profound-feedback-modal .edit-diff-add {
  background: rgba(102, 187, 106, 0.15) !important;
}

.profound-feedback-modal .edit-diff-add .edit-diff-prefix {
  color: #66bb6a !important;
}

.profound-feedback-modal .edit-diff-add .edit-diff-content {
  background: rgba(102, 187, 106, 0.1) !important;
}

.profound-feedback-modal .edit-diff-remove {
  background: rgba(239, 83, 80, 0.15) !important;
}

.profound-feedback-modal .edit-diff-remove .edit-diff-prefix {
  color: #ef5350 !important;
}

.profound-feedback-modal .edit-diff-remove .edit-diff-content {
  background: rgba(239, 83, 80, 0.1) !important;
}

.profound-feedback-modal .edit-diff-context {
  background: transparent !important;
}

.profound-feedback-modal .edit-diff-context .edit-diff-prefix {
  color: transparent !important;
}

.profound-feedback-modal .edit-diff-empty {
  background: rgba(128, 128, 128, 0.08) !important;
}

.profound-feedback-modal .edit-diff-empty .edit-diff-line-num {
  color: transparent !important;
}

.profound-feedback-modal .edit-diff-empty .edit-diff-prefix {
  color: transparent !important;
}

.profound-feedback-modal .edit-diff-empty .edit-diff-content {
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(128, 128, 128, 0.05) 4px,
    rgba(128, 128, 128, 0.05) 8px
  ) !important;
}

.profound-feedback-modal .external-link {
  color: #3f72ff !important;
  text-decoration: none !important;
  word-break: break-all !important;
}

.profound-feedback-modal .external-link:hover {
  text-decoration: underline !important;
}

/* IBM i detail styling in shared activity modal */
.profound-feedback-modal .ibmi-detail {
  display: flex !important;
  flex-direction: column !important;
  gap: 12px !important;
}

.profound-feedback-modal .ibmi-detail-header {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
  align-items: center !important;
}

.profound-feedback-modal .ibmi-detail-badge,
.profound-feedback-modal .ibmi-detail-session,
.profound-feedback-modal .ibmi-detail-op {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

.profound-feedback-modal .ibmi-detail-badge {
  background: rgba(63, 114, 255, 0.14) !important;
  color: var(--feedback-accent) !important;
}

.profound-feedback-modal .ibmi-detail-badge-build {
  background: rgba(46, 182, 125, 0.14) !important;
  color: #2eb67d !important;
}

.profound-feedback-modal .ibmi-detail-session {
  background: var(--feedback-surface-muted) !important;
  color: var(--feedback-text) !important;
  border: 1px solid var(--feedback-border) !important;
}

.profound-feedback-modal .ibmi-detail-op {
  background: rgba(63, 114, 255, 0.08) !important;
  color: var(--feedback-text-muted) !important;
}

.profound-feedback-modal .ibmi-detail-summary {
  font-size: 13px !important;
  color: var(--feedback-text-muted) !important;
}

.profound-feedback-modal .ibmi-screen-preview .iframe-wrapper,
.profound-feedback-modal .iframe-wrapper {
  position: relative !important;
  overflow: hidden !important;
  min-height: 260px !important;
  max-height: 420px !important;
  margin: 0 !important;
  border: 1px solid var(--feedback-border) !important;
  border-radius: 12px !important;
  background: var(--feedback-surface-muted) !important;
}

.profound-feedback-modal .aitool-ibmi-screen-render {
  display: block !important;
  width: 100% !important;
  min-height: 320px !important;
  border: 0 !important;
  background: #ffffff !important;
}

.profound-feedback-modal .iframe-overlay {
  position: absolute !important;
  inset: 0 !important;
  background: transparent !important;
}

.profound-feedback-modal .ibmi-5250-screen-shell {
  position: relative !important;
  overflow: hidden !important;
  border: 1px solid rgba(102, 255, 153, 0.18) !important;
  border-radius: 12px !important;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.03) 1px, transparent 1px, transparent 3px),
    linear-gradient(180deg, #07170e 0%, #031108 100%) !important;
  box-shadow: inset 0 0 0 1px rgba(102, 255, 153, 0.05) !important;
}

.profound-feedback-modal .ibmi-5250-screen-header {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  padding: 10px 12px !important;
  border-bottom: 1px solid rgba(102, 255, 153, 0.12) !important;
  color: #d4ffe5 !important;
}

.profound-feedback-modal .ibmi-5250-screen-pill {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  background: rgba(102, 255, 153, 0.12) !important;
  color: #b7ffd0 !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

.profound-feedback-modal .ibmi-5250-screen-title {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #d4ffe5 !important;
}

.profound-feedback-modal .ibmi-5250-screen-text {
  margin: 0 !important;
  padding: 14px 16px 16px !important;
  overflow-x: auto !important;
  color: #9df7bf !important;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  white-space: pre !important;
}

.profound-feedback-modal .ibmi-session-nav {
  display: flex !important;
  flex-direction: column !important;
  gap: 8px !important;
  padding: 10px 12px !important;
  border: 1px solid var(--feedback-border) !important;
  border-radius: 10px !important;
  background: var(--feedback-surface-muted) !important;
}

.profound-feedback-modal .ibmi-session-nav-header,
.profound-feedback-modal .ibmi-session-nav-controls,
.profound-feedback-modal .ibmi-session-nav-dots {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.profound-feedback-modal .ibmi-session-nav-header {
  justify-content: space-between !important;
}

.profound-feedback-modal .ibmi-session-nav-title {
  font-size: 12px !important;
  font-weight: 600 !important;
}

.profound-feedback-modal .ibmi-session-nav-count {
  font-size: 11px !important;
  color: var(--feedback-text-muted) !important;
}

.profound-feedback-modal .ibmi-session-nav-dots {
  flex-wrap: wrap !important;
  justify-content: center !important;
}

.profound-feedback-modal .ibmi-session-nav-btn {
  border: 1px solid var(--feedback-border) !important;
  background: var(--feedback-surface) !important;
  color: var(--feedback-text-muted) !important;
  border-radius: 999px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.profound-feedback-modal .ibmi-session-nav-btn:hover:not(:disabled) {
  border-color: var(--feedback-accent) !important;
  color: var(--feedback-text) !important;
  background: var(--feedback-surface-hover) !important;
}

.profound-feedback-modal .ibmi-session-nav-btn:disabled {
  opacity: 0.45 !important;
  cursor: default !important;
}

.profound-feedback-modal .ibmi-session-nav-arrow {
  padding: 6px 10px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
}

.profound-feedback-modal .ibmi-session-nav-dot {
  min-width: 28px !important;
  height: 28px !important;
  padding: 0 8px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
}

.profound-feedback-modal .ibmi-session-nav-dot.active {
  background: var(--feedback-accent) !important;
  border-color: var(--feedback-accent) !important;
  color: #ffffff !important;
}

.profound-feedback-modal .ibmi-compile-target-list,
.profound-feedback-modal .ibmi-compile-steps {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 8px !important;
}

.profound-feedback-modal .ibmi-compile-meta-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
  gap: 10px !important;
}

.profound-feedback-modal .ibmi-compile-meta-grid > div {
  padding: 10px 12px !important;
  border: 1px solid var(--feedback-border) !important;
  border-radius: 8px !important;
  background: var(--feedback-surface-muted) !important;
}

.profound-feedback-modal .ibmi-compile-meta-label {
  display: block !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--feedback-text-muted) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  margin-bottom: 4px !important;
}

.profound-feedback-modal .ibmi-compile-meta-value {
  font-size: 13px !important;
  color: var(--feedback-text) !important;
  word-break: break-word !important;
}

.profound-feedback-modal .ibmi-compile-step {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 8px 10px !important;
  border-radius: 8px !important;
  background: var(--feedback-surface-muted) !important;
  border: 1px solid var(--feedback-border) !important;
}

.profound-feedback-modal .ibmi-compile-step-verb {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.04em !important;
  color: var(--feedback-accent) !important;
}

.profound-feedback-modal .ibmi-compile-step-target {
  font-size: 13px !important;
  color: var(--feedback-text) !important;
}

.profound-feedback-modal .ibmi-detail-raw-command summary {
  cursor: pointer !important;
  color: var(--feedback-text-muted) !important;
}

/* Context preview dialog */
.profound-feedback-preview-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  z-index: 1000000;
}

.profound-feedback-preview {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80%;
  max-width: 900px;
  max-height: 80vh;
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  z-index: 1000001;
  display: flex;
  flex-direction: column;
  color: var(--feedback-text);
}

.profound-feedback-preview .preview-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--feedback-border);
  background: var(--feedback-surface);
}

.profound-feedback-preview .preview-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profound-feedback-preview .preview-title-row h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.profound-feedback-preview .preview-meta {
  margin-top: 8px;
  color: var(--feedback-text-muted);
  font-size: 13px;
}

.profound-feedback-preview .preview-warning {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(244, 183, 64, 0.14);
  border-left: 4px solid #f4b740;
  border-radius: 6px;
  color: var(--feedback-text);
}

.profound-feedback-preview .preview-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
  background: var(--feedback-surface-muted);
}

.profound-feedback-preview .preview-section {
  margin-bottom: 24px;
}

.profound-feedback-preview .preview-section:last-child {
  margin-bottom: 0;
}

.profound-feedback-preview .preview-section-title {
  margin: 0 0 8px 0;
  color: var(--feedback-accent);
  font-size: 14px;
  font-weight: 700;
}

.profound-feedback-preview pre {
  background: var(--feedback-surface);
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  padding: 12px;
  margin: 0;
  max-height: 300px;
  overflow: auto;
  font-size: 12px;
  line-height: 1.4;
  color: var(--feedback-text);
}

.profound-feedback-preview .preview-size {
  margin-top: 6px;
  font-size: 12px;
  color: var(--feedback-text-muted);
}

.profound-feedback-preview .preview-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--feedback-border);
  background: var(--feedback-surface);
  display: flex;
  justify-content: flex-end;
}

.profound-feedback-preview .close-preview-btn {
  padding: 10px 18px;
  background: var(--feedback-accent);
  border: none;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: 0 10px 28px var(--feedback-button-glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.profound-feedback-preview .close-preview-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 34px var(--feedback-button-glow);
}

.profound-feedback-preview .close-preview-btn:active {
  transform: translateY(0);
}

.profound-feedback-preview .preview-close {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--feedback-text-muted);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}

.profound-feedback-preview .preview-close:hover {
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
}

/* ========================================
   QA MODE STYLES
   ======================================== */

/* QA Badge styling */
.feedback-qa-badge {
  background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%) !important;
  color: white !important;
  font-weight: 600;
}

/* QA Capture Form */
.qa-capture-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.qa-capture-form.drag-over {
  border: 2px dashed #3f72ff;
  border-radius: 6px;
  box-shadow: 0 0 0 3px rgba(63,114,255,0.2);
  background: rgba(63,114,255,0.05);
  padding: 8px;
}

.qa-capture-form.drag-over::after {
  content: 'Drop files here';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 8px 16px;
  background: #3f72ff;
  color: white;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  pointer-events: none;
  z-index: 10;
}

.qa-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.qa-form-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--feedback-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.qa-form-field input[type="text"],
.qa-form-field select {
  padding: 8px 12px;
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--feedback-surface);
  color: var(--feedback-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.qa-form-field input[type="text"]:focus,
.qa-form-field select:focus {
  outline: none;
  border-color: var(--feedback-accent);
  box-shadow: 0 0 0 3px rgba(63, 114, 255, 0.15);
}

.qa-form-field input[type="text"]::placeholder,
.qa-form-field textarea::placeholder {
  color: #9ca3af;
  opacity: 1;
}

/* Required field asterisk */
.qa-form-field .required {
  color: #dc2626;
  font-weight: 600;
}

/* Field error messages - hidden by default */
.qa-form-field .field-error {
  display: none;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

/* Show error when field has error class */
.qa-form-field.has-error .field-error {
  display: block;
}

/* Error state for inputs and textareas */
.qa-form-field.has-error input[type="text"],
.qa-form-field.has-error textarea {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.qa-form-field.has-error input[type="text"]:focus,
.qa-form-field.has-error textarea:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

/* Task mode follow-up inline error */
.profound-feedback-panel .follow-up-input-row.has-error .feedback-editor-wrapper {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.profound-feedback-panel .follow-up-input-row.has-error .feedback-editor-wrapper:focus-within {
  border-color: #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

.profound-feedback-panel .follow-up-error {
  display: none;
  font-size: 12px;
  color: #dc2626;
  margin-top: 4px;
}

.profound-feedback-panel .follow-up-input-row.has-error + .follow-up-error {
  display: block;
}

/* QA "Create as objective" checkbox */
.qa-objective-checkbox-field {
  margin-top: 4px;
}

.qa-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 400;
  color: var(--feedback-text);
  user-select: none;
}

.qa-checkbox-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--feedback-accent);
}

.qa-checkbox-label span {
  line-height: 1;
}

/* QA Agent Selector Field */
.qa-agent-selector-field {
  margin-top: 12px;
}

.qa-agent-selector-field > label {
  font-size: 13px;
  color: var(--feedback-text-muted);
  margin-bottom: 8px;
  display: block;
}

/* Override agent-selector styles for compact widget - match home page exactly */
.qa-agent-selector {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.qa-agent-selector .agent-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  background: var(--feedback-surface);
  border: 1.5px solid var(--feedback-border);
  border-radius: 8px;
  padding: 1px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  user-select: none;
}

.qa-agent-selector .agent-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.qa-agent-selector .agent-btn-decrement,
.qa-agent-selector .agent-btn-increment {
  width: 16px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--feedback-text-muted);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  opacity: 0.3;
  outline: none;
}

.qa-agent-selector .agent-btn-decrement:hover,
.qa-agent-selector .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
}

.qa-agent-selector .agent-btn-decrement:active,
.qa-agent-selector .agent-btn-increment:active {
  transform: scale(0.9);
}

.qa-agent-selector .agent-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  transition: all 0.2s ease;
  cursor: pointer;
  border-radius: 6px;
}

.qa-agent-selector .agent-icon:hover {
  background: rgba(0, 0, 0, 0.03);
}

.qa-agent-selector .agent-icon svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
  transition: all 0.2s ease;
}

/* Count Badge - positioned on card, hidden by default */
.qa-agent-selector .agent-count-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--feedback-text);
  color: white;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  opacity: 0;
  transform: scale(0.8);
}

/* Badge hidden when count is 0 */
.qa-agent-selector .agent-card[data-count="0"] .agent-count-badge {
  opacity: 0;
  transform: scale(0.8);
}

/* Active agent card styles - Claude */
.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(217, 119, 87, 0.1) 0%, rgba(217, 119, 87, 0.05) 100%);
  border-color: rgba(217, 119, 87, 0.4);
}

.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-icon svg {
  opacity: 1;
  color: #D97757;
}

.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-btn-decrement,
.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-btn-increment {
  color: #D97757;
  opacity: 0.6;
}

.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-btn-decrement:hover,
.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(217, 119, 87, 0.1);
}

.qa-agent-selector .agent-card[data-agent="claude"]:not([data-count="0"]) .agent-count-badge {
  background: #D97757;
  opacity: 1;
  transform: scale(1);
}

/* Active agent card styles - Codex */
.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(16, 163, 127, 0.1) 0%, rgba(16, 163, 127, 0.05) 100%);
  border-color: rgba(16, 163, 127, 0.4);
}

.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-icon svg {
  opacity: 1;
  color: #10a37f;
}

.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-btn-decrement,
.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-btn-increment {
  color: #10a37f;
  opacity: 0.6;
}

.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-btn-decrement:hover,
.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(16, 163, 127, 0.1);
}

.qa-agent-selector .agent-card[data-agent="codex"]:not([data-count="0"]) .agent-count-badge {
  background: #10a37f;
  opacity: 1;
  transform: scale(1);
}

/* Active agent card styles - Gemini */
.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(66, 133, 244, 0.1) 0%, rgba(66, 133, 244, 0.05) 100%);
  border-color: rgba(66, 133, 244, 0.4);
}

.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-icon svg {
  opacity: 1;
  color: #4285f4;
}

.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-btn-decrement,
.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-btn-increment {
  color: #4285f4;
  opacity: 0.6;
}

.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-btn-decrement:hover,
.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(66, 133, 244, 0.1);
}

.qa-agent-selector .agent-card[data-agent="gemini"]:not([data-count="0"]) .agent-count-badge {
  background: #4285f4;
  opacity: 1;
  transform: scale(1);
}

/* Hover effects for specific agents */
.qa-agent-selector .agent-card[data-agent="claude"]:hover {
  border-color: rgba(217, 119, 87, 0.6);
  box-shadow: 0 4px 16px rgba(217, 119, 87, 0.15);
}

.qa-agent-selector .agent-card[data-agent="codex"]:hover {
  border-color: rgba(16, 163, 127, 0.6);
  box-shadow: 0 4px 16px rgba(16, 163, 127, 0.15);
}

.qa-agent-selector .agent-card[data-agent="gemini"]:hover {
  border-color: rgba(66, 133, 244, 0.6);
  box-shadow: 0 4px 16px rgba(66, 133, 244, 0.15);
}

/* Active agent card styles - Bob */
.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-color: rgba(99, 102, 241, 0.4);
}

.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-icon svg {
  opacity: 1;
  color: #6366F1;
}

.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-btn-decrement,
.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-btn-increment {
  color: #6366F1;
  opacity: 0.6;
}

.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-btn-decrement:hover,
.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(99, 102, 241, 0.1);
}

.qa-agent-selector .agent-card[data-agent="bob"]:not([data-count="0"]) .agent-count-badge {
  background: #6366F1;
  opacity: 1;
  transform: scale(1);
}

.qa-agent-selector .agent-card[data-agent="bob"]:hover {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.15);
}

/* Grok (xAI) - dark near-black accent for visual parity in QA selector */
.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(20, 20, 20, 0.10) 0%, rgba(20, 20, 20, 0.05) 100%);
  border-color: rgba(20, 20, 20, 0.45);
}

.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-icon svg {
  opacity: 1;
  color: #111111;
}

.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-decrement,
.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-increment {
  color: #111111;
  opacity: 0.6;
}

.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-decrement:hover,
.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-increment:hover {
  opacity: 1;
  background: rgba(20, 20, 20, 0.1);
}

.qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-count-badge {
  background: #111111;
  opacity: 1;
  transform: scale(1);
}

.qa-agent-selector .agent-card[data-agent="grok"]:hover {
  border-color: rgba(20, 20, 20, 0.6);
  box-shadow: 0 4px 16px rgba(20, 20, 20, 0.18);
}

/* Dark theme override for Grok in QA selector (keeps xAI logo visible) */
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) {
  background: linear-gradient(135deg, rgba(240, 240, 240, 0.12) 0%, rgba(240, 240, 240, 0.05) 100%);
  border-color: rgba(240, 240, 240, 0.45);
}
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-icon svg,
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-decrement,
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-btn-increment {
  color: #f5f5f5;
}
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:not([data-count="0"]) .agent-count-badge {
  background: #f5f5f5;
  color: #111;
}
:root[data-theme="dark"] .qa-agent-selector .agent-card[data-agent="grok"]:hover {
  border-color: rgba(240, 240, 240, 0.6);
  box-shadow: 0 4px 16px rgba(240, 240, 240, 0.18);
}

/* Hide unconfigured agent cards */
.qa-agent-selector .agent-card.agent-disabled {
  display: none;
}

/* Agent Field */
.qa-agent-field select {
  width: 100%;
}

/* Submit Button */
.qa-submit-btn {
  margin-top: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(135deg, var(--feedback-accent) 0%, #2563eb 100%);
  color: white;
  transition: transform 0.1s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.qa-submit-btn:hover {
  box-shadow: 0 4px 12px rgba(63, 114, 255, 0.3);
  transform: translateY(-1px);
}

.qa-submit-btn:active {
  transform: translateY(0);
}

.qa-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.qa-submit-btn.btn-loading {
  opacity: 0.8;
}

/* QA Button Styling */
.profound-qa-btn {
  background: linear-gradient(135deg, #8e44ad 0%, #6c3483 100%);
}

.profound-qa-btn:hover {
  background: linear-gradient(135deg, #9b59b6 0%, #7d3c98 100%);
  box-shadow: 0 6px 16px rgba(142, 68, 173, 0.5);
}

/* ========================================
   Approve Dialog Styles
   ======================================== */

/* Approve button in header */
.profound-feedback-panel .feedback-approve-btn {
  background: none;
  border: none;
  color: var(--feedback-text-muted);
  cursor: pointer;
  padding: 4px;
  height: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, border-color 0.2s, opacity 0.2s, color 0.2s;
  opacity: 0.8;
}

.profound-feedback-panel .feedback-approve-btn:hover:not(:disabled) {
  background: rgba(46, 182, 125, 0.15);
  color: #2eb67d;
  opacity: 1;
}

.profound-feedback-panel .feedback-approve-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.profound-feedback-panel .feedback-approve-btn.feedback-approve-btn-approved:disabled {
  color: #2eb67d;
  opacity: 0.7;
  cursor: default;
  pointer-events: auto;
}

.profound-feedback-panel .feedback-approve-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Approve Modal Specific Styles */
.profound-approve-modal .modal-content {
  max-width: 560px;
}

.profound-approve-modal .modal-section {
  margin-bottom: 20px;
}

.profound-approve-modal .modal-section:last-child {
  margin-bottom: 0;
}

.profound-approve-modal .modal-section label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--feedback-text);
  font-size: 14px;
}

.profound-approve-modal .modal-info {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px 16px;
  background: rgba(63, 114, 255, 0.05);
  border-radius: 6px;
  border: 1px solid var(--feedback-border);
}

.profound-approve-modal .modal-repo {
  font-weight: 600;
  color: var(--feedback-text);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 14px;
}

.profound-approve-modal .modal-stats {
  color: var(--feedback-text-muted);
  font-size: 13px;
}

.profound-approve-modal .modal-branches {
  margin-top: 12px;
  padding: 10px 16px;
  background: rgba(63, 114, 255, 0.08);
  border-radius: 6px;
  border-left: 3px solid var(--feedback-accent);
}

.profound-approve-modal .branch-info {
  font-size: 13px;
  color: var(--feedback-text);
}

.profound-approve-modal .branch-info code {
  background: rgba(0, 0, 0, 0.15);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 12px;
  color: var(--feedback-accent);
  font-weight: 500;
}

.profound-approve-modal .branch-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profound-approve-modal .branch-item {
  font-size: 13px;
  color: var(--feedback-text);
}

.profound-approve-modal .branch-item strong {
  font-weight: 600;
  margin-right: 4px;
}

.profound-approve-modal .commit-message-input {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

.profound-approve-modal .commit-message-input:focus {
  outline: none;
  border-color: var(--feedback-accent);
}

.profound-approve-modal .commit-message-input::placeholder {
  color: var(--feedback-text-muted);
}

.profound-approve-modal .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 6px;
  font-weight: 400 !important;
}

.profound-approve-modal .checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--feedback-accent);
}

.profound-approve-modal .checkbox-label span {
  color: var(--feedback-text);
  font-size: 14px;
  font-weight: 400;
}

.profound-approve-modal .new-branch-container {
  margin-top: 8px;
  margin-left: 26px;
}

.profound-approve-modal .new-branch-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--feedback-border);
  border-radius: 6px;
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 14px;
  box-sizing: border-box;
}

.profound-approve-modal .new-branch-input:focus {
  outline: none;
  border-color: var(--feedback-accent);
}

.profound-approve-modal .new-branch-input::placeholder {
  color: var(--feedback-text-muted);
}

.profound-approve-modal .field-hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--feedback-text-muted);
}

.profound-approve-modal .approve-modal-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(244, 183, 64, 0.14);
  border: 1px solid #f4b740;
  border-radius: 6px;
  color: var(--feedback-text);
  font-size: 14px;
}

.profound-approve-modal .approve-modal-warning .warning-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #f4b740;
  color: var(--feedback-surface);
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.profound-approve-modal .approve-modal-error {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid #ef4444;
  border-radius: 6px;
  color: var(--feedback-text);
  font-size: 14px;
}

.profound-approve-modal .approve-modal-error .error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: white;
  color: #ef4444;
  font-weight: 700;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  border: 2px solid #ef4444;
}

.profound-approve-modal .approve-modal-warning[hidden],
.profound-approve-modal .approve-modal-error[hidden] {
  display: none;
}

/* Conflict resolution panel shown when approval hits merge conflicts */
.profound-approve-modal .conflict-resolution-panel {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--feedback-border, rgba(255, 255, 255, 0.1));
}

.profound-approve-modal .conflict-resolution-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  background: rgba(255, 152, 0, 0.08);
  border: 1px solid rgba(255, 152, 0, 0.25);
  border-radius: 6px;
  color: var(--feedback-text, #e0e0e0);
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 16px;
}

.profound-approve-modal .conflict-resolution-message .warning-icon {
  flex-shrink: 0;
}

.profound-approve-modal .conflict-resolution-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profound-approve-modal .conflict-resolution-options button {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
}

.profound-approve-modal .conflict-resolution-options .field-hint {
  margin: 0 0 10px 12px;
}

.profound-approve-modal .conflict-resolution-options button:last-child {
  margin-top: 6px;
}

.profound-approve-modal .btn-primary {
  background: linear-gradient(135deg, #2eb67d 0%, #25a268 100%);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  min-width: 140px;
  transition: all 0.2s;
}

.profound-approve-modal .btn-primary:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(46, 182, 125, 0.3);
  transform: translateY(-1px);
}

.profound-approve-modal .btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Approve Modal Maximized State (widget context) */
.profound-approve-modal.maximized {
  padding: 0 !important;
  display: block !important;
}

.profound-approve-modal.maximized[hidden] {
  display: none !important;
}

.profound-approve-modal.maximized .modal-content {
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  display: flex;
  flex-direction: column;
}

.profound-approve-modal.maximized .modal-body {
  flex: 1;
  overflow-y: auto;
}

.profound-approve-modal .header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  width: auto;
  margin-left: auto;
  flex: 0 0 auto;
  flex-wrap: nowrap;
}

.profound-approve-modal .header-actions > * {
  flex: 0 0 auto;
}

/* ── ExitPlanMode / Plan Detail ── */

.profound-feedback-modal .plan-detail {
  font-family: inherit;
  line-height: 1.6;
  color: var(--feedback-text);
}

.profound-feedback-modal .plan-detail h1,
.profound-feedback-modal .plan-detail h2,
.profound-feedback-modal .plan-detail h3 {
  margin: 12px 0 6px;
  font-weight: 600;
}

.profound-feedback-modal .plan-detail h1 { font-size: 16px; }
.profound-feedback-modal .plan-detail h2 { font-size: 14px; }
.profound-feedback-modal .plan-detail h3 { font-size: 13px; }

.profound-feedback-modal .plan-detail ul,
.profound-feedback-modal .plan-detail ol {
  padding-left: 20px;
  margin: 4px 0;
}

.profound-feedback-modal .plan-detail li {
  margin: 2px 0;
}

.profound-feedback-modal .plan-detail code {
  background: var(--feedback-surface-muted);
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 12px;
}

.profound-feedback-modal .plan-detail pre {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 4px;
  padding: 10px;
  overflow-x: auto;
  font-size: 12px;
  margin: 6px 0;
  color: #f8f8f2;
}

/* ── AskUserQuestion Styles ── */

.profound-feedback-modal .ask-question-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profound-feedback-modal .ask-question-collapsible {
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  overflow: hidden;
}

.profound-feedback-modal .ask-question-summary {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  color: var(--feedback-text);
  user-select: none;
  list-style: none;
  background: var(--feedback-surface-muted);
}

.profound-feedback-modal .ask-question-summary::-webkit-details-marker {
  display: none;
}

.profound-feedback-modal .ask-question-summary::before {
  content: '▶';
  font-size: 9px;
  color: var(--feedback-text-muted);
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-top: 3px;
}

.profound-feedback-modal .ask-question-collapsible[open] > .ask-question-summary::before {
  transform: rotate(90deg);
}

.profound-feedback-modal .ask-question-summary-num {
  font-weight: 600;
  color: #8b5cf6;
}

.profound-feedback-modal .ask-question-summary-chip {
  display: inline-flex;
  padding: 1px 8px;
  background: #8b5cf620;
  color: #8b5cf6;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  margin-top: 1px;
}

.profound-feedback-modal .ask-question-summary-text {
  flex: 1;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.4;
}

.profound-feedback-modal .ask-question-summary-count {
  font-size: 11px;
  color: var(--feedback-text-muted);
  flex-shrink: 0;
}

.profound-feedback-modal .ask-question-body {
  padding: 8px 14px 14px;
  border-top: 1px solid var(--feedback-border);
}

.profound-feedback-modal .ask-question-multi-badge {
  font-size: 10px;
  background: #8b5cf620;
  color: #8b5cf6;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  flex-shrink: 0;
}

.profound-feedback-modal .ask-question-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profound-feedback-modal .ask-question-option {
  padding: 10px 14px;
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
}

.profound-feedback-modal .ask-question-option-label {
  font-weight: 500;
  font-size: 14px;
  color: var(--feedback-text);
}

.profound-feedback-modal .ask-question-option-desc {
  font-size: 12px;
  color: var(--feedback-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

.profound-feedback-modal .ask-question-option-preview {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 4px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 11px;
  line-height: 1.4;
  white-space: pre-wrap;
  max-height: 120px;
  overflow: auto;
  color: #f8f8f2;
}

.profound-feedback-modal .ask-question-denied-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #f59e0b;
  background: #f59e0b20;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
  margin-top: 8px;
}

.profound-feedback-modal .ask-question-answered-badge {
  font-size: 13px;
  color: #10b981;
  font-weight: 500;
  margin-top: 8px;
  padding: 8px 12px;
  background: #10b98110;
  border-radius: 4px;
  white-space: pre-wrap;
}

/* Answer UI */
.profound-feedback-modal .ask-question-answer-ui {
  margin-top: 12px;
  padding: 12px;
  background: #8b5cf610;
  border: 1px solid #8b5cf630;
  border-radius: 4px;
}

.profound-feedback-modal .ask-answer-label {
  font-size: 12px;
  font-weight: 600;
  color: #8b5cf6;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.profound-feedback-modal .ask-answer-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.profound-feedback-modal .ask-answer-option-btn {
  padding: 8px 12px 8px 36px;
  background: var(--feedback-surface-muted);
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--feedback-text);
  transition: all 0.15s;
  position: relative;
  text-align: left;
}

.profound-feedback-modal .ask-answer-option-btn::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--feedback-border);
  background: transparent;
  transition: all 0.15s;
}

.profound-feedback-modal .ask-answer-question[data-multi-select="true"] .ask-answer-option-btn::before {
  border-radius: 3px;
}

.profound-feedback-modal .ask-answer-option-btn:hover {
  border-color: #8b5cf6;
  background: #8b5cf610;
}

.profound-feedback-modal .ask-answer-option-btn:hover::before {
  border-color: #8b5cf6;
}

.profound-feedback-modal .ask-answer-option-btn.selected {
  border-color: #8b5cf6;
  background: #8b5cf610;
}

.profound-feedback-modal .ask-answer-option-btn.selected::before {
  border-color: #8b5cf6;
  background: #8b5cf6;
  box-shadow: inset 0 0 0 2.5px var(--feedback-surface-muted);
}

.profound-feedback-modal .ask-answer-question[data-multi-select="true"] .ask-answer-option-btn.selected::before {
  box-shadow: none;
}

.profound-feedback-modal .ask-answer-question[data-multi-select="true"] .ask-answer-option-btn.selected::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-60%) rotate(45deg);
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
}

.profound-feedback-modal .ask-answer-option-btn-label {
  font-weight: 500;
}

.profound-feedback-modal .ask-answer-option-btn-desc {
  font-size: 11px;
  color: var(--feedback-text-muted);
  margin-top: 2px;
}

.profound-feedback-modal .ask-answer-question {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--feedback-border);
}

.profound-feedback-modal .ask-answer-question:last-of-type {
  border-bottom: none;
  margin-bottom: 8px;
  padding-bottom: 0;
}

.profound-feedback-modal .ask-answer-question-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--feedback-text);
  margin-bottom: 8px;
}

.profound-feedback-modal .ask-answer-freeform {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.profound-feedback-modal .ask-answer-freeform textarea {
  flex: 1;
  min-height: 36px;
  max-height: 120px;
  padding: 8px 12px;
  border: 1px solid var(--feedback-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  background: var(--feedback-surface-muted);
  color: var(--feedback-text);
}

.profound-feedback-modal .ask-answer-submit-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.profound-feedback-modal .ask-answer-submit {
  padding: 8px 16px;
  background: #8b5cf6;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s;
}

.profound-feedback-modal .ask-answer-submit:hover {
  background: #7c3aed;
}

.profound-feedback-modal .ask-answer-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Preview layout */
.profound-feedback-modal .ask-answer-preview-layout {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 12px;
  min-height: 120px;
}

.profound-feedback-modal .ask-answer-preview-options {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profound-feedback-modal .ask-answer-preview-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 8px 12px;
}

.profound-feedback-modal .ask-answer-preview-panel {
  background: #2d2d2d;
  border: 1px solid #404040;
  border-radius: 4px;
  overflow: auto;
  max-height: 300px;
}

.profound-feedback-modal .ask-answer-preview-content {
  margin: 0;
  padding: 12px;
  font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #f8f8f2;
}
