* { box-sizing: border-box; }

/* ─── Theme tokens — IRIS (default) + 4 dark variants ──────────────────
   Set on body via data-iris-theme (theme picker in the topbar). The :root
   values are the IRIS theme; each variant redefines the surface tints.
   Accent stays HAV-IQ purple across themes (brand). */
:root {
  /* Deep Indigo (sleek pass) — near-black with a cool undertone, layered by
     lightness so surfaces read as elevation, not flat panels. */
  --iris-bg: #0b0c10;
  --iris-text: #e8eaf0;
  --iris-surface: #1b1f2a;
  --iris-panel: #101218;
  --iris-panel-2: #161922;
  --iris-topbar: #0d0f14;
  /* Design tokens */
  --iris-text-dim: #9aa0ad;
  --iris-border: #262b38;
  --iris-border-soft: rgba(255,255,255,0.06);
  --iris-accent: #9333EA;
  --iris-accent-2: #a855f7;
  --iris-accent-soft: rgba(147,51,234,0.14);
  --iris-glow: 0 0 0 3px rgba(147,51,234,0.28);
  --iris-elev-1: 0 1px 2px rgba(0,0,0,0.4);
  --iris-elev-2: 0 8px 24px rgba(0,0,0,0.45);
  --iris-elev-3: 0 24px 70px rgba(0,0,0,0.6);
  --iris-radius: 10px;
  --iris-radius-sm: 6px;
  --iris-radius-lg: 14px;
  --iris-ease: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}
body[data-iris-theme="midnight"] {
  --iris-bg: #0f1419; --iris-surface: #1a2330; --iris-panel: #0d1420; --iris-panel-2: #14202e; --iris-topbar: #16202c;
  --iris-border: #25364a; --iris-border-soft: rgba(120,170,220,0.08);
}
body[data-iris-theme="purple"] {
  --iris-bg: #150f1f; --iris-surface: #261b3a; --iris-panel: #120c1c; --iris-panel-2: #1d1430; --iris-topbar: #1e1530;
  --iris-border: #33264d; --iris-border-soft: rgba(200,160,255,0.08);
}
body[data-iris-theme="ocean"] {
  --iris-bg: #0b1620; --iris-surface: #14252f; --iris-panel: #0a141d; --iris-panel-2: #102230; --iris-topbar: #0f2230;
  --iris-border: #1d3a4c; --iris-border-soft: rgba(120,200,220,0.08);
}
body[data-iris-theme="forest"] {
  --iris-bg: #0e1a14; --iris-surface: #163025; --iris-panel: #0b170f; --iris-panel-2: #102a1c; --iris-topbar: #11281b;
  --iris-border: #1d3d2b; --iris-border-soft: rgba(130,210,160,0.08);
}

.theme-pick { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; }
.theme-pick-ic { display: inline-flex; align-items: center; color: #c4b5fd; }
.theme-pick-ic .lic { display: block; }
.theme-select {
  background: var(--iris-panel-2);
  color: var(--iris-text);
  border: 1px solid #3a3a42;
  border-radius: 7px;
  font-size: 12px;
  padding: 3px 6px;
  cursor: pointer;
}
.topbar-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #9333EA; /* status-locked IRIS purple */
  color: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 11px;
  margin-right: 6px;
  cursor: pointer;
}
.topbar-preview-btn .lic { display: block; }
.topbar-preview-btn:hover { filter: brightness(1.12); }
/* ☁ Org → Cloud sync control */
.topbar-mdc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--iris-panel-2); color: var(--iris-text-dim, #c7c7d2);
  border: 1px solid #3a3a42; border-radius: 7px; font-size: 12px; font-weight: 600;
  padding: 4px 11px; margin-right: 6px; cursor: pointer;
}
.topbar-mdc-btn .lic { display: block; }
.topbar-mdc-btn:hover { border-color: #6d28d9; color: #c4b5fd; }
.topbar-mdc-btn.mdc-on { color: #c4b5fd; border-color: #6d28d9; background: rgba(147,51,234,0.12); }
.mdc-pop {
  position: fixed; z-index: 9998; width: 320px; padding: 14px;
  background: var(--iris-surface, #1b1b22); border: 1px solid var(--iris-border, #2a2a32);
  border-radius: 10px; box-shadow: 0 12px 34px rgba(0,0,0,0.5); color: var(--iris-text, #e6e6e6);
}
.mdc-pop[hidden] { display: none; }
.mdc-h { font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.mdc-row { display: flex; flex-direction: column; gap: 5px; margin-bottom: 10px; }
.mdc-row label { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; }
.mdc-mode { background: var(--iris-panel-2); color: var(--iris-text); border: 1px solid #3a3a42; border-radius: 6px; padding: 6px 8px; font-size: 12px; }
.mdc-note { font-size: 11px; line-height: 1.5; color: #9ca3af; margin-bottom: 10px; }
.mdc-note strong { color: #c4b5fd; }
.mdc-status { font-size: 11.5px; color: #c7c7d2; background: rgba(0,0,0,0.18); border-radius: 6px; padding: 7px 9px; margin-bottom: 10px; }
.mdc-actions { display: flex; gap: 8px; }
.mdc-sync { flex: 1; background: #9333EA; color: #fff; border: 0; border-radius: 7px; padding: 8px; font-weight: 600; font-size: 12px; cursor: pointer; }
.mdc-sync:disabled { opacity: 0.5; cursor: not-allowed; }
.mdc-sync:not(:disabled):hover { filter: brightness(1.1); }
.mdc-clear { background: transparent; color: #9ca3af; border: 1px solid #3a3a42; border-radius: 7px; padding: 8px 12px; font-size: 12px; cursor: pointer; }
.mdc-clear:hover { color: #fca5a5; border-color: #C23934; }

/* Paste-as-attachment chips (Claude-style) */
.chat-attachments { display: none; flex-wrap: wrap; gap: 6px; padding: 6px 6px 0; }
.attach-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--iris-panel-2); border: 1px solid #3a3a42; border-radius: 8px;
  padding: 4px 8px; font-size: 12px; color: var(--iris-text); cursor: pointer;
}
.attach-chip .attach-meta { opacity: 0.6; font-size: 11px; }
.attach-chip .attach-remove {
  background: transparent; border: 0; color: #9a9aa8; cursor: pointer;
  font-size: 12px; padding: 0 2px; line-height: 1;
}
.attach-chip .attach-remove:hover { color: #fca5a5; }
.attach-chip-sent { margin-top: 6px; background: rgba(255, 255, 255, 0.06); cursor: default; }

/* File attachment (📎 + drag-drop) */
.chat-attach-btn {
  background: transparent; border: 0; border-radius: 6px;
  color: #9a9aa8; cursor: pointer; font-size: 16px; line-height: 1;
  padding: 2px 4px; margin-right: 2px; align-self: center; opacity: 0.75;
}
.chat-attach-btn:hover { color: #c4b5fd; opacity: 1; }
.attach-chip.attach-reading { opacity: 0.7; cursor: default; }
.attach-chip.attach-reading .attach-meta { color: #c4b5fd; }
.attach-toast {
  width: 100%; font-size: 12px; color: #fca5a5;
  background: rgba(194, 57, 52, 0.12); border: 1px solid rgba(194, 57, 52, 0.4);
  border-radius: 8px; padding: 5px 9px; margin-top: 4px;
}
.chat-drop-active { outline: 2px dashed #9333EA; outline-offset: -6px; background: rgba(147, 51, 234, 0.06); }

/* Visual export controls (DocExport.addControls) + doc-embedded visuals */
.dx-controls { display: inline-flex; gap: 6px; }
.dx-btn { background: transparent; border: 1px solid #3a3a42; border-radius: 6px; color: #c4b5fd; cursor: pointer; font-size: 11px; padding: 3px 8px; }
.dx-btn:hover { background: rgba(147, 51, 234, 0.12); border-color: #9333EA; }
.doc-visual { margin: 16px 0; border: 1px solid #2d2d35; border-radius: 10px; padding: 12px; }
.doc-visual figcaption { font-weight: 600; color: var(--iris-text); margin-bottom: 8px; font-size: 13px; }
.doc-visual svg { max-width: 100%; height: auto; }
.attach-preview {
  width: 100%; max-height: 200px; overflow: auto; margin: 6px 0 0; padding: 8px;
  background: #0f0a1f; border: 1px solid #3a3a42; border-radius: 6px;
  font: 11.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #c9c9d4; white-space: pre-wrap;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--iris-bg);
  color: var(--iris-text);
  /* Calm/Focused typography — Inter when available, system-ui fallback. */
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

body {
  height: 100vh;
  border-radius: 11px;
  overflow: hidden;
  position: relative;
}

/* Screen system — exactly one screen visible at a time */
.screen {
  display: none;
  width: 100%;
  height: 100vh;
  border-radius: 11px;
  overflow: hidden;
}
.screen.active { display: block; }

#chat-screen.active {
  display: grid;
  grid-template-rows: 44px auto 1fr;
}

#login-screen.active,
#aws-connect-screen.active,
#signup-screen.active {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  background: radial-gradient(ellipse at top, #1f1424 0%, #1a1a1a 60%, #0f0f10 100%);
}

/* ──────── LOGIN SCREEN ──────── */

.login-bg-grad {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 600px 400px at 30% 20%, rgba(147, 51, 234, 0.18), transparent 70%),
    radial-gradient(ellipse 500px 300px at 70% 80%, rgba(236, 72, 153, 0.15), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.screen-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  font-size: 18px;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  padding: 0;
}
.screen-close:hover {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(236, 72, 153, 0.3);
  color: #f9fafb;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 92%;
  max-width: 360px;
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.login-logo {
  width: 44px;
  height: 44px;
  border-radius: 11px;
  filter: drop-shadow(0 4px 14px rgba(147, 51, 234, 0.4));
}
.login-product {
  text-align: left;
  line-height: 1.1;
}
.login-haviq {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
  background: linear-gradient(135deg, #c084fc, #f0abfc, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-iris {
  font-size: 11px;
  font-weight: 600;
  color: #9ca3af;
  letter-spacing: 2px;
  margin-top: 1px;
}

.login-tagline {
  font-size: 13px;
  background: linear-gradient(135deg, #c084fc, #f0abfc, #f9a8d4);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 2px 0 3px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: opacity 0.4s ease;
}
.login-subtagline {
  font-size: 10px;
  color: #6b7280;
  margin: 0 0 12px;
  font-style: italic;
  letter-spacing: 0.3px;
  transition: opacity 0.4s ease;
}

/* Pitch block — rotating hook + key features */
.login-pitch {
  width: 100%;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.06), rgba(236, 72, 153, 0.06));
  border: 1px solid rgba(147, 51, 234, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 14px;
  text-align: left;
}
.login-hook {
  font-size: 12px;
  color: #f0abfc;
  font-weight: 600;
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(147, 51, 234, 0.15);
  transition: opacity 0.4s ease;
}
.login-features {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 70px;        /* prevents layout jump as feature changes */
  transition: opacity 0.4s ease;
}
.login-features li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #f0abfc;
  line-height: 1.4;
  text-align: left;
  opacity: 0;
  animation: feature-fade-in 0.6s ease forwards;
  padding: 4px 0;
}
.login-features .feat-icon {
  font-size: 22px;
  color: #c084fc;
  flex: 0 0 auto;
  line-height: 1;
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.4);
}

@keyframes feature-fade-in {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-hook { transition: opacity 0.45s ease; }
.feat-icon {
  color: #c084fc;
  font-size: 13px;
  flex: 0 0 auto;
  line-height: 1.2;
}

.login-primary {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #9333EA 0%, #C026D3 50%, #EC4899 100%);
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  cursor: pointer;
  color: white;
  text-align: left;
  box-shadow:
    0 4px 14px rgba(147, 51, 234, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}
.login-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 6px 20px rgba(236, 72, 153, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.login-primary:active { transform: translateY(0); }
.login-primary-icon {
  font-size: 18px;
  flex: 0 0 auto;
}
.login-primary-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.login-primary-line1 {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.2px;
}
.login-primary-line2 {
  font-size: 10px;
  opacity: 0.85;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-secondary {
  width: 100%;
  background: transparent;
  border: 1px solid #3d3d3d;
  color: #d1d5db;
  border-radius: 7px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 12px;
  margin-top: 8px;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.login-secondary:hover {
  border-color: #9333EA;
  color: #f9fafb;
}

/* ── AWS two-connect pane (Model B: dev org + pipeline org) ── */
.aws-conn-steps {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 18px 0 14px;
}
.aws-conn-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 12px;
  border: 1px solid #3d3d3d;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease;
}
.aws-conn-row.connected {
  border-color: #1AAA55;
  background: rgba(26, 170, 85, 0.07);
}
.aws-conn-num {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid #4b5563;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.aws-conn-row.connected .aws-conn-num {
  border-color: #1AAA55;
  background: #1AAA55;
  color: #fff;
}
.aws-conn-body { flex: 1 1 auto; min-width: 0; }
.aws-conn-title {
  font-size: 13px;
  font-weight: 600;
  color: #f3f4f6;
  display: flex;
  align-items: center;
  gap: 6px;
}
.aws-conn-tag {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #c4b5fd;
  border: 1px solid #6d28d9;
  border-radius: 4px;
  padding: 1px 5px;
}
.aws-conn-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
  line-height: 1.4;
}
.aws-conn-sub.ok { color: #34d399; }
/* The inline domain input is superseded by the login-host chooser popover. */
.aws-conn-domain { display: none; }

/* ── Login-host chooser (Production / Sandbox / custom My Domain) ── */
.iris-host-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.iris-host-card {
  width: 100%;
  max-width: 360px;
  background: #1d1d1f;
  border: 1px solid #3d3d3d;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}
.iris-host-title { font-size: 15px; font-weight: 700; color: #f3f4f6; }
.iris-host-sub { font-size: 12px; color: #9ca3af; margin: 4px 0 16px; line-height: 1.45; }
.iris-host-opt {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #3d3d3d;
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.iris-host-opt:hover { border-color: #9333EA; background: rgba(147, 51, 234, 0.08); }
.iris-host-opt b { font-size: 13px; color: #f3f4f6; font-weight: 600; }
.iris-host-opt span { font-size: 11px; color: #8b8b94; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.iris-host-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 0; color: #5b5b63; font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em;
}
.iris-host-divider::before, .iris-host-divider::after {
  content: ""; flex: 1; height: 1px; background: #333;
}
.iris-host-label {
  font-size: 12px; font-weight: 600; color: #e5e7eb; margin-bottom: 6px;
  display: flex; align-items: baseline; gap: 7px;
}
.iris-host-hint { font-size: 10px; font-weight: 400; color: #8b8b94; }
.iris-host-custom { display: flex; gap: 8px; }
.iris-host-input {
  flex: 1 1 auto; min-width: 0;
  background: #141416;
  border: 1px solid #3d3d3d;
  color: #e5e7eb;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.iris-host-input:focus { outline: none; border-color: #9333EA; }
.iris-host-go {
  flex: 0 0 auto;
  background: #9333EA; border: none; color: #fff;
  border-radius: 7px; padding: 8px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.iris-host-go:hover { background: #7e22ce; }
.iris-host-cancel {
  width: 100%; margin-top: 14px; background: transparent; border: none;
  color: #8b8b94; font-size: 12px; cursor: pointer;
}
.iris-host-cancel:hover { color: #d1d5db; }
.aws-conn-btn {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
  padding: 7px 14px;
  white-space: nowrap;
}
.aws-conn-row.connected .aws-conn-btn {
  border-color: #1AAA55;
  color: #34d399;
}
.login-primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.3);
}

.login-divider {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 8px;
  color: #4b5563;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, #3d3d3d, transparent);
}

.login-link {
  color: #9ca3af;
  font-size: 12px;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.login-link:hover { color: #c084fc; }

.login-footnote {
  margin-top: 16px;
  padding: 10px 14px;
  background: rgba(127, 29, 29, 0.2);
  border: 1px solid #7f1d1d;
  color: #fecaca;
  border-radius: 6px;
  font-size: 12px;
  width: 100%;
  text-align: center;
}

/* Trial signup form */
.signup-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.signup-label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
  color: #cbd5e1;
  text-align: left;
  font-weight: 500;
}
.signup-label .optional {
  color: #6b7280;
  font-weight: 400;
  font-size: 10px;
}
.signup-form input {
  background: #181820;
  border: 1px solid #3d3d3d;
  color: #f9fafb;
  padding: 7px 10px;
  border-radius: 5px;
  font: inherit;
  font-size: 12px;
  transition: border-color 0.15s ease;
}
.signup-form input:focus {
  outline: none;
  border-color: #9333EA;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.2);
}
.signup-org-info {
  text-align: left;
  background: rgba(147, 51, 234, 0.08);
  border: 1px solid rgba(147, 51, 234, 0.25);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 11px;
  margin-top: 4px;
}
.signup-org-label { color: #9ca3af; font-weight: 500; margin-right: 5px; font-size: 10px; }
.signup-org-value {
  color: #f0abfc;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
}
.signup-org-note {
  margin-top: 4px;
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
}

/* Install screen */
.install-spinning {
  animation: install-pulse 2s ease-in-out infinite;
}
@keyframes install-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 4px 14px rgba(147, 51, 234, 0.4)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 6px 24px rgba(236, 72, 153, 0.6)); }
}
.install-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 12px;
  font-size: 13px;
  color: #9ca3af;
}
.install-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, #9333EA, #EC4899);
  animation: install-bounce 1.4s ease-in-out infinite;
}
.install-dot:nth-child(2) { animation-delay: 0.2s; }
.install-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes install-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}
.install-text { margin-left: 4px; }

/* Expired + welcome info blocks */
.expired-info, .welcome-info {
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid #2d2d2d;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.welcome-info {
  background: rgba(20, 83, 45, 0.15);
  border-color: rgba(34, 197, 94, 0.3);
}
.expired-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #d1d5db;
}
.expired-label { color: #6b7280; }
.expired-row code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  background: rgba(147, 51, 234, 0.15);
  color: #f0abfc;
  padding: 2px 8px;
  border-radius: 4px;
}

.banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  font-size: 11.5px;
  line-height: 1.25;
  border-bottom: 1px solid rgba(0, 0, 0, 0.3);
}
.banner-warning {
  background: linear-gradient(90deg, #b45309, #d97706, #b45309);
  color: #fef3c7;
}
.banner-info {
  background: linear-gradient(90deg, #1e3a8a, #2563eb, #1e3a8a);
  color: #dbeafe;
}
.banner .banner-cta {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
}
.banner .banner-cta:hover { background: rgba(255, 255, 255, 0.28); }
.banner .banner-text { flex: 1; min-width: 0; }
.banner a {
  color: white;
  text-decoration: underline;
  font-weight: 600;
  white-space: nowrap;
}
.banner button {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.banner button:hover { background: rgba(255, 255, 255, 0.25); }

/* HAV-IQ brand-purple variant for the install-gate banner */
.banner-haviq {
  background: linear-gradient(90deg, #5b21b6, #9333ea 45%, #ec4899 95%, #9333ea);
  background-size: 200% 100%;
  animation: banner-haviq-shimmer 12s ease-in-out infinite;
  color: #f5e9ff;
  flex-wrap: nowrap;          /* one compact row — never balloon into a tall block */
  row-gap: 3px;
  padding: 4px 10px;
  min-height: 0;
  overflow: hidden;
}
/* the status text shrinks + truncates so the row stays compact */
.banner-haviq #install-gate-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes banner-haviq-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
.banner-haviq .banner-text { display: inline-flex; align-items: center; gap: 6px; }
.banner-haviq .banner-text strong { color: #ffffff; font-weight: 700; }
.banner-haviq .banner-icon { font-size: 14px; line-height: 1; }
.banner-haviq .banner-cta {
  background: rgba(255, 255, 255, 0.95);
  color: #6b21a8;
  font-weight: 700;
  border: 1px solid rgba(255,255,255,0.4);
}
.banner-haviq .banner-cta:hover {
  background: #ffffff;
  color: #581c87;
}
.banner-haviq .banner-ghost {
  background: transparent;
  color: #f5e9ff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  height: auto;
  width: auto;
}
.banner-haviq .banner-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.65);
}
.banner-haviq .banner-ghost:disabled {
  opacity: 0.6;
  cursor: wait;
}
.banner-haviq .banner-secondary {
  color: #f5e9ff;
  text-decoration: underline;
  font-size: 11.5px;
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
}
.banner-haviq .banner-secondary:hover { opacity: 1; }

/* Rotating feature-tease fade transitions */
#install-gate-text {
  display: inline-block;
  transition: opacity 0.3s ease, transform 0.3s ease;
  opacity: 1;
}
#install-gate-text.ig-fade-out { opacity: 0; transform: translateY(-3px); }
#install-gate-text.ig-fade-in  { opacity: 1; transform: translateY(0); }
#install-gate-text em {
  font-style: italic;
  color: #ffe9ff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.25);
}
#install-gate-text code {
  background: rgba(255, 255, 255, 0.18);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #ffffff;
}

/* Mode-aware visibility: each mode shows only its own controls.
 * The banner sets data-mode="preview"|"needs-permset"|"full". */
#install-gate-banner[data-mode="full"]          .ig-preview-only { display: none !important; }
#install-gate-banner[data-mode="full"]          .ig-permset-only { display: none !important; }
#install-gate-banner[data-mode="preview"]       .ig-full-only    { display: none !important; }
#install-gate-banner[data-mode="preview"]       .ig-permset-only { display: none !important; }
#install-gate-banner[data-mode="needs-permset"] .ig-preview-only { display: none !important; }
#install-gate-banner[data-mode="needs-permset"] .ig-full-only    { display: none !important; }

/* Full Mode — calmer gradient (no install CTA = less urgent). Still on
 * brand, but blue-violet instead of hot purple-pink to signal a
 * settled/connected state. */
.banner-haviq[data-mode="full"] {
  background: linear-gradient(90deg, #312e81, #6d28d9 50%, #4338ca 100%);
  background-size: 200% 100%;
}

/* Needs-Permset Mode — amber/orange. User is ONE step away from Full
 * Mode: the package is installed, they just need HAVIQ_Admin. Amber
 * signals "action required" without the alarm of red. */
.banner-haviq[data-mode="needs-permset"] {
  background: linear-gradient(90deg, #92400e, #d97706 50%, #b45309 100%);
  background-size: 200% 100%;
  color: #fef3c7;
}
.banner-haviq[data-mode="needs-permset"] strong { color: #ffffff; }
.banner-haviq[data-mode="needs-permset"] code {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}
.banner-haviq[data-mode="needs-permset"] .banner-cta {
  background: #ffffff;
  color: #92400e;
  font-weight: 700;
}
.banner-haviq[data-mode="needs-permset"] .banner-cta:hover {
  background: #fef3c7;
}
.banner-haviq[data-mode="needs-permset"] .banner-ghost {
  color: #fef3c7;
  border-color: rgba(255, 255, 255, 0.45);
}
.banner-haviq[data-mode="needs-permset"] .banner-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Version pill — shows installed package version when detect() found it */
.banner-pill-version {
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}

/* Connected pill — shown in Full Mode where the install CTA used to be */
.banner-haviq .banner-pill {
  background: rgba(134, 239, 172, 0.18);
  color: #d1fae5;
  border: 1px solid rgba(134, 239, 172, 0.35);
  padding: 3px 10px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  padding: 0 12px;
  border-bottom: 1px solid #2d2d2d;
  background: var(--iris-topbar);
  border-top-left-radius: 11px;
  border-top-right-radius: 11px;
  position: relative;            /* anchor for the centered CI-loading banner */
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; border-radius: 7px; display: block; }
/* Topbar (post-login) is just "IRIS" — you already know which product you're in.
   The full "IRIS Workspace" lockup lives on the login screen, where it introduces
   itself. HAV-IQ remains the name of the managed package it installs. */
.name { font-weight: 600; letter-spacing: 0.01em; }
.ctx {
  margin-left: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #333;
  color: #bbb;
  font-size: 11px;
  cursor: help;
}
.ctx[data-state="safe"] { background: #14532d; color: #86efac; }
.ctx[data-state="prod"] { background: #7f1d1d; color: #fecaca; font-weight: 600; }

/* Phase 7g-0b — Pipeline pill (shown only when >1 pipeline or pinned) */
.pipeline-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: #2a2a32;
  color: #bbb;
  font-size: 11px;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.pipeline-pill[data-state="pinned"] {
  background: linear-gradient(135deg, #4c1d95, #6d28d9);
  color: #ede9fe;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.25);
}
.pipeline-pill[data-state="unpinned"] {
  background: #3a2a5e;
  color: #c4b5fd;
  font-style: italic;
}
.pipeline-pill:hover { filter: brightness(1.1); }

/* Phase 7g-0p (Session 78) — HAV-IQ control-plane pill. Visible ONLY in
   the dual-pin scenario (HaviqPin org ≠ OrgPin org). Amber tone signals
   "you are looking at one org but pipelines route through another" —
   distinct from purple PipelinePin to avoid visual confusion. */
.haviq-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 10px;
  background: linear-gradient(135deg, #78350f, #b45309);
  color: #fef3c7;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25);
}
.haviq-pill[data-state="auto"] {
  font-weight: 500;
  background: linear-gradient(135deg, #5b3010, #92520a);
}
.haviq-pill:hover { filter: brightness(1.15); }

/* Phase 7g-0b — Pipeline pin popover (reuses ctx-pin-* classes + adds list styles) */
.pipeline-pin-popover {
  position: fixed;
  z-index: 10002;
  width: 360px;
  padding: 12px 14px;
  background: #17171c;
  border: 1px solid #3a3a44;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(109, 40, 217, 0.18);
  color: #e4e4e7;
  font-size: 12px;
  line-height: 1.5;
  animation: iris-fade-in 0.12s ease-out;
  max-height: 480px;
  overflow-y: auto;
}
.pipeline-pin-popover .ctx-pin-title,
.pipeline-pin-popover .ctx-pin-row,
.pipeline-pin-popover .ctx-pin-label,
.pipeline-pin-popover .ctx-pin-host,
.pipeline-pin-popover .ctx-pin-sub,
.pipeline-pin-popover .ctx-pin-btn,
.pipeline-pin-popover .ctx-pin-btn-unpin,
.pipeline-pin-popover .ctx-pin-hint {
  /* inherit styles from ctx-pin-* in the ctx-pill popover */
}
.pipeline-pin-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  max-height: 280px;
  overflow-y: auto;
}
/* Multi-pipeline disambiguation prompt (in-chat) */
.msg.pipeline-choice {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pl-choice-head { line-height: 1.45; }
.pl-choice-head strong { color: #c4b5fd; }
.pl-choice-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.pl-pick {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 7px 11px;
  background: #101013;
  border: 1px solid rgba(109, 40, 217, 0.45);
  border-radius: 6px;
  color: #e6e6ea;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
}
.pl-pick:hover { background: rgba(109, 40, 217, 0.16); border-color: rgba(109, 40, 217, 0.8); }
.pl-pick.picked { background: rgba(26, 170, 85, 0.14); border-color: #1AAA55; }
.pl-pick-git { font-size: 10px; opacity: 0.6; font-family: ui-monospace, monospace; }
.pl-picked-note { font-size: 12px; color: #1AAA55; }

.pipeline-pin-item {
  padding: 8px 10px;
  background: #101013;
  border: 1px solid #2a2a32;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.pipeline-pin-item.is-pinned {
  border-color: rgba(109, 40, 217, 0.5);
  background: rgba(109, 40, 217, 0.1);
}
.pipeline-pin-item-name {
  font-weight: 600;
  color: #f3e8ff;
  font-size: 12.5px;
}
.pipeline-pin-item-id {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: #9ca3af;
}
.pipeline-pin-item-id code {
  background: none;
  color: inherit;
  padding: 0;
}
/* Phase 7g-0b v2 — Git context row per pipeline (Provider / Project · Branch) */
.pipeline-pin-item-git {
  font-size: 11px;
  color: #c4b5fd;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}
.pipeline-pin-item-git-provider {
  font-weight: 600;
  color: #e9d5ff;
}
.pipeline-pin-item-git-sep {
  color: #6b7280;
}
.pipeline-pin-item-git-project {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #d8b4fe;
}
.pipeline-pin-item-git-branch {
  color: #9ca3af;
  font-style: italic;
}
.pipeline-pin-item-badge {
  display: inline-block;
  width: fit-content;
  padding: 2px 8px;
  background: rgba(236, 72, 153, 0.15);
  color: #f9a8d4;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
}
/* Phase 7g-0 — pinned org state */
.ctx[data-state="pinned"] {
  background: linear-gradient(135deg, #5b21b6, #7c3aed);
  color: #f3e8ff;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.35);
}
.ctx[data-state="pinned-no-tab"] {
  background: #3f2a60;
  color: #d8b4fe;
  font-style: italic;
}
.ctx { transition: background 0.15s ease, box-shadow 0.15s ease; }
.ctx:hover { filter: brightness(1.1); }

/* Phase 7g-0 — OrgPin popover (anchored beneath the ctx pill) */
.ctx-pin-popover {
  position: fixed;
  z-index: 10002;
  width: 320px;
  padding: 12px 14px;
  background: #17171c;
  border: 1px solid #3a3a44;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(147, 51, 234, 0.12);
  color: #e4e4e7;
  font-size: 12px;
  line-height: 1.5;
  animation: iris-fade-in 0.12s ease-out;
}
.ctx-pin-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #c084fc;
  margin-bottom: 8px;
}
.ctx-pin-row {
  padding: 8px 10px;
  background: #101013;
  border: 1px solid #2a2a32;
  border-radius: 6px;
  margin-bottom: 8px;
}
.ctx-pin-row.ctx-pin-current {
  border-color: rgba(147, 51, 234, 0.45);
  background: rgba(147, 51, 234, 0.09);
}
.ctx-pin-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #a1a1aa;
  margin-bottom: 3px;
}
.ctx-pin-host {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e9d5ff;
  word-break: break-all;
  margin-bottom: 6px;
}
.ctx-pin-sub {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 4px;
}
.ctx-pin-btn {
  display: inline-block;
  padding: 5px 10px;
  background: #7c3aed;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
}
.ctx-pin-btn:hover { background: #6d28d9; }
.ctx-pin-btn-unpin { background: #475569; }
.ctx-pin-btn-unpin:hover { background: #334155; }
.ctx-pin-btn-reconnect { background: #0891b2; }
.ctx-pin-btn-reconnect:hover { background: #0e7490; }
.ctx-pin-btn-reconnect:disabled { background: #475569; cursor: not-allowed; opacity: 0.7; }
.ctx-pin-reconnect {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #2d2d30;
}
.ctx-pin-reconnect-status {
  font-size: 10.5px;
  margin-top: 6px;
  line-height: 1.4;
  min-height: 1em;
}
.ctx-pin-reconnect-ok  { color: #22c55e; }
.ctx-pin-reconnect-err { color: #ef4444; }
.ctx-pin-hint {
  font-size: 10.5px;
  color: #6b7280;
  margin-top: 6px;
  line-height: 1.45;
}

.actions { display: flex; align-items: center; gap: 6px; }
.size-group {
  display: inline-flex;
  align-items: center;
  background: #1e1e1e;
  border: 1px solid #444;
  border-radius: 4px;
  overflow: hidden;
}
.size-group button {
  background: transparent;
  border: none;
  color: #aaa;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 0;
  border-right: 1px solid #444;
}
.size-group button:last-child { border-right: none; }
.size-group button:hover { background: #3d3d3d; color: white; }
.size-group button.active {
  background: linear-gradient(135deg, #9333EA, #EC4899);
  color: white;
}
.actions button {
  background: #333;
  border: 1px solid #444;
  color: #ddd;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.actions button:hover { background: #3d3d3d; }
.actions #btn-close {
  background: transparent;
  border: none;
  font-size: 18px;
  width: 28px;
  padding: 0;
}
.actions #btn-orgintel {
  background: transparent;
  border: 1px solid #444;
  font-size: 14px;
  width: 28px;
  padding: 0;
  text-align: center;
  position: relative;            /* anchor for the status dot */
}
.actions #btn-orgintel .oi-globe { display: inline-block; width: 1.1em; height: 1.2em; overflow: hidden; line-height: 1.2em; vertical-align: middle; }
.actions #btn-orgintel .oi-globe-strip { display: block; }
.actions #btn-orgintel .oi-globe-strip i { display: block; font-style: normal; text-align: center; height: 1.2em; }
/* off — dim, no status dot */
.orgintel.oi-off { opacity: .45; }
.orgintel.oi-off:hover { opacity: .75; }
/* status dot: amber when pending (on, not yet synced), green when ready */
.orgintel.oi-pending::after, .orgintel.oi-ready::after {
  content: ''; position: absolute; right: 1px; bottom: 1px;
  width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid #1b1b22;
}
.orgintel.oi-pending::after { background: #F59E0B; }  /* status-locked */
.orgintel.oi-ready::after   { background: #1AAA55; }  /* status-locked */
/* loading — the globe revolves on its axis by cycling 🌍🌎🌏 faces (same as the banner), not a cartwheel */
.orgintel.oi-loading .oi-globe-strip { animation: ci-earth-roll 1.5s steps(3) infinite; }

/* ── Centered "Org Intelligence Loading…" banner — shown in the topbar while the brain loads
   (e.g. right after a session-expiry re-login). Absolutely centered so it never disturbs the
   brand/actions flex layout; click-through so it can't block the toolbar. ── */
.ci-loading-banner {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .2px;
  color: #9333EA;                /* status-locked — IRIS Intelligence purple */
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.ci-loading-banner[hidden] { display: none; }
/* Earth "revolving on its axis" = cycle the three globe faces 🌍🌎🌏 (filmstrip), not a 2D cartwheel. */
.ci-loading-banner .ci-earth { display: inline-block; width: 1.1em; height: 1.2em; overflow: hidden; line-height: 1.2em; font-size: 15px; vertical-align: middle; }
.ci-loading-banner .ci-earth-strip { display: block; animation: ci-earth-roll 1.5s steps(3) infinite; }
.ci-loading-banner .ci-earth-strip i { display: block; font-style: normal; text-align: center; height: 1.2em; }
@keyframes ci-earth-roll { from { transform: translateY(0); } to { transform: translateY(-3.6em); } }
.ci-loading-dots { display: inline-block; width: 14px; text-align: left; margin-left: -3px; }
.ci-loading-dots i { font-style: normal; opacity: 0; animation: ci-dot 1.4s infinite both; }
.ci-loading-dots i:nth-child(1) { animation-delay: 0s; }
.ci-loading-dots i:nth-child(2) { animation-delay: .2s; }
.ci-loading-dots i:nth-child(3) { animation-delay: .4s; }
@keyframes ci-dot { 0% { opacity: 0; } 35% { opacity: 1; } 70%, 100% { opacity: 0; } }

.chat-only {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

/* Chat with metadata tree on the left — tree always visible, narrows on smaller screens */
.chat-with-tree {
  display: grid;
  grid-template-columns: var(--tree-w, 220px) minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
  position: relative;            /* anchor for the drag-resize handle */
}
@media (max-width: 900px) {
  .chat-with-tree { --tree-w: 180px; }
}
@media (max-width: 600px) {
  .chat-with-tree { --tree-w: 150px; }
}
/* Drag handle straddling the tree/chat border — widen the tree to read long Apex class names. */
.tree-resize {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--tree-w, 220px);
  width: 7px;            /* wide invisible grab area (easy to grab, like VS Code) */
  margin-left: -3px;
  cursor: col-resize;
  z-index: 20;
}
/* only a THIN 1px line is visible; highlights to 2px purple on hover/drag — matches VS Code splitter width */
.tree-resize::before {
  content: "";
  position: absolute;
  top: 0; bottom: 0;
  left: 50%;
  width: 1px;
  transform: translateX(-50%);
  background: transparent;
  transition: background 0.12s, width 0.12s;
}
.tree-resize:hover::before, .tree-resize.dragging::before { width: 1px; background: rgba(147, 51, 234, 0.9); }

.tree-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
  background: var(--iris-panel);
  border-right: 1px solid #2d2d2d;
  overflow: hidden;
}

.tree-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--iris-panel-2);
  border-bottom: 1px solid #2d2d2d;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #9ca3af;
}
.tree-action {
  background: transparent;
  border: 1px solid #3d3d3d;
  color: #9ca3af;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tree-action:hover { background: rgba(147, 51, 234, 0.15); color: #f0abfc; border-color: rgba(147, 51, 234, 0.4); }
.tree-action.spinning { animation: tree-spin 0.8s linear infinite; }
@keyframes tree-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.tree-search { padding: 6px 8px; border-bottom: 1px solid #2d2d2d; }
.tree-search input {
  width: 100%;
  background: #1e1e22;
  border: 1px solid #3d3d3d;
  color: #e6e6e6;
  padding: 5px 8px;
  border-radius: 4px;
  font: inherit;
  font-size: 11px;
}
.tree-search input:focus { outline: none; border-color: rgba(147, 51, 234, 0.5); }

.tree-content {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 0;
  font-size: 12px;
}
.tree-load-more { display: block; width: calc(100% - 16px); margin: 4px 8px 6px; padding: 5px; background: rgba(147, 51, 234, 0.10); border: 1px dashed #6d28d9; border-radius: 5px; color: #a78bfa; font-size: 11px; font-weight: 600; cursor: pointer; }
.tree-load-more:hover { background: rgba(147, 51, 234, 0.20); }
.tree-load-more:disabled { opacity: 0.6; cursor: default; }
.tree-fetch-byname { display: block; margin: 10px auto 0; padding: 7px 12px; background: rgba(147, 51, 234, 0.12); border: 1px solid #6d28d9; border-radius: 6px; color: #c4b5fd; font-size: 12px; cursor: pointer; }
.tree-fetch-byname:hover { background: rgba(147, 51, 234, 0.22); }
/* Flash a re-surfaced (already-open / reopened) card so the user notices it */
.card-flash { animation: cardFlash 1.2s ease; }
@keyframes cardFlash {
  0%, 100% { box-shadow: none; }
  25% { box-shadow: 0 0 0 2px #9333EA, 0 0 18px rgba(147, 51, 234, 0.5); }
}
.tree-loading, .tree-empty, .tree-error {
  padding: 12px;
  font-size: 11px;
  color: #6b7280;
  font-style: italic;
  text-align: center;
}
.tree-error { color: #fca5a5; }

.tree-folder {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #6b7280;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  border-top: 1px solid transparent;
}
.tree-folder:hover {
  color: #c084fc;
  background: rgba(147, 51, 234, 0.05);
}
.tree-folder-arrow {
  display: inline-block;
  width: 10px;
  font-size: 9px;
  color: #6b7280;
  transition: transform 0.15s ease;
  text-align: center;
}
.tree-folder.expanded .tree-folder-arrow {
  transform: rotate(90deg);
}
.tree-folder .tree-count {
  background: #2d2d2d;
  color: #9ca3af;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 9px;
  margin-left: auto;
  font-weight: 500;
}
.tree-folder-content {
  display: none;
  padding-bottom: 4px;
}
.tree-folder.expanded + .tree-folder-content {
  display: block;
}
.tree-folder-empty {
  padding: 3px 12px 8px;
  color: #4b5563;
  font-size: 10px;
  font-style: italic;
}

.tree-item {
  padding: 4px 12px;
  cursor: pointer;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 2px solid transparent;
}
.tree-item:hover {
  background: rgba(147, 51, 234, 0.1);
  color: #f9fafb;
  border-left-color: rgba(147, 51, 234, 0.6);
}
.tree-item.active {
  background: linear-gradient(90deg, rgba(147, 51, 234, 0.25), transparent);
  color: #f0abfc;
  border-left-color: #c084fc;
  font-weight: 500;
}
.tree-item.disabled { color: #4b5563; cursor: not-allowed; }
.tree-item.readonly { color: #9ca3af; }
.tree-item.readonly .tree-item-icon { opacity: 0.7; }
.tree-item-sub {
  color: #6b7280;
  font-size: 10px;
  margin-left: 4px;
}
.tree-item-icon {
  flex: 0 0 auto;
  font-size: 11px;
  color: #6b7280;
  width: 12px;
  text-align: center;
}
.tree-item.active .tree-item-icon { color: #c084fc; }
.tree-item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-pane {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
  overflow: hidden;
}

/* Top progress bar — thin indeterminate bar while IRIS is processing (foundation for the task tray). */
#iris-progress-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: rgba(147,51,234,0.14); z-index: 99999; overflow: hidden; pointer-events: none; }
/* Queued-mode indicator chip (above the input): "IRIS is working · N queued · ⏹ Stop". */
#iris-queue-indicator { display: flex; align-items: center; gap: 10px; margin: 0 12px 6px; padding: 6px 12px; font-size: 12px; color: #9ca3af; background: rgba(147,51,234,0.08); border: 1px solid rgba(147,51,234,0.25); border-radius: 8px; }
#iris-queue-indicator .qi-count { font-weight: 600; color: #b98aff; }
#iris-queue-indicator .qi-stop { margin-left: auto; background: transparent; border: 1px solid rgba(194,57,52,0.5); color: #fca5a5; border-radius: 6px; padding: 3px 10px; font-size: 11.5px; cursor: pointer; }
#iris-queue-indicator .qi-stop:hover { background: rgba(194,57,52,0.18); }
.iris-progress-fill { position: absolute; top: 0; height: 100%; width: 38%; border-radius: 3px; background: linear-gradient(90deg, transparent, #9333EA, #b98aff, #9333EA, transparent); animation: iris-progress-slide 1.15s ease-in-out infinite; }
@keyframes iris-progress-slide { 0% { left: -40%; } 100% { left: 100%; } }
@media (prefers-reduced-motion: reduce) { .iris-progress-fill { animation-duration: 2.4s; } }

/* Cross-linked org components in a chat response (feedback #1): dotted purple underline; hover = bubble. */
.md-link { color: #b98aff; border-bottom: 1px dotted rgba(147,51,234,0.6); cursor: pointer; }
.md-link:hover { color: #cbb0ff; border-bottom-color: #9333EA; background: rgba(147,51,234,0.10); border-radius: 3px; }
.md-tip { position: fixed; z-index: 100000; max-width: 320px; padding: 9px 11px; border-radius: 9px;
  background: #16161c; border: 1px solid #3a3a46; border-left: 3px solid #9333EA; box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 12px; line-height: 1.5; color: #d8dee9; }
.md-tip .md-tip-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 4px; }
.md-tip .md-tip-head b { color: #e6e6ea; font-size: 12.5px; }
.md-tip .md-tip-kind { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }
.md-tip .md-tip-body { color: #b9bdc6; }
.md-tip .md-tip-hint { margin-top: 6px; font-size: 10.5px; color: #6b7280; }

.chat-log {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  padding: 10px 12px;
  border-radius: 10px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
  max-width: 90%;
  font-size: 13px;
  /* The chat-log is a flex column — without this, appending a new message/card
     vertically COMPRESSES existing ones (squished to a line). Every bubble + msg-
     based card keeps its natural height; the log scrolls instead. (2026-07-08) */
  flex-shrink: 0;
}
.msg.user {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  align-self: flex-end;
}
/* A response that is ENTIRELY a card (doc / plan / testsuite) leaves an empty
   assistant bubble — without this it renders as a padded blank strip ("blank
   line"). Hide empty assistant bubbles so only the card shows. */
.msg.assistant:empty { display: none; padding: 0; margin: 0; border: 0; }

/* Per-response actions — ⬇ download / ⧉ copy on every assistant reply */
.msg-actions { display: flex; gap: 4px; margin-top: 8px; opacity: 0; transition: opacity 0.15s; }
.msg.assistant:hover .msg-actions, .msg-actions:focus-within { opacity: 1; }
.msg-act { background: transparent; border: 1px solid #3a3a42; border-radius: 6px; color: #9a9aa8; cursor: pointer; font-size: 12px; padding: 1px 7px; line-height: 1.4; }
.msg-act:hover { color: #c4b5fd; border-color: #9333EA; }

/* Send button → ⏹ Stop while a turn is in flight */
#btn-send.btn-stop { background: #C23934 !important; border-color: #C23934 !important; color: #fff !important; }
#btn-send.btn-stop:hover { background: #a52d29 !important; }
.msg.assistant {
  background: var(--iris-surface);
  color: var(--iris-text);
  align-self: flex-start;
}
/* Code editor + plan cards carry code and side-by-side diffs — they need the
   full chat-column width, not the 90% chat-bubble cap. */
.code-editor-card,
.plan-card {
  max-width: 100%;
  width: 100%;
  align-self: stretch;
}
/* Code editor card is collapsed by default — header only; click to expand. */
.code-editor-card-collapsed .cec-body { display: none; }
.code-editor-card-collapsed .cec-header { margin-bottom: 0; }

/* Live-highlighted editor: a transparent textarea over a synced layer that
   colors changed lines. Both MUST share font/padding/line-height exactly. */
/* Find & Replace bar (edit mode) */
.cec-find { display: flex; align-items: center; gap: 4px; margin-bottom: 6px; padding: 5px 6px; background: #1b1b22; border: 1px solid #6d28d9; border-radius: 8px; flex-wrap: wrap; }
.cec-find input { background: #0f0a1f; border: 1px solid #3a3a46; border-radius: 5px; color: #e9d5ff; font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 4px 7px; box-sizing: border-box; }
.cec-find-q, .cec-find-r { width: 150px; }
.cec-find-count { font-size: 11px; color: #9ca3af; min-width: 42px; text-align: center; }
.cec-find button { background: transparent; border: 1px solid #4a4a54; border-radius: 5px; color: #c4b5fd; font: 11px system-ui; padding: 4px 7px; cursor: pointer; }
.cec-find button:hover { background: rgba(147, 51, 234, 0.18); }
.cec-find-case.on { background: #9333EA; color: #fff; border-color: #9333EA; }
.cec-find-x { margin-left: auto; }
.cec-edit-wrap { position: relative; min-height: 320px; display: flex; align-items: flex-start; }
.cec-edit-main { position: relative; flex: 1; min-width: 0; height: 100%; }
/* Dual pane: give the editor (left) the SAME fixed, scrollable height as the Existing pane (right,
   460px) so the textarea scrolls INTERNALLY (its scroll event fires) and both panes stay synced
   line-for-line on both axes. Single pane keeps the natural full-height editor. */
.cec-edit-wrap.cec-dual .cec-edit-main,
.cec-edit-wrap.cec-dual .cec-egutter { height: 460px; }
.cec-edit-wrap .cec-editor,
.cec-edit-wrap .cec-hl {
  margin: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 10px;
  border: 1px solid #6d28d9;
  border-radius: 8px;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: pre;
  tab-size: 4;
}
.cec-edit-wrap .cec-hl {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  /* Visible default for plain tokens; ApexHighlight spans override per token.
     The textarea on top is transparent, so THIS layer is what the user sees. */
  color: #e9d5ff;
  background: #0f0a1f;
  border-color: transparent;
  z-index: 0;
}
.cec-edit-wrap .cec-editor {
  position: relative;
  z-index: 1;
  background: transparent;
  /* Transparent text + visible caret → the colored highlight layer shows
     through while you type. */
  color: transparent;
  caret-color: #e9d5ff;
  overflow: auto;
}
.cec-edit-wrap .cec-editor::selection { background: rgba(147, 51, 234, 0.45); }
.cec-hl-line { display: block; min-height: 1.5em; }
.cec-hl-add { background: rgba(34, 197, 94, 0.30); }
/* As-you-type ghost autocomplete (grey suggestion shown through the textarea) */
.cec-ghost { color: #6b7280; opacity: 0.85; font-style: italic; }
.cec-ghost-more { color: #7c6ba8; font-size: 10px; font-style: normal; opacity: 0.9; }
.cec-ac-toggle.on { background: #9333EA !important; color: #fff !important; border-color: #9333EA !important; }

/* View: line-numbered, foldable rows (VSCode-style) */
.cec-rows { line-height: 1.5; }
.cec-vrow { display: flex; align-items: flex-start; }
.cec-vrow:hover { background: rgba(147, 51, 234, 0.07); }
.cec-vgutter { flex-shrink: 0; display: inline-flex; align-items: baseline; gap: 2px; width: 56px; padding: 0 8px 0 4px; user-select: none; }
.cec-vfold { width: 14px; flex-shrink: 0; text-align: center; color: #7c6ba8; cursor: pointer; font-size: 10px; line-height: 1.5; }
.cec-vfold-empty { cursor: default; visibility: hidden; }
.cec-vfold:hover { color: #c4b5fd; }
.cec-vnum { flex: 1; text-align: right; color: #6b7280; font-size: 11px; }
.cec-vcode { flex: 1; min-width: 0; padding-right: 10px; white-space: pre; }
.cec-folded-head .cec-vcode::after { content: ' ⋯ }'; color: #6a9955; opacity: 0.8; }

/* Edit: line-number gutter beside the textarea overlay */
.cec-egutter { flex-shrink: 0; width: 46px; overflow: hidden; padding: 10px 8px 10px 0; text-align: right; color: #6b7280; background: #0c0818; border: 1px solid #6d28d9; border-right: 0; border-radius: 8px 0 0 8px; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; user-select: none; box-sizing: border-box; }
.cec-egn { height: 1.5em; }
.cec-edit-main .cec-hl, .cec-edit-main .cec-editor { border-radius: 0 8px 8px 0; }

/* Dual-pane edit: left = your changes, right = existing (read-only), synced scroll */
.cec-edit-wrap.cec-dual { gap: 10px; }
.cec-edit-col { display: flex; flex-direction: column; flex: 1; min-width: 0; }
/* Right "Existing" pane is hidden in single mode; shown ONLY in dual. (Using a
   class beats the [hidden] attribute, which display:flex would otherwise win.) */
.cec-edit-right { display: none; flex-direction: column; flex: 1; min-width: 0; }
.cec-edit-wrap.cec-dual .cec-edit-right { display: flex; }
/* Fixed-height frame (same model as the read-only "Existing" pane): the editor
   + gutter fill it 100% and scroll internally, so the gutter's line-number
   content can't balloon the frame. Resizable like a panel. */
.cec-edit-inner { display: flex; position: relative; height: 460px; min-height: 320px; max-height: 75vh; overflow: hidden; align-items: stretch; resize: vertical; }
.cec-egutter { min-height: 0; height: 100%; }
.cec-col-head { font: 11px/1.4 system-ui; font-weight: 600; color: #c4b5fd; padding: 4px 8px 6px; }
.cec-right-body .cec-vrow.cec-removed-line { background: rgba(239, 68, 68, 0.26); }
.cec-right-body { height: 460px; min-height: 320px; max-height: 75vh; overflow: auto; box-sizing: border-box; resize: vertical;
  background: #0f0a1f; color: #e9d5ff; border: 1px solid #6d28d9; border-radius: 8px; padding: 6px 0; white-space: pre;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
/* Single ◧ / Dual ◨ segmented toggle */
.cec-pane-toggle { display: inline-flex; border: 1px solid #6d28d9; border-radius: 6px; overflow: hidden; }
.cec-pane-btn { background: transparent; color: #9ca3af; border: 0; padding: 5px 10px; font: 11px/1 system-ui; font-weight: 600; cursor: pointer; }
.cec-pane-btn + .cec-pane-btn { border-left: 1px solid #6d28d9; }
.cec-pane-btn.active { background: #9333EA; color: #fff; }

/* Inline editing of agent-generated plan code (Edit → Save / Reset). */
.plan-edit-btn,
.plan-edit-save,
.plan-edit-reset {
  margin-left: 8px;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 5px;
  cursor: pointer;
  border: 1px solid #6d28d9;
  background: transparent;
  color: #c4b5fd;
  vertical-align: middle;
}
.plan-edit-save { background: #9333EA; color: #fff; border-color: #9333EA; }
.plan-edit-btn:hover,
.plan-edit-reset:hover { background: rgba(147, 51, 234, 0.18); }
.plan-diff-edit {
  width: 100%;
  box-sizing: border-box;
  min-height: 280px;
  max-height: 720px;   /* match .plan-diff-body so the two panes share a viewport height while editing */
  resize: vertical;
  margin-top: 6px;
  background: #0f0a1f;
  color: #e9d5ff;
  border: 1px solid #6d28d9;
  border-radius: 8px;
  padding: 10px;
  /* font-size + line-height IDENTICAL to .plan-diff-body so mirrored scrollTop stays line-for-line */
  font: 11px/1.5 "SF Mono", Menlo, Consolas, monospace;
}
.plan-edit-saved { margin-left: 8px; font-size: 11px; color: #86efac; }
.plan-edit-count {
  margin-left: 8px;
  font-size: 11px;
  color: #c4b5fd;
  background: rgba(147, 51, 234, 0.16);
  border: 1px solid #6d28d9;
  border-radius: 10px;
  padding: 1px 8px;
}

/* 💜 Section-scoped refine — mini chat inside a plan section */
.plan-refine-btn {
  margin-left: 6px;
  background: transparent;
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 3px 7px;
  cursor: pointer;
  font-size: 12px;
  line-height: 1;
}
.plan-refine-btn:hover { background: rgba(147, 51, 234, 0.18); }
.section-refine {
  margin: 8px 0 4px;
  padding: 8px;
  background: rgba(147, 51, 234, 0.08);
  border: 1px solid #6d28d9;
  border-radius: 8px;
}
.section-refine .sr-bar { display: flex; gap: 6px; align-items: flex-end; }
.section-refine .sr-input {
  flex: 1;
  resize: vertical;
  min-height: 38px;
  box-sizing: border-box;
  background: var(--iris-panel-2, #1f1f23);
  color: var(--iris-text, #e6e6e6);
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 6px 8px;
  font: 12.5px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.section-refine .sr-send,
.section-refine .sr-close {
  border: 0;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 13px;
}
.section-refine .sr-send { background: #9333EA; color: #fff; }
.section-refine .sr-send:disabled { opacity: 0.6; cursor: default; }
.section-refine .sr-close { background: transparent; color: #9a9aa8; border: 1px solid #3a3a42; }
.section-refine .sr-status { margin-top: 6px; font-size: 11.5px; color: #c4b5fd; min-height: 14px; }

/* Flow visualizer — diagram of a generated Salesforce Flow */
.btn-visualize-flow {
  background: transparent;
  color: #c4b5fd;
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
.btn-visualize-flow:hover { background: rgba(147, 51, 234, 0.18); }
.btn-export-doc {
  background: transparent;
  color: #c4b5fd;
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
}
.btn-export-doc:hover { background: rgba(147, 51, 234, 0.18); }
.btn-refine-card {
  background: #9333EA;
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 5px 11px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.btn-refine-card:hover { filter: brightness(1.1); }
.flow-diagram-wrap {
  margin: 8px 0;
  border: 1px solid #34343e;
  border-radius: 8px;
  background: #141418;
  overflow: hidden;
}
.flow-diagram-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #c4b5fd;
  background: #1b1b22;
  border-bottom: 1px solid #2a2a32;
}
.flow-diagram-label { flex: 1; }
.flow-refine {
  background: #9333EA;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
}
.flow-refine:hover { filter: brightness(1.1); }
.flow-expand {
  background: transparent; color: #c4b5fd; border: 1px solid #6d28d9;
  border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; padding: 5px 11px;
}
.flow-expand:hover { background: rgba(147, 51, 234, 0.18); }
.flow-inline-btn {
  background: transparent; color: #c4b5fd; border: 1px solid #6d28d9;
  border-radius: 4px; cursor: pointer; font-size: 12px; font-weight: 600; padding: 5px 11px;
}
.flow-inline-btn:hover { background: rgba(147, 51, 234, 0.18); }
/* Inline-expanded: natural size + scroll within the card (the old behaviour). */
.flow-diagram-frame.flow-inline-expanded {
  height: auto; max-height: 80vh; overflow: auto; display: block;
}
.flow-diagram-frame.flow-inline-expanded .flow-diagram-svg { max-width: none; max-height: none; }
.flow-diagram-scroll { overflow: auto; max-height: 560px; padding: 12px; }
.flow-diagram-svg { display: block; }
/* Flow expand modal — dark, theme-based (the diagram is dark-styled), unlike the
   white SLDS record/layout modals. */
.spv-modal-card.spv-modal-dark { background: var(--iris-bg, #0b0c10); }
.spv-modal-dark .spv-modal-bar { background: var(--iris-panel-2, #161922); color: var(--iris-text, #e9e9ee); border-bottom: 1px solid var(--iris-border, #262b38); }
.spv-modal-dark .spv-modal-x { color: #9ca3af; }
.spv-modal-dark .spv-modal-x:hover { color: #fff; }
.flow-modal-body { display: block; background: #e7ebf2; }
/* Default: fit the WIDTH so blocks stay readable; scroll vertically if tall
   (shrink-to-fit-both made tall flows unreadably tiny). Light canvas so the
   light nodes + dark text are clearly visible (Flow-Builder style). */
.flow-diagram-frame {
  max-height: 480px; padding: 14px; overflow: auto; background: #15151b;
}
.flow-diagram-frame .flow-diagram-svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
/* Expanded modal: natural size, scroll both ways. */
.flow-modal-body .flow-diagram-svg { max-width: none; max-height: none; }
.flow-diagram-error {
  margin: 8px 0;
  padding: 8px 10px;
  color: #fca5a5;
  font-size: 12px;
  background: #3b1f1f;
  border: 1px solid #b91c1c;
  border-radius: 6px;
}

/* Salesforce-style screen mockup (light SLDS-flavoured, theme-independent) */
.sfm-wrap { margin: 8px 0; }
.sfm {
  background: #fff;
  border: 1px solid #d8dde6;
  border-radius: 8px;
  overflow: hidden;
  color: #080707;
  font-family: "Salesforce Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.sfm-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: #f3f3f3; border-bottom: 1px solid #d8dde6;
}
.sfm-icon {
  width: 36px; height: 36px; border-radius: 6px; background: #9333EA; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.sfm-titlewrap { flex: 1; min-width: 0; }
.sfm-refresh {
  margin-left: auto;
  background: #fff;
  border: 1px solid #c9c7c5;
  border-radius: 4px;
  color: #514f4d;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 4px 9px;
}
.sfm-refresh:hover { background: #f3f3f3; }
.sfm-refine {
  background: #9333EA;
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 11px;
  margin-left: auto;
}
.sfm-refine:hover { filter: brightness(1.1); }
.sfm-refine + .sfm-refresh { margin-left: 6px; }
/* the in-preview refine chat sits inside the white mockup — keep it readable */
.sfm-wrap > .section-refine { margin: 8px; }
.sfm-obj { font-size: 15px; font-weight: 700; color: #080707; }
.sfm-sub { font-size: 11px; color: #706e6b; }
.sfm-body { max-height: 440px; overflow: auto; padding: 14px 16px; background: #fff; }
.sfm-section {
  font-size: 12px; font-weight: 700; color: #514f4d;
  border-bottom: 1px solid #e5e5e5; padding-bottom: 6px; margin-bottom: 12px;
}
.sfm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 28px; }
.sfm-field { min-width: 0; }
.sfm-label { font-size: 11px; color: #3e3e3c; margin-bottom: 3px; }
.sfm-req { color: #c23934; }
.sfm-type { color: #969492; font-size: 10px; }
.sfm-input {
  border: 1px solid #c9c7c5; border-radius: 4px; padding: 5px 8px;
  font-size: 13px; background: #fff; min-height: 30px; box-sizing: border-box;
  display: flex; align-items: center; justify-content: space-between; color: #080707;
}
.sfm-ph { color: #969492; }
.sfm-pick .sfm-chev, .sfm-ic { color: #706e6b; }
.sfm-ta { min-height: 54px; align-items: flex-start; }
.sfm-check { font-size: 16px; color: #706e6b; }
/* Interactive controls — real, clickable Salesforce-style inputs */
.sfm-in {
  width: 100%; box-sizing: border-box;
  border: 1px solid #c9c7c5; border-radius: 4px; padding: 5px 8px;
  font-size: 13px; background: #fff; color: #080707; min-height: 30px;
  font-family: inherit;
}
.sfm-in:focus { outline: none; border-color: #9333EA; box-shadow: 0 0 0 1px #9333EA; }
textarea.sfm-ta-in { min-height: 54px; resize: vertical; }
.sfm-cb { width: 16px; height: 16px; accent-color: #9333EA; cursor: pointer; margin: 0; }
.sfm-pickwrap { position: relative; min-width: 0; }
.sfm-pick { cursor: pointer; user-select: none; }
.sfm-pick.open { border-color: #9333EA; box-shadow: 0 0 0 1px #9333EA; }
.sfm-pick.open .sfm-chev { color: #9333EA; }
.sfm-pick-menu {
  margin-top: 2px; background: #fff; border: 1px solid #c9c7c5; border-radius: 4px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.14); max-height: 190px; overflow: auto; padding: 4px 0;
}
.sfm-pick-menu[hidden] { display: none; }
.sfm-opt { padding: 6px 10px; font-size: 13px; color: #080707; cursor: pointer; }
.sfm-opt:hover { background: #f3eafe; color: #6b21a8; }
.sfm-opt.sel { background: #faf5ff; color: #6b21a8; font-weight: 600; }
.sfm-empty { color: #706e6b; font-size: 13px; }
@media (max-width: 560px) { .sfm-grid { grid-template-columns: 1fr; } }

/* Page Layout preview — SLDS-style record screen */
.lp-wrap { padding: 0 !important; background: transparent !important; max-width: 100% !important; }
.lp-card { border: 1px solid #d8dde6; border-radius: 10px; overflow: hidden; background: #fff; }
.lp-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: #f3f3f3; border-bottom: 1px solid #e5e5e5; }
/* Graceful fallback when a Layout XML won't parse — show source instead of hard-erroring. */
.lp-parse-warn { padding: 8px 14px; color: #8a6d00; background: #fff8e1; border-bottom: 1px solid #f0e2b8; font-size: 12px; }
.lp-src { margin: 0; padding: 10px 14px; max-height: 320px; overflow: auto; background: #fbfbfb; color: #333; font-size: 11.5px; line-height: 1.45; white-space: pre; }
.lp-ic { font-size: 18px; color: #514f4d; }
.lp-title { font-size: 15px; font-weight: 700; color: #080707; }
.lp-sub { font-size: 11px; color: #706e6b; }
.lp-body { max-height: 460px; overflow: auto; padding: 12px 16px; background: #fff; }
.lp-section { margin-bottom: 16px; }
.lp-sec-label { font-size: 12px; font-weight: 700; color: #514f4d; border-bottom: 1px solid #e5e5e5; padding-bottom: 6px; margin-bottom: 10px; }
.lp-grid { display: grid; gap: 12px 28px; }
.lp-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lp-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lp-label { font-size: 11px; color: #3e3e3c; }
.lp-in {
  width: 100%; box-sizing: border-box; border: 1px solid #c9c7c5; border-radius: 4px;
  padding: 5px 8px; font-size: 13px; min-height: 30px; background: #fff; color: #080707; font-family: inherit;
}
.lp-in:focus { outline: none; border-color: #9333EA; box-shadow: 0 0 0 1px #9333EA; }
.lp-in:disabled { background: #f3f3f3; color: #969492; cursor: not-allowed; }
/* Type-accurate controls (layout preview renders the real field type) */
.lp-in.lp-cb { width: 18px; min-height: 18px; height: 18px; padding: 0; accent-color: #9333EA; cursor: default; }
.lp-in.lp-sel { appearance: auto; cursor: default; }
.lp-in.lp-ta { min-height: 46px; resize: vertical; }
.lp-in.lp-lookup { background-image: none; }
/* Small type chip next to the field name so the user SEES "Checkbox" / "Picklist" */
.lp-type {
  font-size: 9.5px; font-weight: 600; color: #6b21a8;
  background: rgba(147, 51, 234, 0.10); border: 1px solid rgba(147, 51, 234, 0.28);
  border-radius: 4px; padding: 0 4px; margin-left: 4px; white-space: nowrap; vertical-align: middle;
}

/* Interactive layout — ✥ Arrange mode (drag fields to reorder/reposition) */
.lp-itembody { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.lp-drag { display: none; color: #9333EA; font-size: 14px; line-height: 1; user-select: none; }
.lp-blank-tag { font-size: 10px; color: #b8b8b8; font-style: italic; }
.lp-arrange-btn.active { background: rgba(147, 51, 234, 0.18); }
.lp-arrange .lp-item {
  flex-direction: row; align-items: center; gap: 8px;
  padding: 4px 6px; border: 1px solid transparent; border-radius: 8px; cursor: grab;
}
.lp-arrange .lp-item:hover { background: rgba(147, 51, 234, 0.05); border-color: #e5d5f5; }
.lp-arrange .lp-drag { display: inline; cursor: grab; }
.lp-arrange .lp-item.lp-dragging { opacity: 0.4; }
.lp-arrange .lp-item.lp-drop-before { box-shadow: inset 0 3px 0 -1px #9333EA; }
.lp-arrange .lp-item.lp-drop-after { box-shadow: inset 0 -3px 0 -1px #9333EA; }
.lp-arrange .lp-col.lp-drop-into { outline: 2px dashed #9333EA; outline-offset: 3px; border-radius: 8px; }
.lp-arrange .lp-col { min-height: 28px; }

/* Field palette + remove zone (Arrange mode) */
.lp-arrange-tools { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 10px; background: rgba(147, 51, 234, 0.05); border: 1px solid #e5d5f5; border-radius: 10px; }
.lp-palette { flex: 1; min-width: 220px; display: flex; flex-direction: column; gap: 6px; }
.lp-pal-label { font-size: 11px; font-weight: 600; color: #6b21a8; }
.lp-pal-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 120px; overflow-y: auto; }
.lp-pal-chip { display: inline-flex; align-items: center; background: #fff; border: 1px solid #c4b5fd; border-radius: 6px; padding: 3px 8px; font-size: 12px; color: #4c1d95; cursor: grab; }
.lp-pal-chip:hover { background: #f5f3ff; border-color: #9333EA; }
.lp-pal-chip.lp-dragging { opacity: 0.4; }
.lp-remove-zone { align-self: stretch; display: flex; align-items: center; justify-content: center; min-width: 130px; padding: 8px 12px; border: 2px dashed #d1a3a3; border-radius: 8px; color: #b15858; font-size: 12px; font-weight: 600; }
.lp-remove-zone.active { border-color: #C23934; background: rgba(194, 57, 52, 0.08); color: #C23934; }

/* Per-field behavior badge — only interactive in Arrange mode */
.lp-beh { display: none; margin-left: 6px; background: #fff; border: 1px solid #c4b5fd; border-radius: 5px; padding: 0 6px; font-size: 10px; color: #4c1d95; cursor: pointer; vertical-align: middle; }
.lp-beh:hover { background: #f5f3ff; border-color: #9333EA; }
.lp-arrange .lp-beh { display: inline-block; }
.lp-arrange .lp-req, .lp-arrange .lp-ro { display: none; }   /* the badge replaces the static tags while arranging */
.lp-blank { min-height: 52px; }
.lp-field { font-weight: 500; }
.lp-req { color: #c23934; font-weight: 700; }
.lp-ro { color: #706e6b; font-size: 10.5px; background: #ececec; padding: 1px 6px; border-radius: 999px; }
.lp-rls { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-chip { font-size: 12px; color: #08389e; background: #eef2fb; border: 1px solid #d6e0f5; border-radius: 999px; padding: 3px 10px; }
.lp-rl { border: 1px solid #e0e3e8; border-radius: 6px; padding: 8px 10px; margin-bottom: 8px; background: #fafbfc; }
.lp-rl-name { font-size: 12.5px; font-weight: 600; color: #08389e; margin-bottom: 6px; }
.lp-rl-cols { display: flex; flex-wrap: wrap; gap: 5px; }
.lp-rl-col { font-size: 11px; color: #3e3e3c; background: #eef2fb; border: 1px solid #d6e0f5; border-radius: 4px; padding: 2px 7px; font-family: "SF Mono", Menlo, monospace; }
.lp-rl-empty { font-size: 11px; color: #969492; font-style: italic; }
.lp-empty-msg { color: #706e6b; font-size: 13px; }
.lp-pv { margin: 8px 0; }

/* SplitPreview — XML (left) / live preview (right) + ⤢ Expand modal */
.spv { display: grid; grid-template-columns: 1fr 1fr; margin: 8px 0; border: 1px solid var(--iris-border, #2a2a32); border-radius: 10px; overflow: hidden; }
.spv-pane { display: flex; flex-direction: column; min-width: 0; }
.spv-code { border-right: 1px solid var(--iris-border, #2a2a32); }
.spv-pane-h {
  display: flex; align-items: center; gap: 8px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: #9ca3af; padding: 6px 10px; background: rgba(0,0,0,0.18); border-bottom: 1px solid var(--iris-border, #2a2a32);
}
.spv-pane-h > span:first-child { flex: 1; }
.spv-refine, .spv-expand {
  background: transparent; border: 1px solid #6d28d9; color: #c4b5fd; border-radius: 5px;
  padding: 2px 8px; font-size: 11px; font-weight: 600; cursor: pointer; letter-spacing: 0;
}
.spv-refine { background: #9333EA; color: #fff; border-color: #9333EA; }
.spv-refine:hover { filter: brightness(1.1); }
.spv-expand:hover { background: rgba(147,51,234,0.18); }
.spv-src {
  flex: 1; min-height: 360px; max-height: 600px; resize: vertical; border: 0; outline: none;
  padding: 10px 12px; background: #0a0b0f; color: #d6c8ee;
  font: 12px/1.55 "SF Mono", Menlo, Consolas, monospace; white-space: pre; overflow: auto;
}
.spv-preview { flex: 1; min-height: 360px; max-height: 600px; overflow: auto; padding: 10px; background: #f3f3f5; }
@media (max-width: 680px) { .spv { grid-template-columns: 1fr; } .spv-code { border-right: 0; border-bottom: 1px solid var(--iris-border, #2a2a32); } }

.spv-modal { position: fixed; inset: 0; z-index: 9999; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; padding: 24px; }
.spv-modal-card { width: 92vw; height: 90vh; background: #fff; border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.spv-modal-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; background: #f3f3f3; border-bottom: 1px solid #e5e5e5; font-weight: 700; color: #080707; }
.spv-modal-x { background: transparent; border: 0; font-size: 16px; cursor: pointer; color: #514f4d; }
.spv-modal-body { flex: 1; overflow: auto; padding: 18px; background: #f3f3f5; }
.lp-refine { margin-left: auto; background: #9333EA; color: #fff; border: 0; border-radius: 4px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer; }
.lp-refine:hover { filter: brightness(1.1); }
@media (max-width: 560px) { .lp-grid { grid-template-columns: 1fr !important; } }

/* MetaEditor — shared edit-source / live-preview card */
.meta-editor { padding: 0 !important; background: transparent !important; max-width: 100% !important; }
.meta-editor .me-head {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--iris-panel-2, #1b1b22); border: 1px solid var(--iris-border, #2a2a32);
  border-bottom: 0; border-radius: 10px 10px 0 0;
}
.me-ic { color: #c084fc; font-size: 15px; }
.me-titlewrap { flex: 1; min-width: 0; }
.me-title { font-size: 13px; font-weight: 700; color: var(--iris-text, #e9e9ee); }
.me-sub { font-size: 11px; color: #9ca3af; }
.me-reset {
  background: transparent; color: #c4b5fd; border: 1px solid #6d28d9;
  border-radius: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.me-reset:hover { background: rgba(147, 51, 234, 0.18); }
.me-body {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--iris-border, #2a2a32); border-radius: 0 0 10px 10px; overflow: hidden;
}
.me-pane { display: flex; flex-direction: column; min-width: 0; }
.me-edit { border-right: 1px solid var(--iris-border, #2a2a32); }
.me-pane-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af;
  padding: 6px 10px; background: rgba(0,0,0,0.18); border-bottom: 1px solid var(--iris-border, #2a2a32);
}
.me-src {
  flex: 1; min-height: 320px; max-height: 560px; resize: vertical;
  border: 0; outline: none; padding: 10px 12px; background: #0a0b0f; color: #d6c8ee;
  font: 12px/1.55 "SF Mono", Menlo, Consolas, monospace; white-space: pre; overflow: auto;
}
.me-preview { flex: 1; min-height: 320px; max-height: 560px; overflow: auto; padding: 10px; background: #f3f3f5; }
.me-error { color: #fca5a5; font-size: 12px; padding: 10px 12px; background: #3b1f1f; border: 1px solid #b91c1c; border-radius: 6px; }
@media (max-width: 620px) { .me-body { grid-template-columns: 1fr; } .me-edit { border-right: 0; border-bottom: 1px solid var(--iris-border, #2a2a32); } }
.msg.error {
  background: #5a1d1d;
  color: #ffd1d1;
  align-self: flex-start;
}
.msg pre, .msg code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Rendered (markdown + thinking) assistant messages — drop pre-wrap so block elements render properly */
.msg.assistant.rendered { white-space: normal; }
.msg-md { white-space: normal; }
.msg-md p { margin: 0 0 8px 0; }
.msg-md p:last-child { margin-bottom: 0; }
.msg-md ul, .msg-md ol { margin: 4px 0 8px 0; padding-left: 20px; }
.msg-md li { margin: 2px 0; line-height: 1.5; }
.msg-md h2, .msg-md h3, .msg-md h4 {
  margin: 10px 0 6px 0; font-weight: 600; color: #f0f0f0;
}
.msg-md h2 { font-size: 15px; }
.msg-md h3 { font-size: 14px; }
.msg-md h4 { font-size: 13px; color: #d4d4d4; }
.msg-md strong { color: #fff; font-weight: 600; }
.msg-md em { color: #ccc; }
.msg-md code.md-inline {
  background: #1a1a1a; padding: 1px 5px; border-radius: 3px;
  font-size: 11.5px; color: #f5b8a8; border: 1px solid #333;
}
.msg-md pre.md-code {
  background: #161616; border: 1px solid #333; border-radius: 6px;
  padding: 10px 12px; margin: 8px 0;
  overflow-x: auto; overflow-y: auto;
  max-height: 360px; white-space: pre;
}
.msg-md pre.md-code code {
  background: transparent; border: none; padding: 0;
  color: #e6e6e6; font-size: 12px; line-height: 1.45;
}
.msg-md.msg-empty { color: #888; font-style: italic; }

/* GFM tables (renderMarkdown → .md-table). Scrolls horizontally on its own so a wide
   table never forces the message body to scroll sideways. */
.msg-md .md-table {
  display: block; width: max-content; max-width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 10px 0; font-size: 12.5px;
  border: 1px solid #333; border-radius: 6px;
}
.msg-md .md-table th, .msg-md .md-table td {
  border: 1px solid #2d2d2d; padding: 6px 10px; text-align: left; vertical-align: top;
}
.msg-md .md-table th {
  background: #1e1e1e; color: var(--iris-text, #e8eaf0); font-weight: 600; white-space: nowrap;
}
.msg-md .md-table td { color: var(--iris-text, #e8eaf0); }
.msg-md .md-table tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Collapsible thinking block — Claude-Code style */
.msg-thinking {
  margin: 0 0 8px 0;
  border-left: 2px solid #4a4a55;
  background: rgba(255,255,255,0.02);
  border-radius: 0 4px 4px 0;
}
.msg-thinking summary {
  cursor: pointer; padding: 4px 10px; font-size: 11.5px;
  color: #8a8a96; user-select: none; list-style: none; outline: none;
}
.msg-thinking summary::-webkit-details-marker { display: none; }
.msg-thinking summary::before {
  content: "▾ "; color: #6a6a76; display: inline-block; margin-right: 2px;
  transition: transform 0.15s ease;
}
.msg-thinking[open] summary::before {
  content: "▴ "; color: #c9a3ff;
}
.msg-thinking summary:hover { color: #b0b0bb; }
.msg-thinking .thinking-icon { margin-right: 4px; opacity: 0.7; }
.msg-thinking-body {
  padding: 6px 12px 8px 12px; font-size: 11.5px; line-height: 1.55;
  color: #9a9aa8; white-space: pre-wrap; font-family: inherit;
  border-top: 1px dashed #333;
  max-height: 240px; overflow-y: auto;
}
.msg-thinking-live summary { color: #c9a3ff; }
.msg-thinking-live summary::after {
  content: " · streaming"; color: #6a6a76; font-style: italic; font-size: 10.5px;
}
/* Live status ticker next to a beating heart — reflects the current analysis. */
.msg-thinking-live .thinking-heart {
  display: inline-block; margin-right: 5px;
  animation: iris-thinking-pulse 1s ease-in-out infinite;
}
@keyframes iris-thinking-pulse {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50%      { transform: scale(1.28); opacity: 1; }
}
.msg-thinking-live .thinking-status { color: #c4b5fd; font-style: italic; }

.msg-plan-pending {
  margin-top: 6px; padding: 6px 10px; font-size: 11.5px;
  color: #c9a3ff; background: rgba(147,51,234,0.08);
  border-radius: 4px; font-style: italic;
}

/* ─── IRIS pulsing-heart loader ─────────────────────────────────────── */
.msg.assistant.iris-loader-host {
  background: linear-gradient(135deg, rgba(147,51,234,0.12), rgba(79,70,229,0.10));
  border: 1px solid rgba(147,51,234,0.30);
  padding: 12px 14px;
}
.iris-loader {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 36px;
}
.iris-heart-wrap {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iris-heart {
  font-size: 22px;
  line-height: 1;
  display: inline-block;
  transform-origin: center;
  animation: iris-heartbeat 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 6px rgba(147,51,234,0.55));
  position: relative;
  z-index: 2;
}
.iris-heart-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(147,51,234,0.6);
  animation: iris-pulse-ring 1.6s ease-out infinite;
  z-index: 1;
}
.iris-heart-ring::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid rgba(192,132,252,0.45);
  animation: iris-pulse-ring 1.6s ease-out 0.5s infinite;
}
@keyframes iris-heartbeat {
  0%   { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(147,51,234,0.45)); }
  14%  { transform: scale(1.28); filter: drop-shadow(0 0 14px rgba(192,132,252,0.95)); }
  28%  { transform: scale(1.0);  filter: drop-shadow(0 0 6px rgba(147,51,234,0.55)); }
  42%  { transform: scale(1.18); filter: drop-shadow(0 0 12px rgba(192,132,252,0.85)); }
  70%  { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(147,51,234,0.45)); }
  100% { transform: scale(1);    filter: drop-shadow(0 0 4px rgba(147,51,234,0.45)); }
}
@keyframes iris-pulse-ring {
  0%   { transform: scale(0.7); opacity: 0.85; }
  100% { transform: scale(1.7); opacity: 0; }
}
/* In-bubble streaming indicator — small pulsing heart that stays visible
   for the whole duration of an LLM turn. Added when the big iris-loader
   stops (on first chunk) and removed when the stream is fully complete.
   Reuses iris-heartbeat keyframes from the loader so the visual is
   consistent. Pointer-events:none so it never blocks text selection. */
.msg.assistant.streaming { position: relative; }
.msg.assistant.streaming::before {
  content: "💜";
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 14px;
  line-height: 1;
  animation: iris-heartbeat 1.1s ease-in-out infinite;
  filter: drop-shadow(0 0 4px rgba(147,51,234,0.55));
  pointer-events: none;
  z-index: 2;
}
.iris-loader-text {
  font-size: 12.5px;
  color: #d8c4ff;
  font-style: italic;
  letter-spacing: 0.2px;
  background: linear-gradient(90deg, #d8c4ff 0%, #ffffff 50%, #d8c4ff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: iris-shimmer 2.4s linear infinite;
}
.iris-loader-text.iris-fade-in {
  animation: iris-shimmer 2.4s linear infinite, iris-fade-in 0.45s ease-out;
}
@keyframes iris-shimmer {
  0%   { background-position: 200% center; }
  100% { background-position: -200% center; }
}
@keyframes iris-fade-in {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* IRIS plan card — structured proposal with approve/reject */
.plan-card {
  background: linear-gradient(135deg, #1f1f23, #2a2a32);
  border: 1px solid #444;
  border-left: 4px solid #9333EA;
  border-radius: 10px;
  padding: 0;
  margin: 6px 0;
  align-self: stretch;
  max-width: 100%;
  overflow: hidden;
  font-size: 13px;
  /* Phase 7g-0k — never let the chat-log flex layout compress the card.
     Without this, follow-up messages could squeeze the card vertically. */
  flex-shrink: 0;
}
.plan-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(236, 72, 153, 0.15));
  border-bottom: 1px solid #3a3a3a;
  /* Phase 7g-0k — clickable header (collapse/expand the card body) */
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}
.plan-header:hover {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.22), rgba(236, 72, 153, 0.22));
}
.plan-collapse-chevron {
  display: inline-block;
  width: 14px;
  font-size: 10px;
  color: #c084fc;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}
.plan-header .plan-title { flex: 1; }

/* Phase 7g-0k — collapsed state: hide everything below the header.
   Header stays clickable so user can re-expand. Border-bottom of header
   removed when collapsed so the card looks like a clean single-row pill. */
.plan-card.plan-card-collapsed > .plan-header {
  border-bottom: none;
}
.plan-card.plan-card-collapsed > .plan-summary,
.plan-card.plan-card-collapsed > .plan-files,
.plan-card.plan-card-collapsed > .plan-actions,
.plan-card.plan-card-collapsed > .plan-diff,
.plan-card.plan-card-collapsed > .plan-feedback,
.plan-card.plan-card-collapsed > .plan-status,
.plan-card.plan-card-collapsed > .plan-deploy,
.plan-card.plan-card-collapsed > .plan-coverage-note {
  display: none !important;
}
.plan-title {
  font-weight: 700;
  color: #f9fafb;
  font-size: 13px;
}
.plan-risk {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}
/* Metadata-type badge (Apex / LWC / Trigger / Flow / Layout …) — top-right, tells the user what the card is. */
.plan-type {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 9px;
  border-radius: 999px;
  color: #c4b5fd;
  background: rgba(147, 51, 234, 0.16);
  border: 1px solid rgba(147, 51, 234, 0.4);
}
.plan-risk-low { background: #14532d; color: #86efac; }
.plan-risk-medium { background: #78350f; color: #fde68a; }
.plan-risk-high { background: #7f1d1d; color: #fecaca; }

.plan-summary {
  padding: 8px 14px;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}

.plan-files {
  padding: 4px 14px 8px;
}
.plan-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  color: #d1d5db;
}
.plan-file-action {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}
.plan-file-action-modify { background: #1d4ed8; color: white; }
.plan-file-action-create { background: #15803d; color: white; }
.plan-file-action-delete { background: #b91c1c; color: white; }
.plan-file-name {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #f9fafb;
}
.plan-file-desc { color: #9ca3af; font-size: 11px; }

.plan-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid #3a3a3a;
}
.plan-actions button {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}
.btn-show-diff {
  background: #2d2d2d;
  border-color: #444;
  color: #ddd;
}
.btn-show-diff:hover { background: #3d3d3d; }
/* Secondary actions (Review coverage / Visualize flow / Preview UI / Doc) shown
   inline, always visible. Left group pushes Reject/Approve to the right. */
.plan-actions-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-right: auto;
}
.plan-actions-left button {
  background: transparent;
  color: #c4b5fd;
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
}
.plan-actions-left button:hover { background: rgba(147, 51, 234, 0.18); }

/* 💡 Explain — shared inline natural-language explanation panel (plan + code cards) */
.card-explain {
  margin-top: 10px;
  border: 1px solid #3a3a46;
  border-left: 3px solid #9333EA; /* status-locked IRIS purple */
  background: rgba(147, 51, 234, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.5;
  color: #d1d5db;
  /* #1 — long explanations must stay readable: wrap long lines instead of
     running off-screen, and scroll vertically rather than getting cut. */
  overflow-wrap: anywhere;
  word-break: break-word;
  max-height: 520px;
  overflow-y: auto;
}
.card-explain-head {
  font-weight: 700;
  font-size: 12px;
  margin-bottom: 6px;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 6px;
}
.card-explain-ic { font-size: 14px; }
.card-explain-body p { margin: 0 0 7px; }
.card-explain-body p:last-child { margin-bottom: 0; }
.card-explain-body ul { margin: 0 0 7px; padding-left: 18px; }
.card-explain-body li { margin: 2px 0; }
.card-explain-body code { background: rgba(255, 255, 255, 0.06); padding: 1px 4px; border-radius: 3px; font-size: 11.5px; overflow-wrap: anywhere; }
.card-explain-body pre { white-space: pre-wrap; overflow-x: auto; }
.card-explain-loading { opacity: 0.7; font-style: italic; }
.card-explain-foot { margin-top: 8px; font-size: 10.5px; opacity: 0.55; }
/* Explain: Text / Visual-flow toggle */
.cf-toggle { margin-left: auto; display: inline-flex; border: 1px solid #6d28d9; border-radius: 6px; overflow: hidden; }
.cf-tab { background: transparent; color: #9ca3af; border: 0; padding: 3px 8px; font: 11px/1 system-ui; font-weight: 600; cursor: pointer; }
.cf-tab + .cf-tab { border-left: 1px solid #6d28d9; }
.cf-tab.active { background: #9333EA; color: #fff; }
/* Visual flow diagram (code logic → steps) */
.code-flow { display: flex; flex-direction: column; align-items: center; padding: 6px 0; }
.cf-node { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; max-width: 340px; box-sizing: border-box; background: #1b1b22; border: 1px solid #3a3a46; border-left: 4px solid #6d28d9; border-radius: 8px; padding: 8px 22px 8px 12px; font-size: 12.5px; color: #e5e7eb; }
.cf-decision { background: rgba(245, 158, 11, 0.08); }
.cf-ic { font-size: 14px; flex-shrink: 0; }
.cf-label { flex: 1; }
.cf-tag { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; border: 1px solid #4a4a54; border-radius: 4px; padding: 1px 5px; }
.cf-arrow { color: #7c6ba8; font-size: 14px; line-height: 1.3; }
.cf-empty { padding: 12px; color: #9ca3af; font-style: italic; font-size: 12px; }
/* Export Doc button in the explain head */
.ce-head-actions { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; }
.ce-export { background: transparent; color: #a78bfa; border: 1px solid #6d28d9; border-radius: 6px; padding: 3px 8px; font: 11px/1 system-ui; font-weight: 600; cursor: pointer; }
.ce-export:hover { background: rgba(147, 51, 234, 0.18); }
/* IRIS goto icon (bottom-right of each flow block) → jump to that code line */
.cf-goto { position: absolute; right: 5px; bottom: 3px; background: transparent; border: 0; padding: 0; font-size: 13px; line-height: 1; cursor: pointer; color: #a78bfa; opacity: 0.85; }
.cf-goto:hover { color: #c4b5fd; opacity: 1; }
.cec-vrow.cf-line-flash, .cec-hl-line.cf-line-flash { background: rgba(147, 51, 234, 0.42) !important; box-shadow: inset 3px 0 0 #9333EA; transition: background 0.6s ease, box-shadow 0.6s ease; }
.btn-approve {
  background: linear-gradient(135deg, #15803d, #16a34a);
  color: white;
}
/* Calm/Focused — secondary actions tucked behind a ⋯ menu; the menu wrapper
   takes the free space so Reject/Approve cluster at the right. */
.plan-more { position: relative; margin-right: auto; }
.btn-more {
  background: #2d2d2d;
  border: 1px solid #444;
  color: #ddd;
  border-radius: 5px;
  padding: 7px 13px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  letter-spacing: 1px;
}
.btn-more:hover { background: #3d3d3d; }
.plan-more-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px;
  min-width: 184px;
  background: var(--iris-surface, #2d2d2d);
  border: 1px solid #3a3a42;
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}
.plan-more-menu[hidden] { display: none; }
.plan-more-menu button {
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  color: var(--iris-text, #e6e6e6);
  padding: 8px 11px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin: 0;
}
.plan-more-menu button:hover { background: rgba(147, 51, 234, 0.14); border-color: #6d28d9; }
.btn-approve:hover { background: linear-gradient(135deg, #166534, #15803d); }
.btn-reject {
  background: #2d2d2d;
  border-color: #7f1d1d;
  color: #fecaca;
}
.btn-reject:hover { background: #3a1818; }
/* View card (metadata opened from the tree) — nothing changed yet, so hide the
   Approve/Reject workflow buttons until the user actually edits it. */
.plan-card.plan-view .btn-approve,
.plan-card.plan-view .btn-reject { display: none; }
.plan-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

.plan-status {
  padding: 8px 14px;
  font-size: 11px;
  border-top: 1px solid #3a3a3a;
}
.plan-status.approved { background: rgba(21, 128, 61, 0.15); color: #86efac; }
.plan-status.rejected { background: rgba(127, 29, 29, 0.15); color: #fca5a5; }

/* Approve flow: per-step + per-file deploy progress shown inside the plan card */
.plan-deploy {
  padding: 10px 14px 12px;
  border-top: 1px solid #3a3a3a;
  background: rgba(0, 0, 0, 0.18);
  font-size: 11.5px;
  color: #d4d4d4;
}
/* Dependency-resolver preflight banner (BuildResolver) */
.plan-resolver {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(147, 51, 234, 0.10);
  border: 1px solid rgba(147, 51, 234, 0.35);
  font-size: 11px;
  line-height: 1.5;
}
.plan-resolver-title {
  font-weight: 700;
  color: #c9a6f5;
  margin-bottom: 4px;
}
.plan-resolver-line { color: #d4d4d4; display: flex; gap: 6px; align-items: baseline; }
.plan-resolver-icon { flex: 0 0 auto; }
.plan-resolver-line[data-level="confirm"] { color: #f0c674; }
.plan-resolver-line[data-level="object"] { color: #9ad29a; }
.plan-deploy-step {
  padding: 6px 0;
  font-weight: 600;
  color: #e6e6e6;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-deploy-file {
  padding: 3px 0 3px 22px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #b8b8b8;
}
.plan-deploy-icon {
  width: 16px;
  text-align: center;
  font-weight: 700;
  flex-shrink: 0;
}
.plan-deploy-fname {
  color: #e6e6e6;
}
.plan-deploy-status {
  color: #888;
  font-style: italic;
  margin-left: auto;
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}
/* Per-state icon coloring (JS sets data-state on the row) */
.plan-deploy-step .plan-deploy-icon { font-size: 14px; }
.plan-deploy [data-step] { margin-top: 4px; }
.plan-deploy-step[data-state="ok"]      .plan-deploy-icon,
.plan-deploy-file[data-state="ok"]      .plan-deploy-icon { color: #86efac; }
.plan-deploy-step[data-state="fail"]    .plan-deploy-icon,
.plan-deploy-file[data-state="fail"]    .plan-deploy-icon { color: #fca5a5; }
.plan-deploy-step[data-state="running"] .plan-deploy-icon,
.plan-deploy-file[data-state="running"] .plan-deploy-icon { color: #c9a3ff; }
.plan-deploy-step[data-state="ok"]   .plan-deploy-label { color: #86efac; }
.plan-deploy-step[data-state="fail"] .plan-deploy-label { color: #fca5a5; }

.plan-diff {
  padding: 0 14px 12px;
  display: none;
}
.plan-diff.open { display: block; }
.plan-diff-file {
  margin-top: 8px;
  border: 1px solid #2d2d2d;
  border-radius: 4px;
  overflow: hidden;
}
.plan-diff-header {
  background: #2d2d2d;
  padding: 5px 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e6e6e6;
}
.plan-diff-body {
  background: #0d1117;
  color: #d1d5db;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.5;   /* explicit + identical to .plan-diff-edit so edit-mode scroll stays line-aligned */
  padding: 10px;
  white-space: pre;
  /* Phase 7g-0l — always-visible custom scrollbars so users immediately
     know the code is scrollable inside the card. Default OS scrollbars
     are auto-hidden on macOS / thin invisible elsewhere on dark themes. */
  overflow-x: scroll;
  overflow-y: scroll;
  max-height: 720px;
  resize: vertical;
  scrollbar-width: thin;
  scrollbar-color: #6d28d9 #1f2937;
}
/* Changed-line highlighting in the side-by-side panes — the block you edited in
   the class, and the block IRIS wrote/updated in the test. */
.plan-diff-body .plan-line { display: block; min-height: 1em; }
.plan-diff-body .plan-line-new {
  background: rgba(147, 51, 234, 0.18);
  box-shadow: inset 3px 0 0 #9333EA;
}
/* Dual-pane diff coloring — matches the code editor's review (green add / red del). */
.plan-diff-body .plan-line-add {
  background: rgba(26, 170, 85, 0.20);
  box-shadow: inset 3px 0 0 #1AAA55;
}
.plan-diff-body .plan-line-del {
  background: rgba(194, 57, 52, 0.20);
  box-shadow: inset 3px 0 0 #C23934;
}
.plan-changed-badge {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: 10px; font-weight: 600; line-height: 16px;
  color: #e9d5ff; background: rgba(147, 51, 234, 0.22);
  border: 1px solid #9333EA; border-radius: 10px; vertical-align: middle;
}
.plan-diff-body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: #1f2937;
}
.plan-diff-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #4c1d95);
  border-radius: 6px;
  border: 2px solid #1f2937;
}
.plan-diff-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9333ea, #6d28d9);
}
.plan-diff-body::-webkit-scrollbar-corner {
  background: #1f2937;
}

/* ── Code preview clamp (default). Each file body renders as a short,
   fade-out snippet; click the body or "Show full code" to expand to the
   full scrollable view. Stops large XML/Apex from eating the chat window.
   Higher specificity (.plan-diff.plan-diff-preview …) so it wins over the
   later .plan-diff-pane rule for side-by-side panes. */
.plan-diff.plan-diff-preview .plan-diff-body {
  max-height: 168px;
  overflow: hidden;
  resize: none;
  cursor: pointer;
  -webkit-mask-image: linear-gradient(to bottom, #000 64%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 64%, transparent 100%);
}
.plan-diff.plan-diff-preview .plan-diff-body::-webkit-scrollbar { display: none; }
.plan-diff-expand {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(147, 51, 234, 0.10);
  border: 1px solid #6d28d9;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.plan-diff-expand:hover { background: rgba(147, 51, 234, 0.20); }

/* Per-card edge collapse icon — sits at the right of the header (the whole
   header is also click-to-collapse; this is the discoverable affordance). */
.plan-collapse-btn {
  flex-shrink: 0;
  margin-left: 4px;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 12px;
  color: #c084fc;
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid #6d28d9;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
}
.plan-collapse-btn:hover { background: rgba(147, 51, 234, 0.25); }
.plan-close-btn {
  flex-shrink: 0;
  margin-left: 4px;
  width: 22px;
  height: 22px;
  line-height: 1;
  font-size: 12px;
  color: #9ca3af;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #3a3a42;
  border-radius: 5px;
  cursor: pointer;
  padding: 0;
}
.plan-close-btn:hover { background: rgba(194, 57, 52, 0.22); border-color: #C23934; color: #fca5a5; }

/* Closed-cards tray (CardArchive) */
.card-archive { position: sticky; top: 0; z-index: 6; margin: 0 0 10px; border: 1px solid var(--iris-border, #2a2a32); border-radius: 9px; overflow: hidden; background: var(--iris-panel-2, #1b1b22); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
.ca-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; user-select: none; }
.ca-head:hover { background: rgba(147, 51, 234, 0.10); }
.card-archive.ca-flash { animation: caFlash 1s ease; }
@keyframes caFlash {
  0%, 100% { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35); }
  30% { box-shadow: 0 0 0 2px #9333EA, 0 4px 16px rgba(147, 51, 234, 0.55); }
}
.ca-toggle { font-size: 12.5px; font-weight: 600; color: #c4b5fd; }
.ca-count { display: inline-block; min-width: 18px; text-align: center; font-size: 11px; color: #fff; background: #6d28d9; border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.ca-chev { color: #9ca3af; font-size: 11px; }
.ca-list { border-top: 1px solid var(--iris-border, #2a2a32); padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.ca-list[hidden] { display: none; }
.ca-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px; background: var(--iris-bg, #14141a); }
.ca-item-ic { flex: 0 0 auto; }
.ca-item-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--iris-text, #e6e6e6); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca-item-type { font-size: 10.5px; color: #9ca3af; background: rgba(147,51,234,0.12); border-radius: 999px; padding: 1px 7px; }
.ca-reopen { flex: 0 0 auto; background: transparent; border: 1px solid #6d28d9; color: #c4b5fd; border-radius: 5px; padding: 3px 9px; font-size: 11px; font-weight: 600; cursor: pointer; }
.ca-reopen:hover { background: rgba(147, 51, 234, 0.18); }
.ca-empty { font-size: 12px; color: #9ca3af; padding: 6px 8px; }

/* Plan feedback row (👍/👎 → AWS feedback store for internal RCA). */
.plan-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 10px;
  font-size: 12px;
  color: var(--iris-text-dim, #9ca3af);
  flex-wrap: wrap;
}
.plan-feedback-q { opacity: 0.85; }
.plan-fb-btn {
  background: var(--iris-panel-2, #1f1f23);
  border: 1px solid #3a3a42;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 13px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.plan-fb-btn:hover { border-color: #9333EA; background: rgba(147, 51, 234, 0.12); }
.plan-fb-down:hover { border-color: #C23934; background: rgba(194, 57, 52, 0.12); }
.plan-feedback-thanks { color: #1AAA55; font-weight: 600; }
.plan-fb-comment {
  flex: 1 0 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}
.plan-fb-text {
  width: 100%;
  box-sizing: border-box;
  background: var(--iris-bg, #0d1117);
  color: var(--iris-text, #e6e6e6);
  border: 1px solid #6d28d9;
  border-radius: 6px;
  padding: 7px 9px;
  font: 12px/1.4 inherit;
  resize: vertical;
}
.plan-fb-text:focus { outline: none; border-color: #9333EA; }
.plan-fb-comment-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
/* Voice feedback mic — pulses red while recording. */
.plan-fb-mic { background: none; border: 1px solid #3f3f47; border-radius: 6px; color: #c4b5fd; cursor: pointer; padding: 4px 9px; margin-right: auto; display: inline-flex; align-items: center; }
.plan-fb-mic:hover { background: rgba(147,51,234,.14); }
.plan-fb-mic.plan-fb-mic-on { color: #fff; background: #C23934; border-color: #C23934; animation: plan-fb-mic-pulse 1.1s ease-in-out infinite; }
@keyframes plan-fb-mic-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(194,57,52,.5); } 50% { box-shadow: 0 0 0 5px rgba(194,57,52,0); } }
.plan-fb-comment-actions button {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #3a3a42;
  background: transparent;
  color: var(--iris-text, #e6e6e6);
}
.plan-fb-send { background: #9333EA; color: #fff; border-color: #9333EA; }

/* ── Flow-Guardian banner (panel/guardian/) — scrolling ambient alerts ── */
.guardian-banner { position: relative; display: flex; align-items: center; height: 34px; overflow: hidden;
  background: linear-gradient(90deg, rgba(147,51,234,0.12), rgba(236,72,153,0.10)); border-bottom: 1px solid #2d2d2d; font-size: 13px; flex: 0 0 auto; }
.guardian-banner[hidden] { display: none; }
.guardian-banner .guardian-bell, .guardian-banner .guardian-cfg { flex: 0 0 auto; padding: 0 12px; height: 100%; display: flex; align-items: center; background: var(--iris-topbar); z-index: 2; border: none; }
.guardian-banner .guardian-bell { color: #c084fc; border-right: 1px solid #2d2d2d; }
.guardian-banner .guardian-cfg { color: #9ca3af; cursor: pointer; border-left: 1px solid #2d2d2d; font-size: 13px; }
.guardian-banner .guardian-vp { flex: 1; overflow: hidden; }
.guardian-banner .guardian-track { display: inline-flex; gap: 46px; white-space: nowrap; padding-left: 24px; animation: guardian-scroll 40s linear infinite; }
.guardian-banner:hover .guardian-track { animation-play-state: paused; }
@keyframes guardian-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.guardian-banner .gm { display: inline-flex; align-items: center; gap: 8px; color: var(--iris-text); }
.guardian-banner .gm-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 auto; }
.guardian-banner .gm-red .gm-dot { background: #C23934; } .guardian-banner .gm-amber .gm-dot { background: #F59E0B; }
.guardian-banner .gm-purple .gm-dot { background: #9333EA; } .guardian-banner .gm-blue .gm-dot { background: #3B82F6; }
.guardian-banner .gm-time { color: #6b7280; font-size: 11px; }
.guardian-banner .gm-act { color: #c084fc; font-weight: 600; cursor: pointer; }
.guardian-banner .gm-act:hover { text-decoration: underline; }
.guardian-banner .gm-x { color: #6b7280; cursor: pointer; font-size: 11px; }
.guardian-banner .gm-x:hover { color: #C23934; }

/* ── Metadata Scope picker (panel/scope/) ── */
.scope-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 200; }
.scope-modal[hidden] { display: none; }
.scope-card { width: 760px; max-width: 94vw; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; }
.scope-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #4a4a54; font-weight: 600; font-size: 14px; }
.scope-name { display: flex; align-items: center; gap: 8px; padding: 12px 18px 0; font-size: 13px; color: #9ca3af; }
.scope-name input { flex: 0 0 220px; background: var(--iris-panel-2); border: 1px solid #3a3a42; border-radius: 6px; padding: 6px 10px; color: var(--iris-text); font: inherit; }
.scope-cols { display: grid; grid-template-columns: 1fr 92px 1fr; gap: 14px; padding: 16px 18px; align-items: stretch; }
.scope-col { border: 1px solid #4a4a54; border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; height: min(440px, 60vh); min-height: 240px; resize: vertical; background: var(--iris-bg); }
.scope-mid { display: flex; flex-direction: column; justify-content: center; gap: 10px; }
.scope-mid button { padding: 9px 6px; border-radius: 7px; border: 1px solid #6d28d9; background: rgba(147,51,234,0.12); color: #c4b5fd; cursor: pointer; font-size: 12px; font-weight: 700; }
.scope-mid button:hover { background: rgba(147,51,234,0.24); }
.scope-col-h { padding: 9px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #9ca3af; background: var(--iris-panel-2); border-bottom: 1px solid #4a4a54; }
.scope-col-h b { color: #c084fc; }
.scope-search { margin: 8px; padding: 7px 9px; background: #1a1a1e; border: 1px solid #4a4a54; border-radius: 6px; color: var(--iris-text); font: inherit; font-size: 12px; }
.scope-list { overflow-y: scroll; flex: 1; padding-bottom: 6px; }
/* P4: macOS hides overlay scrollbars → force a visible purple one so users know the list scrolls */
.scope-list::-webkit-scrollbar { width: 12px; }
.scope-list::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 6px; }
.scope-list::-webkit-scrollbar-thumb { background: linear-gradient(#9333EA, #6d28d9); border-radius: 6px; border: 2px solid var(--iris-bg); }
.scope-list::-webkit-scrollbar-thumb:hover { background: linear-gradient(#a855f7, #7c3aed); }
.scope-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--iris-text); border-bottom: 1px solid rgba(255,255,255,0.05); user-select: none; }
.scope-row:hover { background: rgba(147,51,234,0.12); }
.scope-row.sel { background: rgba(147,51,234,0.30); }
.scope-empty { padding: 14px; color: #6b7280; font-style: italic; font-size: 12px; text-align: center; }
.scope-more { margin: 6px 8px 8px; padding: 7px 10px; background: rgba(147,51,234,0.12); border: 1px dashed #6d28d9; border-radius: 6px; color: #c4b5fd; font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.scope-more:hover { background: rgba(147,51,234,0.22); }
.scope-group-h { position: sticky; top: 0; padding: 6px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #a78bfa; background: var(--iris-panel-2); border-bottom: 1px solid rgba(255,255,255,0.06); }
.scope-group-h b { color: #6b7280; font-weight: 600; }
.scope-foot { display: flex; align-items: center; gap: 8px; padding: 13px 18px; border-top: 1px solid #4a4a54; }
.scope-foot .scope-hint { font-size: 11px; color: #6b7280; margin-right: auto; }
.scope-foot button { padding: 7px 16px; border-radius: 7px; border: 1px solid #4a4a54; background: transparent; color: var(--iris-text); cursor: pointer; font-weight: 600; }
.scope-save { background: #9333EA !important; color: #fff !important; border-color: #9333EA !important; }

/* ── Integrations panel (panel/integrations/) ── */
.scope-x { cursor: pointer; color: #9ca3af; background: none; border: none; font-size: 16px; }
.intg-modal, .rule-modal { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 10000; }
.intg-modal[hidden], .rule-modal[hidden] { display: none; }
.intg-card { width: 660px; max-width: 94vw; max-height: 84vh; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; display: flex; flex-direction: column; }
.intg-head, .rule-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid #4a4a54; font-weight: 600; font-size: 14px; }
.intg-sub { padding: 12px 18px 0; font-size: 12px; color: #9ca3af; }
.intg-body { overflow-y: auto; padding: 6px 18px 14px; }
.intg-group { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; margin: 16px 0 7px; }
.intg-master { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid #6d28d9; border-radius: 9px; margin: 12px 0 4px; background: rgba(147,51,234,0.10); }
.intg-master .intg-name { font-size: 14px; }
.intg-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid #3f3f47; border-radius: 9px; margin-bottom: 8px; background: var(--iris-bg); }
.intg-icon { font-size: 18px; flex: 0 0 auto; width: 22px; text-align: center; }
.intg-meta { flex: 1; min-width: 0; }
.intg-name { font-size: 13px; font-weight: 600; }
.intg-desc { font-size: 11px; color: #9ca3af; }
.intg-badge { font-size: 10px; color: #1AAA55; border: 1px solid rgba(26,170,85,0.4); border-radius: 999px; padding: 2px 8px; flex: 0 0 auto; }
.intg-cfg { background: transparent; border: 1px solid #4a4a54; color: #9ca3af; border-radius: 6px; padding: 4px 8px; cursor: pointer; font-size: 12px; flex: 0 0 auto; }
.intg-cfg:hover { background: rgba(147,51,234,0.14); border-color: #6d28d9; color: #c4b5fd; }
.intg-tog { width: 38px; height: 22px; border-radius: 999px; background: #3a3a42; position: relative; cursor: pointer; flex: 0 0 auto; transition: background .15s; border: none; }
.intg-tog.on { background: #1AAA55; }
.intg-tog::after { content: ''; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: left .15s; }
.intg-tog.on::after { left: 18px; }
.intg-foot, .rule-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 13px 18px; border-top: 1px solid #4a4a54; }
.intg-done { background: #9333EA; color: #fff; border: none; border-radius: 7px; padding: 8px 18px; font-weight: 600; cursor: pointer; }
/* Git connect form (Flow-Guardian source PAT intake) */
.gcf-card { width: 460px; }
.gcf-body { padding: 14px 18px 4px; display: flex; flex-direction: column; gap: 4px; }
.gcf-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; margin-top: 10px; }
.gcf-opt { text-transform: none; letter-spacing: 0; color: #6b7280; font-weight: 400; }
.gcf-in { padding: 8px 10px; background: #1a1a1e; border: 1px solid #4a4a54; border-radius: 6px; color: var(--iris-text); font: inherit; font-size: 13px; }
.gcf-in:focus { outline: none; border-color: #9333EA; }
.gcf-help { font-size: 11px; color: #6b7280; margin-top: 6px; }
.gcf-help code { background: rgba(255,255,255,0.07); padding: 1px 4px; border-radius: 3px; }
.gcf-msg { min-height: 16px; font-size: 12px; color: #c4b5fd; margin-top: 8px; }
.gcf-cancel { background: transparent; color: #9ca3af; border: 1px solid #4a4a54; border-radius: 7px; padding: 8px 16px; cursor: pointer; }
.gcf-save { background: #9333EA; color: #fff; border: none; border-radius: 7px; padding: 8px 18px; font-weight: 600; cursor: pointer; }
.gcf-save:disabled { opacity: 0.6; cursor: default; }

/* "Use IRIS in your CLI" panel */
.cli-card { width: 640px; }
.cli-step { margin: 14px 0; }
.cli-step-h { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #c084fc; margin-bottom: 8px; font-weight: 600; }
.cli-note { font-size: 11px; color: #9ca3af; margin-top: 6px; }
.cli-note code, .cli-tool-loc code { background: var(--iris-panel-2); padding: 1px 5px; border-radius: 4px; color: #e9d5ff; }
.cli-block { position: relative; margin: 6px 0; }
.cli-copy { position: absolute; top: 6px; right: 6px; background: var(--iris-panel-2); border: 1px solid var(--iris-border); color: #c4b5fd; border-radius: 5px; padding: 2px 9px; font-size: 11px; cursor: pointer; z-index: 1; }
.cli-copy:hover { background: rgba(147,51,234,0.2); }
.cli-pre { background: #0a0b0f; border: 1px solid var(--iris-border); border-radius: 8px; padding: 10px 12px; margin: 0; overflow-x: auto; font: 12px/1.5 "SF Mono", Menlo, Consolas, monospace; color: #d6c8ee; white-space: pre; }
.cli-tool { border: 1px solid var(--iris-border); border-radius: 9px; padding: 10px 12px; margin-bottom: 10px; background: var(--iris-bg); }
.cli-tool-h { display: flex; align-items: baseline; gap: 10px; }
.cli-tool-name { font-weight: 600; font-size: 13px; }
.cli-tool-reg { font-family: "SF Mono", Menlo, monospace; font-size: 11px; color: #c084fc; background: var(--iris-accent-soft); padding: 1px 7px; border-radius: 999px; }
.cli-tool-loc { font-size: 11px; color: #9ca3af; margin: 3px 0 4px; }
.cli-docs { margin-right: auto; font-size: 12px; color: #c084fc; text-decoration: none; align-self: center; }
.cli-docs:hover { text-decoration: underline; }

/* BYO-app secure intake (ConnectAppForm) */
.caf-trigger { display: block; margin: 10px auto 20px; background: transparent; border: 0; color: #9ca3af; font-size: 12px; cursor: pointer; text-decoration: underline; }
.aws-conn-token { display: inline-block; margin-top: 6px; padding: 0; background: transparent; border: 0; color: #a78bfa; font-size: 11px; cursor: pointer; text-decoration: underline; }
.aws-conn-token:hover { color: #c4b5fd; }
.stf-card { width: 460px; }
.caf-trigger:hover { color: #c4b5fd; }
.caf-card { width: 460px; max-width: 92vw; }
.caf-body { display: flex; flex-direction: column; gap: 4px; padding: 4px 2px; }
.caf-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: #9ca3af; margin-top: 8px; }
.caf-key, .caf-sec { width: 100%; box-sizing: border-box; background: var(--iris-bg, #0a0b0f); border: 1px solid var(--iris-border, #2a2a32); border-radius: 7px; padding: 9px 11px; font: 13px/1.4 "SF Mono", Menlo, monospace; color: #e9d5ff; }
.caf-key:focus, .caf-sec:focus { outline: none; border-color: #9333EA; box-shadow: 0 0 0 1px #9333EA; }
.caf-status { font-size: 12px; margin-top: 10px; padding: 8px 10px; border-radius: 6px; background: rgba(0,0,0,0.18); color: #c7c7d2; }
.caf-status.caf-ok { background: rgba(26,170,85,0.14); color: #6ee7a8; border: 1px solid rgba(26,170,85,0.4); }
.caf-status.caf-err { background: rgba(194,57,52,0.14); color: #fca5a5; border: 1px solid rgba(194,57,52,0.4); }
.caf-save { background: #9333EA !important; color: #fff !important; }
.caf-save:hover { filter: brightness(1.1); }

/* Per-integration filter rules editor */
.rule-card { width: 560px; max-width: 94vw; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; }
.rule-body { padding: 14px 18px; max-height: 64vh; overflow-y: auto; }
.rule-sec { margin-bottom: 16px; }
.rule-sec > label { display: block; font-size: 12px; color: #cbd5e1; margin-bottom: 6px; font-weight: 600; }
.rule-hint { font-size: 11px; color: #6b7280; font-weight: 400; }
.rule-toggle { display: flex; align-items: center; gap: 9px; font-size: 12px; color: #cbd5e1; font-weight: 400; }
.rule-foot button { padding: 7px 16px; border-radius: 7px; border: 1px solid #4a4a54; background: transparent; color: var(--iris-text); cursor: pointer; font-weight: 600; }
.rule-save { background: #9333EA !important; color: #fff !important; border-color: #9333EA !important; }
.rule-nl { width: 100%; box-sizing: border-box; background: var(--iris-bg); border: 1px solid #6d28d9; border-radius: 8px; padding: 9px 11px; color: var(--iris-text); font: inherit; font-size: 13px; resize: vertical; }
.rule-nl:focus { outline: none; border-color: #9333EA; }
.rule-convert { margin-top: 8px; background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; border: none; border-radius: 7px; padding: 7px 14px; font-weight: 600; font-size: 12px; cursor: pointer; }
.rule-convert:disabled { opacity: 0.6; cursor: default; }
.rule-compiled-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; margin: 4px 0 12px; border-top: 1px solid #3a3a42; padding-top: 12px; }
.rule-num { background: var(--iris-bg); border: 1px solid #4a4a54; border-radius: 6px; padding: 6px 9px; color: var(--iris-text); font: inherit; font-size: 12px; }
.chip-box { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px; border: 1px solid #4a4a54; border-radius: 8px; background: var(--iris-bg); }
.chip { display: inline-flex; align-items: center; gap: 5px; background: rgba(147,51,234,0.18); border: 1px solid #6d28d9; color: #e9d5ff; border-radius: 999px; padding: 3px 9px; font-size: 12px; }
.chip b { cursor: pointer; color: #c4b5fd; font-weight: 700; }
.chip-box input { flex: 1; min-width: 90px; background: transparent; border: none; outline: none; color: var(--iris-text); font: inherit; font-size: 12px; }

/* ── Slack reply modal (branded, replaces window.prompt) ── */
.srm-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 10001; backdrop-filter: blur(3px); animation: iris-fade 150ms ease; }
.srm-overlay[hidden] { display: none; }
.srm-card { width: 480px; max-width: 94vw; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; display: flex; flex-direction: column; }
.srm-head { padding: 11px 16px 9px; border-bottom: 1px solid #4a4a54; }
.srm-head-row { display: flex; align-items: center; justify-content: space-between; }
.srm-head-sub { margin-top: 7px; }
.srm-brand { font-weight: 600; font-size: 14px; color: var(--iris-text); display: inline-flex; align-items: center; gap: 7px; }
.srm-logo { font-size: 15px; }
.srm-chan { font-size: 12px; color: #9ca3af; font-family: "SF Mono", Menlo, Consolas, monospace; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srm-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.srm-ic-btn { width: 30px; height: 28px; padding: 0; border-radius: 7px; font-size: 15px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.srm-x { background: transparent; border: none; color: #9ca3af; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.srm-x:hover { background: rgba(255,255,255,0.08); color: var(--iris-text); }
.srm-msg { margin: 14px 16px 4px; padding: 11px 13px; border: 1px solid #3f3f47; border-left: 3px solid #9333EA; border-radius: 8px; background: var(--iris-bg); }
.srm-msg-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.srm-avatar { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.srm-author { font-size: 13px; font-weight: 600; color: var(--iris-text); }
.srm-time { font-size: 11px; color: #6b7280; }
.srm-msg-body { font-size: 13px; color: #d1d5db; line-height: 1.4; white-space: pre-wrap; word-break: break-word; }
/* Thread view — scrollable conversation with separators between messages. */
.srm-msg.srm-thread { max-height: 240px; overflow-y: auto; }
.srm-msg.srm-thread .srm-msg-top { margin-top: 10px; }
.srm-msg.srm-thread .srm-msg-top:first-child { margin-top: 0; }
.srm-sep { height: 1px; background: #2d2d35; margin: 10px 0; }
/* Monaco full-screen editor overlay (Phase 1 — Cursor-for-SF surface) */
.mco-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px); }
.mco-shell { width: 92vw; height: 88vh; display: flex; flex-direction: column; background: #1e1e1e; border: 1px solid #3f3f47; border-radius: 12px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,0.7); }
.mco-head { display: flex; align-items: center; justify-content: space-between; padding: 9px 14px; background: #16161a; border-bottom: 1px solid #2d2d35; }
.mco-name { font-size: 13px; font-weight: 600; color: #f3f4f6; font-family: "SF Mono", Menlo, Consolas, monospace; }
.mco-actions { display: inline-flex; gap: 8px; }
.mco-btn { background: transparent; border: 1px solid #4a4a54; color: #c4b5fd; border-radius: 6px; padding: 5px 13px; font-size: 12px; font-weight: 600; cursor: pointer; }
.mco-btn:hover { background: rgba(255,255,255,0.06); }
.mco-btn.mco-btn-on { background: rgba(147,51,234,0.22); border-color: #9333EA; color: #e9d5ff; }
.mco-btn.mco-save { background: linear-gradient(135deg, #9333EA, #C026D3); border-color: transparent; color: #fff; }
.mco-btn.mco-save:hover { filter: brightness(1.08); }
/* Disabled state — visibly greyed + non-interactive (e.g. Apply until the code changes). */
.mco-btn:disabled, .mco-btn:disabled:hover { opacity: .45; cursor: not-allowed; background: transparent; filter: none; }
.mco-btn.mco-save:disabled, .mco-btn.mco-save:disabled:hover { background: #3a3a44; color: #9ca3af; filter: none; opacity: .6; }
.mco-editor { flex: 1; min-height: 0; position: relative; }
.mco-foot { padding: 6px 14px; font-size: 11px; color: #9ca3af; background: #16161a; border-top: 1px solid #2d2d35; min-height: 14px; }

/* Execution panel dock (iris-exec-panel-design.md P1: Query + Test) */
.mco-exec { flex: 0 0 40vh; min-height: 200px; border-top: 2px solid #2d2d35; background: #15171e; display: flex; flex-direction: column; overflow: hidden; }
.mco-btn.mco-run.on { background: rgba(147,51,234,0.22); border-color: #9333EA; color: #e9d5ff; }
.xp-dock { display: flex; flex-direction: column; height: 100%; }
.xp-bar { display: flex; align-items: center; gap: 6px; padding: 6px 10px; background: #16161a; border-bottom: 1px solid #2d2d35; }
.xp-tab { background: transparent; border: 1px solid transparent; color: #9ca3af; border-radius: 6px; padding: 4px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.xp-tab:hover { color: #e9e9ee; }
.xp-tab.on { background: rgba(147,51,234,0.18); border-color: #9333EA; color: #e9d5ff; }
.xp-org { margin-left: auto; font-size: 11px; color: #8a8a96; font-family: "SF Mono", Menlo, monospace; }
.xp-collapse { background: transparent; border: none; color: #9ca3af; cursor: pointer; font-size: 14px; padding: 0 6px; }
.xp-body { flex: 1; min-height: 0; overflow: auto; padding: 10px; }
.xp-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.xp-chk { font-size: 11px; color: #c4b5fd; display: inline-flex; align-items: center; gap: 4px; }
.xp-run { margin-left: auto; background: linear-gradient(135deg, #9333EA, #C026D3); border: none; color: #fff; border-radius: 6px; padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.xp-run:hover { filter: brightness(1.08); }
.xp-soql { width: 100%; height: 84px; resize: vertical; background: #0f1117; border: 1px solid #2d2d35; color: #e9e9ee; border-radius: 6px; padding: 8px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; box-sizing: border-box; }
.xp-tname { flex: 1; background: #0f1117; border: 1px solid #2d2d35; color: #e9e9ee; border-radius: 6px; padding: 6px 10px; font-family: "SF Mono", Menlo, monospace; font-size: 12px; }
.xp-out { margin-top: 10px; }
.xp-busy, .xp-empty, .xp-meta { font-size: 12px; color: #9ca3af; padding: 4px 0; }
.xp-err { font-size: 12px; color: #fca5a5; background: rgba(194,57,52,0.12); border: 1px solid rgba(194,57,52,0.4); border-radius: 6px; padding: 8px 10px; font-family: "SF Mono", Menlo, monospace; white-space: pre-wrap; }
.xp-ok { color: #4ade80; font-weight: 700; } .xp-bad { color: #fca5a5; font-weight: 700; } .xp-warn { color: #fbbf24; font-weight: 700; }
.xp-gridwrap { overflow: auto; border: 1px solid #2d2d35; border-radius: 6px; }
.xp-grid { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.xp-grid th { position: sticky; top: 0; background: #1b1b22; color: #c4b5fd; text-align: left; padding: 6px 9px; border-bottom: 1px solid #2d2d35; white-space: nowrap; }
.xp-grid td { padding: 5px 9px; border-bottom: 1px solid #23232b; color: #e9e9ee; white-space: nowrap; }
.xp-grid tr:hover td { background: rgba(147,51,234,0.06); }
.xp-null { color: #6b7280; font-style: italic; } .xp-obj { color: #60a5fa; cursor: help; }
.xp-tests td:first-child { width: 22px; text-align: center; }
.xp-hint { font-size: 11px; color: #8a8a96; }
.xp-apex { width: 100%; height: 120px; resize: vertical; background: #0f1117; border: 1px solid #2d2d35; color: #e9e9ee; border-radius: 6px; padding: 8px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; box-sizing: border-box; }
.xp-log { background: #0f1117; border: 1px solid #23232b; border-radius: 6px; padding: 8px 10px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 11px; color: #cbd5e1; white-space: pre-wrap; max-height: 240px; overflow: auto; margin: 6px 0; }
.xp-fulllog summary { font-size: 11px; color: #c4b5fd; cursor: pointer; padding: 4px 0; }
.xp-method { flex: 1; background: #0f1117; border: 1px solid #2d2d35; color: #e9e9ee; border-radius: 6px; padding: 6px 10px; font-family: "SF Mono", Menlo, monospace; font-size: 12px; }
.xp-params { margin-bottom: 8px; }
.xp-prow { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.xp-plabel { font-size: 11.5px; color: #c4b5fd; min-width: 160px; display: inline-flex; gap: 6px; align-items: baseline; }
.xp-ptype { font-size: 10px; color: #8a8a96; }
.xp-pin.xp-tname { flex: 1; }
.mco-kbd { font-size: 10px; font-weight: 500; color: #c4b5fd; background: rgba(147,51,234,0.15); border: 1px solid rgba(147,51,234,0.4); border-radius: 5px; padding: 1px 6px; margin-left: 8px; font-family: inherit; }

/* Cmd+K inline-edit prompt bar (floats over the editor, top-center) */
.mco-k { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; display: flex; align-items: center; gap: 7px; width: min(640px, 80%); padding: 8px 10px; background: #232330; border: 1px solid #9333EA; border-radius: 10px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); }
.mco-k-spark { font-size: 14px; }
.mco-k-input { flex: 1; background: #16161a; border: 1px solid #3f3f47; color: #f3f4f6; border-radius: 7px; padding: 7px 10px; font-size: 13px; outline: none; }
.mco-k-input:focus { border-color: #9333EA; }
.mco-k-x { padding: 5px 9px !important; }

/* Inline AI diff preview (covers the editor; Accept/Reject bar at the bottom) */
.mco-diff { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; background: #1e1e1e; }
.mco-diff-ed { flex: 1; min-height: 0; }
.mco-diff-bar { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: #16161a; border-top: 1px solid #2d2d35; }
.mco-diff-label { font-size: 12px; font-weight: 600; color: #c4b5fd; }
.mco-diff-reject { color: #fca5a5 !important; border-color: #6b3a3a !important; }

/* CI-P2c: Impact panel — Context Intelligence where-used / uses (docked in the editor) */
.mco-impact-panel { position: absolute; top: 10px; right: 10px; width: 340px; max-height: 70%;
  display: flex; flex-direction: column; background: #1b1b22; border: 1px solid #3f3f47;
  border-radius: 10px; box-shadow: 0 16px 48px rgba(0,0,0,0.55); z-index: 30; overflow: hidden; }
.mco-imp-head { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 12px; background: #16161a; border-bottom: 1px solid #2d2d35; font-size: 12.5px; color: #e6e6ea; }
.mco-imp-head b { color: #c4b5fd; }
.mco-imp-actions { display: inline-flex; align-items: center; gap: 4px; }
.mco-imp-x, .mco-imp-back { background: transparent; border: none; color: #9ca3af; font-size: 13px; cursor: pointer; padding: 2px 5px; border-radius: 5px; }
.mco-imp-back:hover, .mco-imp-x:hover { background: rgba(147,51,234,0.18); color: #fff; } /* status-locked */
.mco-imp-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mco-imp-body { padding: 8px 12px 12px; overflow-y: auto; }
.mco-imp-group { margin-top: 8px; }
.mco-imp-h { font-size: 11px; font-weight: 700; letter-spacing: .3px; color: #9ca3af; margin: 6px 0 4px; }
.mco-imp-item { font-size: 12.5px; color: #d8d8de; padding: 4px 6px; margin: 0 -6px; border-radius: 5px; word-break: break-word; cursor: pointer; }
.mco-imp-item:hover { background: rgba(147,51,234,0.14); } /* status-locked */
.mco-imp-type { display: inline-block; font-size: 10px; color: #c4b5fd;
  background: rgba(147,51,234,0.16); border-radius: 4px; padding: 1px 5px; margin-right: 6px; } /* status-locked */
.mco-imp-empty { font-size: 12px; color: #8b8b94; padding: 2px 0; }
.mco-imp-warn { font-size: 11.5px; line-height: 1.45; color: #f4d6a8; margin-bottom: 6px;
  background: rgba(245,158,11,0.12); border-left: 2px solid #F59E0B; /* status-locked */
  border-radius: 5px; padding: 6px 9px; }
.mco-imp-src { margin-top: 10px; font-size: 10.5px; color: #6f6f78; }

/* IRIS-produced technical documentation — clean, downloadable doc card */
.doc-card { margin: 12px 0; border: 1px solid #3f3f47; border-left: 3px solid #9333EA; border-radius: 11px; background: var(--iris-surface, #16161a); overflow: hidden; flex-shrink: 0; align-self: stretch; width: 100%; box-sizing: border-box; }
.doc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #2d2d35; background: rgba(147,51,234,0.08); }
.doc-title { font-size: 13.5px; font-weight: 700; color: var(--iris-text, #f3f4f6); }
.doc-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.doc-btn { background: transparent; border: 1px solid rgba(147,51,234,0.4); color: #c4b5fd; border-radius: 6px; padding: 4px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.doc-btn:hover { background: rgba(147,51,234,0.18); color: #fff; }
.doc-btn.doc-attached { background: rgba(26,170,85,0.14); border-color: #1AAA55; color: #1AAA55; opacity: 1; cursor: default; }   /* status-locked success green */
.doc-btn.doc-attached:hover { background: rgba(26,170,85,0.14); color: #1AAA55; }
.doc-btn.doc-dl-toggle { background: linear-gradient(135deg, #9333EA, #C026D3); border-color: transparent; color: #fff; }
.doc-btn.doc-dl-toggle:hover { filter: brightness(1.08); }
/* Download dropdown menu */
.doc-dl-wrap { position: relative; display: inline-flex; }
.doc-dl-menu { position: absolute; top: calc(100% + 4px); right: 0; z-index: 30; display: flex; flex-direction: column; min-width: 130px; background: var(--iris-panel-2, #232330); border: 1px solid #3a3a42; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); overflow: hidden; }
.doc-dl-menu[hidden] { display: none; }
.doc-dl-opt { background: transparent; border: 0; color: var(--iris-text, #e6e6ea); text-align: left; padding: 8px 12px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.doc-dl-opt:hover { background: rgba(147,51,234,0.18); color: #fff; }
.doc-body { padding: 14px 16px; max-height: 460px; overflow-y: auto; font-size: 13px; line-height: 1.55; color: #d8dee9; }
.doc-card.collapsed .doc-body { display: none; }
/* Collapse chevron + Close (✕) — mirror PlanCard so a doc card can be tucked away / closed to 🗂 Closed. */
.doc-collapse-chevron { flex: 0 0 auto; cursor: pointer; color: #9333EA; font-size: 11px; user-select: none; padding: 2px 2px; line-height: 1; }
.doc-collapse-chevron:hover { color: #b98aff; }
.doc-btn.doc-close { flex: 0 0 auto; color: #9ca3af; padding: 4px 8px; }
.doc-btn.doc-close:hover { background: rgba(194,57,52,0.18); border-color: #C23934; color: #fca5a5; }
.doc-empty { color: #fbbf24; font-size: 12.5px; margin: 0; }

/* Inline SVG diagrams (ERDs etc.) — white canvas so a light-themed diagram reads */
.svg-figure, .doc-figure { margin: 12px 0; padding: 12px; border: 1px solid #3f3f47; border-radius: 11px; background: #ffffff; overflow: auto; position: relative; }
.svg-figure svg, .doc-figure svg { max-width: 100%; height: auto; display: block; margin: 0 auto; }
.doc-card.doc-full .doc-body { max-height: none; }   /* ⤢ Expand → review the whole doc */

/* ── Test automation card (Phase A) ─────────────────────────────────── */
.test-card { margin: 12px 0; border: 1px solid #3f3f47; border-left: 3px solid #9333EA; border-radius: 11px; background: var(--iris-surface, #16161a); overflow: hidden; }
.test-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid #2d2d35; background: rgba(147,51,234,0.08); cursor: pointer; }
.test-card.collapsed .test-head { border-bottom: 0; }
.test-chev { background: none; border: 0; color: #c4b5fd; cursor: pointer; font-size: 12px; line-height: 1; padding: 0 2px; flex: 0 0 auto; }
.test-platform { font-size: 12px; font-weight: 700; color: #c4b5fd; background: rgba(147,51,234,0.16); padding: 3px 9px; border-radius: 999px; flex: 0 0 auto; }
.test-title { font-size: 13px; font-weight: 600; color: var(--iris-text, #e6e6ea); flex: 1 1 auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.test-summary { font-size: 11.5px; color: #8b8b94; flex: 0 0 auto; }
.test-actions { display: inline-flex; gap: 6px; flex: 0 0 auto; }
.test-btn { background: transparent; border: 1px solid #3f3f47; color: #c4b5fd; border-radius: 7px; padding: 5px 10px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.test-btn:hover { border-color: #9333EA; color: #fff; background: rgba(147,51,234,0.18); }
.test-btn:disabled { opacity: 0.6; cursor: default; }
.test-commit-link { color: #c4b5fd; font-size: 12px; margin-left: 4px; }
.test-body { max-height: 520px; overflow-y: auto; }
.test-card.collapsed .test-body, .test-card.collapsed .test-foot { display: none; }
.test-file { border-bottom: 1px solid #24242b; }
.test-file-path { padding: 7px 14px; font-size: 11.5px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: #9aa0aa; background: rgba(255,255,255,0.02); }
.test-file-name { color: #c4b5fd; }
.test-file-code { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: 12px; line-height: 1.5; background: #0e0e11; color: #d8dee9; }
.test-file-code code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre; }
.test-foot { padding: 9px 14px; font-size: 11.5px; color: #8b8b94; background: rgba(255,255,255,0.015); border-top: 1px solid #24242b; }

/* Ticket-driven flow — ticket summary card */
.ticket-card { margin: 10px 0; padding: 13px 15px; border: 1px solid #3f3f47; border-left: 3px solid #9333EA; border-radius: 10px; background: var(--iris-bg, #0e0e11); flex-shrink: 0; align-self: stretch; width: 100%; box-sizing: border-box; }
.ticket-close { margin-left: auto; flex: 0 0 auto; background: transparent; border: 1px solid rgba(147,51,234,0.4); color: #9ca3af; border-radius: 6px; width: 22px; height: 22px; line-height: 1; font-size: 12px; cursor: pointer; }
.ticket-close:hover { background: rgba(194,57,52,0.18); border-color: #C23934; color: #fca5a5; }
.ticket-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.ticket-key { font-weight: 700; font-size: 13px; color: var(--iris-text, #f3f4f6); }
.ticket-src { font-size: 10px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 7px; border-radius: 999px; color: #fff; }
.ticket-src-jira { background: #2684FF; }
.ticket-src-snow { background: #62D84E; color: #06210c; }
.ticket-src-gitlab { background: #FC6D26; }
.ticket-status { font-size: 11px; color: #c4b5fd; border: 1px solid rgba(147,51,234,0.4); border-radius: 999px; padding: 2px 9px; }
.ticket-open { margin-left: auto; font-size: 12px; color: #c4b5fd; text-decoration: none; font-weight: 600; }
.ticket-open:hover { color: #fff; }
.ticket-title { font-size: 14px; font-weight: 600; color: var(--iris-text, #f3f4f6); margin-top: 8px; }
.ticket-meta { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.ticket-desc { font-size: 12.5px; color: #d1d5db; line-height: 1.5; margin-top: 8px; white-space: pre-wrap; word-break: break-word; max-height: 220px; overflow-y: auto; }
.ticket-err { color: #fca5a5; }
.ticket-linked { margin-top: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ticket-linked-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6b7280; }
.ticket-comp { font-size: 11px; font-family: "SF Mono", Menlo, Consolas, monospace; background: rgba(147,51,234,0.14); border: 1px solid rgba(147,51,234,0.35); color: #e9d5ff; border-radius: 5px; padding: 2px 7px; }
.ticket-foot { font-size: 11px; color: #c4b5fd; margin-top: 10px; padding-top: 8px; border-top: 1px solid rgba(147,51,234,0.2); }

/* IRIS summarize button + summary pane */
.srm-summarize { background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; border: none; }
.srm-summarize:hover { filter: brightness(1.1); }
.srm-summarize:disabled { opacity: 0.7; cursor: wait; }
.srm-draft { background: transparent; color: #c4b5fd; border: 1px solid rgba(147,51,234,0.5); }
.srm-draft:hover { background: rgba(147,51,234,0.15); color: #fff; }
.srm-draft:disabled { opacity: 0.7; cursor: wait; }
.srm-summary { position: relative; margin: 4px 16px 0; padding: 12px 14px; border: 1px solid rgba(147,51,234,0.4); border-radius: 9px; background: rgba(147,51,234,0.08); }
/* Fixed height — scrolls internally so it never pushes the reply box down. */
.srm-sum-content { max-height: 132px; overflow-y: auto; padding-right: 6px; }
.srm-sum-expand { position: absolute; top: 6px; right: 6px; z-index: 1; width: 22px; height: 22px; padding: 0; border-radius: 5px; border: 1px solid rgba(147,51,234,0.45); background: rgba(147,51,234,0.18); color: #c4b5fd; cursor: pointer; font-size: 12px; line-height: 1; }
.srm-sum-expand:hover { background: rgba(147,51,234,0.32); color: #fff; }
.srm-sum-loading { font-size: 12px; color: #c4b5fd; }
.srm-sum-err { font-size: 12px; color: #fca5a5; }
.srm-sum-row { display: flex; gap: 9px; margin-bottom: 9px; }
.srm-sum-row:last-of-type { margin-bottom: 4px; }
.srm-sum-ic { font-size: 14px; flex: 0 0 auto; line-height: 1.4; }
.srm-sum-col { min-width: 0; }
.srm-sum-label { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #c084fc; font-weight: 700; margin-bottom: 2px; }
.srm-sum-text { font-size: 12.5px; color: #e2e8f0; line-height: 1.45; white-space: pre-wrap; word-break: break-word; }
.srm-sum-foot { font-size: 10px; color: #6b7280; margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(147,51,234,0.2); }
.srm-sum-actions { display: flex; justify-content: flex-end; margin-top: 10px; padding-top: 9px; border-top: 1px solid rgba(147,51,234,0.25); }
.srm-sum-draft { background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; border: none; border-radius: 7px; padding: 7px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.srm-sum-draft:hover { filter: brightness(1.1); }
.srm-sum-draft:disabled { opacity: 0.7; cursor: wait; }
/* Expanded summary popup (opened from the ⤢ icon) */
.srm-sum-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 10002; backdrop-filter: blur(3px); animation: iris-fade 150ms ease; }
.srm-sum-pop { width: 540px; max-width: 94vw; max-height: 80vh; display: flex; flex-direction: column; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; }
.srm-sum-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #4a4a54; font-weight: 600; font-size: 14px; color: var(--iris-text); }
.srm-sum-pop-x { background: transparent; border: none; color: #9ca3af; cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 6px; }
.srm-sum-pop-x:hover { background: rgba(255,255,255,0.08); color: var(--iris-text); }
.srm-sum-pop-body { padding: 16px; overflow-y: auto; }
.srm-replywrap { padding: 8px 16px 4px; }
.srm-input { width: 100%; box-sizing: border-box; background: var(--iris-bg); border: 1px solid #6d28d9; border-radius: 8px; padding: 9px 11px; color: var(--iris-text); font: inherit; font-size: 13px; resize: vertical; min-height: 64px; }
.srm-input:focus { outline: none; border-color: #9333EA; box-shadow: 0 0 0 2px rgba(147,51,234,0.25); }
.srm-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.srm-cancel { padding: 7px 16px; border-radius: 7px; border: 1px solid #4a4a54; background: transparent; color: var(--iris-text); cursor: pointer; font-weight: 600; }
.srm-cancel:hover { background: rgba(255,255,255,0.06); }
.srm-send { padding: 7px 16px; border-radius: 7px; border: none; background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; cursor: pointer; font-weight: 600; }
.srm-send:hover { filter: brightness(1.08); }

/* ── Generic branded input prompt (InputModal) ── */
.im-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 10001; backdrop-filter: blur(3px); animation: iris-fade 150ms ease; }
.im-overlay[hidden] { display: none; }
.im-card { width: 420px; max-width: 94vw; background: var(--iris-surface); border: 1px solid #555; border-radius: 12px; box-shadow: 0 24px 70px rgba(0,0,0,0.6); overflow: hidden; }
.im-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid #4a4a54; }
.im-title { font-weight: 600; font-size: 14px; color: var(--iris-text); }
.im-x { background: transparent; border: none; color: #9ca3af; font-size: 14px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.im-x:hover { background: rgba(255,255,255,0.08); color: var(--iris-text); }
.im-body { padding: 14px 16px 6px; }
.im-label { display: block; font-size: 12px; color: #cbd5e1; margin-bottom: 6px; font-weight: 600; }
.im-input { width: 100%; box-sizing: border-box; background: var(--iris-bg); border: 1px solid #6d28d9; border-radius: 8px; padding: 9px 11px; color: var(--iris-text); font: inherit; font-size: 13px; }
.im-input:focus { outline: none; border-color: #9333EA; box-shadow: 0 0 0 2px rgba(147,51,234,0.25); }
.im-hint { font-size: 11px; color: #6b7280; margin-top: 7px; line-height: 1.4; }
.im-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 10px 16px 14px; }
.im-cancel { padding: 7px 16px; border-radius: 7px; border: 1px solid #4a4a54; background: transparent; color: var(--iris-text); cursor: pointer; font-weight: 600; }
.im-cancel:hover { background: rgba(255,255,255,0.06); }
.im-ok { padding: 7px 16px; border-radius: 7px; border: none; background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; cursor: pointer; font-weight: 600; }
.im-ok:hover { filter: brightness(1.08); }

/* ════════════════════════════════════════════════════════════════════
   SLEEK PASS — Deep Indigo depth, motion, and focus polish.
   ════════════════════════════════════════════════════════════════════ */
button, .tree-item, .tree-folder, .intg-row, .scope-row, .plan-card, .intg-tog,
.icon-tool, .tree-action, .plan-more-menu button, .btn-approve, .btn-reject,
.btn-show-diff, .intg-cfg, .chip { transition: all var(--iris-ease); }

/* Glassy, animated modal overlays. */
.scope-modal, .intg-modal, .rule-modal { backdrop-filter: blur(3px); animation: iris-fade 150ms ease; }
@keyframes iris-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes iris-pop { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

/* Elevated, indigo-bordered surfaces that fade + scale in. */
.scope-card, .intg-card, .rule-card { border-color: var(--iris-border); box-shadow: var(--iris-elev-3);
  animation: iris-pop 200ms cubic-bezier(0.16, 1, 0.3, 1); }
.plan-more-menu { box-shadow: var(--iris-elev-2); border-color: var(--iris-border); }
.plan-card { box-shadow: var(--iris-elev-1); }

/* Focus = soft accent glow, not a hard outline. */
input:focus, textarea:focus { outline: none; box-shadow: var(--iris-glow); border-color: var(--iris-accent) !important; }

/* Hover washes. */
.intg-row:hover { border-color: #34303f; background: linear-gradient(0deg, var(--iris-accent-soft), transparent); }
.tree-item:hover, .scope-row:hover { background: var(--iris-accent-soft); }

/* Primary actions: gradient glow + 1px lift. */
.btn-approve, .scope-save, .intg-done, .rule-save { box-shadow: 0 2px 12px rgba(147,51,234,0.35); }
.btn-approve:hover, .scope-save:hover, .intg-done:hover, .rule-save:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(147,51,234,0.5); }
.intg-tog.on { box-shadow: 0 0 10px rgba(26,170,85,0.45); }

/* Thin indigo scrollbars globally (component scrollbars override as needed). */
* { scrollbar-width: thin; scrollbar-color: #2a3040 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #2a3040; border-radius: 6px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #39415a; }

/* Lucide line icons — inline alignment. */
.lic { display: inline-block; vertical-align: -0.18em; }
.guardian-bell .lic, .guardian-cfg .lic, .tree-action .lic { vertical-align: middle; }
.intg-icon .lic { width: 18px; height: 18px; vertical-align: middle; }
.gm .lic { vertical-align: -0.22em; }
.guardian-cfg:hover { color: #c084fc; }

/* ════════════════════════════════════════════════════════════════════
   PLAN CARD — sleek Deep Indigo redesign.
   ════════════════════════════════════════════════════════════════════ */
.plan-card { background: var(--iris-surface); border: 1px solid var(--iris-border); border-left: 3px solid var(--iris-border);
  border-radius: 14px; box-shadow: var(--iris-elev-2); }
.plan-card[data-risk="low"] { border-left-color: #1AAA55; }
.plan-card[data-risk="medium"] { border-left-color: #F59E0B; }
.plan-card[data-risk="high"] { border-left-color: #C23934; }

.plan-header { background: linear-gradient(180deg, rgba(147,51,234,0.10), transparent);
  border-bottom: 1px solid var(--iris-border-soft); padding: 13px 16px; }
.plan-header:hover { background: linear-gradient(180deg, rgba(147,51,234,0.17), transparent); }
.plan-title { font-weight: 650; font-size: 14px; letter-spacing: -0.01em; display: flex; align-items: center; gap: 8px; }
.plan-ic { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px;
  border-radius: 7px; background: var(--iris-accent-soft); color: #c084fc; flex: 0 0 auto; }
.plan-collapse-chevron { color: var(--iris-text-dim); }

.plan-risk { font-size: 11px; font-weight: 600; padding: 3px 10px 3px 8px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid transparent; }
.plan-risk::before { content: ''; width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto; }
.plan-risk-low { color: #5be08b; background: rgba(26,170,85,0.12); border-color: rgba(26,170,85,0.3); }
.plan-risk-low::before { background: #1AAA55; }
.plan-risk-medium { color: #fbbf52; background: rgba(245,158,11,0.12); border-color: rgba(245,158,11,0.3); }
.plan-risk-medium::before { background: #F59E0B; }
.plan-risk-high { color: #f08a85; background: rgba(194,57,52,0.12); border-color: rgba(194,57,52,0.3); }
.plan-risk-high::before { background: #C23934; }

.plan-summary { color: var(--iris-text-dim); font-size: 13px; padding: 12px 16px 4px; line-height: 1.55; }
.plan-files { padding: 8px 16px 4px; display: flex; flex-direction: column; gap: 6px; }
.plan-file { display: flex; align-items: center; gap: 8px; font-size: 12px; padding: 6px 10px;
  background: var(--iris-bg); border: 1px solid var(--iris-border-soft); border-radius: 8px; }
.plan-file-action { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 7px; border-radius: 5px; flex: 0 0 auto; }
.plan-file-action-create { color: #5be08b; background: rgba(26,170,85,0.14); }
.plan-file-action-modify { color: #fbbf52; background: rgba(245,158,11,0.14); }
.plan-file-action-delete { color: #f08a85; background: rgba(194,57,52,0.14); }
.plan-file-name { font-family: "SF Mono", Menlo, Consolas, monospace; color: var(--iris-text); }
.plan-file-desc { color: var(--iris-text-dim); }

.plan-actions { background: transparent; border-top: 1px solid var(--iris-border-soft); padding: 12px 16px; }
.plan-actions button { border-radius: 8px; }
.btn-approve { background: linear-gradient(135deg, #16a34a, #15803d); }
.btn-reject { background: transparent; border-color: rgba(194,57,52,0.4); color: #f08a85; }
.btn-reject:hover { background: rgba(194,57,52,0.12); }
.btn-show-diff { background: var(--iris-panel-2); border-color: var(--iris-border); color: var(--iris-text-dim); }

.plan-diff-file { border-color: var(--iris-border); border-radius: 8px; overflow: hidden; }
.plan-diff-header { background: var(--iris-panel-2); color: var(--iris-text-dim); font-weight: 600; }
.plan-diff-body { background: #0a0b0f; }
.plan-feedback { padding: 10px 16px 14px; color: var(--iris-text-dim); border-top: 1px solid var(--iris-border-soft); }

/* ════════════════════════════════════════════════════════════════════
   POLISH PASS 2 — aurora glow, tree, and modal-header refinement.
   ════════════════════════════════════════════════════════════════════ */
/* Aurora: a soft purple glow bleeding down from the top chrome. */
.topbar { background: radial-gradient(120% 180% at 18% -40%, rgba(147,51,234,0.16), transparent 55%), var(--iris-topbar); }
.guardian-banner { background: radial-gradient(80% 220% at 10% -60%, rgba(147,51,234,0.20), transparent 60%), linear-gradient(90deg, rgba(147,51,234,0.10), rgba(236,72,153,0.06)); }

/* Tree — Deep Indigo. */
.tree-sidebar { background: var(--iris-panel); border-right: 1px solid var(--iris-border); }
.tree-header { background: linear-gradient(180deg, rgba(147,51,234,0.08), transparent); border-bottom: 1px solid var(--iris-border); color: var(--iris-text-dim); }
.tree-search { border-bottom: 1px solid var(--iris-border); }
.tree-search input { background: var(--iris-bg); border: 1px solid var(--iris-border); }
.tree-item { color: #c7ccd6; }
.tree-item-icon { color: #8b93a3; display: inline-flex; align-items: center; }
.tree-item-icon .lic { width: 14px; height: 14px; vertical-align: middle; }
.tree-item:hover .tree-item-icon, .tree-item.active .tree-item-icon { color: #c084fc; }
.tree-item.active { background: linear-gradient(90deg, var(--iris-accent-soft), transparent); border-left-color: var(--iris-accent); }
.tree-folder:hover { color: #c084fc; }
.tree-action { border: 1px solid var(--iris-border); }
.tree-action:hover { background: var(--iris-accent-soft); color: #c084fc; border-color: #6d28d9; }
/* Funnel + refresh on one line (funnel left of refresh). */
.tree-header-actions { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
/* Quick-switch scope dropdown in the tree header. */
.tree-scope-select { flex: 1; min-width: 0; background: var(--iris-panel-2); border: 1px solid var(--iris-border);
  color: var(--iris-text); border-radius: 6px; padding: 3px 6px; font: inherit; font-size: 11px; cursor: pointer; }
.tree-scope-select:hover { border-color: #6d28d9; }
.tree-scope-select:focus { outline: none; border-color: var(--iris-accent); }

/* Multi-scope switcher (scope-picker). */
.scope-switch { display: flex; align-items: center; gap: 8px; padding: 12px 18px 0; font-size: 13px; color: #9ca3af; }
.scope-switch select { flex: 1; background: var(--iris-panel-2); border: 1px solid #4a4a54; border-radius: 6px; padding: 6px 10px; color: var(--iris-text); font: inherit; }
.scope-del { background: transparent; border: 1px solid #4a4a54; color: #9ca3af; border-radius: 6px; padding: 6px 9px; cursor: pointer; }
.scope-del:hover { border-color: rgba(194,57,52,0.5); color: #f08a85; }

/* Modal headers — faint accent wash. */
.intg-head, .rule-head, .scope-head { background: linear-gradient(180deg, rgba(147,51,234,0.07), transparent); }

/* ── Split diff (panel/ui/diff-view.js) — VS-Code-style before/after ── */
.dv { border: 1px solid var(--iris-border); border-radius: 8px; overflow: hidden; background: #0a0b0f; }
.dv-grid { display: grid; grid-template-columns: auto 1fr auto 1fr; max-height: 380px; overflow: auto;
  font: 11.5px/1.65 "SF Mono", Menlo, Consolas, monospace; }
.dv-head { padding: 6px 12px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--iris-text-dim); background: var(--iris-panel-2); position: sticky; top: 0; z-index: 1; }
.dv-sep { border-left: 1px solid var(--iris-border); }
.dv-ln { text-align: right; padding: 0 8px; color: #555c6b; user-select: none; min-width: 34px; }
.dv-code { padding: 0 12px; white-space: pre; color: #d1d5db; overflow: hidden; }
.bg-ctx { background: transparent; }
.bg-del { background: rgba(194,57,52,0.15); }
.bg-add { background: rgba(26,170,85,0.15); }
.bg-pad { background: rgba(255,255,255,0.018); }
.dv-code.bg-del { box-shadow: inset 2px 0 0 #C23934; }
.dv-code.bg-add { box-shadow: inset 2px 0 0 #1AAA55; }
.dv-ln.bg-del { color: #f08a85; } .dv-ln.bg-add { color: #5be08b; }
/* IRIS narration on the diff (✨ summaries + explain). */
.dv-bar { padding: 7px 10px; border-bottom: 1px solid var(--iris-border); display: flex; }
.dv-explain { background: linear-gradient(135deg, #9333EA, #C026D3); color: #fff; border: none; border-radius: 7px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.dv-explain:hover { filter: brightness(1.08); }
.dv-head .dv-sum { background: transparent; border: none; color: #c084fc; cursor: pointer; font-size: 12px; padding: 0 2px; vertical-align: middle; }
.dv-head .dv-sum:hover { filter: brightness(1.3); }
.dv-narr { padding: 10px 14px; font-size: 12.5px; line-height: 1.6; color: #d6c8ee; background: rgba(147,51,234,0.08); border-bottom: 1px solid var(--iris-border); white-space: pre-wrap; }
.dv-narr[hidden] { display: none; }
.dv-sum-out { border-bottom: none; border-top: 1px solid var(--iris-border); }

/* Branded "thinking" loader — the IRIS logo beating like a heart. */
.iris-beat-wrap { display: inline-flex; align-items: center; gap: 8px; color: #c084fc; font-size: 12.5px; }
.iris-beat { width: 18px; height: 18px; transform-origin: center; animation: iris-heartbeat 1s ease-in-out infinite; }
.iris-beat-emoji { display: inline-block; width: auto; height: auto; font-size: 16px; line-height: 1; }
/* Calm "thinking" pulse (gentle fade, not a heartbeat). */
.iris-think { display: inline-block; font-size: 16px; line-height: 1; animation: iris-think-pulse 1.4s ease-in-out infinite; }
@keyframes iris-think-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes iris-heartbeat { 0%,100% { transform: scale(1); } 14% { transform: scale(1.28); } 28% { transform: scale(1); } 42% { transform: scale(1.18); } 56% { transform: scale(1); } }
/* Standard AI disclaimer footer (reused wherever IRIS narrates). */
.iris-disclaimer { display: block; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--iris-border-soft); font-size: 11px; color: #8b8b94; font-style: italic; }

/* Size badge in plan-diff header — shows "350 lines" so users know
   what they're scrolling into before they start. Subtle purple chip,
   right-aligned via float for both single-col and side-by-side modes. */
.plan-diff-size {
  float: right;
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: #c4b5fd;
  background: rgba(124, 58, 237, 0.12);
  border: 1px solid rgba(124, 58, 237, 0.30);
  border-radius: 9px;
  padding: 1px 8px;
  margin-left: 8px;
  letter-spacing: 0.02em;
}

/* Scroll-affordance: subtle gradient at the bottom of the diff-file
   wrapper hinting "more content below". Pointer-events:none so it
   never blocks scrolling or selection. Only meaningful when content
   actually overflows; on short blocks the gradient is invisible
   (covered by short content). */
.plan-diff-file { position: relative; }
.plan-diff-file::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 14px;  /* leave gap for vertical scrollbar */
  bottom: 1px;
  height: 24px;
  background: linear-gradient(to bottom, transparent, rgba(13, 17, 23, 0.85));
  pointer-events: none;
  border-radius: 0 0 5px 5px;
}
.plan-diff-pane { position: relative; }
.plan-diff-pane .plan-diff-body { position: relative; }
.plan-diff-pane::after {
  content: "";
  position: absolute;
  left: 1px;
  right: 14px;
  bottom: 1px;
  height: 24px;
  background: linear-gradient(to bottom, transparent, rgba(15, 15, 18, 0.85));
  pointer-events: none;
  border-radius: 0 0 5px 5px;
}

/* ─── IrisConfirm — HAV-IQ branded confirmation dialog ─────────────────
   Replaces native browser confirm() popups in critical flows so the
   UX feels like part of IRIS rather than a Chrome system dialog.
   Visual language matches .approval-card + .modal-card. */
.iris-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  /* Above the Monaco editor overlay (z-index 10050) — a modal confirm must sit
     on top of the editor, not behind it. */
  z-index: 10100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: iris-confirm-fade-in 0.15s ease-out;
}
@keyframes iris-confirm-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.iris-confirm-card {
  background: linear-gradient(180deg, #1f1f23 0%, #1a1a1d 100%);
  border: 1px solid rgba(124, 58, 237, 0.40);
  border-radius: 12px;
  width: min(480px, 100%);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(124, 58, 237, 0.20);
  animation: iris-confirm-slide-in 0.18s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes iris-confirm-slide-in {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
.iris-confirm-card.iris-confirm-tone-destructive {
  border-color: rgba(220, 38, 38, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(220, 38, 38, 0.20);
}
.iris-confirm-card.iris-confirm-tone-warning {
  border-color: rgba(217, 119, 6, 0.45);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(217, 119, 6, 0.20);
}
.iris-confirm-header {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(79, 70, 229, 0.08));
  border-bottom: 1px solid rgba(124, 58, 237, 0.25);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.iris-confirm-tone-destructive .iris-confirm-header {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.14), rgba(127, 29, 29, 0.10));
  border-bottom-color: rgba(220, 38, 38, 0.30);
}
.iris-confirm-tone-warning .iris-confirm-header {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.14), rgba(146, 64, 14, 0.10));
  border-bottom-color: rgba(217, 119, 6, 0.30);
}
.iris-confirm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.iris-confirm-icon {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 0 4px rgba(147, 51, 234, 0.50));
  flex-shrink: 0;
}
.iris-confirm-title {
  font-size: 14px;
  font-weight: 700;
  color: #e6e6e6;
  letter-spacing: 0.01em;
}
.iris-confirm-close {
  background: transparent;
  border: none;
  color: #888;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.iris-confirm-close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ddd;
}
.iris-confirm-body {
  padding: 16px 18px;
  color: #c8c8c8;
  font-size: 13px;
  line-height: 1.55;
  overflow-y: auto;
  flex: 1;
}
.iris-confirm-body p { margin: 0 0 10px 0; }
.iris-confirm-body p:last-child { margin-bottom: 0; }
.iris-confirm-body strong { color: #e6e6e6; }
.iris-confirm-body code {
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.30);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 12px;
  color: #c4b5fd;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.iris-confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #2d2d2d;
  background: #1a1a1d;
  flex-shrink: 0;
}
.iris-confirm-actions button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #3d3d3d;
  background: #2a2a2e;
  color: #ddd;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 80px;
}
.iris-confirm-actions button:hover {
  background: #333339;
  border-color: #4d4d4d;
}
.iris-confirm-tone-primary .iris-confirm-ok {
  background: linear-gradient(135deg, #7c3aed, #6d28d9);
  border-color: #6d28d9;
  color: white;
}
.iris-confirm-tone-primary .iris-confirm-ok:hover {
  background: linear-gradient(135deg, #9333ea, #7c3aed);
  border-color: #7c3aed;
}
.iris-confirm-tone-destructive .iris-confirm-ok {
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border-color: #b91c1c;
  color: white;
}
.iris-confirm-tone-destructive .iris-confirm-ok:hover {
  background: linear-gradient(135deg, #ef4444, #dc2626);
}
.iris-confirm-tone-warning .iris-confirm-ok {
  background: linear-gradient(135deg, #d97706, #b45309);
  border-color: #b45309;
  color: white;
}
.iris-confirm-tone-warning .iris-confirm-ok:hover {
  background: linear-gradient(135deg, #f59e0b, #d97706);
}
.iris-confirm-actions button:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
}

/* Composer — Claude-style: prompt on top, a toolbar row below (attach + mic on
   the left, Send on the right). The two stack vertically inside one field. */
.chat-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  border-top: 1px solid #2d2d2d;
  background: #252526;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}
.chat-input textarea {
  width: 100%;
  box-sizing: border-box;
  resize: none;
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #e6e6e6;
  padding: 8px 10px;
  border-radius: 8px;
  font: inherit;
  font-size: 13px;
  min-height: 40px;
  max-height: 160px;
  line-height: 1.45;
}
.chat-input textarea:focus {
  outline: none;
  border-color: #9333EA;
}
/* Bottom toolbar row */
.chat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.chat-toolbar-left {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* Attach + mic — matched 30px icon buttons. */
.chat-toolbar-left button,
.chat-toolbar-left #btn-voice {
  background: transparent;
  border: 1px solid #3d3d3d;
  color: #9a9aa8;
  border-radius: 7px;
  width: 30px;
  height: 30px;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: 15px;
  transition: background .15s, color .15s, border-color .15s;
}
.chat-toolbar-left button:hover,
.chat-toolbar-left #btn-voice:hover {
  color: #c4b5fd;
  border-color: #6d28d9;
  background: rgba(147, 51, 234, .12);
}
/* Send — icon-only primary button (↑), turns into a red ■ Stop while sending. */
#btn-send {
  background: linear-gradient(135deg, #9333EA, #EC4899);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Settings modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: #252526;
  border: 1px solid #3d3d3d;
  border-radius: 10px;
  width: min(520px, 90%);
  max-height: 80vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #3d3d3d;
  font-weight: 600;
}
.modal-header button {
  background: transparent;
  border: none;
  color: #ccc;
  font-size: 20px;
  cursor: pointer;
}
.modal-body {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal-body label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: #ccc;
}
.modal-body input,
.modal-body select {
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #e6e6e6;
  padding: 7px 10px;
  border-radius: 4px;
  font: inherit;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
}
.modal-body input[readonly] { background: #181818; color: #888; }
.modal-body input:focus,
.modal-body select:focus {
  outline: none;
  border-color: #9333EA;
}
.modal-body .hint {
  font-size: 10px;
  color: #888;
  margin-top: 2px;
}
.modal-hint {
  font-size: 11px;
  color: #888;
  line-height: 1.5;
  background: #1e1e1e;
  padding: 8px 10px;
  border-radius: 4px;
  border-left: 3px solid #9333EA;
}

/* Connected status — shown at top of settings modal when an AI is configured */
.connected-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: 6px;
  margin-bottom: 4px;
}
.connected-info { display: flex; align-items: center; gap: 8px; min-width: 0; }
.connected-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px rgba(74, 222, 128, 0.6);
  flex: 0 0 auto;
}
.connected-label {
  color: #cbd5e1;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.connected-label strong { color: #f9fafb; }
.connected-model {
  color: #6b7280;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  margin-left: 6px;
}
.connected-disconnect {
  background: transparent;
  border: 1px solid #7f1d1d;
  color: #fca5a5;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  flex: 0 0 auto;
}
.connected-disconnect:hover {
  background: rgba(127, 29, 29, 0.3);
  color: #fef2f2;
}

/* Phase 7g-1 — Legal section in settings modal (Terms + Privacy) */
.settings-legal {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #2a2a32;
}
.settings-legal-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #9ca3af;
  margin-bottom: 6px;
}
.settings-legal-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.settings-legal-link {
  color: #c084fc;
  text-decoration: none;
  font-size: 12px;
  padding: 2px 0;
}
.settings-legal-link:hover {
  color: #e9d5ff;
  text-decoration: underline;
}
.settings-legal-sep {
  color: #4b5563;
  font-size: 12px;
}
.settings-legal-copyright {
  margin-top: 6px;
  font-size: 10.5px;
  color: #6b7280;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #3d3d3d;
}
.modal-footer button {
  background: #333;
  border: 1px solid #444;
  color: #ddd;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}
.modal-footer button.primary {
  background: linear-gradient(135deg, #9333EA, #EC4899);
  border: none;
  color: white;
}
#settings-status {
  padding: 0 18px 14px;
  font-size: 11px;
  min-height: 14px;
}
#settings-status.ok { color: #86efac; }
#settings-status.err { color: #fca5a5; }

/* ─── Detection Diagnostic Card ─────────────────────────────────────── */

.diagnose-card {
  background: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.06));
  border: 1px solid rgba(59, 130, 246, 0.25);
  padding: 12px 14px;
  border-radius: 8px;
}
.diagnose-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: #f0f0f0;
  font-size: 13px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.diagnose-icon { font-size: 16px; }
.diagnose-root-issue {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.2);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12.5px;
  margin-bottom: 10px;
}
/* Phase 7g-0 — OrgPin scope indicator in Diagnose */
.diagnose-pin-note {
  color: #e9d5ff;
  background: rgba(147, 51, 234, 0.15);
  border: 1px solid rgba(147, 51, 234, 0.35);
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-bottom: 10px;
}
.diagnose-host-block + .diagnose-host-block {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(255,255,255,0.1);
}
.diagnose-host-name {
  font-size: 12px;
  color: #d4d4d4;
  margin-bottom: 8px;
}
.diagnose-host-name code {
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e6e6e6;
}
.diagnose-checks {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.diagnose-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  line-height: 1.5;
}
.diagnose-check-pass { background: rgba(21, 128, 61, 0.08); }
.diagnose-check-warn { background: rgba(180, 83, 9, 0.1);   }
.diagnose-check-fail { background: rgba(127, 29, 29, 0.12); }
.diagnose-check-status {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.3;
}
.diagnose-check-body { flex: 1; color: #d4d4d4; min-width: 0; }
.diagnose-check-body strong { color: #eaeaea; font-weight: 600; }
.diagnose-fix {
  margin-top: 4px;
  padding: 5px 8px;
  background: rgba(245, 158, 11, 0.15);
  border-left: 2px solid rgba(245, 158, 11, 0.6);
  border-radius: 0 3px 3px 0;
  font-size: 11px;
  color: #fde68a;
  word-break: break-word;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.diagnose-verdict {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 1.5;
}
.diagnose-verdict strong { color: #ffffff; font-weight: 700; }
.diagnose-verdict-action {
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.14), rgba(236, 72, 153, 0.1));
  border: 1px solid rgba(147, 51, 234, 0.4);
  color: #e9d5ff;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.diagnose-verdict-ok {
  background: rgba(21, 128, 61, 0.14);
  border: 1px solid rgba(134, 239, 172, 0.4);
  color: #d1fae5;
}

/* ─── Settings toggle switch ────────────────────────────────────────── */

.toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
  cursor: pointer;
}
.toggle-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  font-size: 12.5px;
  color: #d4d4d4;
}
.toggle-label strong {
  color: #eaeaea;
  font-weight: 600;
}
.toggle-label small.hint {
  color: #8a8a92;
  font-size: 11px;
  line-height: 1.45;
}
.toggle-label code {
  background: #1a1a1a;
  padding: 0 5px;
  border-radius: 3px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 10.5px;
  color: #f5b8a8;
  border: 1px solid #2a2a2a;
}
.toggle-switch {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 38px;
  height: 20px;
  background: #3d3d3d;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
  margin: 2px 0 0 0;
  border: 1px solid #4a4a4a;
}
.toggle-switch::before {
  content: "";
  position: absolute;
  top: 1px; left: 1px;
  width: 16px; height: 16px;
  background: #ffffff;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.toggle-switch:checked {
  background: linear-gradient(90deg, #9333ea, #ec4899);
  border-color: rgba(236, 72, 153, 0.5);
}
.toggle-switch:checked::before {
  transform: translateX(18px);
}
.toggle-switch:focus-visible {
  outline: 2px solid rgba(147, 51, 234, 0.6);
  outline-offset: 2px;
}

/* ─── TestClassGen ──────────────────────────────────────────────────── */

/* Badge on the plan header: "💜 +1 test" / "+2 tests" */
.plan-with-test {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(147,51,234,0.2), rgba(236,72,153,0.18));
  border: 1px solid rgba(147,51,234,0.4);
  color: #e9d5ff;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

/* Auto-generated file row inside the plan card — fades in from below */
.plan-file-auto-gen {
  animation: tgen-row-fade 0.4s ease-out;
  background: rgba(147, 51, 234, 0.06);
  border-left: 2px solid rgba(147, 51, 234, 0.5);
  padding-left: 6px;
  border-radius: 0 3px 3px 0;
}
.plan-file-auto-badge {
  margin-left: auto;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(147, 51, 234, 0.2);
  border: 1px solid rgba(147, 51, 234, 0.4);
  color: #e9d5ff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
@keyframes tgen-row-fade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Streaming card that appears below the plan while the test is being
 * generated. Reuses the existing .iris-heart animation from the loader. */
.test-gen-card {
  background: linear-gradient(135deg, rgba(147,51,234,0.10), rgba(79,70,229,0.08));
  border: 1px solid rgba(147, 51, 234, 0.30);
  padding: 10px 12px;
  margin-top: 6px;
  border-radius: 8px;
}
.test-gen-card .test-gen-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #d4d4d4;
}
.test-gen-card .test-gen-header .iris-heart-wrap {
  width: 28px;
  height: 28px;
}
.test-gen-card .test-gen-header .iris-heart {
  font-size: 18px;
}
.test-gen-label strong {
  color: #f0f0f0;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: 3px;
}
.test-gen-code {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 10px 12px;
  max-height: 320px;
  overflow: auto;
  margin: 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: #e6e6e6;
  white-space: pre;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.test-gen-code code { background: transparent; border: none; padding: 0; }

/* Finished state — green accent, no pulsing */
.test-gen-done {
  background: linear-gradient(135deg, rgba(21,128,61,0.10), rgba(147,51,234,0.08));
  border-color: rgba(134, 239, 172, 0.30);
}
.test-gen-done .test-gen-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(21,128,61,0.2);
  border: 1px solid rgba(134, 239, 172, 0.5);
  color: #86efac;
  font-weight: 700;
  font-size: 16px;
}

/* Error state — soft red, IRIS didn't break the plan */
.test-gen-error {
  background: rgba(127, 29, 29, 0.10);
  border-color: rgba(239, 68, 68, 0.35);
}
.test-gen-error .test-gen-label {
  color: #fca5a5;
}
.test-gen-error .test-gen-code {
  display: none;
}

/* ─── ProdGuard ─────────────────────────────────────────────────────── */

/* Red banner shown on prod orgs when no override is active */
.banner-prod-warning {
  background: linear-gradient(90deg, #7f1d1d, #b91c1c 50%, #7f1d1d);
  color: #fee2e2;
  border-top: 2px solid #ef4444;
  border-bottom: 1px solid rgba(0,0,0,0.4);
}
.banner-prod-warning .banner-text {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}
.banner-prod-warning .banner-icon { font-size: 15px; }
.banner-prod-warning strong { color: #ffffff; font-weight: 700; }
.banner-prod-warning .banner-cta {
  background: #ffffff;
  color: #991b1b;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  font-size: 11.5px;
}
.banner-prod-warning .banner-cta:hover { background: #fecaca; }

/* Header timer pill — shown during an active override */
.prodguard-timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7f1d1d, #b91c1c);
  color: #fff1f1;
  font-size: 11px;
  font-weight: 600;
  margin-right: 4px;
  border: 1px solid rgba(255,255,255,0.2);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.35);
  animation: prodguard-pulse 2.4s ease-in-out infinite;
}
.prodguard-timer-pill .prodguard-timer-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.9);
  animation: prodguard-dot-blink 1s ease-in-out infinite;
}
.prodguard-timer-pill button {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  margin-left: 4px;
}
.prodguard-timer-pill button:hover { background: rgba(255, 255, 255, 0.35); }

@keyframes prodguard-pulse {
  0%, 100% { box-shadow: 0 0 12px rgba(239, 68, 68, 0.35); }
  50%      { box-shadow: 0 0 18px rgba(239, 68, 68, 0.6); }
}
@keyframes prodguard-dot-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.55; transform: scale(0.85); }
}

/* Subtle red glow around the whole chat screen while override is active */
body.prodguard-unlocked #chat-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border: 2px solid rgba(239, 68, 68, 0.55);
  border-radius: 4px;
  box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.12);
  animation: prodguard-border-pulse 2.4s ease-in-out infinite;
  z-index: 9;
}
@keyframes prodguard-border-pulse {
  0%, 100% { box-shadow: inset 0 0 30px rgba(239, 68, 68, 0.12); }
  50%      { box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.22); }
}

/* Modal */
.prodguard-modal-panel {
  background: #1f1f23;
  border: 1px solid #7f1d1d;
  border-radius: 10px;
  width: min(560px, 92%);
  max-height: 88vh;
  overflow: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(239, 68, 68, 0.25);
}
.prodguard-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #3d3d3d;
  background: linear-gradient(90deg, #450a0a, #7f1d1d, #450a0a);
}
.prodguard-modal-header .prodguard-icon { font-size: 22px; }
.prodguard-modal-header h2 {
  margin: 0;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.prodguard-modal-panel .modal-body { gap: 14px; }
.prodguard-warn {
  margin: 0;
  padding: 10px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  border-radius: 0 4px 4px 0;
  color: #fee2e2;
  font-size: 12.5px;
  line-height: 1.5;
}
.prodguard-warn strong { color: #ffffff; }
.prodguard-warn em { color: #fca5a5; font-style: italic; }
.prodguard-org {
  display: inline-block;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  color: #ffffff;
}
.prodguard-upsell {
  margin: 0;
  padding: 8px 12px;
  background: linear-gradient(90deg, rgba(147,51,234,0.12), rgba(236,72,153,0.10));
  border-radius: 4px;
  font-size: 12px;
  color: #e9d5ff;
}
.prodguard-upsell a {
  color: #ffffff;
  font-weight: 700;
  text-decoration: underline;
}
.prodguard-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: #d4d4d4;
  margin: 0;
}
.prodguard-field > span,
.prodguard-field legend {
  font-weight: 600;
  color: #eaeaea;
  padding: 0;
}
.prodguard-field input[type="text"],
.prodguard-field textarea {
  background: #161618;
  border: 1px solid #3d3d3d;
  color: #eaeaea;
  border-radius: 4px;
  padding: 7px 10px;
  font-size: 12.5px;
  font-family: inherit;
}
.prodguard-field input[type="text"]:focus,
.prodguard-field textarea:focus {
  border-color: #ef4444;
  outline: none;
}
.prodguard-field.prodguard-duration {
  border: none;
  padding: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
}
.prodguard-duration label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: normal;
  cursor: pointer;
}
.prodguard-duration input[type="radio"] { accent-color: #ef4444; }
.prodguard-ack {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #d4d4d4;
  cursor: pointer;
  padding: 6px 0;
}
.prodguard-ack input[type="checkbox"] { accent-color: #ef4444; margin-top: 2px; }
.prodguard-error {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 12px;
}

.prodguard-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid #3d3d3d;
  background: #18181b;
}
.prodguard-modal-footer .btn-secondary {
  background: #2d2d31;
  color: #d4d4d4;
  border: 1px solid #3d3d3d;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12.5px;
  cursor: pointer;
}
.prodguard-modal-footer .btn-secondary:hover { background: #3a3a3f; }
.prodguard-modal-footer .btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
.prodguard-modal-footer .btn-danger:hover { background: #ef4444; }

/* ─────────────────────────────────────────────────────────────────────
   IRIS approval card (v2 phase 7e-2) — inline tool-call approval for
   mutate/destructive tools. Modal+backdrop is used for double-confirm
   and typed-reason verifications.
   ───────────────────────────────────────────────────────────────────── */
.approval-card {
  background: linear-gradient(135deg, #1f1f23, #2a2a32);
  border: 1px solid #444;
  border-left: 4px solid #9333EA;
  border-radius: 10px;
  margin: 6px 0;
  align-self: stretch;
  max-width: 100%;
  flex-shrink: 0;   /* don't let a follow-up message compress the approval card */
  overflow: hidden;
  font-size: 13px;
  color: #e6e6e6;
  animation: iris-fade-in 0.18s ease-out;
}
.approval-card-destructive {
  border-left-color: #b91c1c;
  background: linear-gradient(135deg, #2a1518, #2a2030);
}
.approval-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.15), rgba(236, 72, 153, 0.15));
  border-bottom: 1px solid #3a3a3a;
}
.approval-card-destructive .approval-header {
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.18), rgba(236, 72, 153, 0.12));
}
.approval-title {
  font-weight: 700;
  color: #f9fafb;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.approval-title code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  color: #c084fc;
  background: rgba(147, 51, 234, 0.12);
  padding: 1px 6px;
  border-radius: 3px;
}
.approval-icon { font-size: 14px; }
.approval-tier {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 8px;
  border-radius: 4px;
}
.approval-tier-read        { background: #14532d; color: #86efac; }
.approval-tier-mutate      { background: #1e3a8a; color: #bfdbfe; }
.approval-tier-destructive { background: #7f1d1d; color: #fecaca; }

.approval-desc {
  padding: 8px 14px 0;
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.5;
}
.approval-args {
  padding: 8px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.approval-args-empty {
  padding: 8px 14px;
  color: #6b7280;
  font-style: italic;
  font-size: 11.5px;
}
.approval-arg {
  display: flex;
  gap: 8px;
  font-size: 11.5px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #d1d5db;
  align-items: flex-start;
}
.approval-arg-key {
  color: #9333EA;
  font-weight: 600;
  flex-shrink: 0;
  min-width: 100px;
}
.approval-arg-val {
  color: #e6e6e6;
  word-break: break-word;
  white-space: pre-wrap;
}
.approval-verify {
  padding: 6px 14px;
  font-size: 11.5px;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.18);
  border-top: 1px solid #3a3a3a;
}
.approval-actions {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid #3a3a3a;
}
.approval-btn {
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.approval-btn-icon {
  font-size: 14px;
  line-height: 1;
  font-weight: 700;
  display: inline-block;
}
.approval-btn-deny {
  background: #2d2d2d;
  border-color: #4b5563;
  color: #d1d5db;
  margin-right: auto;
}
.approval-btn-deny:hover { background: #3a3a3a; }
.approval-btn-approve {
  background: linear-gradient(135deg, #9333EA, #EC4899);
  color: white;
  border-color: transparent;
}
.approval-btn-approve:hover {
  background: linear-gradient(135deg, #7e22ce, #db2777);
}
.approval-card-destructive .approval-btn-approve {
  background: linear-gradient(135deg, #b91c1c, #EC4899);
}
.approval-card-destructive .approval-btn-approve:hover {
  background: linear-gradient(135deg, #991b1b, #db2777);
}
.approval-btn-confirm {
  background: linear-gradient(135deg, #b91c1c, #dc2626);
  color: white;
}
.approval-btn-confirm:hover:not(:disabled) {
  background: linear-gradient(135deg, #991b1b, #b91c1c);
}
.approval-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Decided card collapses into a compact chip */
.approval-card-decided {
  border-left-width: 3px;
  background: #1a1a1f;
}
.approval-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 12px;
}
.approval-chip-approved { color: #86efac; }
.approval-chip-denied   { color: #fca5a5; }
.approval-chip code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: inherit;
  opacity: 0.85;
}

/* Modal (double-confirm + typed-reason) */
.approval-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: iris-fade-in 0.15s ease-out;
}
.approval-modal {
  background: #1f1f23;
  border: 1px solid #4b5563;
  border-radius: 12px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}
.approval-modal-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(185, 28, 28, 0.25), rgba(236, 72, 153, 0.15));
  border-bottom: 1px solid #3a3a3a;
  font-weight: 700;
  color: #fecaca;
  font-size: 14px;
  text-transform: capitalize;
}
.approval-modal-icon { font-size: 18px; }
.approval-modal-body { padding: 16px 18px; }
.approval-modal-tool {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.approval-modal-tool code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  color: #c084fc;
  background: rgba(147, 51, 234, 0.15);
  padding: 2px 8px;
  border-radius: 4px;
}
.approval-modal-desc {
  margin: 0 0 10px;
  font-size: 12.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.approval-modal-label {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  color: #d1d5db;
}
.approval-modal-label strong {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #fde68a;
  letter-spacing: 1px;
}
.approval-modal-input,
.approval-modal-textarea {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  background: #0f0f12;
  border: 1px solid #4b5563;
  border-radius: 5px;
  color: #f9fafb;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
}
.approval-modal-input {
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.approval-modal-input:focus,
.approval-modal-textarea:focus {
  outline: none;
  border-color: #9333EA;
  box-shadow: 0 0 0 2px rgba(147, 51, 234, 0.25);
}
.approval-modal-actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid #3a3a3a;
  background: rgba(0, 0, 0, 0.2);
}

/* ─────────────────────────────────────────────────────────────────────
   IRIS render layer (Phase 7h iris-render skill) — typed DOM components
   for tool results. Pipeline list, topology diagram, etc.
   ───────────────────────────────────────────────────────────────────── */
.render-card {
  background: linear-gradient(135deg, #1f1f23, #2a2a32);
  border: 1px solid #3a3a3a;
  border-left: 4px solid #9333EA;
  border-radius: 10px;
  margin: 8px 0;
  align-self: stretch;
  max-width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  color: #e6e6e6;
  animation: iris-fade-in 0.18s ease-out;
  /* 2026-04-29 — flex-shrink:0 prevents the card from being squeezed by
     long sibling message bubbles in the chat-log flex column. Same fix
     as .plan-card (Phase 7g-0k). */
  flex-shrink: 0;
}

/* Click the card header to toggle expanded vs compact view. Compact view
   caps the card at 320px; expanded view shows everything. Useful for
   deployment-list and pipeline-list with many rows — user can collapse
   when scrolling past, expand when reviewing. Topology card is unaffected
   (its height is naturally bounded by stage count). */
.render-card.collapsed > :not(.render-header) { display: none; }
.render-card .render-header { cursor: pointer; user-select: none; }
.render-card .render-header::before {
  content: "▾ ";
  font-size: 10px;
  color: #c4b5fd;
  margin-right: 4px;
  transition: transform 0.15s;
  display: inline-block;
}
.render-card.collapsed .render-header::before {
  transform: rotate(-90deg);
}
.render-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(147, 51, 234, 0.12), rgba(236, 72, 153, 0.10));
  border-bottom: 1px solid #3a3a3a;
}
.render-title {
  font-weight: 700;
  color: #f9fafb;
  font-size: 13px;
}
.render-count {
  font-size: 10.5px;
  font-weight: 700;
  color: #c084fc;
  background: rgba(147, 51, 234, 0.18);
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.render-empty {
  padding: 16px 14px;
  color: #9ca3af;
  font-style: italic;
  font-size: 12px;
  text-align: center;
}
.render-footnote {
  padding: 6px 14px 8px;
  font-size: 10.5px;
  color: #6b7280;
  border-top: 1px solid #2a2a32;
  background: rgba(0, 0, 0, 0.18);
}

/* Status dots — used by both renderers */
.render-status {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
.render-status-active   { background: #16a34a; box-shadow: 0 0 6px rgba(22, 163, 74, 0.5); }
.render-status-inactive { background: #4b5563; }
.render-status-unknown  { background: #b45309; }

/* Badges — provider, org type */
.render-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 7px;
  border-radius: 4px;
}
.render-badge-provider { background: #1e3a8a; color: #bfdbfe; }
.render-badge-orgtype  { background: #2a2a32; color: #d1d5db; border: 1px solid #4b5563; }
.render-badge-prod     { background: #7f1d1d; color: #fecaca; }
.render-badge-sandbox  { background: #14532d; color: #86efac; }

/* Table renderer (pipelineList) */
.render-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.render-table thead {
  background: rgba(0, 0, 0, 0.25);
}
.render-table th {
  text-align: left;
  padding: 8px 14px;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #9ca3af;
  font-weight: 700;
  border-bottom: 1px solid #3a3a3a;
}
.render-table td {
  padding: 8px 14px;
  border-bottom: 1px solid #2a2a32;
  vertical-align: middle;
}
.render-table tbody tr:last-child td { border-bottom: none; }
.render-table tbody tr:hover {
  background: rgba(147, 51, 234, 0.08);
}
.render-cell-name {
  color: #f9fafb;
  font-weight: 600;
  display: flex;
  align-items: center;
}
.render-pipeline-name {
  font-size: 12.5px;
}
.render-cell-branch code,
.render-cell-project {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #d1d5db;
}
.render-cell-branch code {
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
}

/* ─── Deployment list renderer (deploymentList — Phase 7g-0h) ──────── */
.render-deployment-list .dep-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 4px;
}

/* ── Deployment Card (single-deployment lifecycle) ─────────────────── */
.depc-card {
  position: relative;
  padding: 12px 14px;
  background: rgba(20, 20, 25, 0.7);
  border: 1px solid #2a2a32;
  border-left-width: 4px;
  border-radius: 8px;
  font-size: 12px;
  color: #e4e4e7;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.depc-card.depc-status-pass     { border-left-color: #16a34a; }
.depc-card.depc-status-fail     { border-left-color: #dc2626; }
.depc-card.depc-status-running  { border-left-color: #3b82f6; }
.depc-card.depc-status-pending  { border-left-color: #6b7280; }
.depc-card.depc-status-awaiting { border-left-color: #f59e0b; }
.depc-card.depc-status-cancelled{ border-left-color: #4b5563; }
.depc-card.depc-prod { box-shadow: inset 0 3px 0 -1px rgba(220, 38, 38, 0.55); }

.depc-header { display: flex; align-items: center; gap: 8px; }
.depc-status-icon {
  width: 20px; height: 20px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; flex-shrink: 0;
}
.depc-status-icon.depc-status-pass     { background: rgba(22, 163, 74, 0.18); color: #86efac; }
.depc-status-icon.depc-status-fail     { background: rgba(220, 38, 38, 0.20); color: #fca5a5; }
.depc-status-icon.depc-status-running  { background: rgba(59, 130, 246, 0.18); color: #93c5fd; animation: depc-spin 1.4s linear infinite; }
.depc-status-icon.depc-status-pending  { background: rgba(107, 114, 128, 0.18); color: #d1d5db; }
.depc-status-icon.depc-status-awaiting { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.depc-status-icon.depc-status-cancelled{ background: rgba(75, 85, 99, 0.20); color: #9ca3af; }
@keyframes depc-spin { to { transform: rotate(360deg); } }

.depc-name { font-weight: 600; flex: 1; }
.depc-status-pill {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 10px; border: 1px solid currentColor;
}
.depc-status-pill.depc-status-pass     { color: #86efac; }
.depc-status-pill.depc-status-fail     { color: #fca5a5; }
.depc-status-pill.depc-status-running  { color: #93c5fd; }
.depc-status-pill.depc-status-awaiting { color: #fde68a; }
.depc-status-pill.depc-status-pending  { color: #d1d5db; }
.depc-status-pill.depc-status-cancelled{ color: #9ca3af; }
.depc-live { font-size: 10px; color: #93c5fd; opacity: 0.85; }

/* Stage chain */
.depc-chain { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.depc-stage {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  background: #101013; border: 1px solid #2a2a32; font-size: 11px;
}
.depc-stage-done { opacity: 0.8; }
.depc-stage-done .depc-stage-mark { color: #86efac; }
.depc-stage-running { border-color: rgba(59, 130, 246, 0.6); background: rgba(59, 130, 246, 0.10); }
.depc-stage-awaiting { border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.10); }
.depc-stage-fail { border-color: rgba(220, 38, 38, 0.6); background: rgba(220, 38, 38, 0.10); }
.depc-stage-prod { border-color: rgba(220, 38, 38, 0.55); }
.depc-arrow { color: #c084fc; font-size: 12px; }
.depc-lock { font-size: 10px; }

/* Meta + AI */
.depc-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; color: #a1a1aa; font-size: 11px; align-items: center; }
.depc-mr { color: #c084fc; text-decoration: none; }
.depc-mr:hover { text-decoration: underline; }
.depc-risk.risk-low  { color: #86efac; }
.depc-risk.risk-med  { color: #fde68a; }
.depc-risk.risk-high { color: #fca5a5; }
.depc-ai {
  font-size: 11px; line-height: 1.5; color: #d4d4d8;
  padding: 7px 10px; border-left: 2px solid rgba(147, 51, 234, 0.55);
  background: rgba(147, 51, 234, 0.07); border-radius: 0 6px 6px 0;
}

/* Action buttons */
.depc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.depc-btn {
  padding: 6px 12px; border-radius: 6px; font-size: 11px; font-weight: 600;
  cursor: pointer; border: 1px solid #2a2a32; background: #101013; color: #e4e4e7;
  transition: background 0.12s, border-color 0.12s, opacity 0.12s;
}
.depc-btn:hover { background: rgba(147, 51, 234, 0.14); border-color: rgba(147, 51, 234, 0.7); }
.depc-btn[disabled] { opacity: 0.5; cursor: default; }
.depc-btn-promote  { border-color: rgba(22, 170, 85, 0.55); color: #86efac; }
.depc-btn-promote:hover { background: rgba(22, 170, 85, 0.14); }
.depc-btn-approve  { border-color: rgba(22, 170, 85, 0.55); color: #86efac; }
.depc-btn-reject   { border-color: rgba(194, 57, 52, 0.55); color: #fca5a5; }
.depc-btn-rollback { border-color: rgba(194, 57, 52, 0.55); color: #fca5a5; }
.depc-btn-rollback:hover { background: rgba(194, 57, 52, 0.14); }
.depc-err { font-size: 11px; color: #fca5a5; }
.depc-promoted {
  margin-top: 8px; font-size: 11px; font-weight: 600;
  color: #c4b5fd; opacity: 0.9;
  border-top: 1px dashed rgba(147, 51, 234, 0.4); padding-top: 8px;
}
/* Horizontal promote chain — cards sit side by side, scroll if they overflow */
.depc-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  overflow-x: auto;
  padding-bottom: 6px;
}
.depc-row .depc-mount,
.depc-mount-inrow { flex: 0 0 auto; width: 300px; max-width: 80vw; }
.depc-row::-webkit-scrollbar { height: 8px; }
.depc-row::-webkit-scrollbar-thumb { background: rgba(147, 51, 234, 0.5); border-radius: 4px; }

/* Feature group — wraps a deployment + its promote chain under one header */
.depc-feature {
  border: 1px solid rgba(147, 51, 234, 0.35); border-radius: 10px;
  padding: 8px; background: rgba(147, 51, 234, 0.05);
}
.depc-feature-head { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; font-size: 12px; }
.depc-feature-name { font-weight: 700; color: #c4b5fd; }
.depc-feature-count { color: #a1a1aa; font-size: 11px; }
.depc-feature-sp { flex: 1; }
.depc-feature-refresh, .depc-feature-collapse, .depc-feature-close {
  background: transparent; border: 0; color: #a1a1aa; cursor: pointer;
  font-size: 14px; line-height: 1; padding: 2px 5px; border-radius: 5px;
}
.depc-feature-refresh:hover, .depc-feature-collapse:hover, .depc-feature-close:hover { background: rgba(147, 51, 234, 0.18); color: #fff; }
.depc-feature-close:hover { color: #fca5a5; }
.depc-feature-row { margin: 0; }
.depc-spin { animation: depc-spin 0.8s linear; }

/* ── Workspace organizer bar ───────────────────────────────────────── */
.ws-bar {
  position: sticky; top: 0; z-index: 6;
  background: rgba(16, 16, 20, 0.96); backdrop-filter: blur(6px);
  border-bottom: 1px solid #2a2a32;
  padding: 6px 8px; margin: 0 0 6px 0;
}
.ws-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ws-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 14px; cursor: pointer;
  background: #1a1a20; border: 1px solid #2a2a32; color: #d4d4d8; font-size: 11px;
  transition: background 0.12s, border-color 0.12s;
}
.ws-chip:hover { background: rgba(147, 51, 234, 0.14); border-color: rgba(147, 51, 234, 0.6); }
.ws-chip-active { background: rgba(147, 51, 234, 0.2); border-color: #9333EA; color: #fff; }
.ws-chip-empty { opacity: 0.5; }
.ws-n {
  font-weight: 700; font-size: 10px; min-width: 16px; text-align: center;
  background: rgba(147, 51, 234, 0.25); border-radius: 8px; padding: 1px 5px;
}
.ws-popover {
  display: none; margin-top: 6px;
  background: #14141a; border: 1px solid #2a2a32; border-radius: 8px;
  max-height: 320px; overflow-y: auto; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.ws-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; cursor: pointer; font-size: 12px; color: #e4e4e7;
  border-bottom: 1px solid #1f1f26;
}
.ws-item:hover { background: rgba(147, 51, 234, 0.12); }
.ws-item-ic { flex-shrink: 0; }
.ws-item-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item-sub { font-size: 10px; opacity: 0.6; font-family: ui-monospace, monospace; }
.ws-item-go { font-size: 10px; color: #c4b5fd; flex-shrink: 0; }
.ws-empty { padding: 10px; font-size: 12px; opacity: 0.6; }

/* Login: "Other sign-in options" disclosure. The escape hatches stay one click away
   without competing with the primary action. */
.login-more {
  display: block; width: 100%; margin-top: 10px; padding: 6px;
  background: none; border: none; cursor: pointer;
  color: var(--t-label, rgba(255,255,255,0.55)); font-size: 12px; font-weight: 500;
  letter-spacing: 0.01em; transition: color 0.15s ease;
}
.login-more:hover { color: var(--t-text, rgba(255,255,255,0.85)); }
.login-more-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.login-more-opts[hidden] { display: none; }

/* Connect-method chooser (Settings → Salesforce): session token vs OAuth sign-in. */
.ss-cm-card { border: 1px solid var(--t-line, rgba(255,255,255,0.12)); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.ss-cm-t { font-weight: 600; margin-bottom: 2px; }
.ss-cm-s { font-size: 12px; opacity: 0.65; margin-bottom: 10px; }
.ss-cm { display: flex; gap: 9px; align-items: flex-start; padding: 7px 0; cursor: pointer; }
.ss-cm input { margin-top: 3px; flex-shrink: 0; }
.ss-cm span { display: flex; flex-direction: column; }
.ss-cm b { font-size: 13px; font-weight: 600; }
.ss-cm em { font-size: 11px; opacity: 0.6; font-style: normal; }
/* Cross-links between the two connect dialogs — never strand the user. */
.iris-host-token-alt, .stf-oauth-alt {
  background: none; border: none; padding: 0; cursor: pointer;
  color: #c4b5fd; font-size: 12px; text-decoration: underline;
}
.iris-host-token-alt { display: block; width: 100%; margin-top: 10px; text-align: center; }
.stf-alt-wrap { margin-top: 6px; }
/* The "add this Callback URL" help — the readonly URI must stay selectable. */
.oauth-cb-uri { font-family: ui-monospace, monospace; font-size: 11px; }

/* 🧪 Runs — expandable per-method results under a finished test run (JobStore). */
.ws-job-detail { padding: 2px 10px 8px 26px; border-left: 2px solid rgba(147, 51, 234, 0.35); margin-left: 10px; }
.ws-job-m { display: flex; gap: 6px; align-items: baseline; font-size: 11px; padding: 2px 0; }
.ws-job-mn { font-family: ui-monospace, monospace; flex-shrink: 0; }
.ws-job-mm { opacity: 0.65; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Session-expired re-auth overlay ───────────────────────────────── */
#iris-reauth-overlay {
  position: fixed; inset: 0; z-index: 2147483646;
  background: rgba(8, 8, 12, 0.82);
  display: flex; align-items: center; justify-content: center;
}
.reauth-box {
  width: min(340px, 86vw);
  background: #1b1033; color: #fff;
  border: 1px solid #9333EA; border-radius: 12px;
  padding: 24px 22px; text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
}
.reauth-icon { font-size: 34px; margin-bottom: 8px; }
.reauth-title { font-size: 16px; font-weight: 700; color: #c4b5fd; margin-bottom: 8px; }
.reauth-msg { font-size: 13px; line-height: 1.5; color: #d4d4d8; margin-bottom: 18px; }
.reauth-btn {
  background: #9333EA; color: #fff; border: 0; border-radius: 8px;
  padding: 10px 20px; font-size: 13px; font-weight: 700; cursor: pointer;
}
.reauth-btn:hover { background: #7e22ce; }
.dep-card {
  position: relative;
  padding: 10px 12px;
  background: rgba(20, 20, 25, 0.7);
  border: 1px solid #2a2a32;
  border-left-width: 4px;
  border-radius: 6px;
  font-size: 12px;
  color: #e4e4e7;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}
.dep-card:hover {
  background: rgba(30, 30, 38, 0.85);
  transform: translateX(1px);
}
/* Status-driven left-border accent */
.dep-card.dep-status-pass     { border-left-color: #16a34a; }
.dep-card.dep-status-fail     { border-left-color: #dc2626; }
.dep-card.dep-status-running  { border-left-color: #3b82f6; }
.dep-card.dep-status-pending  { border-left-color: #6b7280; }
.dep-card.dep-status-awaiting { border-left-color: #f59e0b; }
.dep-card.dep-status-cancelled{ border-left-color: #4b5563; }
.dep-card.dep-status-unknown  { border-left-color: #b45309; }
/* Production target — extra red border at the top */
.dep-card.dep-target-prod {
  box-shadow: inset 0 1px 0 rgba(220, 38, 38, 0.4);
}

.dep-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dep-row + .dep-row {
  margin-top: 4px;
}
.dep-row-header {
  font-weight: 600;
}
.dep-status-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.dep-status-icon.dep-status-pass     { background: rgba(22, 163, 74, 0.18); color: #86efac; }
.dep-status-icon.dep-status-fail     { background: rgba(220, 38, 38, 0.20); color: #fca5a5; }
.dep-status-icon.dep-status-running  {
  background: rgba(59, 130, 246, 0.18);
  color: #93c5fd;
  animation: dep-running-pulse 1.4s ease-in-out infinite;
}
.dep-status-icon.dep-status-pending  { background: rgba(107, 114, 128, 0.18); color: #d1d5db; }
.dep-status-icon.dep-status-awaiting { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.dep-status-icon.dep-status-cancelled{ background: rgba(75, 85, 99, 0.20); color: #9ca3af; }
.dep-status-icon.dep-status-unknown  { background: rgba(180, 83, 9, 0.20); color: #fcd34d; }
@keyframes dep-running-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  50%      { opacity: 0.85; box-shadow: 0 0 0 4px rgba(59, 130, 246, 0); }
}

.dep-name {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #f9fafb;
  letter-spacing: -0.1px;
}
.dep-status-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dep-status-pill.dep-status-pass     { background: rgba(22, 163, 74, 0.15);  color: #86efac; }
.dep-status-pill.dep-status-fail     { background: rgba(220, 38, 38, 0.18);  color: #fca5a5; }
.dep-status-pill.dep-status-running  { background: rgba(59, 130, 246, 0.15); color: #93c5fd; }
.dep-status-pill.dep-status-pending  { background: rgba(107, 114, 128, 0.15);color: #d1d5db; }
.dep-status-pill.dep-status-awaiting { background: rgba(245, 158, 11, 0.15); color: #fde68a; }
.dep-status-pill.dep-status-cancelled{ background: rgba(75, 85, 99, 0.18);   color: #9ca3af; }
.dep-status-pill.dep-status-unknown  { background: rgba(180, 83, 9, 0.18);   color: #fcd34d; }

.dep-badges { margin-left: auto; display: inline-flex; gap: 4px; }
.dep-badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.dep-badge-prod    { background: #7f1d1d; color: #fecaca; }
.dep-badge-back    { background: #4c1d95; color: #ddd6fe; }
.dep-badge-approval{ background: #78350f; color: #fde68a; }

.dep-row-stage {
  font-size: 11.5px;
  color: #cbd5e1;
}
.dep-stage-from { color: #d1d5db; font-weight: 500; }
.dep-stage-arrow { color: #c084fc; font-weight: 700; }
.dep-stage-to    { color: #d1d5db; font-weight: 500; }
.dep-branch code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #d8b4fe;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 6px;
  border-radius: 3px;
}

.dep-row-meta {
  font-size: 11px;
  color: #9ca3af;
}
.dep-mr-link, .dep-mr {
  color: #93c5fd;
  text-decoration: none;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}
.dep-mr-link:hover { text-decoration: underline; color: #bfdbfe; }
.dep-risk {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
}
.dep-risk.risk-low  { background: rgba(22, 163, 74, 0.18);  color: #86efac; }
.dep-risk.risk-med  { background: rgba(245, 158, 11, 0.18); color: #fde68a; }
.dep-risk.risk-high { background: rgba(220, 38, 38, 0.20);  color: #fca5a5; }
.dep-time { color: #6b7280; }
.dep-creator { color: #6b7280; font-style: italic; }
.dep-pipeline-status {
  font-size: 10.5px;
  color: #9ca3af;
  font-style: italic;
}

.dep-ai-summary {
  margin-top: 6px;
  padding: 6px 8px;
  background: rgba(147, 51, 234, 0.06);
  border-left: 2px solid rgba(147, 51, 234, 0.4);
  border-radius: 0 4px 4px 0;
  font-size: 11px;
  color: #d8b4fe;
  line-height: 1.45;
}

/* Topology renderer (pipelineTopology) */
.render-topo-scroll {
  overflow-x: auto;
  padding: 14px 12px;
  background: radial-gradient(ellipse at center, #1a1a1f 0%, #131318 100%);
}
.render-topo-svg {
  display: block;
  color: #6b7280;
}
.render-topo-rect {
  fill: #1f1f23;
  stroke: #4b5563;
  stroke-width: 1.5;
  transition: stroke 0.15s ease;
}
.render-topo-node:hover .render-topo-rect {
  stroke: #9333EA;
}
.render-topo-node-prod .render-topo-rect {
  fill: #2a1518;
  stroke: #b91c1c;
  stroke-width: 2;
}
.render-topo-body {
  width: 100%;
  height: 100%;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 11.5px;
  box-sizing: border-box;
}
.render-topo-name {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: #f9fafb;
  font-size: 12px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.render-topo-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
}
.render-topo-branch {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  color: #9ca3af;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.render-topo-arrow {
  color: #6b7280;
}

/* Phase 7i — fabrication warning banner. Surfaces when the model narrated
   a tool action ("Fetching...") without actually emitting tool_use. */
.fabrication-warning {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 6px 0;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(120, 53, 15, 0.18), rgba(180, 83, 9, 0.10));
  border: 1px solid #78350f;
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  font-size: 12px;
  color: #fde68a;
  align-self: stretch;
  animation: iris-fade-in 0.18s ease-out;
}
.fab-warn-icon {
  font-size: 16px;
  line-height: 1;
  color: #f59e0b;
  flex-shrink: 0;
}
.fab-warn-body { line-height: 1.4; }
.fab-warn-body strong { color: #fde68a; }
.fab-warn-body code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 6px;
  border-radius: 3px;
  color: #fde68a;
}

/* Phase 7i — Apex + Test side-by-side plan-card. Detected when a plan
   contains exactly 2 class/trigger files and one has "test" in its path.
   The stacked summary + buttons still appear; only the diff section
   renders in 2 columns. */
.plan-card-sbs .plan-diff.open {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px 14px;
}
/* Full-width expand control spans both panes in side-by-side mode. */
.plan-card-sbs .plan-diff.open .plan-diff-expand { grid-column: 1 / -1; }
/* Extra files (objects, fields, LWC) shown below the apex+test panes span both columns. */
.plan-card-sbs .plan-diff.open .plan-diff-file { grid-column: 1 / -1; }
.plan-diff-pane {
  background: #0f0f12;
  border: 1px solid #2a2a32;
  border-radius: 6px;
  overflow: hidden;
  min-width: 0;
}
.plan-diff-pane-apex { border-left: 3px solid #9333EA; }
.plan-diff-pane-test { border-left: 3px solid #EC4899; }
/* Existing | New dual-pane diff (default for code modify files). The wrapper is
   a .plan-diff-file, so strip its border/decoration and make it a 2-col grid. */
.plan-diff-dual {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  border: 0 !important;
  background: transparent !important;
  border-radius: 0 !important;
  overflow: visible !important;
}
.plan-diff-dual::after { display: none !important; }
.plan-diff-pane-before { border-left: 3px solid #6b7280; }
.plan-diff-pane-before .plan-diff-header { color: #9a9aa8; }
.plan-diff-pane-after { border-left: 3px solid #9333EA; }
.plan-diff-pane .plan-diff-header {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(147, 51, 234, 0.10);
  border-bottom: 1px solid #2a2a32;
  color: #e6e6e6;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.plan-diff-pane-test .plan-diff-header {
  background: rgba(236, 72, 153, 0.10);
}
.plan-diff-pane .plan-diff-body {
  /* Phase 7g-0l — visible scrollbars + same resize affordance as single-col */
  max-height: 720px;
  overflow-x: scroll;
  overflow-y: scroll;
  resize: vertical;
  margin: 0;
  padding: 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1.45;
  color: #d1d5db;
  background: transparent;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: #6d28d9 #1f2937;
}
.plan-diff-pane .plan-diff-body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
  background: rgba(31, 41, 55, 0.5);
}
.plan-diff-pane .plan-diff-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #7c3aed, #4c1d95);
  border-radius: 6px;
  border: 2px solid rgba(31, 41, 55, 0.5);
}
.plan-diff-pane .plan-diff-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #9333ea, #6d28d9);
}
.plan-diff-pane .plan-diff-body::-webkit-scrollbar-corner {
  background: rgba(31, 41, 55, 0.5);
}

/* Phase 7i-2 — "Generating test…" placeholder pane on the right while
   TestClassGen streams. Morphed out when PlanCard.morphToSideBySide fires. */
.plan-diff-pane-pending .plan-diff-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 160px;
  padding: 20px;
  color: #c4b5fd;
  font-size: 12px;
  text-align: center;
}
.plan-diff-placeholder-label {
  max-width: 220px;
  line-height: 1.5;
  color: #d8b4fe;
}

/* Phase 7i-2 — two-step Approve → Commit & Deploy. Approve disables and
   mutes into "✓ Approved"; a new pink Commit & Deploy button appears. */
.btn-approve.btn-approved {
  background: #1f1f23;
  border-color: #4b5563;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.85;
}
.btn-commit-deploy {
  background: linear-gradient(135deg, #9333EA 0%, #EC4899 100%);
  border: 1px solid #EC4899;
  color: #fff;
  padding: 7px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.25);
}
.btn-commit-deploy:hover:not(:disabled) {
  filter: brightness(1.1);
  box-shadow: 0 0 0 2px rgba(236, 72, 153, 0.4);
}
.btn-commit-deploy:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: saturate(0.6);
}

/* Session 78 — three-step flow: Approve → Commit (write only) → Commit & Deploy
   (write + promote). 💾 Commit gets a calmer slate tone so users visually
   read it as the "less aggressive" choice next to the purple/pink Deploy. */
.btn-commit {
  background: linear-gradient(135deg, #334155 0%, #475569 100%);
  border: 1px solid #64748b;
  color: #e2e8f0;
  padding: 7px 16px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-right: 6px;
}
.btn-commit:hover:not(:disabled) {
  filter: brightness(1.15);
  border-color: #94a3b8;
}
.btn-commit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  filter: saturate(0.6);
}
.btn-commit.btn-approved {
  background: #1f1f23;
  border-color: #4b5563;
  color: #9ca3af;
  opacity: 0.85;
}

/* "Approved — click Commit & Deploy" hint status */
.plan-status.approved-pending {
  background: rgba(147, 51, 234, 0.10);
  color: #d8b4fe;
  border-top: 1px solid rgba(147, 51, 234, 0.25);
  padding: 8px 14px;
  font-size: 11.5px;
}

/* Review coverage button */
.btn-review-coverage {
  background: #2d2d2d;
  border: 1px solid #9333EA;
  color: #c084fc;
  padding: 7px 14px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.btn-review-coverage:hover {
  background: rgba(147, 51, 234, 0.15);
  color: #e9d5ff;
}

/* Coverage note (shown after Review coverage click) */
.plan-coverage-note {
  padding: 10px 14px;
  background: rgba(147, 51, 234, 0.08);
  border-top: 1px solid #3a3a3a;
  font-size: 11.5px;
  color: #cbd5e1;
  animation: iris-fade-in 0.18s ease-out;
}
.plan-coverage-note-title {
  font-weight: 700;
  color: #c084fc;
  margin-bottom: 4px;
}
.plan-coverage-note-body { line-height: 1.5; }
.plan-coverage-cmd {
  margin: 6px 0 0;
  padding: 8px 10px;
  background: #0f0f12;
  border: 1px solid #2a2a32;
  border-radius: 4px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  color: #e9d5ff;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Phase 7f-1 — live coverage via apex-tooling.tooling_query */
.plan-coverage-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  margin-right: 8px;
}
.plan-coverage-pill.cov-pass { background: rgba(34, 197, 94, 0.18); color: #86efac; }
.plan-coverage-pill.cov-warn { background: rgba(234, 179, 8, 0.18); color: #fde68a; }
.plan-coverage-pill.cov-fail { background: rgba(239, 68, 68, 0.18); color: #fca5a5; }
.plan-coverage-stats {
  display: inline-block;
  font-size: 11px;
  color: #cbd5e1;
}
.plan-coverage-stat-covered { color: #86efac; }
.plan-coverage-stat-uncovered { color: #fca5a5; }
.plan-coverage-source {
  margin-top: 4px;
  font-size: 10px;
  color: #6b7280;
  font-style: italic;
}
.plan-coverage-uncovered-lines {
  margin-top: 6px;
  font-size: 11px;
  color: var(--t-label, #9ca3af);
}
.plan-coverage-uncovered-lines code {
  color: #fca5a5; /* status-locked */
  word-break: break-word;
}
.btn-cover-remaining {
  margin-top: 8px;
  display: inline-block;
  padding: 6px 10px;
  font-size: 11px;
  border: 1px solid var(--t-selected-bg, #9333EA);
  border-radius: 6px;
  background: var(--t-selected-bg, rgba(147, 51, 234, 0.15));
  color: var(--t-input-text, #e9d5ff);
  cursor: pointer;
}
.btn-cover-remaining:hover { background: var(--t-hover-bg, rgba(147, 51, 234, 0.28)); }

/* ── Process swimlane (deterministic process-resolution engine) ── */
.process-swimlane .process-fresh { margin-left: 8px; font-size: 10px; color: var(--t-label, #9ca3af); font-style: italic; }
.process-swimlane .process-systems {
  font-size: 11px; color: var(--t-label, #9ca3af); margin: 4px 0 8px; padding: 4px 8px;
  border-left: 2px solid var(--t-selected-bg, #9333EA);
}
.process-lanes { display: flex; align-items: stretch; gap: 0; overflow-x: auto; padding: 4px 2px 8px; }
.process-lane-wrap { display: flex; align-items: center; flex: 0 0 auto; }
.process-lane {
  flex: 0 0 auto; min-width: 150px; max-width: 220px; align-self: stretch;
  border: 1px solid var(--t-border, rgba(147, 51, 234, 0.28)); border-radius: 8px;
  background: var(--t-card-bg, rgba(255, 255, 255, 0.02)); overflow: hidden;
}
.process-lane.gap { border-style: dashed; opacity: 0.72; }
.process-lane-head {
  padding: 6px 8px; background: var(--t-selected-bg, rgba(147, 51, 234, 0.12));
  border-bottom: 1px solid var(--t-border, rgba(147, 51, 234, 0.2));
}
.process-lane-name { font-weight: 600; font-size: 12px; color: var(--t-text, #e5e7eb); }
.process-lane-anchor { font-size: 10px; font-family: monospace; color: var(--t-label, #9ca3af); word-break: break-all; }
.process-vendor-badge {
  display: inline-block; margin-top: 3px; padding: 1px 6px; font-size: 9px; border-radius: 8px;
  background: rgba(147, 51, 234, 0.22); color: #c4b5fd; /* status-locked */
}
.process-lane-body { padding: 6px 8px; display: flex; flex-direction: column; gap: 6px; }
.process-fact-group { display: flex; flex-direction: column; gap: 2px; }
.process-fact-label { font-size: 9px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--t-label, #9ca3af); }
.process-chips { display: flex; flex-wrap: wrap; gap: 3px; }
.process-chip {
  font-size: 10px; padding: 1px 6px; border-radius: 6px; max-width: 100%;
  background: var(--t-input-bg, rgba(255, 255, 255, 0.05)); color: var(--t-input-text, #d1d5db);
  border: 1px solid var(--t-border, rgba(255, 255, 255, 0.08)); word-break: break-word;
}
.process-chip.clickable { cursor: pointer; border-color: var(--t-selected-bg, rgba(147, 51, 234, 0.4)); }
.process-chip.clickable:hover { background: var(--t-hover-bg, rgba(147, 51, 234, 0.25)); }
.process-fact-gap, .process-gap-note { font-size: 10px; color: #fca5a5; /* status-locked */ font-style: italic; }
.process-gap-note.subtle { color: var(--t-label, #9ca3af); }
.process-arrow { flex: 0 0 auto; padding: 0 4px; color: var(--t-selected-bg, #9333EA); font-weight: 700; }
.process-foot { font-size: 10px; color: var(--t-label, #6b7280); font-style: italic; margin-top: 6px; }

/* ── LWC Bundle Card (collapsible · tabbed · per-file dual-pane edit · preview) ── */
.lwc-bundle-card .lwc-bundle-sub { margin-left: 8px; font-size: 11px; color: var(--t-label, #9ca3af); }
.lwc-bundle-card .lwc-bundle-err { padding: 10px 12px; font-size: 12px; color: #fca5a5; /* status-locked */ }
/* LWC card uses the standard plan-card shell → hide its body when the plan card collapses. */
.plan-card.plan-card-collapsed > .lwc-tabs,
.plan-card.plan-card-collapsed > .lwc-panes,
.plan-card.plan-card-collapsed > .fb-bar,
.plan-card.plan-card-collapsed > .lwc-bundle-err { display: none !important; }
.lwc-bundle-card.plan-card-collapsed .plan-collapse-chevron { transform: rotate(-90deg); }
.lwc-tabs { display: flex; flex-wrap: wrap; gap: 3px; padding: 8px 4px 0; }
.lwc-tab {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-size: 11px; cursor: pointer;
  border: 1px solid transparent; border-bottom: none; border-radius: 7px 7px 0 0;
  background: transparent; color: #b8b8c2; /* status-locked — inactive tab, matches card chrome */
}
.lwc-tab:hover { background: rgba(147, 51, 234, 0.1); color: #e6e6e6; /* status-locked */ }
/* Active tab — brighter brand highlight + accent underline; fits the app's purple accent. */
.lwc-tab.active {
  background: rgba(147, 51, 234, 0.2); color: #f4f0fc; /* status-locked */
  border-color: rgba(147, 51, 234, 0.5); box-shadow: inset 0 -2px 0 #9333EA; /* status-locked */
}
/* Subtle, branded, low-saturation badges — each file type differs by a muted tint, no bold colors. */
.lwc-tab-badge {
  font-family: monospace; font-size: 8px; font-weight: 600; letter-spacing: .06em; padding: 1px 5px; border-radius: 4px;
  background: var(--t-input-bg, rgba(255,255,255,0.04)); border: 1px solid var(--t-border, rgba(255,255,255,0.08));
  color: var(--t-label, #9ca3af);
}
.lwc-tab-badge.t-html { color: #a9b0bd; }   /* status-locked */
.lwc-tab-badge.t-js   { color: #b3a6d6; }   /* status-locked */
.lwc-tab-badge.t-css  { color: #9db3bf; }   /* status-locked */
.lwc-tab-badge.t-meta { color: #9ca3af; }   /* status-locked */
.lwc-tab-badge.t-other{ color: #a9a0c2; }   /* status-locked */
.lwc-tab-badge.t-preview { color: var(--t-selected-bg, #b3a6d6); border-color: color-mix(in srgb, var(--t-selected-bg, #9333EA) 30%, transparent); }
.lwc-tab-badge.t-iris { color: var(--t-selected-bg, #b3a6d6); border-color: color-mix(in srgb, var(--t-selected-bg, #9333EA) 45%, transparent); background: color-mix(in srgb, var(--t-selected-bg, #9333EA) 10%, transparent); }
.lwc-tab-iris .lwc-tab-name { color: var(--t-input-text, #c4b5fd); }
.lwc-tab.active .lwc-tab-badge { border-color: color-mix(in srgb, var(--t-selected-bg, #9333EA) 40%, transparent); }
.lwc-tab-name { font-family: monospace; }
.lwc-panes { padding: 8px 2px; }
.lwc-pane.hidden { display: none; }
.lwc-pane-bar { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.lwc-edit-btn {
  padding: 4px 12px; font-size: 11px; font-weight: 600; cursor: pointer; border-radius: 6px;
  border: 1px solid var(--t-selected-bg, #9333EA); background: transparent; color: var(--t-input-text, #c4b5fd);
}
.lwc-edit-btn:hover { background: var(--t-hover-bg, rgba(147,51,234,0.15)); }
/* Monaco read-only code view — VS-Code coloring + folding + indent guides. Needs explicit height. */
.lwc-view-mount {
  height: 420px; min-height: 200px; max-height: 680px; resize: vertical; overflow: hidden;
  border: 1px solid var(--t-border, rgba(255,255,255,0.1)); border-radius: 8px;
}
.lwc-view {
  margin: 0; overflow: auto; box-sizing: border-box;
  font-family: monospace; font-size: 12px; line-height: 1.5; padding: 10px 12px; white-space: pre; tab-size: 2;
  background: var(--t-input-bg, rgba(0,0,0,0.22)); color: var(--t-input-text, #d1d5db);
}
/* When Monaco can't load, the <pre> fallback fills the mount container. */
.lwc-view-mount > .lwc-view { height: 100%; max-height: none; border: 0; border-radius: 0; }
.lwc-preview-wrap { display: flex; flex-direction: column; gap: 8px; }
.lwc-preview-note { font-size: 11px; color: var(--t-label, #9ca3af); font-style: italic; }
.lwc-preview-note code { font-style: normal; }
.lwc-preview-frame {
  width: 100%; min-height: 300px; max-height: 560px; resize: vertical;
  border: 1px solid var(--t-border, rgba(255,255,255,0.1)); border-radius: 8px; background: #fff;
}
/* ✨ IRIS assist tab */
.lwc-assist { display: flex; flex-direction: column; gap: 10px; }
.lwc-assist-intro { font-size: 12px; color: var(--t-label, #9ca3af); line-height: 1.5; }
.lwc-assist-intro b { color: var(--t-text, #e5e7eb); }
.lwc-assist-intro i { color: var(--t-input-text, #c4b5fd); font-style: normal; }
.lwc-assist-warn {
  font-size: 12px; line-height: 1.5; padding: 8px 11px; border-radius: 8px;
  color: #F59E0B; /* status-locked */ background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.lwc-assist-warn b { color: var(--t-text, #e5e7eb); }
.lwc-assist-log { display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.lwc-assist-log:empty { display: none; }
.lwc-assist-msg { font-size: 12.5px; line-height: 1.5; padding: 8px 11px; border-radius: 9px; max-width: 92%; white-space: pre-wrap; }
.lwc-assist-msg.user { align-self: flex-end; background: var(--t-selected-bg, rgba(147,51,234,0.16)); color: var(--t-text, #e5e7eb); }
.lwc-assist-msg.iris { align-self: flex-start; background: var(--t-input-bg, rgba(255,255,255,0.04)); color: var(--t-text, #e5e7eb); border: 1px solid var(--t-border, rgba(255,255,255,0.08)); }
.lwc-assist-msg.thinking { color: var(--t-label, #9ca3af); font-style: italic; }
.lwc-assist-msg.err { align-self: flex-start; color: #C23934; /* status-locked */ }
.lwc-assist-fb { border-top: none !important; padding: 6px 0 0 !important; margin-top: 4px; }
/* Markdown-rendered IRIS explanations — normal wrapping (pre-wrap would double-space the HTML). */
.lwc-assist-msg.iris:not(.thinking) { white-space: normal; }
.lwc-assist-msg .msg-md > :first-child { margin-top: 0; }
.lwc-assist-msg .msg-md > :last-child { margin-bottom: 0; }
.lwc-assist-msg .msg-md code { font-size: .92em; padding: 1px 4px; border-radius: 4px; background: rgba(147,51,234,0.14); }
.lwc-assist-msg .msg-md ol, .lwc-assist-msg .msg-md ul { margin: 6px 0; padding-left: 20px; }
.lwc-assist-msg .msg-md li { margin: 3px 0; }
.lwc-assist-row { display: flex; gap: 8px; align-items: flex-end; }
.lwc-assist-input {
  flex: 1; box-sizing: border-box; resize: vertical; font-family: inherit; font-size: 12.5px; line-height: 1.4;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--t-border, rgba(255,255,255,0.12));
  background: var(--t-input-bg, rgba(0,0,0,0.25)); color: var(--t-input-text, #e5e7eb);
}
.lwc-assist-input:focus { outline: 2px solid var(--t-selected-bg, #9333EA); outline-offset: -1px; }
.lwc-assist-send {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 38px; height: 38px; padding: 0; cursor: pointer; border-radius: 9px;
  border: 1px solid #9333EA; background: rgba(147, 51, 234, 0.92); color: #fff; /* status-locked */
}
.lwc-assist-send svg { display: block; }
.lwc-assist-send:hover:not(:disabled) { filter: brightness(1.1); }
.lwc-assist-send:disabled { opacity: 0.5; cursor: default; }

/* ── 🗄 Metadata backups: per-card toggle + browser ── */
.plan-backup-toggle {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; cursor: pointer;
  color: var(--t-label, #9ca3af); user-select: none; margin-right: auto;
}
.plan-backup-toggle input { accent-color: var(--t-selected-bg, #9333EA); cursor: pointer; }
.mdbackup-card .mdbk-sub, .mdbackup-view .mdbk-sub { margin-left: 8px; font-size: 11px; color: var(--t-label, #9ca3af); }
.mdbk-auto {
  display: flex; align-items: center; gap: 7px; font-size: 12px; cursor: pointer; user-select: none;
  color: var(--t-text, #e5e7eb); padding: 8px 10px; margin: 6px 0 10px; border-radius: 8px;
  background: var(--t-input-bg, rgba(255,255,255,0.03)); border: 1px solid var(--t-border, rgba(255,255,255,0.08));
}
.mdbk-auto input { accent-color: var(--t-selected-bg, #9333EA); cursor: pointer; }
.mdbk-list { display: flex; flex-direction: column; gap: 6px; }
.mdbk-empty { font-size: 12px; color: var(--t-label, #9ca3af); font-style: italic; padding: 6px 2px; }
.mdbk-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 8px; border: 1px solid var(--t-border, rgba(255,255,255,0.08));
  background: var(--t-card-bg, rgba(255,255,255,0.02));
}
.mdbk-meta { display: flex; flex-direction: column; min-width: 0; }
.mdbk-meta b { font-size: 12.5px; color: var(--t-text, #e5e7eb); font-family: monospace; word-break: break-all; }
.mdbk-meta span { font-size: 10.5px; color: var(--t-label, #9ca3af); }
.mdbk-actions { display: flex; gap: 5px; flex-shrink: 0; }
.mdbk-actions button {
  font-size: 11px; padding: 4px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--t-border, rgba(255,255,255,0.12)); background: transparent; color: var(--t-input-text, #d1d5db);
}
.mdbk-actions .mdbk-restore { border-color: var(--t-selected-bg, #9333EA); color: var(--t-input-text, #c4b5fd); }
.mdbk-actions button:hover { background: var(--t-hover-bg, rgba(147,51,234,0.14)); }
.plan-coverage-fallback {
  color: #fca5a5;
  font-size: 11px;
  margin-bottom: 4px;
}

/* Phase 7g-0m — "Not measured yet" panel for first-time coverage clicks
   on a class that hasn't been deployed + tested yet. Calmer styling than
   the red "fail" pill — guidance, not alarm. */
.plan-coverage-not-measured {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(147, 51, 234, 0.12);
  color: #d8b4fe;
  font-size: 12px;
  margin-bottom: 6px;
}
.plan-coverage-next-steps {
  margin: 6px 0 8px 0;
  padding-left: 18px;
  font-size: 11.5px;
  color: #cbd5e1;
  line-height: 1.5;
}
.plan-coverage-next-steps li { margin-bottom: 4px; }
.plan-coverage-next-steps li strong { color: #e9d5ff; }
.plan-coverage-stats code,
.plan-coverage-not-measured code {
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: #d8b4fe;
}

/* Icon next to Reject / Approve labels in plan actions */
.plan-actions .btn-icon {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
}

/* ── SettingsShell — full-screen Settings + Integrations (app-style) ── */
.settings-shell { position: fixed; inset: 0; z-index: 9000; display: flex;
  background: #0c0c0e; color: #e5e7eb; font: 13px/1.5 system-ui, -apple-system, sans-serif; }
.settings-shell[hidden] { display: none; }
.ss-nav { width: 240px; flex-shrink: 0; background: #0a0a0c; border-right: 1px solid #1f1f24;
  padding: 14px 10px; overflow-y: auto; }
.ss-back { background: none; border: 0; color: #9ca3af; font-size: 13px; cursor: pointer; padding: 6px 8px; margin-bottom: 10px; }
.ss-back:hover { color: #e5e7eb; }
.ss-search { margin-bottom: 14px; }
.ss-search-in { width: 100%; box-sizing: border-box; padding: 7px 10px; border-radius: 8px;
  border: 1px solid #26262c; background: #141418; color: #e5e7eb; font-size: 13px; }
.ss-nav-group { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  color: #6b7280; margin: 14px 8px 4px; }
.ss-nav-item { display: flex; align-items: center; gap: 9px; width: 100%; background: none; border: 0;
  color: #cbd5e1; cursor: pointer; padding: 7px 8px; border-radius: 8px; font-size: 13px; text-align: left; }
.ss-nav-item:hover { background: #16161a; }
.ss-nav-item.ss-active { background: #1c1c22; color: #fff; }
.ss-nav-ic { width: 16px; text-align: center; opacity: .85; }
.ss-main { flex: 1; overflow-y: auto; }
.ss-main-inner { max-width: 720px; margin: 0 auto; padding: 40px 32px 80px; }
.ss-title { font-size: 22px; font-weight: 700; margin: 0 0 4px; color: #f3f4f6; }
.ss-title-row { display: flex; align-items: center; justify-content: space-between; }
.ss-sub { color: #9ca3af; font-size: 13px; margin: 0 0 24px; }
/* List / tile view toggle */
.ss-view-toggle { display: inline-flex; border: 1px solid #2d2d35; border-radius: 8px; overflow: hidden; }
.ss-view-btn { background: transparent; border: none; color: #9ca3af; padding: 5px 11px; cursor: pointer; font-size: 15px; line-height: 1; }
.ss-view-btn:hover { color: #e5e7eb; }
.ss-view-btn.on { background: rgba(147,51,234,0.22); color: #c4b5fd; }
/* Tile grid */
.ss-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 4px; }
.ss-tile { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 9px; padding: 18px 12px 14px; border: 1px solid #1f1f24; border-radius: 12px; background: #0e0e11; }
.ss-tile-ic { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; font-size: 30px; }
.ss-tile-ic img { width: 36px; height: 36px; object-fit: contain; }
.ss-tile-name { font-size: 13px; font-weight: 600; color: #f3f4f6; }
.ss-tile-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.ss-tile-btn { background: #9333EA; color: #fff; border: none; border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer; }
.ss-tile-btn:hover { filter: brightness(1.08); }
.ss-tile-btn.ss-btn-ghost { background: transparent; border: 1px solid #3a3a42; color: #c4b5fd; padding: 5px 9px; }
.ss-tile-btn.ss-btn-soon { background: #26262c; color: #6b7280; cursor: default; }
.ss-tile-badge { position: absolute; top: 9px; right: 10px; color: #1AAA55; font-size: 13px; font-weight: 800; }
.ss-group-label { font-size: 12px; font-weight: 600; color: #9ca3af; margin: 22px 2px 8px; }
.ss-card-list { border: 1px solid #1f1f24; border-radius: 12px; overflow: hidden; background: #0e0e11; }
.ss-card-row { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid #18181c; }
.ss-card-row:last-child { border-bottom: 0; }
.ss-card-ic { font-size: 22px; width: 28px; text-align: center; flex-shrink: 0; }
.ss-card-body { flex: 1; min-width: 0; }
.ss-card-name { font-weight: 600; color: #f3f4f6; font-size: 14px; }
.ss-card-desc { color: #8b8f98; font-size: 12.5px; margin-top: 2px; }
/* Concurrent-instructions mode selector (Queued / Parallel) + explainer. */
.ss-conc-modes { margin: -6px 18px 10px; padding: 11px 13px; border: 1px solid #2d2d35; border-left: 3px solid #9333EA; border-radius: 9px; background: rgba(147,51,234,0.05); display: flex; flex-direction: column; gap: 9px; }
.ss-conc-modes[hidden] { display: none; }
.ss-conc-hint { font-size: 12px; color: #8b8f98; }
.ss-conc-mode { display: flex; gap: 9px; align-items: flex-start; font-size: 12.5px; line-height: 1.5; color: #b9bdc6; cursor: pointer; }
.ss-conc-mode input { margin-top: 3px; flex: 0 0 auto; accent-color: #9333EA; }
.ss-conc-mode input:disabled { cursor: default; }
.ss-conc-mode b { color: #e6e6ea; }
.ss-soon { font-size: 9.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #F59E0B; background: rgba(245,158,11,0.14); border-radius: 6px; padding: 1px 6px; }
.ss-btn { background: #26262c; color: #e5e7eb; border: 1px solid #34343c; border-radius: 8px;
  padding: 7px 16px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.ss-btn:hover { background: #303038; }
.ss-btn-ghost { background: transparent; color: #9ca3af; }
.ss-btn-ghost:hover { background: #18181c; color: #e5e7eb; }
.ss-badge { font-size: 11px; color: #1AAA55; margin-left: 8px; font-weight: 600; } /* status-locked */
.ss-badge-muted { color: #9ca3af; }
.ss-field { display: flex; flex-direction: column; gap: 5px; padding: 14px 18px; border-bottom: 1px solid #18181c; }
.ss-field > span { font-size: 12.5px; color: #9ca3af; }
.ss-in { width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px;
  border: 1px solid #26262c; background: #141418; color: #e5e7eb; font-size: 13px; }
.ss-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 14px 18px; }
.ss-form-foot .ssg-msg { color: #9ca3af; font-size: 12px; margin-right: auto; }
.ss-switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.ss-switch input { opacity: 0; width: 0; height: 0; }
.ss-switch span { position: absolute; inset: 0; background: #34343c; border-radius: 22px; cursor: pointer; transition: .15s; }
.ss-switch span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px;
  background: #e5e7eb; border-radius: 50%; transition: .15s; }
.ss-switch input:checked + span { background: #9333EA; } /* status-locked */
.ss-switch input:checked + span::before { transform: translateX(16px); }
.ss-card-actions { display: flex; gap: 8px; flex-shrink: 0; align-items: center; }
.ss-card-logo { width: 24px; height: 24px; object-fit: contain; display: block; }
.ss-btn-soon, .ss-btn-soon:hover { opacity: .4; cursor: not-allowed; background: transparent; color: #6b7280; border-color: #26262c; }
.ssg-hint { display: block; font-size: 11.5px; color: #6b7280; margin-top: 5px; }

/* Settings → Usage (Quanta meter) */
.ss-usage-body { margin-top: 10px; }
.ss-usage-big { font-size: 30px; font-weight: 800; color: var(--iris-text, #e6e6ea); line-height: 1.1; }
.ss-usage-big span { font-size: 15px; font-weight: 600; color: #9333EA; }
.ss-usage-meta { font-size: 12px; color: #8b8b94; margin: 4px 0 16px; }
.ss-usage-days { display: flex; flex-direction: column; gap: 6px; max-width: 520px; }
.ss-usage-row { display: grid; grid-template-columns: 92px 1fr 64px; align-items: center; gap: 10px; font-size: 12px; }
.ss-usage-day { color: #9aa0aa; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.ss-usage-bar { height: 8px; background: rgba(147,51,234,0.15); border-radius: 5px; overflow: hidden; }
.ss-usage-bar i { display: block; height: 100%; background: linear-gradient(90deg,#9333EA,#C026D3); }
.ss-usage-q { text-align: right; color: #c4b5fd; font-weight: 600; }
.ss-usage-empty { color: #8b8b94; font-size: 13px; }
.ss-usage-h3 { font-size: 12px; font-weight: 700; color: #c4b5fd; text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 8px; }
/* Settings → Reporting filter bar */
.ss-rep-filters { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 0 16px; align-items: flex-end; }
.ss-rep-f { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: #9aa0aa; }
.ss-rep-f select { background: var(--iris-panel-2,#232330); color: var(--iris-text,#e6e6ea); border: 1px solid #3a3a42; border-radius: 7px; padding: 5px 8px; font-size: 12px; }
.ss-rep-disabled { opacity: 0.45; }
.ss-rep-multi { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ss-rep-chip { background: transparent; border: 1px solid #3a3a42; color: #c4b5fd; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.ss-rep-chip.on { background: rgba(147,51,234,0.22); border-color: #9333EA; color: #fff; }
.ss-rep-dim { color: #8b8b94; font-size: 12px; }

/* Context Intelligence card — Features tab (collapsible) */
.ss-ci-beta { font-size: 9px; font-weight: 700; letter-spacing: .5px; color: #c4b5fd;
  background: rgba(147,51,234,0.22); border: 1px solid #9333EA; /* status-locked */
  border-radius: 999px; padding: 1px 6px; vertical-align: middle; }
.ss-ci-wrap { padding: 0; }
.ss-ci-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; cursor: pointer; user-select: none; }
.ss-ci-head:hover { background: rgba(147,51,234,0.06); } /* status-locked */
.ss-ci-chevron { font-size: 10px; color: #9ca3af; width: 12px; text-align: center; }
.ss-ci-name { font-size: 13px; font-weight: 600; color: #e6e6ea; }
.ss-ci-spacer { flex: 1; }
.ss-ci-switch { cursor: default; }
.ss-ci-collapse { padding: 0 14px 14px; }
.ss-ci-desc { font-size: 12.5px; color: #8b8f98; line-height: 1.5; margin-bottom: 8px; }
.ss-ci-loading { padding: 16px 14px; color: #8b8b94; font-size: 13px; }
.ss-ci-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px 14px; margin-top: 4px; }
.ss-ci-field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: #9ca3af; }
.ss-ci-field select, .ss-ci-field input[type="time"] {
  background: #1c1c22; border: 1px solid #3a3a42; color: #e6e6ea; border-radius: 8px;
  padding: 7px 9px; font-size: 13px; }
.ss-ci-field select:focus, .ss-ci-field input:focus { outline: none; border-color: #9333EA; } /* status-locked */
.ss-ci-days-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.ss-ci-days-lbl { font-size: 12px; color: #9ca3af; }
.ss-ci-days { display: flex; gap: 6px; flex-wrap: wrap; }
.ss-ci-day { font-size: 12px; color: #c4b5fd; border: 1px solid #3a3a42; border-radius: 999px;
  padding: 4px 11px; cursor: pointer; user-select: none; }
.ss-ci-day.on { background: rgba(147,51,234,0.22); border-color: #9333EA; color: #fff; } /* status-locked */
.ss-ci-day input { display: none; }
.ss-ci-note { margin-top: 12px; font-size: 12px; line-height: 1.5; color: #b0a8c8;
  background: rgba(147,51,234,0.08); border-left: 2px solid #9333EA; /* status-locked */
  border-radius: 6px; padding: 9px 11px; }
/* "Active now" — what works today (on-demand grounding + Impact) */
.ss-ci-active { font-size: 12.5px; line-height: 1.5; color: #cfeede;
  background: rgba(26,170,85,0.10); border-left: 2px solid #1AAA55; /* status-locked */
  border-radius: 6px; padding: 9px 11px; }
/* "Scheduled refresh — coming soon" section header + the dimmed (not-yet-live) schedule fields */
.ss-ci-section { margin: 16px 0 2px; font-size: 12px; font-weight: 700; color: #9ca3af; }
.ss-ci-soon { font-size: 9px; font-weight: 700; letter-spacing: .5px; color: #c4b5fd; vertical-align: middle;
  background: rgba(147,51,234,0.18); border: 1px solid #6b3fa0; border-radius: 999px; padding: 1px 7px; margin-left: 6px; } /* status-locked */
.ss-ci-subnote { font-size: 11.5px; color: #8b8b94; line-height: 1.5; margin: 4px 0 8px; }
.ss-ci-form .ss-ci-grid, .ss-ci-form .ss-ci-days-row { opacity: .6; } /* schedule not active yet */
#ss-ci-form .ss-ci-grid, #ss-ci-form .ss-ci-days-row { opacity: .6; }
.ss-ci-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.ss-ci-save { background: #9333EA; color: #fff; border: none; border-radius: 8px; /* status-locked */
  padding: 8px 18px; font-size: 13px; font-weight: 600; cursor: pointer; }
.ss-ci-save:disabled { opacity: .6; cursor: default; }
.ss-ci-st { font-size: 12px; }
.ss-ci-st.ok { color: #1AAA55; } /* status-locked */
.ss-ci-st.err { color: #C23934; } /* status-locked */
@media (max-width: 460px) { .ss-ci-grid { grid-template-columns: 1fr; } }

/* CI rebuild spinner + working state (Rebuild Intelligence button) */
.ss-ci-spin { display:inline-block; width:11px; height:11px; border:2px solid rgba(147,51,234,.28); border-top-color:#9333EA; border-radius:50%; animation: ss-ci-spin .7s linear infinite; vertical-align:-1px; margin-right:3px; }
@keyframes ss-ci-spin { to { transform: rotate(360deg); } }
.ss-ci-st.ss-ci-working { color:#9333EA; } /* status-locked */

/* ── Migration Workbench (CPQ→RLM) + IDE/Migration mode switch ─────────── */
.mode-switch { display: inline-flex; border: 1px solid #3a3a3a; border-radius: 8px; overflow: hidden; margin-right: 8px; }
.mode-switch .ms-opt {
  background: transparent; color: #b8b8b8; border: none; padding: 5px 10px; font-size: 14px;
  cursor: pointer; font-family: inherit; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.mode-switch .ms-opt:hover { background: rgba(147,51,234,0.12); color: #e6e6e6; }
.mode-switch .ms-opt.active { background: #9333EA; color: #fff; font-weight: 600; }

.workbench { flex-direction: column; flex: 1; min-height: 0; overflow: auto; padding: 14px 18px; gap: 12px; background: #1e1e1e; }
.wb-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.wb-title { font-size: 15px; font-weight: 700; color: #e6e6e6; }
.wb-route { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #b8b8b8; }
.wb-route label { color: #9a9a9a; }
.wb-route select {
  background: #2a2a2a; color: #e6e6e6; border: 1px solid #3a3a3a; border-radius: 6px; padding: 4px 8px;
  font-size: 12px; font-family: inherit;
}
.wb-route .wb-arrow { color: #9333EA; font-weight: 700; }

.wb-objbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.wb-objbar-label { font-size: 11px; color: #9a9a9a; margin-right: 4px; }
.wb-chip {
  background: #2a2a2a; color: #c8c8c8; border: 1px solid #3a3a3a; border-radius: 14px; padding: 3px 10px;
  font-size: 11.5px; cursor: pointer; font-family: inherit;
}
.wb-chip:hover { border-color: #9333EA; }
.wb-chip.on { background: rgba(147,51,234,0.16); border-color: #9333EA; color: #e6d9fb; font-weight: 600; }

.wb-benches { display: flex; flex-direction: column; gap: 10px; }
.wb-row { display: grid; grid-template-columns: 1fr 38px 1fr; align-items: stretch; gap: 0; }
.wb-row-head .wb-bench-head {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; color: #9333EA; text-transform: uppercase;
  padding: 2px 4px;
}
.wb-card {
  border: 1px solid #3a3a3a; border-radius: 10px; padding: 10px 12px; background: #262626;
}
.wb-card-l { border-left: 3px solid #6b7280; }
.wb-card-r { border-left: 3px solid #9333EA; background: rgba(147,51,234,0.06); }
.wb-card-unmapped { border-left-color: #F59E0B; background: rgba(245,158,11,0.07); }
.wb-card-title { font-size: 12.5px; font-weight: 600; color: #e6e6e6; margin-bottom: 5px; }
.wb-card-title code, .wb-sub code { font-size: 10.5px; color: #9a9a9a; background: rgba(0,0,0,0.25); padding: 0 4px; border-radius: 3px; }
.wb-sub { font-size: 11px; color: #b8b8b8; padding: 1px 0 1px 10px; }
.wb-note { font-size: 11px; color: #c8c8c8; line-height: 1.5; margin-bottom: 6px; }
.wb-maparrow { display: flex; align-items: center; justify-content: center; color: #9333EA; font-size: 18px; font-weight: 700; }
.wb-conf { font-size: 9.5px; font-weight: 600; padding: 1px 6px; border-radius: 4px; }
.wb-conf-high { background: rgba(26,170,85,0.18); color: #5cd98a; }
.wb-conf-medium { background: rgba(245,158,11,0.18); color: #f0c674; }
.wb-conf-low { background: rgba(194,57,52,0.18); color: #e88; }
.wb-empty { color: #8a8a8a; font-size: 12px; padding: 16px; text-align: center; }

.wb-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 4px; }
.wb-foot-note { font-size: 10.5px; color: #8a8a8a; }
.wb-generate {
  background: #9333EA; color: #fff; border: none; border-radius: 8px; padding: 8px 16px; font-size: 12.5px;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
.wb-generate:hover { background: #7e22ce; }
.wb-generate:disabled { background: #3a3a3a; color: #777; cursor: not-allowed; }

.wb-plan { margin-top: 4px; }
.wb-plan-card { border: 1px solid rgba(147,51,234,0.4); border-radius: 10px; background: rgba(147,51,234,0.07); padding: 12px 14px; }
.wb-plan-title { font-size: 13px; font-weight: 700; color: #e6d9fb; margin-bottom: 8px; }
.wb-plan-steps { margin: 0 0 8px; padding-left: 20px; }
.wb-plan-steps li { font-size: 12px; color: #d4d4d4; line-height: 1.7; }
.wb-plan-steps li code { font-size: 10.5px; color: #9a9a9a; }
.wb-plan-review { font-size: 9.5px; font-weight: 600; color: #f0c674; background: rgba(245,158,11,0.16); padding: 0 5px; border-radius: 4px; }
.wb-plan-flag { color: #f0c674 !important; }
.wb-plan-foot { font-size: 10.5px; color: #8a8a8a; line-height: 1.5; }

/* Detailed migration-plan blocks (Generate Plan → clear instructions) */
.wb-pl-intro { font-size: 11px; color: #b8b8b8; line-height: 1.55; margin-bottom: 10px; }
.wb-pl-block { border: 1px solid #3a3a3a; border-left: 3px solid #9333EA; border-radius: 8px; padding: 9px 12px; margin-bottom: 9px; background: rgba(0,0,0,0.18); }
.wb-pl-unmapped { border-left-color: #F59E0B; }
.wb-pl-h { font-size: 12.5px; font-weight: 700; color: #e6d9fb; margin-bottom: 5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wb-pl-line { font-size: 11.5px; color: #c8c8c8; line-height: 1.6; margin: 1px 0; }
.wb-pl-line b { color: #e6e6e6; }
.wb-pl-steps { margin: 4px 0 2px; padding-left: 20px; }
.wb-pl-steps li { font-size: 11.5px; color: #d4d4d4; line-height: 1.65; }

/* Topbar declutter — ⓘ info pill reveals org + connected branch on click */
.info-pill {
  background: #2a2a2a; color: #b8b8b8; border: 1px solid #3a3a3a; border-radius: 10px;
  min-width: 20px; height: 20px; font-size: 11px; cursor: pointer; padding: 0 5px; line-height: 1;
}
.info-pill:hover { border-color: #9333EA; color: #e6e6e6; }
.ctx-group { display: none; align-items: center; gap: 6px; }
.ctx-group.show { display: inline-flex; }
/* Web/AWS surface can't dock or close a page — hide the extension-only size/dock + close controls */
.surface-web .size-group,
.surface-web #btn-close { display: none !important; }

/* Small purple heartbeat shown in the topbar while IRIS is processing a request */
.iris-heartbeat { display: inline-flex; align-items: center; gap: 5px; margin-right: 6px; user-select: none; }
.iris-heartbeat .hb-heart { font-size: 14px; line-height: 1; animation: iris-hb 0.85s ease-in-out infinite; }
.iris-heartbeat .hb-msg { font-size: 11px; color: #c4b5fd; white-space: nowrap; max-width: 180px; overflow: hidden; text-overflow: ellipsis; }
@keyframes iris-hb { 0%,100% { transform: scale(1); opacity: 0.8; } 45% { transform: scale(1.35); opacity: 1; } }

/* Layout editor — 💾 Save button + saved confirmation */
.lp-save-btn.lp-saved { background: #1AAA55 !important; color: #fff !important; border-color: #1AAA55 !important; }

/* Phase 2 — per-field access pin (🔒) + Profiles/PermSets popover (layout editor, light theme) */
.lp-item { position: relative; }
.lp-item-new { border: 1px dashed #9333EA; border-radius: 6px; }
.lp-type-new { background: rgba(147,51,234,0.12); color: #6b21a8; border: 1px solid rgba(147,51,234,0.3); border-radius: 4px; padding: 0 4px; font-size: 9.5px; font-weight: 600; }
.lp-pa-pin {
  position: absolute; top: 4px; right: 4px; z-index: 2; width: 22px; height: 22px; padding: 0;
  border: 1px solid #c9c7c5; border-radius: 6px; background: #fff; cursor: pointer; font-size: 12px; line-height: 1;
}
.lp-pa-pin:hover { border-color: #9333EA; }
.lp-pa-pin.set { background: #9333EA; border-color: #9333EA; }
.lp-pa-pop {
  position: absolute; top: 28px; right: 4px; z-index: 30; width: 240px; max-height: 320px; overflow: auto;
  background: #fff; border: 1px solid #c9c7c5; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); padding: 8px;
  color: #181818;
}
.lp-pa-h { font-size: 11.5px; color: #3e3e3c; margin-bottom: 6px; }
.lp-pa-h b { color: #181818; }
.lp-pa-tabs { display: flex; gap: 4px; margin-bottom: 6px; }
.lp-pa-tab { flex: 1; background: #f3f2f2; color: #444; border: 1px solid #dddbda; border-radius: 6px; padding: 3px 6px; font-size: 10.5px; cursor: pointer; }
.lp-pa-tab.active { background: #9333EA; color: #fff; border-color: #9333EA; font-weight: 600; }
.lp-pa-list { max-height: 160px; overflow: auto; border: 1px solid #ecebea; border-radius: 6px; padding: 4px; margin-bottom: 6px; font-size: 11.5px; }
.lp-pa-row { display: flex; align-items: center; gap: 6px; padding: 2px 4px; cursor: pointer; }
.lp-pa-row:hover { background: #f6f3fb; }
.lp-pa-acc { display: flex; gap: 12px; font-size: 11px; color: #444; margin-bottom: 6px; }
.lp-pa-acc label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
.lp-pa-foot { display: flex; align-items: center; justify-content: space-between; }
.lp-pa-count { font-size: 10px; color: #706e6b; }
.lp-pa-done { background: #9333EA; color: #fff; border: none; border-radius: 6px; padding: 4px 12px; font-size: 11.5px; font-weight: 600; cursor: pointer; }
.lp-pa-done:hover { background: #7e22ce; }

/* Single-pane ⇄ dual-pane preview toggle */
.spv.spv-single { grid-template-columns: 1fr; }
.spv.spv-single .spv-code { display: none; }
.spv-single {
  background: transparent; border: 1px solid #6d28d9; color: #c4b5fd; border-radius: 5px;
  padding: 2px 8px; font-size: 11px; font-weight: 600; cursor: pointer; letter-spacing: 0;
}
.spv-single:hover { background: rgba(109,40,217,0.15); }

/* Mini search in the field-access popover */
.lp-pa-search {
  width: 100%; box-sizing: border-box; border: 1px solid #c9c7c5; border-radius: 6px;
  padding: 4px 8px; font-size: 11.5px; margin-bottom: 6px; font-family: inherit;
}
.lp-pa-search:focus { outline: none; border-color: #9333EA; }

/* Icon-only layout header buttons (💜 ✥ 🛡 💾) + active/saved states */
.lp-iconbtn {
  margin-left: 3px; padding: 4px 7px; font-size: 13px; min-width: 26px; line-height: 1;
  background: #f3f0fb; color: #6b21a8; border: 1px solid #d8c9f5; font-weight: 600;
}
.lp-iconbtn:first-of-type { margin-left: auto; }
.lp-iconbtn:hover { background: #e9e0fb; filter: none; }
.lp-iconbtn.active { background: #9333EA; color: #fff; border-color: #9333EA; }
.lp-iconbtn.lp-saved { background: #1AAA55 !important; color: #fff !important; border-color: #1AAA55 !important; }

/* Instant styled tooltip for the layout header icons (💜 ✥ 🛡 💾) */
.lp-iconbtn[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; top: calc(100% + 7px); right: 0; z-index: 50;
  background: #1f2937; color: #fff; font-size: 11px; font-weight: 500; letter-spacing: 0;
  padding: 5px 9px; border-radius: 6px; white-space: nowrap; pointer-events: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.3);
}
.lp-iconbtn[data-tip]:hover::before {
  content: ""; position: absolute; top: calc(100% + 2px); right: 9px; z-index: 50;
  border: 5px solid transparent; border-bottom-color: #1f2937; pointer-events: none;
}

/* Locked (managed/standard) permission sets in the access picker — shown but not editable */
.lp-pa-row-dis { opacity: 0.6; cursor: not-allowed; }
.lp-pa-locked {
  font-size: 9px; font-weight: 600; color: #92400e; background: #fef3c7;
  border: 1px solid #fde68a; border-radius: 4px; padding: 0 4px; margin-left: 4px; vertical-align: middle;
}

/* Permission Sets sub-filter (Custom / Managed) in the access popover */
.lp-pa-subfilter { display: flex; gap: 4px; margin-bottom: 6px; }
.lp-pa-subchip {
  flex: 1; background: #f3f2f2; color: #444; border: 1px solid #dddbda; border-radius: 6px;
  padding: 3px 6px; font-size: 10.5px; cursor: pointer; font-family: inherit;
}
.lp-pa-subchip.active { background: #6b21a8; color: #fff; border-color: #6b21a8; font-weight: 600; }
.lp-pa-none { font-size: 11.5px; color: #706e6b; padding: 10px; text-align: center; }

/* ✦ Fix button on a failed deploy row + numbered deploy sequence */
.plan-fix-btn {
  margin-left: 8px; background: #9333EA; color: #fff; border: none; border-radius: 5px;
  padding: 2px 9px; font-size: 11px; font-weight: 600; cursor: pointer;
}
.plan-fix-btn:hover { background: #7e22ce; }
.plan-fix-btn:disabled { opacity: 0.6; cursor: default; }
.plan-deploy-seqnote { font-size: 10px; color: #8a8a8a; margin: 2px 0 4px; }
.plan-deploy-seq { color: #9333EA; font-weight: 700; font-size: 11px; }

/* Pre-deploy build-sequence review (drag-to-reorder + Proceed) */
.plan-seqreview { margin: 8px 14px 12px; border: 1px solid rgba(147,51,234,0.4); border-radius: 10px; background: rgba(147,51,234,0.06); padding: 10px 12px; }
.psr-title { font-size: 12px; font-weight: 700; color: #c9a6f5; margin-bottom: 6px; }
.psr-report { font-size: 10.5px; color: #b8b8b8; line-height: 1.5; margin-bottom: 8px; }
.psr-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.psr-row { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid #3a3a3a; border-radius: 7px; background: #262626; font-size: 11.5px; color: #e6e6e6; cursor: grab; }
.psr-row:hover { border-color: #9333EA; }
.psr-dragging { opacity: 0.5; }
.psr-handle { color: #8a8a8a; cursor: grab; }
.psr-num { color: #9333EA; font-weight: 700; }
.psr-name { flex: 1; font-family: ui-monospace, monospace; font-size: 11px; }
.psr-kind { font-size: 9.5px; color: #8a8a8a; }
.psr-actions { display: flex; gap: 8px; justify-content: flex-end; }
.psr-reset, .psr-cancel { background: transparent; color: #b8b8b8; border: 1px solid #3a3a3a; border-radius: 6px; padding: 4px 10px; font-size: 11.5px; cursor: pointer; }
.psr-reset:hover, .psr-cancel:hover { border-color: #9333EA; color: #e6e6e6; }
.psr-proceed { background: #9333EA; color: #fff; border: none; border-radius: 6px; padding: 5px 14px; font-size: 12px; font-weight: 600; cursor: pointer; }
.psr-proceed:hover { background: #7e22ce; }

/* System-field duplicate flag + remove button in the build-sequence review */
.psr-row.psr-dup { border-color: #F59E0B; background: rgba(245,158,11,0.08); }
.psr-duptag { font-size: 9.5px; font-weight: 600; color: #f0c674; background: rgba(245,158,11,0.16); border-radius: 4px; padding: 0 5px; }
.psr-remove { margin-left: auto; background: transparent; color: #8a8a8a; border: 1px solid #3a3a3a; border-radius: 5px; padding: 1px 7px; font-size: 11px; cursor: pointer; }
.psr-remove:hover { border-color: #C23934; color: #e88; }
.psr-proceed:disabled { background: #3a3a3a; color: #777; cursor: not-allowed; }

/* Collapsed build-sequence review bar */
.psr-bar { display: flex; align-items: center; gap: 8px; }
.psr-toggle { background: transparent; border: none; color: #c9a6f5; font-size: 13px; cursor: pointer; padding: 0 2px; line-height: 1; }
.psr-summary { flex: 1; font-size: 12px; font-weight: 700; color: #c9a6f5; cursor: pointer; }
.psr-warn { color: #f0c674; font-weight: 600; }
.plan-seqreview .psr-list, .plan-seqreview .psr-report, .plan-seqreview .psr-actions { margin-top: 8px; }

/* Test-class sync prompt (auto-test-gen: confirm + pick the test class on a class MODIFY) */
.test-sync-prompt { padding: 10px 12px; }
.test-sync-msg { font-size: 13px; margin-bottom: 8px; line-height: 1.4; }
.tsync-chosen { color: #9333EA; font-weight: 600; }
.test-sync-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tsync-btn { padding: 5px 10px; font-size: 12px; border-radius: 6px; border: 1px solid #9333EA; background: transparent; color: #9333EA; cursor: pointer; }
.tsync-btn:hover:not(:disabled) { background: #9333EA; color: #fff; }
.tsync-btn:disabled { opacity: .5; cursor: default; }
.tsync-yes { background: #9333EA; color: #fff; }
.test-sync-custom { display: flex; gap: 8px; margin-top: 8px; }
.tsync-name { flex: 1; padding: 5px 8px; font-size: 12px; border: 1px solid #c9a6f5; border-radius: 6px; }

/* SchemaGuard — invented-field warning in the AI-edit diff (iris-exec-panel/competitive grounding fix) */
.mco-schema-warn { background: rgba(245,158,11,0.16); border-bottom: 1px solid rgba(245,158,11,0.5); color: #fcd34d; font-size: 12px; font-weight: 600; padding: 7px 12px; font-family: "SF Mono", Menlo, monospace; }

/* ── Pre-deploy code analysis (PMD) panel — inside the plan card ───────────── */
.pmd-panel {
  margin: 10px 12px; padding: 10px 12px;
  border: 1px solid var(--iris-border); border-radius: var(--iris-radius-sm);
  background: var(--iris-panel-2); font-size: 12px; line-height: 1.5;
}
.pmd-panel .pmd-head { font-weight: 600; margin-bottom: 6px; color: var(--iris-text); }
.pmd-panel .pmd-file { margin-top: 6px; color: var(--iris-text-dim); }
.pmd-panel .pmd-file b { color: var(--iris-text); }
.pmd-panel .pmd-ok { color: #1AAA55; }
.pmd-panel .pmd-newcls {
  font-size: 10px; padding: 1px 6px; border-radius: 8px; margin-left: 4px;
  background: var(--iris-accent-soft); color: var(--iris-accent-2);
}
.pmd-panel .pmd-pre { font-size: 10px; color: var(--iris-text-dim); margin-left: 4px; }
.pmd-panel .pmd-find {
  display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap;
  padding: 3px 6px 3px 14px; border-radius: 4px; margin-top: 2px;
}
.pmd-panel .pmd-find.pmd-block { background: rgba(194,57,52,0.10); }
.pmd-panel .pmd-find.pmd-warn  { background: rgba(245,158,11,0.10); }
.pmd-panel .pmd-sev { flex: 0 0 auto; }
.pmd-panel .pmd-rule { font-weight: 600; color: var(--iris-text); }
.pmd-panel .pmd-block .pmd-rule { color: #C23934; }
.pmd-panel .pmd-warn  .pmd-rule { color: #F59E0B; }
.pmd-panel .pmd-loc { color: var(--iris-text-dim); font-variant-numeric: tabular-nums; }
.pmd-panel .pmd-msg { color: var(--iris-text-dim); flex: 1 1 100%; }
/* ── PMD auto-heal / re-run actions (shown on a blocked panel) ── */
.pmd-panel .pmd-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pmd-panel .pmd-fix-btn, .pmd-panel .pmd-rerun-btn {
  font: inherit; font-size: 12px; padding: 5px 12px; border-radius: var(--iris-radius-sm);
  cursor: pointer; border: 1px solid rgba(147,51,234,0.40); background: rgba(147,51,234,0.10);
  color: var(--iris-text); transition: background 0.12s ease;
}
.pmd-panel .pmd-fix-btn { border-color: var(--iris-accent); background: var(--iris-accent-soft); color: var(--iris-accent-2); font-weight: 600; }
.pmd-panel .pmd-fix-btn:hover, .pmd-panel .pmd-rerun-btn:hover { background: rgba(147,51,234,0.20); }
.pmd-panel .pmd-fix-btn:disabled, .pmd-panel .pmd-rerun-btn:disabled { opacity: 0.6; cursor: default; }

/* ── PMD header badge (✓ / ⚠ / ⛔ PMD) — outcome pill next to the type badge ── */
.plan-pmd-badge {
  flex: 0 0 auto; font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  padding: 3px 8px; border-radius: 999px; border: 1px solid; white-space: nowrap;
}
.plan-pmd-badge.pmd-badge-pass  { color: #1AAA55; background: rgba(26,170,85,0.14);  border-color: rgba(26,170,85,0.40); }
.plan-pmd-badge.pmd-badge-warn  { color: #F59E0B; background: rgba(245,158,11,0.14); border-color: rgba(245,158,11,0.40); }
.plan-pmd-badge.pmd-badge-block { color: #C23934; background: rgba(194,57,52,0.14);  border-color: rgba(194,57,52,0.40); }
.plan-pmd-badge.pmd-badge-run { color: #9aa0ad; background: rgba(147,51,234,0.10); border-color: rgba(147,51,234,0.30); }

/* LWC bundle pane — brief highlight when its code is refreshed after an IRIS-assist commit */
.lwc-pane-flash { animation: lwcPaneFlash 1.2s ease-out; }
@keyframes lwcPaneFlash {
  0%   { box-shadow: inset 0 0 0 2px rgba(147,51,234,0.55); }
  100% { box-shadow: inset 0 0 0 2px rgba(147,51,234,0); }
}

/* ── LWC sticky deploy bar — pending IRIS-assist change, deployable from any tab ── */
.lwc-deploybar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 8px; padding: 9px 12px;
  background: var(--iris-panel-2); border-top: 1px solid var(--iris-border);
  border-radius: 0 0 var(--iris-radius) var(--iris-radius);
  box-shadow: 0 -6px 16px rgba(0,0,0,0.28);
}
.lwc-deploybar-label { font-size: 12px; font-weight: 600; color: var(--iris-text); }
.lwc-deploybar.lwc-deploybar-done .lwc-deploybar-label { color: #1AAA55; }
.lwc-deploybar-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.lwc-deploybar-review {
  font-size: 12px; padding: 5px 12px; border-radius: var(--iris-radius-sm);
  background: transparent; color: var(--iris-text-dim);
  border: 1px solid var(--iris-border); cursor: pointer;
}
.lwc-deploybar-review:hover { color: var(--iris-text); border-color: var(--iris-accent); }
.lwc-deploybar-deploy {
  font-size: 12px; font-weight: 700; padding: 5px 14px; border-radius: var(--iris-radius-sm);
  background: var(--iris-accent); color: #fff; border: 1px solid var(--iris-accent); cursor: pointer;
}
.lwc-deploybar-deploy:hover { background: var(--iris-accent-2); }
.lwc-deploybar-deploy:disabled { opacity: 0.65; cursor: default; }

/* Ticket card — split-doc offer buttons (Success Criteria / Test Plan) + retry */
.ticket-foot-label { font-size: 12px; color: var(--iris-text-dim); margin-right: 4px; }
.ticket-extra-btn {
  font-size: 11px; font-weight: 600; padding: 4px 10px; margin: 2px 4px 0 0;
  border-radius: var(--iris-radius-sm); cursor: pointer;
  background: var(--iris-accent-soft); color: var(--iris-accent-2);
  border: 1px solid rgba(147,51,234,0.4);
}
.ticket-extra-btn:hover:not(:disabled) { background: var(--iris-accent); color: #fff; }
.ticket-extra-btn:disabled { cursor: default; opacity: 0.8; }

/* ── Email template preview (live record / sample data) ─────────────────────── */
.emp-panel { margin: 8px 12px 12px; border-top: 1px solid var(--iris-border); padding-top: 10px; }
.emp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.emp-title { font-size: 12px; font-weight: 700; color: var(--iris-text); }
.emp-id {
  flex: 1 1 200px; min-width: 160px; font-size: 12px; padding: 6px 9px;
  border-radius: var(--iris-radius-sm); border: 1px solid var(--iris-border);
  background: var(--iris-panel); color: var(--iris-text);
}
.emp-id:focus { outline: none; border-color: var(--iris-accent); box-shadow: var(--iris-glow); }
.emp-live, .emp-sample {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: var(--iris-radius-sm); cursor: pointer;
  border: 1px solid rgba(147,51,234,0.4); background: var(--iris-accent-soft); color: var(--iris-accent-2);
}
.emp-live { background: var(--iris-accent); color: #fff; border-color: var(--iris-accent); }
.emp-live:hover:not(:disabled) { background: var(--iris-accent-2); }
.emp-sample:hover { background: var(--iris-accent); color: #fff; }
.emp-live:disabled { opacity: 0.6; cursor: default; }
.emp-status { font-size: 11px; color: #F59E0B; margin: 6px 2px 0; min-height: 14px; }
.emp-out { margin-top: 10px; border: 1px solid var(--iris-border); border-radius: var(--iris-radius-sm); overflow: hidden; background: #fff; }
.emp-mailhead { padding: 8px 12px; background: var(--iris-panel-2); border-bottom: 1px solid var(--iris-border); font-size: 12px; }
.emp-sub-label { color: var(--iris-text-dim); text-transform: uppercase; font-size: 10px; letter-spacing: .5px; margin-right: 6px; }
.emp-sub { color: var(--iris-text); font-weight: 600; }
.emp-note { padding: 6px 12px; font-size: 11px; color: var(--iris-text-dim); background: var(--iris-panel); border-bottom: 1px solid var(--iris-border); }
.emp-frame-wrap { background: #fff; }
.emp-frame { width: 100%; height: 420px; border: 0; background: #fff; }
.emp-ph { background: rgba(245,158,11,0.18); color: #92600b; border-radius: 3px; padding: 0 3px; }

/* ═══ Developer mode — restrained, VS Code-like UI (feedback: "looks vibecoded / too fancy") ═══
   Toggled by body.iris-dev-mode (Settings → Features → Developer mode). Flattens the dominant
   surfaces to VS Code's default dark palette (neutral #3c3c3c borders — NO purple), tightens
   density, and reduces motion. One !important block instead of touching ~99 gradients / 88 shadows. */
body.iris-dev-mode .plan-card,
body.iris-dev-mode .approval-card,
body.iris-dev-mode .doc-card,
body.iris-dev-mode .ticket-card,
body.iris-dev-mode .code-editor-card,
body.iris-dev-mode .metadata-card,
body.iris-dev-mode .cec-card {
  background: #1e1e1e !important; background-image: none !important;               /* VS Code editor bg */
  border: 1px solid #3c3c3c !important; border-left: 1px solid #3c3c3c !important; /* VS Code neutral borders — no purple */
  border-radius: 4px !important; box-shadow: none !important;
}
body.iris-dev-mode .plan-header,
body.iris-dev-mode .doc-head,
body.iris-dev-mode .ticket-head,
body.iris-dev-mode .cec-header { background: #252526 !important; background-image: none !important; box-shadow: none !important; border-color: #3c3c3c !important; }  /* VS Code sidebar/title bg */
/* Message bubbles: flat, tighter radius, VS Code neutrals. */
body.iris-dev-mode .msg { border-radius: 4px !important; box-shadow: none !important; }
body.iris-dev-mode .msg.assistant { background: #1e1e1e !important; background-image: none !important; border: 1px solid #333333 !important; }
body.iris-dev-mode .msg.user { background: #2d2d30 !important; background-image: none !important; }
/* Buttons: flat; primary actions use the VS Code button blue instead of purple. */
body.iris-dev-mode button[class*="btn-"],
body.iris-dev-mode .plan-fb-send, body.iris-dev-mode .fb-send, body.iris-dev-mode .doc-btn,
body.iris-dev-mode .ticket-extra-btn, body.iris-dev-mode .pmd-fix-btn, body.iris-dev-mode .pmd-rerun-btn {
  background-image: none !important; box-shadow: none !important; border-radius: 3px !important; border-color: #3c3c3c !important;
}
body.iris-dev-mode .btn-approve, body.iris-dev-mode .fb-send, body.iris-dev-mode .plan-fb-send,
body.iris-dev-mode .btn-commit, body.iris-dev-mode .btn-deploy { background: #0e639c !important; }   /* VS Code button blue */
body.iris-dev-mode .btn-approve:hover, body.iris-dev-mode .btn-commit:hover, body.iris-dev-mode .btn-deploy:hover { background: #1177bb !important; }
/* Inputs / diff panes / tree → VS Code neutral borders. */
body.iris-dev-mode .plan-diff-body, body.iris-dev-mode .plan-diff-edit, body.iris-dev-mode input, body.iris-dev-mode textarea, body.iris-dev-mode select { border-color: #3c3c3c !important; }
/* Reduce motion: looping decorative animations finish instantly; the working progress bar stays. */
body.iris-dev-mode *, body.iris-dev-mode *::before, body.iris-dev-mode *::after {
  animation-duration: 0.001s !important; animation-iteration-count: 1 !important;
}
body.iris-dev-mode .iris-progress-fill { animation-duration: 1.15s !important; animation-iteration-count: infinite !important; background: linear-gradient(90deg, transparent, #007acc, transparent) !important; }
/* The Flow-Guardian ticker marquee is functional (scrolls live messages), not decorative — keep it moving in dev mode. */
body.iris-dev-mode .guardian-banner .guardian-track { animation-duration: 40s !important; animation-iteration-count: infinite !important; }
/* Accent → VS Code blue (links, badges) instead of purple. */
body.iris-dev-mode .plan-pmd-badge, body.iris-dev-mode .md-tip { box-shadow: none !important; }
body.iris-dev-mode .md-tip { border-left-color: #007acc !important; }
body.iris-dev-mode .md-link { border-bottom-color: rgba(55,148,255,0.5) !important; color: #3794ff !important; }
/* Hide the purple HAV-IQ shimmer banner in Developer mode (feedback: too flashy). */
body.iris-dev-mode .banner-haviq { display: none !important; }
