* { 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-select {
  background: var(--iris-panel-2);
  color: var(--iris-text);
  border: 1px solid #3a3a42;
  border-radius: 7px;
  font-size: 12px;
  padding: 3px 6px;
  margin-right: 6px;
  cursor: pointer;
}
.topbar-preview-btn {
  background: #9333EA; /* status-locked IRIS purple */
  color: #fff;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  margin-right: 6px;
  cursor: pointer;
}
.topbar-preview-btn:hover { filter: brightness(1.12); }

/* 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; }
.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 {
  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: wrap;
  row-gap: 3px;
  padding: 4px 10px;
  min-height: 0;
}
@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;
}

.brand { display: flex; align-items: center; gap: 10px; }
.logo { width: 26px; height: 26px; border-radius: 7px; display: block; }
.name { font-weight: 600; }
.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;
}
.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-settings {
  background: transparent;
  border: 1px solid #444;
  font-size: 14px;
  width: 28px;
  padding: 0;
  text-align: center;
}

.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: 220px minmax(0, 1fr);
  min-height: 0;
  overflow: hidden;
}
@media (max-width: 900px) {
  .chat-with-tree { grid-template-columns: 180px minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .chat-with-tree { grid-template-columns: 150px minmax(0, 1fr); }
}

.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-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;
}

.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;
}
.msg.user {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  align-self: flex-end;
}
.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. */
.cec-edit-wrap { position: relative; min-height: 320px; }
.cec-edit-wrap .cec-editor,
.cec-edit-wrap .cec-hl {
  margin: 0;
  box-sizing: border-box;
  width: 100%;
  min-height: 320px;
  max-height: 560px;
  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;
  color: transparent;
  background: #0f0a1f;
  border-color: transparent;
  z-index: 0;
}
.cec-edit-wrap .cec-editor {
  position: relative;
  z-index: 1;
  background: transparent;
  color: #e9d5ff;
  resize: vertical;
  overflow: auto;
}
.cec-hl-line { display: block; min-height: 1.5em; }
.cec-hl-add { background: rgba(34, 197, 94, 0.30); }

/* 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: 620px;
  resize: vertical;
  margin-top: 6px;
  background: #0f0a1f;
  color: #e9d5ff;
  border: 1px solid #6d28d9;
  border-radius: 8px;
  padding: 10px;
  font: 12.5px/1.5 ui-monospace, SFMono-Regular, 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 {
  padding: 6px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: #c4b5fd;
  background: #1b1b22;
  border-bottom: 1px solid #2a2a32;
}
.flow-diagram-scroll { overflow: auto; max-height: 560px; padding: 12px; }
.flow-diagram-svg { display: block; }
.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; }
.sfm-empty { color: #706e6b; font-size: 13px; }
@media (max-width: 560px) { .sfm-grid { grid-template-columns: 1fr; } }
.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; }

/* 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;
}

.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;
}
.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; }
.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; }
.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;
}
.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;
  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;
}
.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 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; }
.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: 340px; 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: auto; flex: 1; padding-bottom: 6px; }
.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); }
.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-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: 200; }
.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; }

/* "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; }

/* 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; }

/* ════════════════════════════════════════════════════════════════════
   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);
  z-index: 10000;
  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;
}

.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2d2d2d;
  background: #252526;
  border-bottom-left-radius: 11px;
  border-bottom-right-radius: 11px;
}
.chat-input textarea {
  flex: 1;
  resize: none;
  background: #1e1e1e;
  border: 1px solid #3d3d3d;
  color: #e6e6e6;
  padding: 10px 12px;
  border-radius: 6px;
  font: inherit;
  font-size: 13px;
  min-height: 60px;
  max-height: 120px;
}
.chat-input textarea:focus {
  outline: none;
  border-color: #9333EA;
}
.chat-input button {
  background: linear-gradient(135deg, #9333EA, #EC4899);
  border: none;
  color: white;
  padding: 0 18px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  align-self: stretch;
}
.chat-input button: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%;
  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;
}
.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; }
.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; }
.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-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;
}
