/* Updated CSS: Dark Apple-like Grok-inspired design - Sleek, minimal, dark theme with subtle shades, rounded elements, and high contrast */
/* New enhancement: Transformed #resizeNotch from full-height bar to a compact, rounded "middle node" handle—small pill-shaped (40px tall, 8px wide, fully rounded ends) absolutely positioned in the vertical center of #chatPanel for a subtler, less obtrusive resize grip. Retained drag/hover feedback; positioned to overlap the panel's left edge seamlessly without affecting layout flow. Adjusted #chatPanel to relative for absolute child positioning. */
#chatWrapper {
  position: fixed;
  right: 0;
  left: auto;
  display: flex;
  flex-direction: row;
  z-index: 1000;
}

/* Chat handle: just the arrow in the left gap (no panel/circle). Hidden when chat is closed. */
#chatWrapper.chat-closed #resizeNotch {
  display: none !important;
  pointer-events: none;
}

#resizeNotch {
  width: 24px;
  height: 48px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  left: 6px; /* 12px border→arrow; arrow 12px wide centered in 24px notch */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  background: none;
  border: none;
  transition: opacity 0.15s ease;
}

#resizeNotch:hover {
  opacity: 0.9;
}

#resizeNotch:active {
  opacity: 0.7;
}

/* Left-pointing chevron only (cover/collapse chat) */
#resizeNotch::before {
  content: '';
  width: 12px;
  height: 12px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='rgba(255,255,255,0.55)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3 L4 6 L8 9'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
/* Chat Panel: wider default, left gap for arrow */
#chatPanel {
  width: 440px; height: 100vh;
  background: #111;
  border-left: 1px solid rgba(255,255,255,0.06);
  box-shadow: -2px 0 16px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
  flex: 0 0 auto; overflow: hidden;
  transition: width 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  position: relative;
}

#chatHeader {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 600; font-size: 12px;
  color: rgba(255,255,255,0.65);
  background: #111; flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s ease;
}
#chatHeader:hover { background: rgba(255,255,255,0.03); }

#chatMessages {
  flex: 1 1 0;
  min-height: 0;
  padding: 14px 14px 14px 36px; /* 12px border→arrow, 12px arrow→text; AI text closer to border */
  overflow-y: auto;
  background: #111;
  display: flex;
  flex-direction: column;
  direction: rtl;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
#chatMessages::-webkit-scrollbar { width: 4px; }
#chatMessages::-webkit-scrollbar-track { background: transparent; }
#chatMessages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.message {
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 16px;
  max-width: 80%; width: auto; min-width: 0;
  word-wrap: break-word; white-space: pre-wrap;
  font-size: 13px; line-height: 1.45;
  transition: opacity 0.2s ease;
  box-sizing: border-box; min-height: 0;
  display: inline-table;
  direction: ltr; height: auto; overflow: hidden;
  flex-shrink: 0;
}
.user-message {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9); border: none;
  align-self: flex-start;
  max-width: 80%;
  border-radius: 16px;
  margin-bottom: 18px;
}
.ai-message {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  align-self: flex-end;
  border-radius: 0;
  padding: 4px 2px;
  max-width: 90%;
  font-size: 13px; line-height: 1.55;
}

#chatInputContainer {
  position: relative;
  padding: 12px 16px 20px 16px; /* Bottom padding for breathing room */
  border-top: none;
  display: flex;
  flex-direction: column;
  background: transparent;
  flex-shrink: 0;
}

.input-pill-wrapper {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 10px 12px 6px 12px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.input-pill-wrapper:focus-within {
  border-color: rgba(255,255,255,0.14);
}
#chatInput {
  width: 100%;
  border: none !important; background: transparent !important;
  resize: none; outline: none;
  font-family: inherit; font-size: 12px;
  color: rgba(255,255,255,0.85);
  line-height: 1.5;
  height: 20px;
  min-height: 20px; max-height: 150px;
  padding: 0; margin-bottom: 6px;
  box-sizing: border-box;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}
#chatInput::-webkit-scrollbar { width: 4px; }
#chatInput::-webkit-scrollbar-track { background: transparent; }
#chatInput::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }
#chatInput::placeholder { color: rgba(255,255,255,0.35); }
#chatInput:focus {
  outline: none !important; border: none !important;
  box-shadow: none !important;
}

.pill-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  padding-top: 6px;
}

/* Mode Selector (Cursor-style dropdown) */
.mode-selector {
  position: relative;
}
.mode-selector-btn {
  display: flex; align-items: center; gap: 4px;
  background: none; border: none;
  padding: 2px 6px; border-radius: 6px;
  font-size: 11px; font-weight: 500;
  color: rgba(255,255,255,0.55);
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}
.mode-selector-btn:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.8);
}
/* Arrow and button icon: invert in dark mode at muted opacity */
.mode-selector-arrow { flex-shrink: 0; filter: invert(1); opacity: 0.45; }
[data-theme="light"] .mode-selector-arrow { filter: none; opacity: 0.45; }
.mode-selector-btn:hover .mode-selector-arrow { opacity: 0.75; }
.mode-selector-btn-icon {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: block;
  filter: invert(1);
  opacity: 0.55;
}
[data-theme="light"] .mode-selector-btn-icon { filter: none; opacity: 0.45; }
.mode-selector-menu {
  position: absolute;
  bottom: calc(100% + 6px); left: 0;
  min-width: 160px;
  overflow: visible;
  background: rgba(24,24,24,0.94);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 4px;
  opacity: 0; pointer-events: none;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  z-index: 100;
}
.mode-selector-menu.open {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}
.mode-selector-desc {
  position: absolute;
  left: calc(100% + 4px);
  min-width: 140px;
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.35;
  color: rgba(255,255,255,0.7);
  background: rgba(24,24,24,0.96);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  backdrop-filter: blur(12px);
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease, top 0.1s ease;
  z-index: 101;
  top: 0;
  transform: translateY(-50%);
}
.mode-selector-desc.visible {
  opacity: 1;
  visibility: visible;
}
[data-theme="light"] .mode-selector-desc {
  color: rgba(0,0,0,0.7);
  background: rgba(255,255,255,0.98);
  border-color: rgba(0,0,0,0.12);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.mode-selector-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: none; border: none;
  border-radius: 6px;
  font-size: 12px; font-weight: 500;
  color: rgba(255,255,255,0.65);
  cursor: pointer; text-align: left;
  transition: background 0.1s ease, color 0.1s ease;
}
.mode-selector-option:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.9);
}
.mode-selector-option.active {
  color: rgba(255,255,255,0.9);
}
/* Inner label + icon row */
.mode-option-inner {
  display: flex; align-items: center; gap: 7px;
  white-space: nowrap;
}
.mode-selector-label {
  white-space: nowrap;
}
.mode-option-icon {
  flex-shrink: 0;
  width: 14px; height: 14px;
  filter: invert(1);
  opacity: 0.6;
  transition: opacity 0.1s ease;
}
[data-theme="light"] .mode-option-icon { filter: none; opacity: 0.5; }
.mode-selector-option:hover .mode-option-icon,
.mode-selector-option.active .mode-option-icon {
  opacity: 0.9;
}
/* Checkmark — hidden by default, shown when active */
.mode-option-check {
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s ease;
  filter: invert(1);
}
[data-theme="light"] .mode-option-check { filter: none; }
.mode-selector-option.active .mode-option-check {
  opacity: 0.75;
}

/* Light theme */
[data-theme="light"] .mode-selector-btn { color: rgba(0,0,0,0.45); }
[data-theme="light"] .mode-selector-btn:hover { background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.7); }
[data-theme="light"] .mode-selector-menu {
  background: rgba(255,255,255,0.95);
  border-color: rgba(0,0,0,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}
[data-theme="light"] .mode-selector-option { color: rgba(0,0,0,0.55); }
[data-theme="light"] .mode-selector-option:hover { background: rgba(0,0,0,0.05); color: rgba(0,0,0,0.8); }
[data-theme="light"] .mode-selector-option.active {
  color: rgba(0,0,0,0.8);
}
/* light theme check filter already set above */




#sendBtn {
  position: static; transform: none;
  background: #0066cc; color: #fff;
  border: none; border-radius: 50%;
  width: 24px; height: 24px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
  transition: background 0.15s ease;
  line-height: 0; padding: 0;
}
#sendBtn:hover { background: #0073e6; }
#sendBtn:active { background: #005bb5; }
#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#sendBtn:disabled:hover { background: #0066cc; }
#sendBtn svg { flex-shrink: 0; }
#sendBtn img.send-btn-icon { flex-shrink: 0; display: block; }

/* --- CHAT BUTTON INSIDE TOP TOOLBAR --- */

#chatToolbarBtn {
  padding: 0 10px; height: 26px;
  border-radius: 13px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.65);
  font-size: 11px; font-weight: 500;
  cursor: pointer; flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
#chatToolbarBtn:hover {
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.85);
  border-color: rgba(255,255,255,0.14);
}
#chatToolbarBtn:active { background: rgba(255,255,255,0.08); }


/* Optional: hide when chat is open */
.chat-open #chatToolbarBtn {
  opacity: 0.3;
  pointer-events: none;
}
/* ── Loading spinner — Apple/Google style ── */
#standalone-spinner {
  display: flex; align-items: center;
  padding: 6px 4px 10px 4px;
  width: auto;
  box-sizing: border-box;
  direction: ltr;
}
#standalone-spinner .loading-spinner-container {
  display: flex; align-items: center; justify-content: center;
}
.loading-spinner-svg {
  width: 20px; height: 20px;
  animation: spinner-rotate 2s linear infinite;
}
.loading-spinner-track {
  stroke: rgba(255,255,255,0.06);
  stroke-width: 3;
}
.loading-spinner-path {
  stroke: #0066cc;
  stroke-linecap: round;
  stroke-width: 3;
  stroke-dasharray: 1, 200;
  stroke-dashoffset: 0;
  animation: spinner-dash 1.5s ease-in-out infinite;
  transform-origin: center;
}

@keyframes spinner-rotate {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
@keyframes spinner-dash {
  0% {
    stroke-dasharray: 1, 200;
    stroke-dashoffset: 0;
  }
  50% {
    stroke-dasharray: 80, 200;
    stroke-dashoffset: -30;
  }
  100% {
    stroke-dasharray: 80, 200;
    stroke-dashoffset: -124;
  }
}
/* ──────────────────────────────────────────────── */
/* LIGHT THEME OVERRIDES                          */
/* Apply when <html data-theme="light">           */
/* ──────────────────────────────────────────────── */

:root[data-theme="light"] #chatPanel {
  background: #f5f5f7;
  border-left: 1px solid #ddd;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] #resizeNotch::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='rgba(0,0,0,0.5)' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 3 L4 6 L8 9'/%3E%3C/svg%3E");
}

:root[data-theme="light"] #chatHeader {
  background: #ffffff;
  border-bottom: 1px solid #ddd;
  color: #111111;
}

:root[data-theme="light"] #chatHeader:hover {
  background: #f0f0f0;
}

:root[data-theme="light"] #chatMessages {
  background: #f5f5f7;
  scrollbar-color: #b0b0b0 #f0f0f0;
}

:root[data-theme="light"] #chatMessages::-webkit-scrollbar-track {
  background: #f0f0f0;
}

:root[data-theme="light"] #chatMessages::-webkit-scrollbar-thumb {
  background: #b0b0b0;
}

:root[data-theme="light"] .user-message {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.85);
  border: none;
}

:root[data-theme="light"] .ai-message {
  background: none;
  border: none;
  color: rgba(0,0,0,0.6);
}

/* --- LIGHT THEME INPUT UPDATES (FIXED) --- */

:root[data-theme="light"] #chatInputContainer {
  background: #f5f5f7;
}

/* 1. Added base wrapper state (This was what was staying dark) */
:root[data-theme="light"] .input-pill-wrapper {
  background: #ffffff;
  border-color: #cccccc;
}

/* 2. Focused state for wrapper */
:root[data-theme="light"] .input-pill-wrapper:focus-within {
  border-color: #999; 
  box-shadow: none;   
}

:root[data-theme="light"] #chatInput {
  background: transparent !important; 
  color: #111111;
}

/* 3. Ensure no rectangle frame shows in light mode */
:root[data-theme="light"] #chatInput:focus {
  outline: none !important;
  border: none !important;
  box-shadow: none !important;
}

:root[data-theme="light"] #chatInput::placeholder {
  color: #999999;
}

:root[data-theme="light"] #chatInput::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}
:root[data-theme="light"] #chatInput {
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}

/* Divider inside the pill for Light Mode */
:root[data-theme="light"] .pill-actions {
  border-top-color: #eeeeee;
}

/* Mode Buttons in Light Mode */
:root[data-theme="light"] .mode-btn {
  color: #666666;
}

:root[data-theme="light"] .mode-btn:hover {
  background: #f0f0f0;
  color: #111111;
}

:root[data-theme="light"] .mode-btn.active {
  background: #e0e0e0;
  color: #000000;
}

/* Send Button in Light Mode */
:root[data-theme="light"] #sendBtn {
  background: #0066cc;
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
}

:root[data-theme="light"] #sendBtn:hover {
  background: #0f8bff;
}

:root[data-theme="light"] #sendBtn:active {
  background: #0060d6;
}

/* Toolbar Toggle Button */
:root[data-theme="light"] #chatToolbarBtn {
  background: #f0f0f0;
  border-color: #cccccc;
  color: #111111;
}

:root[data-theme="light"] #chatToolbarBtn:hover {
  background: #e5e5e5;
  border-color: #bbbbbb;
}

:root[data-theme="light"] #chatToolbarBtn:active {
  background: #dddddd;
  border-color: #bbbbbb;
}

/* ── Stop button state ── */
#sendBtn.send-btn-stop {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  transition: background 0.15s ease, color 0.15s ease;
}
#sendBtn.send-btn-stop:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}
#sendBtn.send-btn-stop svg { display: block; }

:root[data-theme="light"] #sendBtn.send-btn-stop {
  background: rgba(0,0,0,0.06);
  color: rgba(0,0,0,0.55);
}
:root[data-theme="light"] #sendBtn.send-btn-stop:hover {
  background: rgba(0,0,0,0.1);
  color: rgba(0,0,0,0.8);
}

/* ── Editable user messages ── */
.user-message {
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}
.user-message:hover:not(.editing) {
  background: rgba(255,255,255,0.14);
}

.user-message.editing {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.12);
  box-shadow: none;
  cursor: default;
  padding: 6px 12px 8px;
  display: flex !important;
  flex-direction: column;
  gap: 6px;
  max-width: 85%;
  min-width: 120px;
  white-space: normal;
  overflow: visible;
  height: auto !important;
  flex-shrink: 0;
  width: auto;
}

.edit-prompt-input {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255,255,255,0.92);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.45;
  resize: none;
  width: 100%;
  height: 20px;
  min-height: 20px;
  max-height: 150px;
  overflow-y: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
  box-sizing: border-box;
}
.edit-prompt-input::-webkit-scrollbar { width: 4px; }
.edit-prompt-input::-webkit-scrollbar-track { background: transparent; }
.edit-prompt-input::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 2px; }

.edit-prompt-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-shrink: 0;
  margin-top: 2px;
}

.edit-prompt-send,
.edit-prompt-cancel {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 999px;
  height: 22px;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255,255,255,0.9);
  font-size: 11px;
  font-weight: 500;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.edit-prompt-send {
  padding: 0 13px;
}
.edit-prompt-cancel {
  padding: 0;
  width: 22px;
}
.edit-prompt-cancel svg {
  display: block;
  flex-shrink: 0;
}
.edit-prompt-send:hover,
.edit-prompt-cancel:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* Light theme overrides */
:root[data-theme="light"] .user-message:hover:not(.editing) {
  background: rgba(0,0,0,0.08);
}

:root[data-theme="light"] .user-message.editing {
  background: rgba(0,0,0,0.06);
  border-color: rgba(0,0,0,0.12);
  box-shadow: none;
  height: auto !important;
  flex-shrink: 0;
  min-width: 120px;
}

:root[data-theme="light"] .edit-prompt-input {
  color: rgba(0,0,0,0.85);
  scrollbar-color: rgba(0,0,0,0.1) transparent;
}
:root[data-theme="light"] .edit-prompt-input::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.1);
}

:root[data-theme="light"] .edit-prompt-send,
:root[data-theme="light"] .edit-prompt-cancel {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.16);
  color: rgba(0,0,0,0.75);
}
:root[data-theme="light"] .edit-prompt-send:hover,
:root[data-theme="light"] .edit-prompt-cancel:hover {
  background: rgba(0,0,0,0.16);
  border-color: rgba(0,0,0,0.22);
  color: rgba(0,0,0,0.9);
}

/* ── Pipeline Review UI ── */
.pipeline-review {
  align-self: flex-end;
  max-width: 90%;
  padding: 4px 2px 8px 2px;
  margin-bottom: 14px;
  direction: ltr;
  flex-shrink: 0;
}
.pipeline-review-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.55);
  margin-bottom: 10px;
  letter-spacing: 0.01em;
}
.pipeline-review-dismiss {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
}
.pipeline-review-dismiss:hover {
  background: rgba(255,255,255,0.2);
  color: #fff;
}
.pipeline-review-dismiss svg {
  display: block;
}
.pipeline-card-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pipeline-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
  user-select: none;
}
.pipeline-tool-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
}
.pipeline-tool-card.selected {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.18);
}
.pipeline-tool-card.selected:hover {
  background: rgba(255,255,255,0.1);
}
.tool-card-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.tool-card-step {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
}
.pipeline-tool-card.selected .tool-card-step {
  background: rgba(0,102,204,0.2);
  color: #4da6ff;
}
.tool-card-name {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipeline-tool-card.selected .tool-card-name {
  color: rgba(255,255,255,0.9);
}
.tool-check {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #4da6ff;
  transition: opacity 0.12s ease;
}
.tool-check-icon {
  width: 12px;
  height: 12px;
}
.pipeline-tool-card.selected .tool-check {
  opacity: 1;
}
.pipeline-review-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.pipeline-review-toggle,
.pipeline-review-submit {
  padding: 0 13px;
  height: 22px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}
.pipeline-review-toggle {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}
.pipeline-review-toggle:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.pipeline-review-submit {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}
.pipeline-review-submit:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}
.pipeline-review-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: auto;
}
.pipeline-review-submit:disabled:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.22);
  color: rgba(255,255,255,0.9);
}
.pipeline-review.submitted .pipeline-tool-card {
  opacity: 0.75;
  pointer-events: none;
  cursor: default;
}

/* ── Pipeline Review — Light theme ── */
:root[data-theme="light"] .pipeline-review-header {
  color: rgba(0,0,0,0.5);
}
:root[data-theme="light"] .pipeline-review-dismiss {
  background: rgba(0,0,0,0.08);
  color: rgba(0,0,0,0.5);
}
:root[data-theme="light"] .pipeline-review-dismiss:hover {
  background: rgba(0,0,0,0.14);
  color: rgba(0,0,0,0.85);
}
:root[data-theme="light"] .pipeline-tool-card {
  background: #ffffff;
  border-color: #ddd;
}
:root[data-theme="light"] .pipeline-tool-card:hover {
  background: #f5f5f5;
  border-color: #ccc;
}
:root[data-theme="light"] .pipeline-tool-card.selected {
  background: #f0f6ff;
  border-color: #b3d4fc;
}
:root[data-theme="light"] .pipeline-tool-card.selected:hover {
  background: #e6f0ff;
}
:root[data-theme="light"] .tool-card-step {
  background: rgba(0,0,0,0.05);
  color: rgba(0,0,0,0.4);
}
:root[data-theme="light"] .pipeline-tool-card.selected .tool-card-step {
  background: rgba(0,102,204,0.12);
  color: #0066cc;
}
:root[data-theme="light"] .tool-card-name {
  color: rgba(0,0,0,0.6);
}
:root[data-theme="light"] .pipeline-tool-card.selected .tool-card-name {
  color: rgba(0,0,0,0.85);
}
:root[data-theme="light"] .tool-check {
  color: #0066cc;
}
:root[data-theme="light"] .pipeline-review-toggle,
:root[data-theme="light"] .pipeline-review-submit {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.16);
  color: rgba(0,0,0,0.75);
}
:root[data-theme="light"] .pipeline-review-toggle:hover,
:root[data-theme="light"] .pipeline-review-submit:hover {
  background: rgba(0,0,0,0.16);
  border-color: rgba(0,0,0,0.22);
  color: rgba(0,0,0,0.9);
}
:root[data-theme="light"] .pipeline-review-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
:root[data-theme="light"] .pipeline-review-submit:disabled:hover {
  background: rgba(0,0,0,0.1);
  border-color: rgba(0,0,0,0.16);
  color: rgba(0,0,0,0.75);
}