@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  color-scheme: light;

  --navy: #0D1240;
  --navy-light: #161b52;
  --off-white: #F5F6FA;
  --white: #ffffff;
  --border: #E2E4EE;
  --border-light: #ECEDF5;
  --border-strong: #c8cad8;
  --text: #1a1a2e;
  --text-dim: #6b6e85;
  --text-muted: #a0a3b5;
  --text-bright: #1a1a2e;
  --accent: #0D1240;
  --accent-blue: #4f6ef7;
  --accent-blue-dim: rgba(79, 110, 247, 0.07);
  --accent-blue-hover: #3b5de5;
  --green: #0d7a5f;
  --green-dim: rgba(13, 122, 95, 0.06);
  --yellow: #b8860b;
  --yellow-dim: rgba(184, 134, 11, 0.06);
  --red: #c0392b;
  --red-dim: rgba(192, 57, 43, 0.05);
  --orange: #d4740a;
  --orange-dim: rgba(212, 116, 10, 0.06);
  --purple: #6c5ce7;
  --purple-dim: rgba(108, 92, 231, 0.06);
  --cyan: #2980b9;
  --cyan-dim: rgba(41, 128, 185, 0.06);
  --sidebar-width: 200px;
  --sidebar-bg: #0D1240;
  --sidebar-text: rgba(255, 255, 255, 0.55);
  --sidebar-text-active: rgba(255, 255, 255, 0.95);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-xs: 4px;
  --shadow-xs: 0 1px 2px rgba(13, 18, 64, 0.03);
  --shadow-sm: 0 1px 3px rgba(13, 18, 64, 0.04), 0 1px 2px rgba(13, 18, 64, 0.02);
  --shadow: 0 2px 8px rgba(13, 18, 64, 0.06), 0 1px 3px rgba(13, 18, 64, 0.04);
  --shadow-md: 0 4px 16px rgba(13, 18, 64, 0.07), 0 2px 6px rgba(13, 18, 64, 0.04);
  --shadow-lg: 0 8px 32px rgba(13, 18, 64, 0.08), 0 4px 12px rgba(13, 18, 64, 0.04);
  --shadow-hover: 0 8px 24px rgba(13, 18, 64, 0.1), 0 2px 8px rgba(13, 18, 64, 0.06);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* aliases for legacy references */
  --surface: #F5F6FA;
  --bg: #F5F6FA;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b6e85;
  --bg-primary: #ffffff;
  --bg-secondary: #F5F6FA;
  --font-sans: var(--font);
  --muted: #a0a3b5;
}

html { height: 100%; scrollbar-gutter: stable; }
body {
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  height: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  text-wrap: balance;
}
h1 { font-weight: 700; line-height: 1.2; }
h2 { font-weight: 600; line-height: 1.25; }
h3 { font-weight: 600; line-height: 1.3; }
h4, h5, h6 { font-weight: 500; line-height: 1.35; }

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══ Sidebar Toggle ═══ */
.sidebar-toggle {
  display: none;
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 100;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--navy);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background 0.2s;
}
.sidebar-toggle:hover { background: var(--navy-light); }
.hamburger-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  position: relative;
  border-radius: 1px;
}
.hamburger-icon::before, .hamburger-icon::after {
  content: '';
  display: block;
  width: 18px;
  height: 2px;
  background: rgba(255,255,255,0.8);
  position: absolute;
  left: 0;
  border-radius: 1px;
}
.hamburger-icon::before { top: -6px; }
.hamburger-icon::after { top: 6px; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}
.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 22px;
  cursor: pointer;
  margin-left: auto;
  padding: 0 4px;
  line-height: 1;
}
.sidebar-close-btn:hover { color: rgba(255,255,255,0.9); }

/* ═══ Sidebar ═══ */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(180deg, #0e1347 0%, #090d30 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: 4px 0 24px rgba(13, 18, 64, 0.12);
  transition: transform 0.3s var(--ease-out), width 0.3s var(--ease-out);
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.1) transparent;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar-brand {
  padding: 16px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: inherit;
}
.brand-lockup { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; line-height: 1; }
.brand-lockup span { padding-left: 2px; color: rgba(255,255,255,0.5); font-size: 9px; font-weight: 700; letter-spacing: 0.25em; }
.sidebar-brand img {
  height: 17px;
  width: auto;
  opacity: 0.92;
  transition: opacity 0.3s var(--ease-out);
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}
.sidebar-brand:hover img { opacity: 1; }
.sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.22);
  padding: 14px 16px 5px;
}
.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 8px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--sidebar-text);
  font-size: 12px;
  font-weight: 400;
  transition: all 0.2s var(--ease-out);
  user-select: none;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  position: relative;
}
.nav-item:hover {
  background: rgba(255,255,255,0.07);
  color: var(--sidebar-text-active);
}
.nav-item.active {
  background: rgba(79, 110, 247, 0.18);
  color: var(--sidebar-text-active);
  font-weight: 500;
}
.nav-icon {
  width: 14px;
  text-align: center;
  font-size: 11px;
  opacity: 0.4;
  flex-shrink: 0;
  transition: opacity 0.15s;
}
.nav-item.active .nav-icon { opacity: 0.95; }
.nav-item:hover .nav-icon { opacity: 0.75; }
.sidebar-footer {
  margin-top: auto;
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(0,0,0,0.1);
}
.sidebar-user-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
  padding: 4px; border-radius: 8px; transition: background 0.15s;
}
.sidebar-user-row:hover { background: rgba(255,255,255,0.08); }
.sidebar-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-blue, #2563eb); display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  font-size: 13px; font-weight: 700; color: #fff; position: relative;
}
.sidebar-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.sidebar-user-info { min-width: 0; flex: 1; }
.sidebar-user {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
}
.sidebar-user-title {
  font-size: 10px; color: rgba(255,255,255,0.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-signout {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  font-size: 11px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s var(--ease-out);
  backdrop-filter: blur(4px);
}
.sidebar-signout:hover {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.1);
}

/* ═══ Main Content Area ═══ */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  height: 100vh;
  background: var(--off-white);
  overflow-y: auto;
  transition: margin-left 0.3s var(--ease-out);
}
.main-content.no-sidebar {
  margin-left: 0;
}

/* ═══ Top Bar ═══ */
header#topBar { display: none; }

/* ═══ Views ═══ */
.view { display: none; }
.view.active { display: block; animation: viewFadeIn 0.35s var(--ease-out); }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ Login ═══ */
#view-login.active {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(145deg, #eef0f8 0%, #e4e7f3 40%, #dde1f2 100%);
  position: relative;
}
#view-login.active::before {
  content: '';
  position: absolute;
  top: -40%;
  right: -20%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse, rgba(79,110,247,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.login-container {
  max-width: 420px;
  width: 100%;
  margin: 0 var(--space-5);
  padding: 40px 36px;
  text-align: center;
  background: var(--white);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(13, 18, 64, 0.10), 0 4px 16px rgba(13, 18, 64, 0.04);
  border: 1px solid rgba(226, 228, 238, 0.7);
  position: relative;
  z-index: 1;
}
.login-container h1 {
  font-size: 20px;
  color: var(--navy);
  margin-bottom: 2px;
}
.login-sub {
  color: var(--text-dim);
  font-size: 13px;
  margin-bottom: var(--space-5);
}
.login-logo {
  width: 280px;
  max-width: 80%;
  margin-bottom: 0;
}
.login-brand-lockup { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-bottom: var(--space-6); }
.login-brand-lockup span { color: var(--text-dim); font-size: 10px; font-weight: 700; letter-spacing: 0.32em; padding-left: 0.32em; }
.login-form { text-align: left; }
.login-form label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  margin-top: 16px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}
.optional { text-transform: none; letter-spacing: 0; opacity: 0.6; font-weight: 400; }

/* ═══ Buttons ═══ */
.btn-primary {
  background: var(--navy);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.18s var(--ease-out);
  position: relative;
}
.btn-primary:hover {
  background: var(--navy-light);
  box-shadow: 0 2px 8px rgba(13, 18, 64, 0.15);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.btn-secondary:hover {
  border-color: var(--border-strong);
  background: var(--off-white);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:active { transform: scale(0.98); }
.btn-secondary:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-small {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
}
.btn-small:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.btn-small:active { transform: scale(0.98); }
.btn-small:disabled { opacity: 0.4; cursor: not-allowed; }

/* ═══ Inputs ═══ */
input[type="text"], input[type="email"], input[type="password"],
input[type="search"], input[type="number"], input[type="date"],
input[type="tel"], input[type="url"],
textarea, select {
  width: 100%;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.10);
}
::placeholder { color: var(--text-muted); opacity: 1; }
select { cursor: pointer; }
textarea { resize: vertical; }

/* ═══ Pipeline Header ═══ */
.pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-5) var(--space-3);
}
.pipeline-header h2 {
  font-size: 20px;
  color: var(--text-bright);
  letter-spacing: -0.02em;
}
.pipeline-controls {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.pipeline-search {
  width: 240px;
  padding: 8px 14px;
  font-size: 13px;
}

/* ═══ Kanban ═══ */
/* ── Deal Stage Filters ── */
.deal-stage-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  padding: 0 var(--space-5) var(--space-3);
}
.stage-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.18s var(--ease-out);
  white-space: nowrap;
}
.stage-pill:hover { border-color: var(--accent-blue); color: var(--text); background: rgba(79,110,247,0.03); }
.stage-pill.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  box-shadow: 0 2px 6px rgba(13, 18, 64, 0.15);
}
.stage-pill .stage-dot { margin: 0; }

/* ── Pipeline Stats ── */
.pipeline-stats {
  display: flex;
  gap: var(--space-3);
  padding: 0 var(--space-5) var(--space-4);
  flex-wrap: wrap;
}
.pipeline-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
  flex: 1;
  min-width: 150px;
  transition: box-shadow 0.18s var(--ease-out);
}
.pipeline-stat:hover {
  box-shadow: var(--shadow-sm);
}
.pipeline-stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-heading);
  line-height: 1;
  letter-spacing: -0.02em;
}
.pipeline-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

/* ── Stage Dots ── */
.stage-dot {
  width: 7px; height: 7px; border-radius: 50%; display: inline-block;
  box-shadow: none;
  flex-shrink: 0;
}
.s-pipeline { background: var(--text-muted); }
.s-origination { background: var(--accent-blue); }
.s-structuring { background: var(--navy); }
.s-diligence { background: var(--purple); }
.s-legal { background: var(--orange); }
.s-closing { background: var(--cyan); }
.s-closed { background: var(--green); }

/* ── Deal Cards Grid ── */
.deal-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-4);
  padding: 0 var(--space-5) var(--space-5);
}
.deal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  cursor: pointer;
  transition: all 0.22s var(--ease-out);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.deal-card:hover {
  border-color: rgba(79, 110, 247, 0.35);
  box-shadow: 0 8px 28px rgba(13, 18, 64, 0.10), 0 2px 8px rgba(79, 110, 247, 0.06);
  transform: translateY(-3px);
}
.deal-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 0;
}
.deal-card-avatar {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: var(--navy);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  font-family: var(--font-heading);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}
.deal-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.deal-card-avatar-upload {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: pointer;
  border-radius: 10px;
}
.deal-card-avatar:hover .deal-card-avatar-upload { opacity: 1; }
.deal-card-avatar-upload svg { width: 18px; height: 18px; fill: #fff; }
.deal-card-title {
  flex: 1;
  min-width: 0;
}
.deal-card-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-bright);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.deal-card-type {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.deal-card-body {
  padding: 14px 16px;
  flex: 1;
}
.deal-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
}
.deal-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}
.deal-card-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.deal-card-stage-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text-dim);
}
.deal-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-top: 1px solid var(--border-light);
  gap: 8px;
}
.deal-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.deal-card-badges span {
  font-size: 10px;
  color: var(--text-dim);
  background: var(--surface);
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
}
.card-score {
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
}
.card-score.high { color: var(--green); background: var(--green-dim); }
.card-score.medium { color: var(--yellow); background: var(--yellow-dim); }
.card-score.low { color: var(--red); background: var(--red-dim); }
.deal-cards-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 48px 20px;
}

/* ═══ New Deal Form ═══ */
.form-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 20px;
}
.form-container h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 16px;
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-group label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 500;
}
.form-group.full { grid-column: 1 / -1; }
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
}

/* ═══ Upload Zone ═══ */
.upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-out);
  background: var(--off-white);
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-blue);
  background: rgba(79,110,247,0.03);
}
.upload-zone p { color: var(--text-dim); font-size: 13px; }
.upload-zone small { color: var(--text-muted); font-size: 11px; }
.file-list { margin-top: 12px; }
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 12px;
  box-shadow: var(--shadow-xs);
}
.file-item .file-remove { color: var(--red); cursor: pointer; font-size: 16px; line-height: 1; transition: transform 0.2s; }
.file-item .file-remove:hover { transform: scale(1.2); }

/* ═══ Deal Room Header ═══ */
.dealroom-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-5);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}
.dealroom-title h2 {
  font-size: 18px;
  color: var(--text-bright);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}
.dealroom-meta { display: flex; gap: 8px; align-items: center; }
.deal-type-badge {
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--navy);
  color: rgba(255,255,255,0.92);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.stage-badge {
  font-size: 10px;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--off-white);
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border: 1px solid var(--border);
}
.score-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
.dealroom-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.presence-list { display: flex; gap: 4px; align-items: center; }
.presence-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
}
.presence-dot:nth-child(2) { background: var(--green); margin-left: -8px; }
.presence-dot:nth-child(3) { background: var(--purple); margin-left: -8px; }

/* ═══ Deal Room Tab Navigation ═══ */
.dr-tabs { display: none; }

/* ═══ Tab Panels ═══ */
.dr-panel { display: none; padding: var(--space-5); overflow-x: hidden; max-width: 100%; }
.dr-panel.active { display: block; animation: panelIn 0.25s var(--ease-out); }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ═══ Overview Grid ═══ */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
}
.overview-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}
.overview-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-strong); }
.overview-card h3 {
  font-family: var(--font);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin-bottom: 10px;
  font-weight: 600;
}
.overview-card:first-child { grid-column: 1 / -1; }

/* ═══ ov-card (compact panel card) ═══ */
.ov-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow-xs);
}
.ov-card h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--font);
}

.placeholder { color: var(--text-muted); font-style: italic; font-size: 13px; padding: var(--space-4) 0; }

/* ═══ Checklist ═══ */
.checklist-header { display: flex; justify-content: space-between; align-items: center; }
.checklist { margin-top: 10px; }
.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background 0.15s;
}
.checklist-item:last-child { border-bottom: none; }
.checklist-item:hover { background: rgba(79,110,247,0.02); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: var(--radius-xs); }
.checklist-item input[type="checkbox"] {
  accent-color: var(--green);
  cursor: pointer;
  flex-shrink: 0;
  width: 16px; height: 16px;
}
.checklist-item.completed .task-title { text-decoration: line-through; color: var(--text-muted); }
.checklist-item.task-high .task-title { color: var(--orange); }
.checklist-item.task-urgent .task-title { color: var(--red); font-weight: 600; }
.task-title { flex: 1; }
.task-assignee { font-size: 11px; color: var(--text-dim); background: var(--off-white); padding: 2px 8px; border-radius: 10px; }
.task-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 0 4px; opacity: 0; transition: all 0.2s; }
.checklist-item:hover .task-delete { opacity: 1; }
.task-delete:hover { color: var(--red); transform: scale(1.2); }

#ovNotesArea {
  width: 100%;
  background: var(--off-white);
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  min-height: 80px;
}

/* ═══ Stage Progress ═══ */
.stage-progress { display: flex; gap: 5px; margin-bottom: 16px; }
.stage-step {
  flex: 1;
  height: 8px;
  border-radius: 4px;
  background: var(--border-light);
  position: relative;
  transition: background 0.3s;
}
.stage-step.completed { background: var(--navy); box-shadow: none; }
.stage-step.current { background: var(--accent-blue); box-shadow: none; }
.stage-label { font-size: 10px; color: var(--text-muted); text-align: center; margin-top: 4px; }
.stage-label.current { color: var(--accent-blue); font-weight: 600; }
.stage-actions { display: flex; gap: 8px; }

/* ═══ Metrics ═══ */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px;
}
.metric-item {
  text-align: center;
  padding: var(--space-3);
  background: var(--white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  transition: border-color 0.18s var(--ease-out);
}
.metric-item:hover { border-color: var(--border); }
.metric-value {
  font-family: var(--font-heading);
  font-size: 17px;
  font-weight: 700;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.metric-label { font-size: 11px; color: var(--text-dim); margin-top: 3px; font-weight: 500; }

.metric-big {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.metric-sub {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 3px;
}

.dr-select {
  background: var(--navy);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font);
  outline: none;
}
.dr-select:focus {
  border-color: var(--accent-blue);
}

/* ═══ Chat ═══ */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 200px);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}
.chat-msg {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  align-items: flex-start;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  margin-left: -4px;
  margin-right: -4px;
}
.chat-msg:hover { background: rgba(79,110,247,0.02); }
.chat-avatar {
  width: 28px; height: 28px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.chat-avatar.user { background: linear-gradient(135deg, var(--accent-blue) 0%, #6b8af9 100%); color: #fff; }
.chat-avatar.agent { background: linear-gradient(135deg, var(--green) 0%, #34d399 100%); color: #fff; }
.chat-avatar.system { background: linear-gradient(135deg, var(--text-muted) 0%, #b8bbd0 100%); color: #fff; }
.chat-body { flex: 1; min-width: 0; }
.chat-sender {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 3px;
}
.chat-sender .chat-role { font-weight: 400; color: var(--text-dim); margin-left: 6px; }
.chat-sender .chat-time { font-weight: 400; color: var(--text-muted); margin-left: 8px; font-size: 11px; }
.chat-text {
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.chat-input-bar {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.chat-input-bar textarea { flex: 1; min-height: 42px; max-height: 120px; }
.chat-input-bar .btn-primary { align-self: flex-end; }

/* ═══ Documents Grid ═══ */
.docs-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}
.docs-header h3 { font-size: 18px; color: var(--text-bright); }
.docs-upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  margin-bottom: 16px;
  transition: all 0.25s var(--ease-out);
  display: none;
  background: var(--white);
}
.docs-upload-zone.visible { display: block; }
.docs-upload-zone.dragover { border-color: var(--accent-blue); box-shadow: 0 0 0 4px rgba(79,110,247,0.06); }
.docs-upload-zone p { color: var(--text-dim); font-size: 13px; }
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.doc-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow-xs);
  transition: border-color 0.15s;
}
.doc-card:hover { border-color: var(--accent-blue); }
.doc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-meta { font-size: 11px; color: var(--text-dim); }
.doc-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.doc-icon { font-size: 28px; }
.doc-download {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: all 0.2s var(--ease-out);
}
.doc-download:hover { color: var(--accent-blue); background: var(--accent-blue-dim); transform: scale(1.1); }
.doc-summary { font-size: 11px; color: var(--text-dim); line-height: 1.4; margin: 4px 0 6px; }
.doc-class {
  display: inline-block;
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  text-transform: uppercase;
  margin-top: 6px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.md-briefing { white-space: normal; }

/* ═══ Activity Log ═══ */
.activity-list { max-height: 400px; overflow-y: auto; }
.activity-list.full { max-height: none; }
.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  transition: background 0.15s;
}
.activity-item:hover { background: rgba(79,110,247,0.02); }
.activity-icon { font-size: 14px; flex-shrink: 0; margin-top: 1px; }
.activity-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 70px;
}
.activity-actor { font-weight: 600; color: var(--text-bright); margin-right: 4px; }
.activity-detail { color: var(--text); }

/* ═══ Markdown in Chat ═══ */
.chat-text h2 { font-size: 16px; color: var(--text-bright); margin: 14px 0 6px; }
.chat-text h3 { font-size: 14px; color: var(--text-bright); margin: 12px 0 4px; }
.chat-text h4 { font-size: 13px; font-weight: 400; color: var(--text-bright); margin: 10px 0 4px; }
.chat-text h5 { font-size: 13px; font-weight: 400; color: var(--accent-blue); margin: 8px 0 4px; }
.chat-text strong { color: var(--text-bright); }
.chat-text hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }
.chat-text ul, .chat-text ol { padding-left: 20px; margin: 6px 0; }
.chat-text li { margin-bottom: 3px; }
.chat-text table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 13px; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-xs); }
.chat-text th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); color: var(--text-dim); font-weight: 600; background: var(--off-white); }
.chat-text td { padding: 6px 12px; border-bottom: 1px solid var(--border-light); }
.chat-text p { margin-bottom: 8px; }
.chat-text p:last-child { margin-bottom: 0; }

/* ═══ Integration / Specialist Panels ═══ */
.integration-panel, .specialist-panel { padding: 0; }
.integration-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.integration-header h3 { font-size: 16px; color: var(--text-bright); }
.integration-status {
  font-size: 11px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
}
.integration-status.online { background: var(--green-dim); color: var(--green); }
.integration-status.offline { background: var(--red-dim); color: var(--red); }
.integration-desc { color: var(--text-dim); font-size: 13px; margin-bottom: var(--space-3); line-height: 1.5; }
.integration-actions { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); flex-wrap: wrap; }
.agent-results { margin-top: var(--space-4); }

.specialist-panel h3 { font-size: 16px; color: var(--text-bright); margin-bottom: 8px; }
.specialist-chat { height: calc(100vh - 280px); }
.specialist-chat.compact-chat { height: 280px; min-height: 200px; }

/* Unified specialist panel layout */
.unified-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
}
.unified-panel-header {
  flex-shrink: 0;
}
.unified-panel-header .generation-actions {
  margin: 6px 0 8px;
}
.unified-chat {
  flex: 1;
  height: auto !important;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.unified-chat .chat-messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.unified-chat .pinned-output {
  flex-shrink: 0;
  max-height: 45vh;
  overflow-y: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}
.unified-chat .pinned-output:empty {
  display: none;
}
.unified-chat .chat-input-bar {
  flex-shrink: 0;
}

/* ═══ Generation Actions ═══ */
.generation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 14px;
}
.btn-action {
  padding: 6px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-family: var(--font);
  transition: all 0.15s var(--ease-out);
}
.btn-action:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
}
.btn-action:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-action.accent {
  background: var(--accent-blue-dim);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 500;
}
.btn-action.accent:hover { background: rgba(79,110,247,0.12); }

.btn-accent {
  background: var(--accent-blue);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-accent:hover { opacity: 0.9; }

.btn-danger {
  background: var(--red, #e74c3c);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-danger:hover { opacity: 0.9; }

.btn-danger-outline {
  background: transparent;
  border: 1px solid var(--red, #e74c3c);
  color: var(--red, #e74c3c);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
}
.btn-danger-outline:hover { background: rgba(231,76,60,0.08); }

.btn-warroom {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-warroom:hover { opacity: 0.9; }

.modal-card {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 24px;
  max-width: 500px;
  width: 90%;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}

.modal-content {
  background: var(--bg-card, #fff);
  border-radius: 12px;
  padding: 24px;
  max-width: 700px;
  width: 90%;
  margin: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.data-table th, .data-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 10px;
}

.dealroom-actions { flex-wrap: wrap; }

/* ═══ Agent Output ═══ */
.agent-output { margin-bottom: 14px; position: relative; }
.agent-output-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin-bottom: 6px;
}
.agent-output-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  max-height: calc(100vh - 400px);
  overflow-y: auto;
  line-height: 1.55;
  white-space: normal;
}
.agent-output-content table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; border-radius: var(--radius-sm); overflow: hidden; }
.agent-output-content th, .agent-output-content td { padding: 8px 12px; border: 1px solid var(--border-light); text-align: left; }
.agent-output-content th { background: var(--off-white); color: var(--text-bright); font-weight: 600; }
.agent-output-content h3, .agent-output-content h4 { color: var(--navy); margin: 18px 0 8px; }
.agent-output-content h5 { color: var(--accent-blue); margin: 14px 0 6px; }
.agent-output-content ul, .agent-output-content ol { padding-left: 20px; margin: 8px 0; }
.agent-output-content li { margin: 4px 0; }
.agent-output-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }

/* ═══ Transactability Empty State ═══ */
.trans-empty { padding: 24px; text-align: center; }
.trans-pillars-preview {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 14px 0;
}
.trans-pillars-preview span {
  font-size: 12px;
  padding: 5px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-dim);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s var(--ease-out);
}
.trans-pillars-preview span:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }

/* ═══ Score Display ═══ */
.score-display {
  text-align: center;
  padding: 28px;
  background: linear-gradient(135deg, var(--white) 0%, var(--off-white) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
}
.score-big { font-family: var(--font-mono); font-size: 60px; font-weight: 800; letter-spacing: -0.04em; }
.score-big.pursue { color: var(--green); text-shadow: 0 2px 12px rgba(16,185,129,0.2); }
.score-big.selective { color: var(--cyan); text-shadow: 0 2px 12px rgba(6,182,212,0.2); }
.score-big.conditional { color: var(--yellow); text-shadow: 0 2px 12px rgba(245,158,11,0.2); }
.score-big.pass { color: var(--red); text-shadow: 0 2px 12px rgba(239,68,68,0.2); }
.score-label { font-size: 14px; color: var(--text-dim); margin-top: 6px; }
.score-rec { font-size: 16px; font-weight: 600; margin-top: 8px; }

.pillar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 20px; }
.pillar-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all 0.25s var(--ease-out);
}
.pillar-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.pillar-name { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 4px; }
.pillar-score-bar { height: 8px; background: var(--border-light); border-radius: 4px; margin: 8px 0; overflow: hidden; }
.pillar-score-fill { height: 100%; border-radius: 4px; transition: width 0.6s var(--ease-out); }
.pillar-reasoning { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

/* ═══ Investors ═══ */
.investors-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 14px;
  height: calc(100vh - 180px);
}
.investors-tracker { overflow-y: auto; }
.investors-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.investors-header h3 { font-size: 15px; color: var(--text-bright); }
.investor-stats { display: flex; gap: 10px; margin-bottom: 12px; }
.inv-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  flex: 1;
}
.inv-stat-val { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-bright); }
.inv-stat-lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; }
.investor-table-wrap { overflow-x: auto; }
.investor-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.investor-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--off-white);
  position: sticky;
  top: 0;
}
.investor-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.investor-table tr { transition: background 0.15s; }
.investor-table tr:hover { background: rgba(79,110,247,0.03); }
.inv-name { font-weight: 600; color: var(--text-bright); }
.inv-firm { font-size: 12px; color: var(--text-dim); }
.inv-status {
  display: inline-block;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  font-weight: 600;
}
.inv-status.identified { background: rgba(160,163,181,0.12); color: var(--text-dim); }
.inv-status.contacted { background: var(--cyan-dim); color: var(--cyan); }
.inv-status.interested { background: var(--green-dim); color: var(--green); }
.inv-status.nda-signed { background: var(--accent-blue-dim); color: var(--accent-blue); }
.inv-status.bid-received { background: var(--purple-dim); color: var(--purple); }
.inv-status.passed { background: var(--red-dim); color: var(--red); }
.inv-interest { font-size: 12px; }
.inv-actions { white-space: nowrap; }
.inv-actions button {
  background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: 12px; padding: 4px 6px;
  transition: all 0.2s;
}
.inv-actions button:hover { color: var(--accent-blue); transform: scale(1.15); }
.investors-chat h4 { font-family: var(--font); font-size: 14px; color: var(--text-dim); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; opacity: 1; }
.compact-chat { height: calc(100vh - 280px); }

/* Investor workspace: keep the tracker readable without allowing a fixed-height
   chat panel or long action labels to force the page outside the deal room. */
#panelInvestors { min-width: 0; }
#panelInvestors .investors-layout {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
  gap: 20px;
  height: auto;
  min-height: calc(100vh - 230px);
  align-items: start;
}
#panelInvestors .investors-tracker,
#panelInvestors .investors-chat { min-width: 0; }
#panelInvestors .investors-header { gap: 12px; flex-wrap: wrap; }
#panelInvestors .investors-header > div { display: flex; flex-wrap: wrap; gap: 8px; }
#panelInvestors .investor-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(86px, 1fr));
  gap: 10px;
}
#panelInvestors .inv-stat { min-width: 0; padding: 12px 10px; }
#panelInvestors .investor-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: calc(100vh - 350px);
  min-height: 220px;
  overflow: auto;
  background: var(--white);
}
#panelInvestors .investor-table { min-width: 690px; }
#panelInvestors .investors-chat {
  position: sticky;
  top: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
#panelInvestors .investors-chat h4 { margin: 0 0 10px; }
#panelInvestors .specialist-chat.compact-chat {
  height: min(560px, calc(100vh - 290px));
  min-height: 300px;
}

@media (max-width: 1200px) {
  #panelInvestors .investors-layout { grid-template-columns: 1fr; min-height: 0; }
  #panelInvestors .investors-chat { position: static; }
  #panelInvestors .specialist-chat.compact-chat { height: 360px; min-height: 280px; }
  #panelInvestors .investor-table-wrap { max-height: 460px; }
}

@media (max-width: 600px) {
  #panelInvestors .investor-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #panelInvestors .investors-header > div { width: 100%; }
  #panelInvestors .investors-header .btn-small,
  #panelInvestors .investors-header .btn-primary { flex: 1 1 auto; }
  #panelInvestors .investor-table-wrap { max-height: 400px; }
}

/* ═══ Modal ═══ */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(13,18,64,0.25);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 300;
  animation: overlayIn 0.2s var(--ease-out);
}
@keyframes overlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  width: 480px;
  max-width: 90vw;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease-spring);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h3 { font-size: 15px; color: var(--text-bright); margin-bottom: 12px; }
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.modal-grid .full { grid-column: 1 / -1; }
.modal-grid label {
  display: block;
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
  font-weight: 500;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px;
}

.modal-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  width: 90%;
  max-width: 500px;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s var(--ease-spring);
}
.modal-box h4 { margin-bottom: 18px; color: var(--text-bright); font-size: 17px; }
.modal-box label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; margin-top: 14px; }
.modal-box input, .modal-box textarea, .modal-box select {
  width: 100%; padding: 10px 12px; background: var(--off-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: 13px; font-family: var(--font);
}
.modal-box textarea { min-height: 100px; resize: vertical; }

@media (max-width: 900px) {
  .investors-layout { grid-template-columns: 1fr; }
  .compact-chat { height: 300px; }
}

/* ═══ Scrollbar ═══ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ═══ Toast ═══ */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 12px;
  color: var(--text);
  z-index: 200;
  box-shadow: var(--shadow-md);
  animation: toastIn 0.3s var(--ease-spring);
}
.toast.success { border-color: var(--green); border-left: 4px solid var(--green); }
.toast.error { border-color: var(--red); border-left: 4px solid var(--red); }
@keyframes toastIn {
  from { transform: translateY(24px) scale(0.96); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

/* ═══ Notification Bell ═══ */
.notif-bell {
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  font-size: 16px;
  padding: 4px 8px;
  transition: transform 0.2s var(--ease-spring);
}
.notif-bell:hover { transform: scale(1.1); }
.notif-icon { filter: grayscale(1); transition: filter 0.2s; }
.notif-bell:hover .notif-icon { filter: none; }
.notif-badge {
  position: absolute; top: -2px; right: 0;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 10px;
  min-width: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(239,68,68,0.3);
}
.notif-dropdown {
  position: fixed;
  top: 12px;
  right: 20px;
  width: 340px;
  max-height: 400px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  z-index: 200;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn 0.2s var(--ease-spring);
}
.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-bright);
  font-weight: 600;
}
.notif-list { max-height: 380px; overflow-y: auto; }
.notif-item {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.15s;
}
.notif-item:hover { background: var(--off-white); }
.notif-item.unread { border-left: 3px solid var(--accent-blue); }
.notif-title { font-size: 12px; font-weight: 600; color: var(--text-bright); }
.notif-body { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.notif-time { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.notif-empty { text-align: center; padding: 20px; color: var(--text-muted); font-size: 12px; }

/* ═══ Analytics Panel ═══ */
.analytics-panel {
  margin: 0 20px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.analytics-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.analytics-header h3 { font-size: 15px; color: var(--text-bright); }
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.analytics-stat {
  text-align: center;
  padding: 12px;
  background: var(--off-white);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.analytics-stat-val { font-family: var(--font-mono); font-size: 20px; font-weight: 700; color: var(--text-bright); letter-spacing: -0.02em; }
.analytics-stat-lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; text-transform: uppercase; letter-spacing: 0.04em; }
.analytics-bar-chart { margin-top: 14px; }
.analytics-bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.analytics-bar-label { min-width: 100px; font-size: 12px; color: var(--text-dim); text-align: right; }
.analytics-bar {
  height: 20px;
  border-radius: var(--radius-xs);
  background: var(--accent-blue);
  transition: width 0.4s var(--ease-out);
  min-width: 2px;
}
.analytics-bar-count { font-size: 12px; color: var(--text-dim); font-family: var(--font-mono); min-width: 20px; }

/* ═══ Comparison Panel ═══ */
.comparison-panel {
  margin: 0 20px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
}
.comparison-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.comparison-header h3 { font-size: 15px; color: var(--text-bright); }
.comparison-select { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.comparison-select label {
  display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--text);
  cursor: pointer; padding: 5px 10px; background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  transition: all 0.15s var(--ease-out);
}
.comparison-select label:hover { border-color: var(--accent-blue); }
.comparison-select label:has(input:checked) { border-color: var(--accent-blue); background: var(--accent-blue-dim); }
.comparison-select input[type="checkbox"] { accent-color: var(--accent-blue); }
.comparison-result { margin-top: 12px; }

/* ═══ Roles ═══ */
.roles-grid { margin: 12px 0; }
.role-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-light); }
.role-row:last-child { border-bottom: none; }
.role-name { font-size: 13px; color: var(--text-bright); font-weight: 600; }
.role-select { width: 140px; padding: 6px 8px; font-size: 12px; }
.role-badge { font-size: 11px; padding: 3px 10px; border-radius: 20px; font-weight: 600; }
.role-badge.admin { background: var(--purple-dim); color: var(--purple); }
.role-badge.analyst { background: var(--cyan-dim); color: var(--cyan); }
.role-badge.read-only { background: rgba(160,163,181,0.12); color: var(--text-dim); }

.research-quick-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }

/* ═══ Auth Tabs ═══ */
.auth-tabs { display: flex; gap: 0; margin-bottom: var(--space-6); border-bottom: 1px solid var(--border); }
.auth-tab {
  background: none; border: none; color: var(--text-muted); padding: 10px 20px;
  font-size: 13px; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all .2s var(--ease-out); font-family: var(--font);
  margin-bottom: -1px; font-weight: 500;
}
.auth-tab:hover { color: var(--text); }
.auth-tab.active { color: var(--navy); border-bottom-color: var(--accent-blue); font-weight: 600; }
.auth-panel { display: none; }
.auth-panel.active { display: block; animation: viewFadeIn 0.3s var(--ease-out); }
.auth-error { color: var(--red); font-size: 12px; margin-top: 10px; font-weight: 500; }
.btn-full { width: 100%; margin-top: 16px; }
.input-uppercase { text-transform: uppercase; }
.work-product-iframe { width: 8.5in; max-width: 100%; min-height: 100%; border: none; background: #fff; box-shadow: 0 2px 20px rgba(0,0,0,0.3); }
.status-connected { color: #22c55e; }
.status-disconnected { color: rgba(255,255,255,0.3); }
.text-warning { color: #f0ad4e; }
.doc-card--selected { outline: 2px solid var(--accent); }
.pill-count { font-size: 10px; opacity: 0.7; margin-left: 2px; }
.btn-inject { margin-top: 8px; margin-right: 8px; }
.invite-card {
  background: linear-gradient(135deg, var(--off-white) 0%, var(--white) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin: 10px 0; display: flex; justify-content: space-between; align-items: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s var(--ease-out);
}
.invite-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.invite-card-info { flex: 1; }
.invite-card-name { font-weight: 600; color: var(--text-bright); font-size: 14px; }
.invite-card-detail { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.invite-card .btn-primary { padding: 7px 18px; font-size: 12px; }

/* ═══ Team Feed ═══ */
.team-actions-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 14px; }
.team-feed-list { display: flex; flex-direction: column; gap: 8px; }
.feed-item {
  padding: 10px 12px;
  border-left: 3px solid var(--border);
  background: var(--white);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  transition: all .15s var(--ease-out);
}
.feed-item:hover {
  border-left-color: var(--accent-blue);
  background: var(--off-white);
}
.feed-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feed-item-agent { font-size: 12px; font-weight: 600; color: var(--accent-blue); }
.feed-item-tab { font-size: 11px; color: var(--text-dim); background: var(--off-white); padding: 3px 10px; border-radius: 10px; }
.feed-item-time { font-size: 11px; color: var(--text-muted); }
.feed-item-content { font-size: 13px; color: var(--text); line-height: 1.6; max-height: 90px; overflow: hidden; }
.feed-item-content.expanded { max-height: none; }

/* ═══ Collaborative Documents ═══ */
.collab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.collab-btn {
  text-align: left;
  padding: 10px 12px;
  line-height: 1.4;
  height: auto;
  white-space: normal;
  border-radius: var(--radius-sm);
}
.collab-btn strong { display: block; margin-bottom: 2px; }
.collab-progress {
  margin: 10px 0; padding: 12px; background: var(--off-white);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.collab-progress-header { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 13px; color: var(--text-bright); font-weight: 600; }
.collab-stages { display: flex; flex-direction: column; gap: 6px; }
.collab-stage-item { font-size: 12px; color: var(--text-dim); padding: 5px 0; transition: all .3s; }
.collab-stage-item.active { color: var(--accent-blue); font-weight: 500; }
.collab-stage-item.done { color: var(--green); }
.collab-stage-dot { display: inline-block; width: 16px; text-align: center; font-size: 10px; }
.collab-stage-item.active .collab-stage-dot { animation: pulse 1.2s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.3} }

/* ═══ Deal Room Panel Components ═══ */

/* Shared stats row */
.dr-stats-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.dr-stat {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: center;
  flex: 1;
}
.dr-stat-val { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--text-bright); display: block; }
.dr-stat-lbl { font-size: 10px; color: var(--text-dim); margin-top: 2px; display: block; }

/* Shared badge */
.dr-badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 20px;
  font-weight: 600;
  white-space: nowrap;
  text-transform: capitalize;
}

/* Shared label */
.dr-label {
  color: var(--text-dim);
  font-size: 12px;
  margin-right: 4px;
}

/* Shared card grid */
.dr-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.dr-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  transition: all 0.25s var(--ease-out);
}
.dr-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dr-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.dr-card-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  color: var(--text-bright);
  text-transform: capitalize;
}
.dr-card-body { font-size: 13px; }
.dr-card-row { padding: 2px 0; }

/* Shared table */
.dr-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.dr-table th {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  color: var(--text-dim);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--off-white);
  position: sticky;
  top: 0;
}
.dr-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}
.dr-table tr { transition: background 0.15s; }
.dr-table tr:hover { background: rgba(79,110,247,0.03); }

/* VDR Tree */
.vdr-tree {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 8px;
  box-shadow: var(--shadow);
}
.vdr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.vdr-row:hover { background: rgba(79,110,247,0.04); }
.vdr-row-main { display: flex; align-items: center; gap: 8px; }
.vdr-icon { font-size: 15px; width: 20px; text-align: center; }
.vdr-name { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.vdr-row-meta { display: flex; align-items: center; gap: 8px; }
.vdr-browser { display: grid; grid-template-columns: minmax(250px, 34%) 1fr; gap: 14px; min-height: 430px; }
.vdr-pane-title { display: flex; justify-content: space-between; align-items: center; padding: 4px 10px 12px; font-size: 12px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em; }
.vdr-folder-row { width: 100%; border: 0; background: transparent; cursor: pointer; font-family: inherit; text-align: left; }
.vdr-folder-row.selected { background: var(--accent-blue-dim); box-shadow: inset 3px 0 0 var(--accent-blue); }
.vdr-folder-row.drag-over { background: var(--green-dim); outline: 2px dashed var(--green); }
.vdr-file-pane { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); overflow: auto; }
.vdr-file-count { font-weight: 500; text-transform: none; letter-spacing: normal; }
.vdr-file-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 10px; border-bottom: 1px solid var(--border-light); transition: background .15s, opacity .15s; }
.vdr-file-row:hover { background: rgba(79,110,247,.04); }
.vdr-file-row.dragging { opacity: .4; }
.vdr-file-identity { display: flex; align-items: center; gap: 10px; min-width: 0; }
.vdr-file-icon { font-size: 23px; }
.vdr-file-identity strong { display: block; color: var(--text-bright); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 390px; }
.vdr-file-identity small { display: block; color: var(--text-dim); font-size: 10px; margin-top: 3px; }
.vdr-file-actions { display: flex; gap: 6px; flex-shrink: 0; }
.vdr-file-btn { border: 1px solid var(--border); background: var(--white); color: var(--text-bright); border-radius: 5px; padding: 6px 9px; font: inherit; font-size: 11px; cursor: pointer; }
.vdr-file-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.vdr-file-btn.danger:hover { border-color: var(--red); color: var(--red); }
.vdr-empty { min-height: 260px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-dim); text-align: center; }
.vdr-empty > span { font-size: 35px; }
.vdr-empty p { margin: 10px 0 3px; color: var(--text-bright); }
.vdr-preview-overlay { position: fixed; inset: 0; z-index: 10000; background: rgba(12,18,31,.78); display: grid; place-items: center; padding: 24px; }
.vdr-preview-modal { width: min(1180px, 96vw); height: min(850px, 92vh); background: var(--white); border-radius: 10px; box-shadow: 0 20px 70px rgba(0,0,0,.45); display: flex; flex-direction: column; overflow: hidden; }
.vdr-preview-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.vdr-preview-header strong, .vdr-preview-header small { display: block; }
.vdr-preview-header small { color: var(--text-dim); font-size: 10px; margin-top: 2px; }
.vdr-preview-header > div:last-child { display: flex; align-items: center; gap: 8px; }
.vdr-preview-close { border: 0; background: transparent; color: var(--text-dim); font-size: 28px; line-height: 1; cursor: pointer; }
.vdr-preview-body { flex: 1; min-height: 0; display: grid; place-items: center; background: #20242c; }
.vdr-preview-body iframe, .vdr-preview-body img, .vdr-preview-body video { width: 100%; height: 100%; border: 0; object-fit: contain; }
.vdr-preview-body audio { width: min(600px, 90%); }
@media (max-width: 820px) {
  .vdr-browser { grid-template-columns: 1fr; }
  .vdr-tree { max-height: 280px; overflow: auto; }
  .vdr-file-row { align-items: flex-start; flex-direction: column; }
  .vdr-file-actions { width: 100%; }
}

/* Timeline */
.tl-timeline {
  position: relative;
  padding-left: 28px;
}
.tl-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}
.tl-item {
  position: relative;
  margin-bottom: 16px;
}
.tl-dot {
  position: absolute;
  left: -24px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-blue);
  border: 2px solid var(--white);
  box-shadow: 0 0 0 2px var(--border);
  z-index: 1;
}
.tl-item.tl-done .tl-dot { background: var(--green); box-shadow: 0 0 0 2px var(--green-dim); }
.tl-item.tl-critical .tl-dot { background: var(--red); box-shadow: 0 0 0 2px var(--red-dim); }
.tl-content {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-xs);
  transition: all 0.2s var(--ease-out);
}
.tl-content:hover { box-shadow: var(--shadow); }
.tl-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.tl-title {
  font-weight: 600;
  font-size: 13.5px;
  color: var(--text-bright);
}
.tl-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.tl-date {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}
.tl-notes {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.45;
}

/* Economics */
.econ-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.econ-card .econ-amount {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-bright);
  margin-bottom: 10px;
}

/* ═══ Collaboration Bar ═══ */
.collab-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  margin-top: 10px;
  font-size: 12px;
}
.collab-bar .collab-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.collab-bar .collab-btn:hover { background: var(--off-white); color: var(--text); border-color: var(--border-strong); }
.collab-bar .collab-btn.active { background: var(--accent-blue-dim); color: var(--accent-blue); border-color: var(--accent-blue); }
.collab-bar .collab-btn .collab-count { font-weight: 600; font-size: 11px; }
.collab-spacer { flex: 1; }

/* ═══ Comments ═══ */
.comment-thread {
  margin-top: 10px;
  border-top: 1px solid var(--border-light);
  padding-top: 10px;
}
.comment-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}
.comment-item:last-child { border-bottom: none; }
.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent-blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.comment-body { flex: 1; min-width: 0; }
.comment-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}
.comment-author { font-weight: 600; font-size: 12.5px; color: var(--text-bright); }
.comment-time { font-size: 11px; color: var(--text-muted); }
.comment-edited { font-size: 10px; color: var(--text-muted); font-style: italic; }
.comment-text { font-size: 13px; color: var(--text); line-height: 1.5; word-break: break-word; }
.comment-text .mention { color: var(--accent-blue); font-weight: 600; cursor: pointer; }
.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.comment-action-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 4px;
}
.comment-action-btn:hover { color: var(--accent-blue); }
.comment-action-btn.liked { color: var(--red); }
.comment-replies {
  margin-left: 40px;
  border-left: 2px solid var(--border-light);
  padding-left: 12px;
}
.comment-input-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  align-items: flex-end;
}
.comment-input-row textarea {
  flex: 1;
  min-height: 36px;
  max-height: 100px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--white);
  color: var(--text);
}
.comment-input-row textarea:focus { border-color: var(--accent-blue); outline: none; }
.comment-input-row .btn-send {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue);
  color: white;
  border: none;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.comment-input-row .btn-send:hover { background: var(--accent-blue-hover); }

/* ═══ Mention Autocomplete ═══ */
.mention-dropdown {
  position: absolute;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-height: 160px;
  overflow-y: auto;
  z-index: 1000;
  min-width: 180px;
}
.mention-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
}
.mention-option:hover, .mention-option.active { background: var(--accent-blue-dim); color: var(--accent-blue); }
.mention-option .mention-name { font-weight: 600; }
.mention-option .mention-role { font-size: 11px; color: var(--text-muted); }

/* ═══ Feed Posts ═══ */
.feed-compose {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.feed-compose textarea {
  width: 100%;
  min-height: 60px;
  max-height: 160px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
  font-family: var(--font);
  background: var(--off-white);
  color: var(--text);
  margin-bottom: 10px;
}
.feed-compose textarea:focus { border-color: var(--accent-blue); outline: none; background: var(--white); }
.feed-compose-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
}
.feed-compose-left {
  display: flex;
  gap: 6px;
}
.feed-attach-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 12px;
}
.feed-attach-btn:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.feed-post-btn {
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  background: var(--accent-blue);
  color: white;
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.feed-post-btn:hover { background: var(--accent-blue-hover); }
.feed-post-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.feed-item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow 0.2s;
}
.feed-item:hover { box-shadow: var(--shadow); }
.feed-item.pinned { border-left: 3px solid var(--accent-blue); }
.feed-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.feed-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.feed-item-meta { flex: 1; }
.feed-item-author { font-weight: 600; font-size: 13px; color: var(--text-bright); }
.feed-item-time { font-size: 11px; color: var(--text-muted); }
.feed-pin-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  font-weight: 600;
}
.feed-item-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 8px;
  word-break: break-word;
}
.feed-item-body .mention { color: var(--accent-blue); font-weight: 600; cursor: pointer; }
.feed-shared-card {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 10px;
  font-size: 12px;
}
.feed-shared-card .shared-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.feed-shared-card .shared-preview { color: var(--text-dim); line-height: 1.4; }

/* Entity attachment chips */
.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s;
}
.attachment-chip:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.attachment-chip .att-icon { font-size: 12px; }
.attachment-chip .att-remove {
  margin-left: 4px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
}
.attachment-chip .att-remove:hover { color: var(--red); }

/* Upload drop zone */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: var(--accent-blue);
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}
.upload-zone input[type="file"] { display: none; }

/* ═══ Responsive ═══ */
/* Legacy 680px removed — see consolidated responsive rules at end of file */

/* ═══ Equity Research Report (ERP) ═══ */
.erp-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.erp-tab {
  background: none; border: none; color: var(--text-secondary); padding: 8px 20px;
  cursor: pointer; font-size: 13px; font-weight: 500; border-bottom: 2px solid transparent;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, sans-serif;
}
.erp-tab.active { color: var(--text-primary); border-bottom-color: var(--accent); }
.erp-tab:hover:not(.active) { color: var(--text-primary); }
.erp-tab-content { display: none; }
.erp-tab-content.active { display: block; }

.erp-header-row {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 20px;
}
.erp-subtitle {
  color: var(--text-secondary); font-size: 13px; line-height: 1.5; max-width: 600px; margin: 0;
}

.erp-progress {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 20px; margin-bottom: 20px;
}
.erp-progress-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.erp-progress-title { font-weight: 600; font-size: 13px; color: var(--text-primary); }
.erp-progress-pct { font-size: 13px; color: var(--accent); font-weight: 600; }
.erp-progress-bar {
  height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; margin-bottom: 8px;
}
.erp-progress-fill {
  height: 100%; background: var(--accent); border-radius: 2px; width: 0%; transition: width 0.5s ease;
}
.erp-progress-section {
  font-size: 12px; color: var(--text-secondary); font-style: italic;
}

/* Reports list */
.erp-reports-list { display: flex; flex-direction: column; gap: 8px; }
.erp-report-card {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 14px 18px; cursor: pointer; transition: border-color 0.15s;
}
.erp-report-card:hover { border-color: var(--accent); }
.erp-report-card-left { display: flex; flex-direction: column; gap: 4px; }
.erp-report-card-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.erp-report-card-meta { font-size: 12px; color: var(--text-secondary); }
.erp-report-card-right { display: flex; align-items: center; gap: 10px; }
.erp-rating-badge {
  display: inline-block; padding: 3px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.erp-rating-badge.buy { background: #0d6e3a; color: #fff; }
.erp-rating-badge.hold { background: #b8860b; color: #fff; }
.erp-rating-badge.sell { background: #b91c1c; color: #fff; }
.erp-rating-badge.pass { background: #6b7280; color: #fff; }
.erp-status-generating { color: var(--accent); font-size: 12px; font-style: italic; }

.erp-report-card-actions { display: flex; gap: 6px; }
.erp-report-card-actions button {
  background: none; border: none; color: var(--text-secondary); cursor: pointer;
  font-size: 12px; padding: 4px 8px; border-radius: 4px;
}
.erp-report-card-actions button:hover { background: var(--border); color: var(--text-primary); }

/* Report viewer */
.erp-report-viewer { max-width: 100%; overflow-x: auto; }
.erp-viewer-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; margin-bottom: 16px; border-bottom: 1px solid var(--border);
}
.erp-viewer-toolbar button {
  background: none; border: 1px solid var(--border); color: var(--text-primary);
  padding: 6px 14px; border-radius: 4px; cursor: pointer; font-size: 12px;
}
.erp-viewer-toolbar button:hover { border-color: var(--accent); color: var(--accent); }

/* Rendered report styles */
.erp-doc {
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  color: #1a1a2e; max-width: 100%;
}
.erp-doc * { box-sizing: border-box; }

.erp-cover {
  background: #0a1628; color: #fff; padding: 60px 40px; border-radius: 8px;
  margin-bottom: 24px; text-align: center; position: relative;
}
.erp-cover-brand {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 300; font-size: 28px; letter-spacing: 0.15em; opacity: 0.9;
  margin-bottom: 40px;
}
.erp-cover-type {
  font-size: 12px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6;
  margin-bottom: 16px;
}
.erp-cover-company { font-size: 32px; font-weight: 700; margin-bottom: 12px; }
.erp-cover-round { font-size: 16px; opacity: 0.8; margin-bottom: 40px; }
.erp-cover-footer { font-size: 10px; opacity: 0.4; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; }

.erp-section {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 28px 32px; margin-bottom: 16px; position: relative;
}
.erp-section-header {
  font-size: 14px; font-weight: 700; color: #0a1628; text-transform: uppercase;
  letter-spacing: 0.08em; margin-bottom: 16px; padding-bottom: 8px;
  border-bottom: 2px solid #0a1628;
}
.erp-section-regen {
  position: absolute; top: 12px; right: 16px; background: none; border: 1px solid #d1d5db;
  color: #6b7280; font-size: 11px; padding: 3px 10px; border-radius: 4px; cursor: pointer;
}
.erp-section-regen:hover { border-color: #2563eb; color: #2563eb; }

.erp-page-header {
  display: flex; justify-content: flex-end; margin-bottom: 12px;
}
.erp-page-brand {
  font-family: 'Inter', 'Helvetica Neue', Helvetica, sans-serif;
  font-weight: 300; font-size: 11px; letter-spacing: 0.12em; color: #9ca3af;
}
.erp-page-footer {
  font-size: 9px; color: #9ca3af; text-align: center; padding-top: 12px;
  border-top: 1px solid #e5e7eb; margin-top: 20px;
}

/* ERP Tables */
.erp-table {
  width: 100%; border-collapse: collapse; font-size: 12px; margin: 12px 0;
}
.erp-table th {
  background: #0a1628; color: #fff; padding: 8px 12px; text-align: left;
  font-weight: 600; font-size: 11px; letter-spacing: 0.03em;
}
.erp-table td {
  padding: 7px 12px; border-bottom: 1px solid #e5e7eb; color: #374151;
}
.erp-table tr:nth-child(even) td { background: #f9fafb; }
.erp-table .cell-pass { color: #0d6e3a; font-weight: 700; }
.erp-table .cell-watch { color: #b8860b; font-weight: 700; }
.erp-table .cell-fail { color: #b91c1c; font-weight: 700; }
.erp-table .cell-num { text-align: right; font-variant-numeric: tabular-nums; }

/* ERP Summary boxes */
.erp-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; margin: 16px 0;
}
.erp-summary-box {
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 6px;
  padding: 12px 16px; text-align: center;
}
.erp-summary-label { font-size: 10px; color: #6b7280; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 4px; }
.erp-summary-value { font-size: 18px; font-weight: 700; color: #0a1628; }

/* ERP Rating box */
.erp-rating-box {
  display: inline-flex; align-items: center; gap: 16px;
  background: #0a1628; color: #fff; padding: 16px 28px; border-radius: 8px; margin: 16px 0;
}
.erp-rating-label { font-size: 11px; opacity: 0.6; text-transform: uppercase; letter-spacing: 0.08em; }
.erp-rating-value { font-size: 28px; font-weight: 700; letter-spacing: 0.05em; }
.erp-rating-irr { font-size: 14px; opacity: 0.8; }

/* ERP Risk severity */
.erp-severity-high { background: #fef2f2; color: #991b1b; padding: 2px 8px; border-radius: 3px; font-weight: 600; font-size: 11px; }
.erp-severity-watch { background: #fffbeb; color: #92400e; padding: 2px 8px; border-radius: 3px; font-weight: 600; font-size: 11px; }
.erp-severity-low { background: #ecfdf5; color: #065f46; padding: 2px 8px; border-radius: 3px; font-weight: 600; font-size: 11px; }

/* ERP text content */
.erp-section p { font-size: 13px; line-height: 1.7; color: #374151; margin-bottom: 12px; }
.erp-section h4 { font-size: 13px; font-weight: 700; color: #0a1628; margin: 16px 0 8px; }
.erp-section ul, .erp-section ol { font-size: 13px; color: #374151; padding-left: 24px; margin: 8px 0; }
.erp-section li { margin-bottom: 4px; line-height: 1.6; }

/* Print styles for ERP */
@media print {
  .erp-viewer-toolbar, .erp-section-regen, .erp-tabs, .erp-header-row { display: none !important; }
  .erp-doc { max-width: 100%; }
  .erp-section { break-inside: avoid; border: none; box-shadow: none; padding: 20px 0; }
  .erp-cover { break-after: page; }
}

/* ═══ AGENT COMMS ═══ */
.agent-comms-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red, #e74c3c); color: #fff;
  font-size: 11px; font-weight: 600; margin-left: 6px;
}
.ac-layout {
  display: flex; gap: 0; height: calc(100vh - 200px); min-height: 500px;
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden;
  background: var(--bg-secondary, #f8f9fa);
}
.ac-channels {
  width: 190px; min-width: 190px; border-right: 1px solid var(--border);
  background: var(--bg-primary, #fff); overflow-y: auto; padding: 4px 0;
}
.ac-channel {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 10px; cursor: pointer; font-size: 12px;
  color: var(--text-secondary); transition: all 0.15s;
}
.ac-channel:hover { background: var(--bg-secondary, #f0f1f3); color: var(--text-primary); }
.ac-channel.active {
  background: var(--accent-blue, #2563eb); color: #fff;
  font-weight: 600;
}
.ac-channel.active .ac-channel-badge { background: rgba(255,255,255,0.3); color: #fff; }
.ac-channel-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.ac-channel-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-channel-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red, #e74c3c); color: #fff;
  font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.ac-channel-divider {
  padding: 8px 10px 4px; font-size: 9px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-secondary); opacity: 0.6;
}
.ac-thread { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ac-messages {
  flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px;
}
.ac-empty { text-align: center; padding: 40px 16px; color: var(--text-secondary); }
.ac-msg {
  display: flex; gap: 10px; max-width: 85%; animation: acFadeIn 0.2s ease;
}
@keyframes acFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
.ac-msg.agent { align-self: flex-start; }
.ac-msg.user { align-self: flex-end; flex-direction: row-reverse; }
.ac-msg-avatar {
  width: 26px; height: 26px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center; font-size: 13px;
  flex-shrink: 0;
}
.ac-msg.agent .ac-msg-avatar { background: var(--navy, #0a1628); color: #fff; }
.ac-msg.user .ac-msg-avatar { background: var(--accent-blue, #2563eb); color: #fff; }
.ac-msg-body { flex: 1; min-width: 0; }
.ac-msg-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.ac-msg-name { font-weight: 600; font-size: 12px; color: var(--text-primary); }
.ac-msg-time { font-size: 11px; color: var(--text-secondary); }
.ac-msg-type-badge {
  font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.ac-msg-type-badge.question { background: #fef3c7; color: #92400e; }
.ac-msg-type-badge.blocking { background: #fecaca; color: #991b1b; }
.ac-msg-type-badge.update { background: #dbeafe; color: #1e40af; }
.ac-msg-type-badge.draft { background: #e0e7ff; color: #3730a3; }
.ac-msg-content {
  background: var(--bg-primary, #fff); border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 14px; font-size: 13px;
  line-height: 1.5; color: var(--text-primary); white-space: pre-wrap; word-wrap: break-word;
}
.ac-msg.user .ac-msg-content {
  background: var(--accent-blue, #2563eb); color: #fff; border-color: transparent;
}
.ac-msg.agent .ac-msg-content { border-radius: 2px 10px 10px 10px; }
.ac-msg.user .ac-msg-content { border-radius: 10px 2px 10px 10px; }
.ac-msg-actions { display: flex; gap: 6px; margin-top: 4px; }
.ac-msg-actions button {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); cursor: pointer;
}
.ac-msg-actions button:hover { background: var(--bg-secondary); color: var(--text-primary); }
.ac-msg-actions button.resolve-btn { color: var(--green, #22c55e); border-color: var(--green, #22c55e); }
.ac-msg.resolved .ac-msg-content { opacity: 0.6; }
.ac-msg.resolved::after {
  content: '✓ Resolved'; font-size: 10px; color: var(--green, #22c55e);
  font-weight: 600; align-self: flex-end; margin-top: 2px;
}
.ac-composer {
  border-top: 1px solid var(--border); padding: 8px 12px;
  background: var(--bg-primary, #fff);
}
.ac-recipient-select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 12px; background: var(--bg-secondary); color: var(--text-primary);
  margin-bottom: 8px;
}
.ac-input-row { display: flex; gap: 8px; align-items: flex-end; }
.ac-input-row textarea {
  flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; resize: none; min-height: 36px; max-height: 100px;
  font-family: inherit; background: var(--bg-secondary); color: var(--text-primary);
}
.ac-input-row textarea:focus { outline: none; border-color: var(--accent-blue); }
.ac-typing {
  padding: 4px 14px; font-size: 12px; color: var(--text-secondary);
  font-style: italic; display: none;
}
.ac-typing.visible { display: block; }

/* ═══ PROFILE MODAL ═══ */
.profile-modal {
  width: 420px; max-width: 95vw; background: var(--bg-primary, #fff);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.profile-modal .modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.profile-modal .modal-header h3 { margin: 0; font-size: 15px; color: var(--text-primary); }
.profile-modal .modal-close {
  background: none; border: none; font-size: 22px; cursor: pointer;
  color: var(--text-secondary); line-height: 1;
}
.profile-avatar-section {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  background: var(--bg-secondary, #f8f9fa);
}
.profile-avatar-preview {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: var(--navy, #0a1628); display: flex;
  align-items: center; justify-content: center; overflow: hidden;
  font-size: 20px; font-weight: 700; color: #fff; position: relative;
}
.profile-avatar-preview img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}
.profile-avatar-actions { display: flex; flex-direction: column; gap: 6px; }
.profile-form { padding: 16px 24px; }
.profile-form .form-row { margin-bottom: 14px; }
.profile-form .form-row label {
  display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px;
}
.profile-form .form-row input,
.profile-form .form-row textarea {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: var(--bg-secondary);
  color: var(--text-primary); transition: border-color 0.15s;
}
.profile-form .form-row input:focus,
.profile-form .form-row textarea:focus { outline: none; border-color: var(--accent-blue); }
.profile-form .form-row input:disabled { opacity: 0.5; cursor: not-allowed; }
.profile-modal .modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 24px; border-top: 1px solid var(--border);
}
/* User avatar in collaboration features */
.user-avatar-sm {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  background: var(--accent-blue, #2563eb); display: inline-flex;
  align-items: center; justify-content: center; overflow: hidden;
  font-size: 11px; font-weight: 700; color: #fff; position: relative;
}
.user-avatar-sm img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
  position: absolute; inset: 0;
}

/* ── SharePoint / OneDrive Panel ── */
.sp-status-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px;
}
.sp-status-icon { font-size: 28px; }
.sp-status-title { font-size: 14px; font-weight: 600; color: var(--text); }
.sp-status-detail { font-size: 12px; color: var(--text-dim); margin-top: 2px; }
.sp-link-section { margin-bottom: 12px; }
.sp-path-display {
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-xs); padding: 8px 12px; margin-bottom: 8px;
}
.sp-path-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 4px; }
.sp-path-value { font-size: 13px; color: var(--text-dim); font-family: monospace; }
.sp-url-row { display: flex; gap: 8px; margin-bottom: 12px; }
.sp-url-input {
  flex: 1; background: var(--white); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 12px; color: var(--text); font-size: 13px;
}
.sp-url-input:focus { outline: none; border-color: var(--accent-blue, #2563eb); }
.sp-open-link {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-blue, #2563eb); color: #fff;
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 600;
  text-decoration: none; transition: background 0.15s;
}
.sp-open-link:hover { background: #1d4ed8; }
.sp-folders-section { margin-bottom: 20px; }
.sp-folders-section h4 { font-size: 13px; color: var(--text-dim); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.sp-folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.sp-folder {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 12px 14px; font-size: 13px; color: var(--text-dim);
}
.sp-folder-icon { font-size: 18px; }
.sp-sync-info { font-size: 12px; color: var(--text-dim); line-height: 1.5; }

/* ── GSuite Integration ── */
.gs-status-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.gs-status-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px; display: flex; align-items: center; gap: 8px; position: relative;
}
.gs-status-card.connected { border-color: rgba(34,197,94,0.3); }
.gs-status-icon { font-size: 22px; flex-shrink: 0; }
.gs-status-text { flex: 1; min-width: 0; }
.gs-status-title { font-size: 13px; font-weight: 600; color: var(--text); }
.gs-status-detail { font-size: 11px; color: var(--text-dim); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-status-indicator {
  width: 8px; height: 8px; border-radius: 50%; position: absolute; top: 10px; right: 10px;
  background: var(--border);
}
.gs-status-indicator.connected { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.4); }
.gs-status-indicator.disconnected { background: #ef4444; }

.gs-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.gs-tab {
  padding: 7px 14px; font-size: 12px; font-weight: 500; color: var(--text-dim);
  background: none; border: none; cursor: pointer; border-bottom: 2px solid transparent;
  transition: all 0.15s;
}
.gs-tab:hover { color: var(--text); }
.gs-tab.active { color: var(--accent-blue); border-bottom-color: var(--accent-blue); }
.gs-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; font-size: 10px; font-weight: 700;
  border-radius: 9px; background: rgba(79,110,247,0.06); color: var(--text-dim);
  margin-left: 4px;
}
.gs-tab.active .gs-tab-count { background: rgba(37,99,235,0.3); color: var(--accent-blue); }

.gs-section { display: none; }
.gs-section.active { display: block; }
.gs-section-toolbar { display: flex; gap: 6px; margin-bottom: 10px; }
.gs-list { min-height: 80px; }

/* Email items */
.gs-email-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 6px; margin-bottom: 6px; cursor: pointer; transition: background 0.12s;
}
.gs-email-item:hover { background: var(--off-white); box-shadow: var(--shadow-xs); }
.gs-email-icon { font-size: 20px; color: #ef4444; flex-shrink: 0; margin-top: 2px; }
.gs-email-content { flex: 1; min-width: 0; }
.gs-email-subject { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-email-from { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.gs-email-snippet { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gs-email-date { font-size: 11px; color: var(--text-muted); flex-shrink: 0; white-space: nowrap; }
.gs-email-actions { display: flex; gap: 4px; flex-shrink: 0; }
.gs-email-expanded { display: none; padding-top: 8px; border-top: 1px solid var(--border-light); margin-top: 8px; }
.gs-email-item.expanded .gs-email-expanded { display: block; }

/* Calendar event items */
.gs-event-item {
  display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 6px; margin-bottom: 6px;
}
.gs-event-date-block {
  flex-shrink: 0; text-align: center; background: rgba(37,99,235,0.1);
  border-radius: var(--radius-xs); padding: 6px 8px; min-width: 44px;
}
.gs-event-date-month { font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--accent-blue); font-weight: 700; }
.gs-event-date-day { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.1; }
.gs-event-content { flex: 1; min-width: 0; }
.gs-event-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.gs-event-time { font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.gs-event-attendees { font-size: 11px; color: var(--text-muted); }
.gs-event-location { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gs-event-link { font-size: 11px; }
.gs-event-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* Drive file items */
.gs-file-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 6px; margin-bottom: 6px; transition: background 0.12s;
}
.gs-file-item:hover { background: var(--off-white); box-shadow: var(--shadow-xs); }
.gs-file-icon { font-size: 22px; flex-shrink: 0; }
.gs-file-icon.spreadsheet { color: #22c55e; }
.gs-file-icon.doc { color: #3b82f6; }
.gs-file-icon.slides { color: #f59e0b; }
.gs-file-icon.pdf { color: #ef4444; }
.gs-file-icon.folder { color: #8b8b8b; }
.gs-file-icon.image { color: #a855f7; }
.gs-file-icon.file { color: var(--text-dim); }
.gs-file-content { flex: 1; min-width: 0; }
.gs-file-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-file-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.gs-file-link { font-size: 11px; }
.gs-file-actions { display: flex; gap: 4px; flex-shrink: 0; }

.gs-remove-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 14px; padding: 2px 6px; border-radius: 4px;
}
.gs-remove-btn:hover { background: rgba(239,68,68,0.2); color: #ef4444; }
.gs-open-btn {
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 11px; padding: 2px 6px; border-radius: 4px; text-decoration: none;
}
.gs-open-btn:hover { background: rgba(37,99,235,0.2); color: var(--accent-blue); }

.gs-config-note {
  margin-top: 12px; padding: 8px 10px; background: var(--off-white); border-radius: var(--radius-xs);
  font-size: 11px; color: var(--text-muted); line-height: 1.5;
}

/* ── MD Briefing ── */
.briefing-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; border-bottom: 1px solid var(--border-light);
  background: var(--off-white);
}
.btn-briefing {
  background: var(--accent-blue, #2563eb); color: #fff;
  border: none; border-radius: var(--radius-sm); padding: 6px 12px;
  font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn-briefing:hover { background: #1d4ed8; }
.briefing-hint { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
.briefing-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 2000;
}
.briefing-modal {
  background: var(--white); border: 1px solid var(--border);
  border-radius: var(--radius); width: 640px; max-width: 95vw; max-height: 85vh;
  overflow-y: auto; padding: 20px;
}
.briefing-modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.briefing-modal-header h3 { font-size: 15px; color: var(--text); margin: 0; }
.briefing-instructions { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }
.briefing-textarea {
  width: 100%; background: var(--off-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px; color: var(--text); font-size: 13px;
  line-height: 1.5; resize: vertical; font-family: inherit;
}
.briefing-textarea:focus { outline: none; border-color: var(--accent-blue, #2563eb); }
.briefing-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.briefing-summary { font-size: 13px; color: var(--accent-blue); background: rgba(37,99,235,0.08); border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 12px; line-height: 1.5; }
.briefing-plan-details { display: flex; flex-direction: column; gap: 8px; }
.briefing-plan-section {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 10px 12px;
}
.briefing-plan-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 8px; font-weight: 600;
}
.briefing-plan-item {
  font-size: 13px; color: var(--text-dim); padding: 4px 0; line-height: 1.4;
  display: flex; align-items: baseline; gap: 8px;
}
.briefing-plan-item::before { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-blue, #2563eb); flex-shrink: 0; margin-top: 6px; }
.briefing-plan-stage {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: var(--text);
}
.briefing-plan-stage .stage-arrow { color: var(--accent-blue, #2563eb); font-size: 16px; }
.briefing-applied-results { display: flex; flex-direction: column; gap: 6px; }
.briefing-applied-item {
  font-size: 13px; padding: 8px 12px; border-radius: 6px; line-height: 1.4;
}
.briefing-applied-item.success { background: rgba(34,197,94,0.1); color: var(--green); }
.briefing-applied-item.error { background: rgba(239,68,68,0.1); color: var(--red); }
.briefing-loading {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 24px; color: var(--text-dim); font-size: 13px;
}
@keyframes briefingSpin { to { transform: rotate(360deg); } }
.briefing-spinner {
  width: 20px; height: 20px; border: 2px solid var(--border-light);
  border-top-color: var(--accent-blue, #2563eb); border-radius: 50%;
  animation: briefingSpin 0.8s linear infinite;
}

/* ── Debrief Extras ── */
.debrief-sentiment {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; padding: 6px 10px;
  border-radius: var(--radius-sm); background: var(--white);
  border: 1px solid var(--border-light);
}
.debrief-sentiment .score { font-size: 16px; }
.debrief-sentiment.positive { color: var(--green); border-color: rgba(34,197,94,0.2); }
.debrief-sentiment.neutral { color: var(--yellow); border-color: rgba(250,204,21,0.2); }
.debrief-sentiment.negative { color: var(--red); border-color: rgba(239,68,68,0.2); }
.debrief-pricing-signal {
  font-size: 13px; color: var(--yellow); background: rgba(250,204,21,0.08);
  border: 1px solid rgba(250,204,21,0.15); border-radius: 6px;
  padding: 8px 12px; margin: 4px 0;
}

/* ── Client Update Preview ── */
.client-update-preview {
  background: var(--off-white); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 16px; margin-bottom: 10px; max-height: 60vh; overflow-y: auto;
}
.client-update-subject {
  font-size: 14px; font-weight: 600; color: var(--text);
  padding-bottom: 8px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.client-update-body {
  font-size: 13px; color: var(--text-dim); line-height: 1.6; white-space: pre-wrap;
}
.client-update-tone {
  display: inline-block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 8px; border-radius: 4px;
  background: rgba(37,99,235,0.15); color: var(--accent-blue); margin-bottom: 12px;
}
.client-update-internal {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border-light);
  font-size: 12px; color: var(--text-muted); font-style: italic;
}

/* ── Handoff Preview ── */
.handoff-preview {
  max-height: 65vh; overflow-y: auto;
}
.handoff-section {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: 8px; padding: 16px; margin-bottom: 12px;
}
.handoff-section-title {
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 10px; font-weight: 600;
}
.handoff-exec-summary {
  font-size: 14px; color: var(--text-dim); line-height: 1.7; white-space: pre-wrap;
  background: rgba(37,99,235,0.06); border: 1px solid rgba(37,99,235,0.12);
  border-radius: 8px; padding: 16px; margin-bottom: 16px;
}
.handoff-snapshot {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px; margin-bottom: 12px;
}
.handoff-snapshot-item {
  font-size: 13px; color: var(--text-dim);
}
.handoff-snapshot-item .label { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 2px; }

/* ── Blocker Cards ── */
.blocker-health-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--white);
  border: 1px solid var(--border-light);
}
.blocker-health-score {
  font-size: 22px; font-weight: 700; line-height: 1;
}
.blocker-health-score.good { color: var(--green); }
.blocker-health-score.fair { color: var(--yellow); }
.blocker-health-score.poor { color: var(--red); }
.blocker-health-label { font-size: 12px; color: var(--text-dim); }
.blocker-card {
  background: var(--white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 12px; margin-bottom: 8px;
}
.blocker-card.severity-critical { border-left: 3px solid #ef4444; }
.blocker-card.severity-high { border-left: 3px solid #f97316; }
.blocker-card.severity-medium { border-left: 3px solid #eab308; }
.blocker-card.severity-low { border-left: 3px solid #6b7280; }
.blocker-card-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px;
}
.blocker-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
.blocker-severity-badge {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  padding: 2px 8px; border-radius: 4px; font-weight: 600;
}
.blocker-severity-badge.critical { background: rgba(239,68,68,0.15); color: var(--red); }
.blocker-severity-badge.high { background: rgba(249,115,22,0.15); color: var(--orange); }
.blocker-severity-badge.medium { background: rgba(234,179,8,0.15); color: var(--yellow); }
.blocker-severity-badge.low { background: rgba(107,114,128,0.15); color: var(--text-muted); }
.blocker-description { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin-bottom: 10px; }
.blocker-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 10px; }
.blocker-resolutions { display: flex; flex-direction: column; gap: 8px; }
.blocker-resolution {
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: 6px; padding: 10px 12px; cursor: pointer; transition: border-color 0.15s;
}
.blocker-resolution:hover { border-color: var(--accent-blue, #2563eb); }
.blocker-resolution-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px;
}
.blocker-resolution-option { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.blocker-resolution-effort {
  font-size: 10px; text-transform: uppercase; padding: 2px 6px;
  border-radius: 3px; background: var(--white); color: var(--text-dim);
}
.blocker-resolution-risk { font-size: 11px; color: var(--text-muted); }
.blocker-resolution-btn {
  margin-top: 8px; font-size: 12px; background: var(--accent-blue, #2563eb);
  color: #fff; border: none; border-radius: 4px; padding: 5px 12px; cursor: pointer;
}
.blocker-resolution-btn:hover { background: #1d4ed8; }

/* ══════════════════════════════════════════════
   INVESTOR SENTIMENT
   ══════════════════════════════════════════════ */

.sentiment-summary {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.sentiment-stat {
  padding: 8px 12px; border-radius: var(--radius-sm); background: var(--white);
  border: 1px solid var(--border-light); text-align: center; min-width: 70px;
}
.sentiment-stat-val { font-size: 18px; font-weight: 700; }
.sentiment-stat-lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-top: 2px; }
.sentiment-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.sentiment-card {
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: 10px; padding: 14px; position: relative; transition: border-color 0.2s;
}
.sentiment-card:hover { border-color: var(--border); }
.sentiment-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.sentiment-card-name { font-weight: 600; font-size: 14px; }
.sentiment-card-firm { font-size: 12px; color: var(--text-dim); }
.sentiment-temp {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px;
  border-radius: 12px; font-size: 12px; font-weight: 600; text-transform: uppercase;
}
.sentiment-temp.hot { background: rgba(239,68,68,0.15); color: #ef4444; }
.sentiment-temp.warm { background: rgba(245,158,11,0.15); color: #f59e0b; }
.sentiment-temp.cool { background: rgba(59,130,246,0.15); color: #3b82f6; }
.sentiment-temp.cold { background: rgba(107,114,128,0.15); color: #6b7280; }
.sentiment-temp.unknown { background: var(--white); color: var(--text-muted); }
.sentiment-score-bar {
  height: 4px; border-radius: 2px; background: var(--white);
  margin: 8px 0; overflow: hidden;
}
.sentiment-score-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.sentiment-signals { font-size: 11px; color: var(--text-dim); margin-top: 6px; }
.sentiment-trend { font-size: 11px; margin-top: 4px; }
.sentiment-trend.rising { color: #22c55e; }
.sentiment-trend.stable { color: var(--text-dim); }
.sentiment-trend.falling { color: #ef4444; }
.sentiment-btn-score {
  margin-top: 8px; font-size: 11px; background: var(--white);
  border: 1px solid var(--border); color: var(--text-dim);
  padding: 4px 10px; border-radius: 4px; cursor: pointer;
}
.sentiment-btn-score:hover { background: rgba(79,110,247,0.06); color: #fff; }

/* ══════════════════════════════════════════════
   PRICING ORACLE
   ══════════════════════════════════════════════ */

.oracle-result { margin-top: 12px; }
.oracle-fair-value {
  display: flex; align-items: center; gap: 14px; padding: 14px;
  background: rgba(34,197,94,0.06);
  border: 1px solid rgba(34,197,94,0.15); border-radius: var(--radius-sm); margin-bottom: 12px;
}
.oracle-fv-range { text-align: center; flex: 1; }
.oracle-fv-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 4px; }
.oracle-fv-val { font-size: 22px; font-weight: 700; color: #22c55e; }
.oracle-fv-unit { font-size: 12px; color: var(--text-dim); }
.oracle-fv-divider { width: 1px; height: 50px; background: rgba(79,110,247,0.06); }
.oracle-confidence {
  text-align: center; padding: 10px 14px;
  background: var(--white); border-radius: var(--radius-sm);
}
.oracle-confidence-val { font-size: 20px; font-weight: 700; }
.oracle-confidence-lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.oracle-section { margin-bottom: 16px; }
.oracle-section h4 { font-size: 13px; color: var(--text-dim); text-transform: uppercase; margin-bottom: 8px; letter-spacing: 0.5px; }
.oracle-benchmarks { display: flex; flex-wrap: wrap; gap: 8px; }
.oracle-benchmark {
  padding: 8px 14px; background: var(--white);
  border: 1px solid var(--border-light); border-radius: 8px; font-size: 12px;
}
.oracle-benchmark-name { color: var(--text-dim); font-size: 11px; }
.oracle-benchmark-val { font-weight: 600; margin-top: 2px; }
.oracle-sensitivity {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
}
.oracle-factor {
  padding: 10px; background: var(--off-white);
  border: 1px solid var(--border-light); border-radius: 8px; font-size: 12px;
}
.oracle-factor-name { font-weight: 600; margin-bottom: 4px; }
.oracle-factor-impact { font-size: 11px; }
.oracle-factor-impact.high { color: #ef4444; }
.oracle-factor-impact.medium { color: #f59e0b; }
.oracle-factor-impact.low { color: #22c55e; }
.oracle-rec {
  padding: 14px; border-radius: 10px; margin-top: 16px; font-size: 13px;
}
.oracle-rec.buy { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.2); color: #22c55e; }
.oracle-rec.hold { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.2); color: #f59e0b; }
.oracle-rec.pass { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.2); color: #ef4444; }

/* ══════════════════════════════════════════════
   PREDICTIVE DEAL SCORING
   ══════════════════════════════════════════════ */

.pred-score-header {
  display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap;
}
.pred-score-card {
  flex: 1; min-width: 140px; padding: 12px; text-align: center;
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
}
.pred-score-val { font-size: 24px; font-weight: 700; }
.pred-score-lbl { font-size: 11px; color: var(--text-dim); text-transform: uppercase; margin-top: 4px; }
.pred-score-sub { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.pred-risk-list { list-style: none; padding: 0; margin: 0; }
.pred-risk-item {
  display: flex; gap: 10px; padding: 10px; margin-bottom: 8px;
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: 8px; font-size: 12px; align-items: flex-start;
}
.pred-risk-badge {
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; white-space: nowrap; flex-shrink: 0;
}
.pred-risk-badge.critical { background: rgba(239,68,68,0.2); color: #ef4444; }
.pred-risk-badge.high { background: rgba(245,158,11,0.2); color: #f59e0b; }
.pred-risk-badge.medium { background: rgba(59,130,246,0.2); color: #3b82f6; }
.pred-risk-badge.low { background: rgba(34,197,94,0.2); color: #22c55e; }
.pred-health-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px; margin-top: 12px;
}
.pred-health-item {
  padding: 10px; text-align: center; background: var(--off-white);
  border: 1px solid var(--border-light); border-radius: 8px;
}
.pred-health-score { font-size: 20px; font-weight: 700; }
.pred-health-cat { font-size: 10px; color: var(--text-dim); text-transform: uppercase; }
.pred-actions-list { display: flex; flex-direction: column; gap: 8px; }
.pred-action-item {
  display: flex; gap: 10px; align-items: center; padding: 10px;
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: 8px; font-size: 12px;
}
.pred-action-priority {
  padding: 2px 8px; border-radius: 4px; font-size: 10px; font-weight: 600;
  text-transform: uppercase; white-space: nowrap;
}
.pred-action-priority.immediate { background: rgba(239,68,68,0.2); color: #ef4444; }
.pred-action-priority.this-week { background: rgba(245,158,11,0.2); color: #f59e0b; }
.pred-action-priority.this-month { background: rgba(59,130,246,0.2); color: #3b82f6; }

/* ══════════════════════════════════════════════
   SCENARIO MODELING
   ══════════════════════════════════════════════ */

.scenario-builder {
  padding: 12px; background: var(--off-white);
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px;
}
.scenario-builder h4 { margin: 0 0 12px; color: var(--text); }
.scenario-form .form-row { margin-bottom: 10px; }
.scenario-form label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; }
.scenario-form input, .scenario-form textarea, .scenario-form select {
  width: 100%; padding: 8px 12px; background: var(--white);
  border: 1px solid var(--border); color: var(--text); border-radius: 6px;
  font-family: inherit; font-size: 13px;
}
.scenarios-list { display: flex; flex-direction: column; gap: 16px; }
.scenario-card {
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: 10px; overflow: hidden;
}
.scenario-card-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--border-light); cursor: pointer;
}
.scenario-card-header:hover { background: var(--off-white); }
.scenario-card-name { font-weight: 600; font-size: 14px; }
.scenario-card-meta { display: flex; gap: 8px; align-items: center; }
.scenario-card-rec {
  padding: 3px 10px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase;
}
.scenario-card-rec.proceed { background: rgba(34,197,94,0.15); color: #22c55e; }
.scenario-card-rec.caution { background: rgba(245,158,11,0.15); color: #f59e0b; }
.scenario-card-rec.avoid { background: rgba(239,68,68,0.15); color: #ef4444; }
.scenario-card-body { padding: 16px; display: none; }
.scenario-card-body.open { display: block; }
.scenario-detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.scenario-detail-section {
  padding: 12px; background: var(--off-white);
  border: 1px solid var(--border-light); border-radius: 8px;
}
.scenario-detail-section h5 { font-size: 12px; text-transform: uppercase; color: var(--text-dim); margin: 0 0 8px; }
.scenario-detail-section p { font-size: 12px; margin: 4px 0; }
.scenario-comparison-bar {
  height: 24px; border-radius: 12px; background: var(--white);
  margin: 12px 0; position: relative; overflow: hidden;
}
.scenario-comparison-fill {
  height: 100%; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 600;
  transition: width 0.4s; min-width: 40px;
}
.scenario-delete-btn {
  font-size: 11px; color: var(--text-muted); cursor: pointer;
  background: none; border: none; padding: 2px 6px;
}
.scenario-delete-btn:hover { color: #ef4444; }

/* ══════════════════════════════════════════════
   DASHBOARD INTELLIGENCE
   ══════════════════════════════════════════════ */

.dash-intel-alerts { margin-bottom: 18px; }
.dash-intel-alert {
  padding: 12px 16px; border-radius: 10px; font-size: 13px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.dash-intel-alert.critical { background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.18); color: var(--red); }
.dash-intel-alert.warning { background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.18); color: var(--yellow); }
.dash-intel-alert.info { background: rgba(59,130,246,0.08); border: 1px solid rgba(59,130,246,0.18); color: var(--accent-blue); }
.dash-intel-alert-icon { font-size: 16px; }
.dash-intel-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px;
}
.dash-metric-card {
  padding: 20px 16px; text-align: center;
  background: linear-gradient(145deg, #ffffff, #f8f9fd);
  border: 1px solid var(--border-light); border-radius: 12px;
  position: relative; overflow: hidden;
}
.dash-metric-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--accent-blue));
  opacity: 0.7;
}
.dash-metric-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.06em; font-weight: 600;
}
.dash-metric-value {
  font-size: 28px; font-weight: 800; color: var(--navy); margin-top: 6px;
  letter-spacing: -0.03em;
}
.dash-metric-warn { color: #e88c00 !important; }
.dash-intel-body { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 16px; }
.dash-intel-col { display: flex; flex-direction: column; gap: 16px; }
.dash-intel-section {
  padding: 20px; background: linear-gradient(145deg, #ffffff, #fafbfe);
  border: 1px solid var(--border-light); border-radius: 12px;
}
.dash-intel-section h3 {
  font-size: 13px; margin: 0 0 14px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
}
.dash-intel-text { font-size: 13px; color: var(--text-dim); line-height: 1.6; }
.dash-intel-text .placeholder { font-style: italic; opacity: 0.6; }
.dash-intel-chart {
  display: flex; gap: 4px; align-items: flex-end; min-height: 100px;
  padding: 8px 0 0;
}
.dash-stage-bar {
  flex: 1; background: linear-gradient(180deg, rgba(80,108,244,0.18), rgba(80,108,244,0.08));
  border-radius: 6px 6px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding: 6px 2px; font-size: 9px; color: var(--text-dim); min-height: 24px;
  font-weight: 600; letter-spacing: 0.02em;
}
.dash-stage-bar-count { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.dash-stuck-item {
  display: flex; justify-content: space-between; padding: 10px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.dash-stuck-item:last-child { border-bottom: none; }
.dash-stuck-name { font-weight: 600; color: var(--text); }
.dash-stuck-days { color: #e88c00; font-weight: 600; }
.dash-deadline-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.dash-deadline-item:last-child { border-bottom: none; }
.dash-overlap-item { font-size: 13px; padding: 6px 0; }
.dash-workload-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 13px;
}
.dash-workload-name { font-weight: 600; min-width: 100px; color: var(--text); }
.dash-workload-track {
  flex: 1; height: 8px; border-radius: 4px;
  background: var(--border-light); overflow: hidden;
}
.dash-workload-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent-blue), #22c55e);
  transition: width 0.4s var(--ease-out);
}
@media (max-width: 768px) {
  .dash-intel-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-intel-body { grid-template-columns: 1fr; }
  .scenario-detail-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════
   DOCUMENT INTELLIGENCE BADGES (Feature 2)
   ══════════════════════════════════════════ */

.doc-card-badges {
  display: flex; gap: 4px; flex: 1; justify-content: flex-end; margin-right: 6px;
}
.doc-intel-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(34,197,94,0.12); color: var(--green);
}
.doc-conflict-badge {
  font-size: 10px; font-weight: 700; width: 18px; height: 18px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(239,68,68,0.15); color: var(--red);
}
.doc-version-badge {
  font-size: 9px; font-weight: 600; padding: 2px 6px; border-radius: 3px;
  background: rgba(56,189,248,0.12); color: var(--cyan);
}

.doc-card-actions {
  display: flex; align-items: center; justify-content: space-between; margin-top: 6px;
}
.doc-action-btns {
  display: flex; gap: 4px;
}
.doc-action-btn {
  font-size: 10px; font-weight: 500; padding: 2px 8px; border-radius: 3px;
  background: var(--white); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
}
.doc-action-btn:hover {
  background: rgba(79,110,247,0.06); color: var(--text-bright); border-color: var(--border);
}

/* ══════════════════════════════════════════
   DOCUMENT INTELLIGENCE MODAL (Feature 2)
   ══════════════════════════════════════════ */

.doc-intel-loading {
  text-align: center; padding: 40px 20px; color: var(--text-dim);
}
.doc-intel-loading .spinner {
  width: 32px; height: 32px; border: 3px solid var(--border-light);
  border-top-color: var(--accent, #2563eb); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.doc-intel-error {
  padding: 20px; text-align: center; color: var(--red); background: rgba(239,68,68,0.08);
  border-radius: 6px; border: 1px solid rgba(239,68,68,0.15);
}

.doc-intel-section {
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-light);
}
.doc-intel-section:last-child { border-bottom: none; }
.doc-intel-section-header {
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--text-dim); margin-bottom: 8px;
}
.doc-intel-text {
  font-size: 13px; color: var(--text-dim); line-height: 1.6; margin: 0;
}

/* Key Terms */
.doc-intel-terms { display: flex; flex-direction: column; gap: 12px; }
.doc-intel-term-group { }
.doc-intel-term-cat {
  font-size: 11px; font-weight: 600; color: var(--accent, #3b82f6);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.doc-intel-term {
  display: flex; align-items: center; gap: 8px; padding: 4px 0;
  border-bottom: 1px solid var(--border-light); font-size: 13px;
}
.doc-intel-term-key {
  color: var(--text-bright); font-weight: 500; min-width: 140px; flex-shrink: 0;
}
.doc-intel-term-val {
  color: var(--text-muted); flex: 1; word-break: break-word;
}
.doc-intel-conf {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  padding: 1px 5px; border-radius: 3px; flex-shrink: 0;
}
.doc-intel-conf.conf-high { background: rgba(34,197,94,0.12); color: var(--green); }
.doc-intel-conf.conf-med { background: rgba(234,179,8,0.12); color: var(--yellow); }
.doc-intel-conf.conf-low { background: rgba(107,114,128,0.12); color: var(--text-muted); }

/* Conflicts */
.doc-intel-conflicts { background: rgba(239,68,68,0.03); border-radius: 8px; padding: 12px; }
.doc-intel-conflict {
  padding: 8px; margin-bottom: 8px; border-radius: 6px;
  background: var(--off-white); border: 1px solid var(--border-light);
}
.doc-intel-conflict-field {
  font-size: 13px; font-weight: 600; color: var(--text-bright);
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.doc-intel-conflict-detail {
  font-size: 12px; color: var(--text-muted); margin-left: 4px;
}
.doc-intel-conflict-detail strong { color: var(--text-bright); }
.doc-intel-conflict-rec {
  font-size: 11px; color: var(--cyan, #22d3ee); margin-top: 4px; font-style: italic;
}

/* ══════════════════════════════════════════
   DOCUMENT VERSION CONTROL (Feature 18)
   ══════════════════════════════════════════ */

.doc-version-empty {
  text-align: center; padding: 30px; color: var(--text-dim); font-size: 13px;
}
.doc-version-list {
  display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px;
}
.doc-version-item {
  padding: 10px 12px; border-radius: 6px;
  background: var(--off-white); border: 1px solid var(--border-light);
  transition: border-color 0.15s;
}
.doc-version-item:hover { border-color: var(--border); }
.doc-version-current { border-color: var(--accent, #2563eb); background: rgba(37,99,235,0.05); }
.doc-version-item-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
}
.doc-version-num {
  font-size: 11px; font-weight: 700; color: var(--accent, #3b82f6);
  background: rgba(59,130,246,0.1); padding: 1px 6px; border-radius: 3px;
}
.doc-version-name {
  font-size: 13px; font-weight: 500; color: var(--text-bright);
}
.doc-version-current-badge {
  font-size: 9px; font-weight: 600; text-transform: uppercase;
  background: rgba(37,99,235,0.15); color: var(--accent-blue); padding: 2px 6px; border-radius: 3px;
}
.doc-version-meta {
  font-size: 11px; color: var(--text-dim); margin-bottom: 4px;
}
.doc-version-changes {
  font-size: 12px; color: var(--text-muted); line-height: 1.5;
}
.doc-version-change-count {
  font-size: 11px; color: var(--cyan, #22d3ee); font-weight: 500;
}

/* Redline Section */
.doc-redline-section {
  padding-top: 14px; border-top: 1px solid var(--border-light);
}
.doc-redline-selectors {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.doc-redline-select {
  flex: 1; min-width: 150px; padding: 6px 10px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--white); color: var(--text);
  font-family: inherit;
}
.doc-redline-select:focus { border-color: var(--accent, #2563eb); outline: none; }

/* Redline Result */
.doc-redline-result {
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--off-white); overflow: hidden;
}
.doc-redline-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: var(--white);
  border-bottom: 1px solid var(--border-light);
}
.doc-redline-header h4 { margin: 0; font-size: 14px; color: var(--text-bright); }
.doc-redline-count {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: rgba(234,179,8,0.12); color: var(--yellow);
}
.doc-redline-summary {
  padding: 12px 16px; font-size: 13px; color: var(--text-dim); line-height: 1.6;
  border-bottom: 1px solid var(--border-light);
}

.doc-redline-group { padding: 12px 16px; }
.doc-redline-group-header {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.doc-redline-group-header.redline-add { color: var(--green); }
.doc-redline-group-header.redline-del { color: var(--red); }
.doc-redline-group-header.redline-mod { color: var(--yellow); }

.doc-redline-item {
  padding: 8px 10px; margin-bottom: 6px; border-radius: 4px;
  border: 1px solid var(--border-light);
}
.redline-add-item { background: rgba(34,197,94,0.04); }
.redline-del-item { background: rgba(239,68,68,0.04); }
.redline-mod-item { background: rgba(234,179,8,0.04); }

.doc-redline-item-section {
  font-size: 12px; font-weight: 600; color: var(--text-bright);
  display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
}
.doc-redline-item-text {
  font-size: 12px; line-height: 1.5; padding: 4px 8px; border-radius: 3px;
  margin-bottom: 2px; font-family: 'SF Mono', 'Consolas', monospace;
}
.redline-text-add {
  background: rgba(34,197,94,0.08); color: var(--green);
  border-left: 2px solid rgba(34,197,94,0.3);
}
.redline-text-del {
  background: rgba(239,68,68,0.08); color: var(--red);
  text-decoration: line-through; border-left: 2px solid rgba(239,68,68,0.3);
}
.doc-redline-item-note {
  font-size: 11px; color: var(--text-dim); font-style: italic; margin-top: 4px;
}

.doc-redline-analysis {
  padding: 12px 16px; border-top: 1px solid var(--border-light);
}

/* ══════════════════════════════════════════
   MARKET COLOR FEED (Feature 16)
   ══════════════════════════════════════════ */

.market-color-content { display: flex; flex-direction: column; gap: 10px; }

.mc-section {
  background: var(--off-white); border: 1px solid var(--border-light);
  border-radius: var(--radius-sm); padding: 12px; transition: border-color 0.15s;
}
.mc-section:hover { border-color: var(--border); }
.mc-section-title {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent-blue, #4f6ef7); margin-bottom: 10px; display: flex; align-items: center; gap: 6px;
}
.mc-summary-bar {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
}
.mc-stat {
  flex: 1; min-width: 120px; padding: 8px 12px; border-radius: var(--radius-sm);
  background: var(--white); border: 1px solid var(--border-light);
  text-align: center;
}
.mc-stat-value { font-size: 16px; font-weight: 700; color: var(--text-bright); }
.mc-stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }
.mc-stat.bullish .mc-stat-value { color: var(--green); }
.mc-stat.bearish .mc-stat-value { color: var(--red); }
.mc-stat.neutral .mc-stat-value { color: var(--yellow); }

.mc-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mc-table th { text-align: left; padding: 6px 8px; color: var(--text-dim); font-weight: 600; border-bottom: 1px solid var(--border); text-transform: uppercase; font-size: 10px; letter-spacing: 0.3px; }
.mc-table td { padding: 8px; border-bottom: 1px solid var(--border-light); color: var(--text-dim); }
.mc-table tr:hover td { background: var(--off-white); }

.mc-news-item { padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.mc-news-item:last-child { border-bottom: none; }
.mc-news-headline { font-size: 13px; font-weight: 500; color: var(--text-bright); margin-bottom: 2px; }
.mc-news-meta { font-size: 11px; color: var(--text-dim); display: flex; gap: 8px; }
.mc-news-summary { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.5; }

.mc-impact-positive { color: var(--green); }
.mc-impact-negative { color: var(--red); }
.mc-impact-neutral { color: var(--yellow); }

.mc-trend-item { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.mc-trend-arrow { font-size: 14px; }
.mc-trend-name { font-size: 13px; color: var(--text-bright); font-weight: 500; flex: 1; }
.mc-trend-impact { font-size: 12px; color: var(--text-muted); }

/* ══════════════════════════════════════════
   CONFLICT DETECTION (Feature 17)
   ══════════════════════════════════════════ */

.conflicts-content { display: flex; flex-direction: column; gap: 12px; }

.conflict-status-bar {
  display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 8px;
}
.conflict-status-badge {
  display: flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.conflict-status-badge.clear { background: rgba(16,185,129,0.1); color: var(--green); border: 1px solid rgba(16,185,129,0.2); }
.conflict-status-badge.warning { background: rgba(245,158,11,0.1); color: var(--yellow); border: 1px solid rgba(245,158,11,0.2); }
.conflict-status-badge.conflict { background: rgba(239,68,68,0.1); color: var(--red); border: 1px solid rgba(239,68,68,0.2); }

.conflict-item {
  padding: 12px 16px; border-radius: 8px;
  background: var(--off-white); border: 1px solid var(--border-light);
}
.conflict-item.severity-high { border-left: 3px solid var(--red); }
.conflict-item.severity-medium { border-left: 3px solid var(--yellow); }
.conflict-item.severity-low { border-left: 3px solid var(--border); }

.conflict-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.conflict-item-type { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 3px; background: var(--white); color: var(--text-dim); }
.conflict-item-severity { font-size: 10px; font-weight: 700; text-transform: uppercase; padding: 2px 8px; border-radius: 3px; }
.conflict-item-severity.high { background: var(--red-dim); color: var(--red); }
.conflict-item-severity.medium { background: var(--yellow-dim); color: var(--yellow); }
.conflict-item-severity.low { background: var(--white); color: var(--text-dim); }

.conflict-item-desc { font-size: 13px; color: var(--text-dim); line-height: 1.5; }
.conflict-item-deals { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

.conflict-header-indicator {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px;
  padding: 2px 8px; border-radius: 4px; margin-left: 8px; font-weight: 600;
}
.conflict-header-indicator.clear { color: var(--green); }
.conflict-header-indicator.warning { color: var(--yellow); }
.conflict-header-indicator.conflict { color: var(--red); }

/* ══════════════════════════════════════════
   COUNTERPARTY INTELLIGENCE (Feature 7)
   ══════════════════════════════════════════ */

.intel-btn {
  font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 3px;
  background: rgba(79,110,247,0.1); border: 1px solid rgba(79,110,247,0.2);
  color: var(--accent-blue, #4f6ef7); cursor: pointer; transition: all 0.15s;
}
.intel-btn:hover { background: rgba(79,110,247,0.2); border-color: rgba(79,110,247,0.4); }

.intel-modal-content { max-height: 70vh; overflow-y: auto; }
.intel-section { margin-bottom: 16px; }
.intel-section-title {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent-blue); margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid rgba(79,110,247,0.15);
}
.intel-firm-overview { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.intel-kv { font-size: 12px; }
.intel-kv-label { color: var(--text-dim); font-size: 10px; text-transform: uppercase; letter-spacing: 0.3px; }
.intel-kv-value { color: var(--text-bright); font-weight: 500; }

.intel-person { padding: 6px 0; border-bottom: 1px solid var(--border-light); }
.intel-person-name { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.intel-person-title { font-size: 11px; color: var(--text-dim); }
.intel-person-bg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.intel-deal-item { display: flex; gap: 8px; padding: 4px 0; font-size: 12px; border-bottom: 1px solid var(--border-light); }

.intel-flag { padding: 8px; border-radius: 6px; margin-bottom: 6px; }
.intel-flag.severity-high { background: rgba(239,68,68,0.06); border: 1px solid rgba(239,68,68,0.15); }
.intel-flag.severity-medium { background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.15); }
.intel-flag.severity-low { background: var(--off-white); border: 1px solid var(--border-light); }
.intel-flag-type { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--text-dim); }
.intel-flag-desc { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.intel-risk-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 4px;
}
.intel-risk-badge.low { background: rgba(16,185,129,0.1); color: var(--green); }
.intel-risk-badge.medium { background: rgba(245,158,11,0.1); color: var(--yellow); }
.intel-risk-badge.high { background: rgba(239,68,68,0.1); color: var(--red); }

/* ══════════════════════════════════════════
   DEAL PATTERNS (Feature 6)
   ══════════════════════════════════════════ */

.patterns-content { display: flex; flex-direction: column; gap: 12px; }

.pattern-card {
  padding: 12px 16px; border-radius: 8px;
  background: var(--off-white); border: 1px solid var(--border-light);
}
.pattern-card-title { font-size: 13px; font-weight: 600; color: var(--text-bright); margin-bottom: 6px; }
.pattern-card-detail { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.pattern-card-action { font-size: 11px; color: var(--accent-blue); margin-top: 4px; font-weight: 500; }

.pattern-similar-deal { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--border-light); }
.pattern-similarity { font-size: 18px; font-weight: 700; color: var(--accent-blue); min-width: 50px; text-align: center; }
.pattern-deal-name { font-size: 13px; font-weight: 500; color: var(--text-bright); }
.pattern-deal-factors { font-size: 11px; color: var(--text-dim); }

/* ══════════════════════════════════════════
   AGENT MEMORY / INSIGHTS (Feature 26)
   ══════════════════════════════════════════ */

.insights-section { margin-top: 16px; }
.insights-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.insights-title { font-size: 14px; font-weight: 700; color: var(--text-bright); }

.insight-card {
  padding: 10px 14px; border-radius: 6px; margin-bottom: 8px;
  background: rgba(79,110,247,0.04); border: 1px solid rgba(79,110,247,0.1);
  transition: border-color 0.15s;
}
.insight-card:hover { border-color: rgba(79,110,247,0.25); }
.insight-learning { font-size: 13px; color: var(--text-bright); font-weight: 500; line-height: 1.5; }
.insight-relevance { font-size: 11px; color: var(--accent-blue); margin-top: 4px; }
.insight-action { font-size: 11px; color: var(--green); margin-top: 2px; }
.insight-source { font-size: 10px; color: var(--text-dim); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.3px; }

.learn-btn {
  font-size: 11px; font-weight: 600; padding: 4px 12px; border-radius: 4px;
  background: rgba(16,185,129,0.1); border: 1px solid rgba(16,185,129,0.2);
  color: var(--green); cursor: pointer; transition: all 0.15s;
}
.learn-btn:hover { background: rgba(16,185,129,0.2); border-color: rgba(16,185,129,0.4); }

/* ══════════════════════════════════════════════════════
   POST-CLOSE AUTOMATION
   ══════════════════════════════════════════════════════ */

.post-close-checklist {
  margin-top: 16px;
}
.pc-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; border-radius: 8px;
  background: rgba(79,110,247,0.04); border: 1px solid rgba(79,110,247,0.1);
  margin-bottom: 16px;
}
.pc-initiated { font-size: 12px; color: var(--text-dim); }
.pc-progress { font-size: 13px; font-weight: 600; color: var(--accent-blue); }

.pc-items { display: flex; flex-direction: column; gap: 8px; }
.pc-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
  transition: all 0.15s;
}
.pc-item.complete { border-left: 3px solid var(--green); opacity: 0.8; }
.pc-item.in_progress { border-left: 3px solid var(--accent-blue); }
.pc-item.pending { border-left: 3px solid var(--text-dim); }
.pc-item-icon { font-size: 16px; width: 20px; text-align: center; }
.pc-item-label { flex: 1; font-size: 14px; font-weight: 500; color: var(--text-bright); }
.pc-status {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.pc-status.complete { background: rgba(16,185,129,0.1); color: var(--green); }
.pc-status.in-progress { background: rgba(79,110,247,0.1); color: var(--accent-blue); }
.pc-status.pending { background: rgba(148,163,184,0.1); color: var(--text-dim); }
.pc-item-action { margin-left: 8px; }
.pc-item-time { font-size: 10px; color: var(--text-dim); }

.post-close-spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(79,110,247,0.2);
  border-top-color: var(--accent-blue); border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════
   DEAL AUTOPSY
   ══════════════════════════════════════════════════════ */

.autopsy-body { padding: 0 4px; }
.autopsy-section {
  margin-bottom: 14px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.autopsy-section:last-child { border-bottom: none; }
.autopsy-section h4 {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 12px; color: var(--text-bright);
}

.autopsy-metrics-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.autopsy-metric {
  flex: 1; min-width: 100px; padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  text-align: center;
}
.autopsy-metric-val {
  display: block; font-size: 18px; font-weight: 700; color: var(--accent-blue);
}
.autopsy-metric-label {
  display: block; font-size: 11px; color: var(--text-dim); margin-top: 4px;
  text-transform: uppercase; letter-spacing: 0.3px;
}

.autopsy-stages {
  display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px;
}
.autopsy-stage {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 4px; font-size: 12px;
  background: rgba(79,110,247,0.06); border: 1px solid rgba(79,110,247,0.12);
}
.autopsy-stage-name { font-weight: 600; color: var(--text-bright); text-transform: capitalize; }
.autopsy-stage-days { color: var(--accent-blue); font-weight: 500; }

.autopsy-list {
  list-style: none; padding: 0; margin: 0;
}
.autopsy-list li {
  padding: 8px 12px; margin-bottom: 6px; border-radius: 6px;
  font-size: 13px; line-height: 1.5; color: var(--text-bright);
  background: var(--surface); border: 1px solid var(--border);
}
.autopsy-list.green li { border-left: 3px solid var(--green); }
.autopsy-list.red li { border-left: 3px solid var(--red); }

.autopsy-decisions { display: flex; flex-direction: column; gap: 10px; }
.autopsy-decision {
  padding: 12px 16px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--border);
}
.autopsy-decision-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.autopsy-decision-impact {
  font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.3px;
}
.autopsy-decision-impact.positive { background: rgba(16,185,129,0.1); color: var(--green); }
.autopsy-decision-impact.negative { background: rgba(239,68,68,0.1); color: var(--red); }
.autopsy-decision-impact.neutral { background: rgba(148,163,184,0.1); color: var(--text-dim); }
.autopsy-decision-date { font-size: 11px; color: var(--text-dim); }
.autopsy-decision-text { font-size: 13px; color: var(--text-bright); font-weight: 500; }
.autopsy-decision-outcome { font-size: 12px; color: var(--text-dim); margin-top: 4px; font-style: italic; }

/* ══════════════════════════════════════════════════════
   WAR ROOM MODE
   ══════════════════════════════════════════════════════ */

.btn-warroom {
  font-size: 11px; font-weight: 600; padding: 5px 12px; border-radius: 4px;
  background: var(--white); border: 1px solid var(--border);
  color: var(--red); cursor: pointer; transition: all 0.2s;
  letter-spacing: 0.03em;
}
.btn-warroom:hover { background: var(--red-dim); border-color: var(--red); }
.btn-warroom.active {
  background: var(--red); color: #fff; border-color: var(--red);
  animation: warroom-pulse 2s ease-in-out infinite;
}

@keyframes warroom-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
}

.warroom-container {
  display: flex; flex-direction: column; height: 100%;
  border-radius: 10px; overflow: hidden;
  transition: all 0.3s;
}
.warroom-container.warroom-active {
  border: 2px solid var(--red);
  box-shadow: 0 0 20px rgba(239,68,68,0.15), inset 0 0 20px rgba(239,68,68,0.03);
}

.warroom-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.warroom-active .warroom-header {
  background: rgba(239,68,68,0.06);
  border-bottom-color: rgba(239,68,68,0.2);
}
.warroom-header-left { display: flex; align-items: center; gap: 10px; }
.warroom-header-right { display: flex; gap: 8px; }

.warroom-indicator {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--text-dim); display: inline-block;
}
.warroom-indicator.pulsing {
  background: var(--red);
  animation: indicator-pulse 1.5s ease-in-out infinite;
}
@keyframes indicator-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}

.warroom-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 14px; font-weight: 700; color: var(--red);
  min-width: 60px;
}

.btn-warroom-activate {
  font-size: 12px; font-weight: 600; padding: 6px 16px; border-radius: 6px;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  transition: all 0.15s;
}
.btn-warroom-activate:hover { background: #dc2626; transform: scale(1.02); }

.btn-warroom-standdown {
  font-size: 12px; font-weight: 600; padding: 6px 16px; border-radius: 6px;
  background: rgba(148,163,184,0.1); border: 1px solid rgba(148,163,184,0.2);
  color: var(--text-bright); cursor: pointer; transition: all 0.15s;
}
.btn-warroom-standdown:hover { background: rgba(148,163,184,0.2); }

.warroom-summon-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px; flex-wrap: wrap;
  background: rgba(239,68,68,0.03); border-bottom: 1px solid rgba(239,68,68,0.1);
}

.btn-summon {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 4px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.15);
  color: var(--red); cursor: pointer; transition: all 0.15s;
}
.btn-summon:hover { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.3); transform: scale(1.05); }

.warroom-feed {
  flex: 1; overflow-y: auto; padding: 16px;
  min-height: 300px; max-height: 60vh;
}

.warroom-msg {
  display: flex; gap: 10px; margin-bottom: 14px;
  animation: warroom-msg-in 0.3s ease-out;
}
@keyframes warroom-msg-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.warroom-system-msg {
  width: 100%; text-align: center; font-size: 12px;
  color: var(--red); font-weight: 600; padding: 6px 0;
  border-top: 1px dashed rgba(239,68,68,0.2);
  border-bottom: 1px dashed rgba(239,68,68,0.2);
}

.warroom-input-bar {
  display: flex; gap: 8px; padding: 12px 16px;
  background: var(--surface); border-top: 1px solid var(--border);
}
.warroom-active .warroom-input-bar {
  border-top-color: rgba(239,68,68,0.2);
}

#warRoomInput {
  flex: 1; padding: 8px 12px; border-radius: 6px; font-size: 13px;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-bright); resize: none; font-family: inherit;
}
#warRoomInput:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 2px rgba(239,68,68,0.15); }

.btn-warroom-send {
  font-size: 12px; font-weight: 700; padding: 8px 20px; border-radius: 6px;
  background: var(--red); color: #fff; border: none; cursor: pointer;
  text-transform: uppercase; letter-spacing: 0.5px; transition: all 0.15s;
}
.btn-warroom-send:hover { background: #dc2626; }

/* War Room mode body treatment */
body.warroom-mode .dealroom-header {
  border-bottom-color: rgba(239,68,68,0.3);
  box-shadow: 0 2px 8px rgba(239,68,68,0.1);
}
body.warroom-mode .sidebar {
  border-right-color: rgba(239,68,68,0.2);
}
body.warroom-mode .nav-item[data-tab="warroom"] {
  background: rgba(239,68,68,0.15); color: var(--red); font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   PREMIUM POLISH — Global Refinements
   ══════════════════════════════════════════════════════ */

/* Panel headers — tighter alignment, refined typography */
.integration-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: var(--space-3);
}
.integration-header h3,
.specialist-panel > h3:first-child {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* Deal header actions — uniform button sizing */
.dealroom-actions .btn-small,
.dealroom-actions .btn-action,
.dealroom-actions .btn-secondary {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: var(--radius-xs);
  white-space: nowrap;
}

/* Feature cards — consistent white card with subtle elevation */
.sentiment-card,
.scenario-card,
.pred-score-card,
.dash-metric-card,
.dash-intel-section,
.oracle-confidence,
.oracle-benchmark,
.oracle-factor,
.conflict-item,
.pattern-card,
.insight-card,
.pc-item,
.autopsy-metric,
.autopsy-decision,
.autopsy-list li,
.blocker-card,
.blocker-health-bar,
.blocker-resolution,
.pred-risk-item,
.pred-health-item,
.pred-action-item,
.mc-section,
.mc-stat {
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
  transition: all 0.2s var(--ease-out);
}
.sentiment-card:hover,
.scenario-card:hover,
.pattern-card:hover,
.insight-card:hover,
.mc-section:hover,
.blocker-resolution:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}

/* Scenario card body toggle → clean light bg */
.scenario-card-header:hover {
  background: var(--off-white);
}
.scenario-detail-section {
  background: var(--off-white);
  border: 1px solid var(--border-light);
}

/* Score bar tracks — subtle track bg for light theme */
.sentiment-score-bar,
.scenario-comparison-bar {
  background: var(--border-light);
}

/* Dashboard bar chart — visible on light bg */
.dash-stage-bar {
  background: rgba(16,185,129,0.12);
}
.dash-stuck-item,
.dash-deadline-item {
  border-bottom-color: var(--border-light);
}

/* Form inputs in feature panels — consistent with global inputs */
.scenario-form input,
.scenario-form textarea,
.scenario-form select {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
  box-shadow: var(--shadow-xs);
}
.scenario-form input:focus,
.scenario-form textarea:focus,
.scenario-form select:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.1), var(--shadow-sm);
}
.scenario-form label {
  color: var(--text-dim);
}
.scenario-builder {
  background: var(--white);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-xs);
}
.scenario-builder h4 {
  color: var(--text);
}

/* Oracle fair-value bar — refined for light theme */
.oracle-fair-value {
  background: linear-gradient(135deg, rgba(16,185,129,0.06), rgba(79,110,247,0.06));
  border: 1px solid rgba(16,185,129,0.12);
}
.oracle-fv-divider {
  background: var(--border-light);
}
.oracle-section h4 {
  color: var(--text-dim);
}

/* Dashboard intelligence alerts — refined for light bg */
.dash-intel-alert.critical { background: var(--red-dim); border-color: rgba(239,68,68,0.15); color: var(--red); }
.dash-intel-alert.warning { background: var(--yellow-dim); border-color: rgba(245,158,11,0.15); color: var(--yellow); }
.dash-intel-alert.info { background: var(--accent-blue-dim); border-color: rgba(79,110,247,0.12); color: var(--accent-blue); }
.dash-intel-section h3 {
  color: var(--text);
}
.dash-intel-text {
  color: var(--text-dim);
}

/* Table styles for light theme */
.mc-table th {
  border-bottom-color: var(--border);
  color: var(--text-dim);
}
.mc-table td {
  border-bottom-color: var(--border-light);
  color: var(--text);
}
.mc-table tr:hover td {
  background: var(--off-white);
}

/* News and trend items — visible borders */
.mc-news-item,
.mc-trend-item {
  border-bottom-color: var(--border-light);
}

/* Doc intelligence — refined for light theme */
.doc-intel-term {
  border-bottom-color: var(--border-light);
}
.doc-intel-conflicts {
  background: var(--red-dim);
}
.doc-intel-conflict {
  background: var(--white);
  border-color: var(--border-light);
}
.doc-intel-text {
  color: var(--text-dim);
}

/* Doc version control — light theme */
.doc-version-item {
  background: var(--white);
  border-color: var(--border-light);
}
.doc-version-item:hover {
  border-color: var(--border);
}
.doc-version-current {
  border-color: var(--accent-blue);
  background: var(--accent-blue-dim);
}
.doc-version-changes {
  color: var(--text-dim);
}

/* Redline sections */
.doc-redline-result {
  border-color: var(--border);
  background: var(--white);
}
.doc-redline-header {
  background: var(--off-white);
  border-bottom-color: var(--border-light);
}
.doc-redline-summary {
  color: var(--text-dim);
  border-bottom-color: var(--border-light);
}
.redline-text-add {
  background: rgba(16,185,129,0.06);
  color: var(--green);
}
.redline-text-del {
  background: rgba(239,68,68,0.06);
  color: var(--red);
  text-decoration: line-through;
}
.doc-redline-analysis {
  border-top-color: var(--border-light);
}

/* Counterparty & intel styles */
.intel-person {
  border-bottom-color: var(--border-light);
}
.intel-deal-item {
  border-bottom-color: var(--border-light);
}
.pattern-similar-deal {
  border-bottom-color: var(--border-light);
}

/* GSuite — card shadows and refinements */
.gs-status-card {
  box-shadow: var(--shadow-xs);
}
.gs-email-item,
.gs-event-item,
.gs-file-item {
  box-shadow: var(--shadow-xs);
  transition: all 0.15s var(--ease-out);
}

/* War room input — light theme */
#warRoomInput {
  background: var(--white);
  border: 1.5px solid var(--border);
  color: var(--text);
}
#warRoomInput:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(239,68,68,0.1);
}

/* Warroom header/input bar — light surfaces */
.warroom-header,
.warroom-input-bar {
  background: var(--white);
  border-color: var(--border-light);
}

/* Post-close items — proper borders */
.pc-item {
  border-radius: var(--radius-sm);
}

/* Briefing — applied results on light bg */
.briefing-applied-item.success {
  background: var(--green-dim);
  color: var(--green);
}
.briefing-applied-item.error {
  background: var(--red-dim);
  color: var(--red);
}

/* Debrief sentiment — readable on light bg */
.debrief-sentiment.positive { color: var(--green); border-color: rgba(16,185,129,0.2); }
.debrief-sentiment.neutral { color: var(--yellow); border-color: rgba(245,158,11,0.2); }
.debrief-sentiment.negative { color: var(--red); border-color: rgba(239,68,68,0.2); }

/* Client update tone badge — light theme */
.client-update-tone {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
}
.client-update-internal {
  border-top-color: var(--border-light);
  color: var(--text-muted);
}

/* Handoff executive summary — light theme */
.handoff-exec-summary {
  background: var(--accent-blue-dim);
  border-color: rgba(79,110,247,0.12);
  color: var(--text-dim);
}
.handoff-section {
  background: var(--white);
  border-color: var(--border-light);
  box-shadow: var(--shadow-xs);
}
.handoff-snapshot-item .label {
  color: var(--text-muted);
}

/* Sentiment button — refined for light */
.sentiment-btn-score {
  background: var(--off-white);
  border-color: var(--border);
  color: var(--text-dim);
}
.sentiment-btn-score:hover {
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
}

/* Client update preview — light */
.client-update-preview {
  background: var(--off-white);
  border-color: var(--border);
}
.client-update-subject {
  color: var(--text);
  border-bottom-color: var(--border-light);
}
.client-update-body {
  color: var(--text-dim);
}

/* Blocker descriptions — readable */
.blocker-card-title { color: var(--text); }
.blocker-description { color: var(--text-dim); }
.blocker-meta { color: var(--text-muted); }
.blocker-health-label { color: var(--text-dim); }
.blocker-resolution-option { color: var(--text); }
.blocker-resolution-effort { background: var(--off-white); color: var(--text-dim); }
.blocker-resolution-risk { color: var(--text-muted); }

/* Oracle recommendation badges — readable on light */
.oracle-rec.buy { background: var(--green-dim); border-color: rgba(16,185,129,0.15); color: var(--green); }
.oracle-rec.hold { background: var(--yellow-dim); border-color: rgba(245,158,11,0.15); color: var(--yellow); }
.oracle-rec.pass { background: var(--red-dim); border-color: rgba(239,68,68,0.15); color: var(--red); }

/* Spacing refinements */
.dr-panel .specialist-panel {
  max-width: 1200px;
}
.dr-panel .placeholder {
  padding: 24px 0;
  text-align: center;
  font-size: 13px;
}

/* ══════════════════════════════════════════════════════
   CHAT ATTACHMENTS & DRAG-DROP
   ══════════════════════════════════════════════════════ */

.chat-attach-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-dim);
  transition: all 0.15s;
  flex-shrink: 0;
}
.chat-attach-btn:hover {
  background: var(--off-white);
  border-color: var(--navy);
  color: var(--navy);
}

.chat-attach-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 0 8px 0;
  width: 100%;
}

.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  color: var(--text);
  max-width: 220px;
}
.attach-chip-icon { font-size: 12px; flex-shrink: 0; }
.attach-chip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}
.attach-chip-size { color: var(--text-muted); flex-shrink: 0; }
.attach-chip-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 2px;
  flex-shrink: 0;
}
.attach-chip-remove:hover { color: var(--red); }

.chat-dragover {
  background: var(--accent-blue-dim) !important;
  outline: 2px dashed var(--accent-blue);
  outline-offset: -4px;
  border-radius: var(--radius);
}
.chat-dragover::after {
  content: 'Drop files here';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-blue);
  background: rgba(79, 110, 247, 0.04);
  border-radius: var(--radius);
  pointer-events: none;
  z-index: 10;
}
.chat-container,
.specialist-chat {
  position: relative;
}

.panel-dragover {
  outline: 2px dashed var(--accent-blue);
  outline-offset: -4px;
  border-radius: var(--radius);
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.chat-attach-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  color: var(--accent-blue);
  background: var(--accent-blue-dim);
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 500;
}

.chat-input-bar {
  flex-wrap: wrap;
}

/* ── Edit/Delete Deal Modals ── */
.modal-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.25s var(--ease-spring);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--navy);
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}
.modal-close:hover { color: var(--text-bright); }
.modal-card form,
.modal-card .form-group {
  padding: 0 22px;
}
.modal-card form {
  padding-top: 16px;
  padding-bottom: 20px;
}
.modal-card .form-group {
  margin-bottom: 14px;
}
.modal-card .form-group label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 5px;
}
.modal-card .form-group input,
.modal-card .form-group select,
.modal-card .form-group textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--white);
  color: var(--text-bright);
  box-sizing: border-box;
}
.modal-card .form-group input:focus,
.modal-card .form-group select:focus,
.modal-card .form-group textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 2px rgba(13,18,64,0.08);
}
.modal-card .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 22px;
}
.modal-card .form-row .form-group {
  padding: 0;
}
.modal-card .form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 22px;
  margin-top: 6px;
}
.btn-danger {
  background: var(--red);
  color: #fff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger:hover { background: #a93226; }
.btn-danger:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-danger-outline {
  background: none;
  color: var(--red);
  border: 1px solid var(--red);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}
.btn-danger-outline:hover {
  background: var(--red);
  color: #fff;
}

/* Agent thinking indicator */
.agent-thinking .thinking-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.thinking-dots {
  display: flex;
  gap: 4px;
}
.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--navy);
  opacity: 0.4;
  animation: thinkingPulse 1.4s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkingPulse {
  0%, 80%, 100% { opacity: 0.4; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.3); }
}
.thinking-label {
  font-size: 12px;
  color: #888;
  font-style: italic;
}

/* ── Task Cards ── */
.task-card {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--white);
}
.task-card:hover {
  border-color: var(--accent-blue);
  background: var(--off-white);
}
.task-card.status-agent_working {
  border-left: 3px solid var(--accent-blue);
}
.task-card.status-agent_complete {
  border-left: 3px solid #f0ad4e;
}
.task-card.status-approved {
  border-left: 3px solid var(--green);
  opacity: 0.7;
}
.task-card.status-denied {
  border-left: 3px solid var(--red);
}
.task-card.status-locked {
  border-left: 3px solid var(--green);
  opacity: 0.5;
}
.task-status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.task-status-badge.pending { background: rgba(150,150,150,0.15); color: var(--text-muted); }
.task-status-badge.agent_working { background: rgba(59,130,246,0.15); color: var(--accent-blue); }
.task-status-badge.agent_complete { background: rgba(240,173,78,0.15); color: #f0ad4e; }
.task-status-badge.approved { background: rgba(40,167,69,0.15); color: var(--green); }
.task-status-badge.denied { background: rgba(220,53,69,0.15); color: var(--red); }
.task-status-badge.locked { background: rgba(40,167,69,0.15); color: var(--green); }

.task-filter-btn {
  opacity: 0.6;
  transition: opacity 0.15s;
}
.task-filter-btn.active {
  opacity: 1;
  background: var(--navy);
  color: white;
}
.task-plan-section { margin-top: 12px; }
.task-plan-section > strong { display: block; margin-bottom: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.task-plan-row { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: left; padding: 10px 0; border: 0; border-bottom: 1px solid var(--border-light); background: transparent; color: var(--text); cursor: pointer; }
.task-plan-row:hover b { color: var(--accent-blue); }
.task-plan-row span { min-width: 0; }
.task-plan-row b, .task-plan-row small { display: block; }
.task-plan-row b { font-size: 13px; color: var(--text-bright); }
.task-plan-row small { margin-top: 3px; font-size: 12px; color: var(--text-muted); }
.task-plan-row em { font-size: 11px; color: var(--text-muted); font-style: normal; text-transform: capitalize; }
.task-plan-note { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--green-dim); color: var(--green); font-size: 12px; }

/* ── Inbox ── */
.inbox-item {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--white);
}
.inbox-item:hover {
  border-color: var(--accent-blue);
  background: var(--off-white);
}
.inbox-item.unread {
  border-left: 3px solid var(--accent-blue);
  background: rgba(59,130,246,0.03);
}
.inbox-item.action-required {
  border-left: 3px solid #f0ad4e;
}
.inbox-from-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(59,130,246,0.1);
  color: var(--accent-blue);
}
.inbox-action-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  background: rgba(240,173,78,0.15);
  color: #f0ad4e;
}
.inbox-thread-msg {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.inbox-thread-msg.from-agent {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.1);
}
.inbox-thread-msg.from-user {
  background: rgba(40,167,69,0.05);
  border: 1px solid rgba(40,167,69,0.1);
}
.inbox-thread-modal { width: min(900px, calc(100vw - 32px)); max-width: 900px; max-height: min(850px, calc(100vh - 32px)); display: flex; flex-direction: column; overflow: hidden; padding: 0; }
.inbox-thread-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 20px 22px 16px; border-bottom: 1px solid var(--border); }
.inbox-thread-header h3 { margin: 0; font-size: 18px; color: var(--text-bright); }
.inbox-thread-participants { margin-top: 5px; color: var(--text-muted); font-size: 12px; }
.inbox-thread-messages { overflow-y: auto; padding: 18px 22px 8px; }
.inbox-thread-msg { padding: 14px 15px; margin-bottom: 10px; font-size: 13px; line-height: 1.55; }
.inbox-message-meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 12px; color: var(--text-muted); }
.inbox-message-meta strong { color: var(--text-bright); }
.inbox-message-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.inbox-thread-attachments { padding: 0 22px; }
.inbox-thread-attachments h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin: 8px 0; }
.inbox-attachment-grid { display: grid; gap: 8px; }
.inbox-attachment { width: 100%; display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 11px; text-align: left; background: var(--off-white); border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; color: var(--text); }
.inbox-attachment:hover { border-color: var(--accent-blue); background: rgba(59,130,246,.04); }
.inbox-attachment-icon { color: var(--accent-blue); font-size: 20px; line-height: 1; }
.inbox-attachment strong, .inbox-attachment small, .inbox-attachment em { display: block; }
.inbox-attachment strong { font-size: 13px; color: var(--text-bright); }
.inbox-attachment small { margin-top: 2px; color: var(--text-muted); font-size: 11px; text-transform: capitalize; }
.inbox-attachment em { margin-top: 5px; color: var(--text-dim); font-style: normal; font-size: 12px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.inbox-attachment b { color: var(--accent-blue); font-size: 12px; font-weight: 600; }
.inbox-compose { border-top: 1px solid var(--border); margin-top: 12px; padding: 14px 22px 20px; }
.inbox-compose textarea { width: 100%; min-height: 78px; resize: vertical; padding: 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; font-size: 13px; }
.inbox-compose-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 8px; }
.inbox-compose-actions label { color: var(--text-muted); font-size: 12px; }
.inbox-compose-actions select { margin-left: 6px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 5px; background: var(--white); color: var(--text); }
@media (max-width: 600px) { .inbox-thread-header, .inbox-thread-messages, .inbox-thread-attachments, .inbox-compose { padding-left: 14px; padding-right: 14px; } .inbox-compose-actions { align-items: flex-end; } .inbox-compose-actions label { display: grid; gap: 5px; } .inbox-compose-actions select { margin-left: 0; } }

/* ── Task Detail Modal ── */
.task-output-content {
  background: var(--off-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
}
.task-collab-msg {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  line-height: 1.5;
}
.task-collab-msg.from-agent {
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.1);
}
.task-collab-msg.from-user {
  background: rgba(40,167,69,0.05);
  border: 1px solid rgba(40,167,69,0.1);
  margin-left: 20px;
}
@keyframes taskPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}
.task-working-indicator {
  animation: taskPulse 2s ease-in-out infinite;
}

/* ══ Work Products ══ */
.wp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.wp-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.wp-card:hover {
  border-color: var(--accent);
}
.wp-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.3;
}
.wp-card-meta {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wp-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.wp-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(59,130,246,0.1);
  color: var(--accent);
}
.wp-badge.vdr-int {
  background: rgba(40,167,69,0.1);
  color: var(--green);
}
.wp-badge.vdr-ext {
  background: rgba(249,115,22,0.1);
  color: var(--yellow);
}
.wp-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.wp-card-actions .btn-small {
  font-size: 11px;
  padding: 3px 8px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE DESIGN — Full Breakpoint System
   ═══════════════════════════════════════════════ */

/* ── Large Desktops / Monitors (1440px+) ── */
@media (min-width: 1440px) {
  :root { --sidebar-width: 210px; }
  .overview-grid { grid-template-columns: repeat(4, 1fr); }
  .dr-card-grid { grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); }
  .pillar-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
}

/* ── Standard Desktop (1025px – 1439px) — default styles, no changes needed ── */

/* ── Tablet / Small Desktop (769px – 1024px) ── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 180px; }
  .sidebar-toggle { display: flex; }
  .sidebar-close-btn { display: block; }
  .sidebar {
    transform: translateX(-100%);
    width: 240px;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0 !important;
    padding-top: 50px;
  }
  .overview-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .investors-layout { grid-template-columns: 1fr; }
  .compact-chat { height: 300px; }
  .dr-card-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
  .pillar-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
  .analytics-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .ac-layout { height: calc(100vh - 250px); }
  .dash-intel-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Mobile / Small Tablet (max-width: 768px) ── */
@media (max-width: 768px) {
  .sidebar-toggle { display: flex; top: 8px; left: 8px; width: 36px; height: 36px; }
  .sidebar-close-btn { display: block; }
  .sidebar {
    transform: translateX(-100%);
    width: 280px;
    box-shadow: 4px 0 24px rgba(13, 18, 64, 0.15);
  }
  .sidebar.sidebar-open { transform: translateX(0); }
  .main-content {
    margin-left: 0 !important;
    padding-top: 52px;
  }

  /* Pipeline header: stack title above controls */
  .pipeline-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: var(--space-4) var(--space-4) var(--space-3);
  }
  .pipeline-header h2 { font-size: 18px; width: 100%; }
  .pipeline-controls { width: 100%; flex-wrap: wrap; }
  .pipeline-search { width: 100%; flex: 1 1 100%; order: -1; margin-bottom: 6px; }

  /* Pipeline stats — scale down for mobile */
  .pipeline-stats { gap: 8px; padding: 0 var(--space-4) var(--space-3); }
  .pipeline-stat { min-width: 0; padding: 10px 14px; }
  .pipeline-stat-value { font-size: 22px; }
  .pipeline-stat-label { font-size: 10px; }

  /* Stage filter pills */
  .deal-stage-filters { gap: 4px; padding: 0 var(--space-4) var(--space-3); }

  /* Deal cards */
  .deal-cards-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 0 var(--space-4) var(--space-4);
  }

  /* Deal card — disable hover lift on touch */
  .deal-card:hover { transform: none; }
  .deal-card:active { transform: scale(0.99); }

  .overview-grid { grid-template-columns: 1fr 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group.full { grid-column: 1; }
  .investors-layout { grid-template-columns: 1fr; }
  .compact-chat { height: 280px; }
  .vdr-browser { grid-template-columns: 1fr; }
  .vdr-tree { max-height: 240px; overflow: auto; }
  .vdr-file-row { align-items: flex-start; flex-direction: column; gap: 6px; }
  .vdr-file-actions { width: 100%; }
  .ac-layout { flex-direction: column; height: auto; min-height: unset; }
  .ac-channels { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid var(--border); max-height: 200px; overflow-y: auto; }
  .ac-thread { min-height: 400px; }
  .dr-card-grid { grid-template-columns: 1fr 1fr; }
  .pillar-grid { grid-template-columns: 1fr 1fr; }
  .dash-intel-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-intel-body { grid-template-columns: 1fr; }
  .scenario-detail-grid { grid-template-columns: 1fr; }
  .docs-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .notif-dropdown { width: calc(100vw - 20px); right: 10px; }
  .modal-box { width: 95vw; max-width: 95vw; margin: 10px; }
  .erp-header-row { flex-direction: column; gap: 8px; }

  /* Deal room header — stack on mobile */
  .dealroom-header {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px var(--space-4);
    position: sticky;
    top: 0;
    z-index: 10;
  }
  .dealroom-header h2 { font-size: 16px; width: 100%; }
  .dealroom-title { width: 100%; }
  .dealroom-meta { flex-wrap: wrap; gap: 4px; }
  .dealroom-actions {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 2px;
  }
  .dealroom-actions::-webkit-scrollbar { display: none; }
  .dealroom-actions .btn-primary,
  .dealroom-actions .btn-secondary,
  .dealroom-actions .btn-small,
  .dealroom-actions .btn-action,
  .dealroom-actions .btn-danger { white-space: nowrap; flex-shrink: 0; }

  /* Re-entry briefing */
  .reentry-head h2 { font-size: 18px; }

  /* Unified / specialist panels on mobile */
  .unified-panel { height: auto; min-height: calc(100vh - 140px); }
  .specialist-chat { height: 50vh; min-height: 300px; }

  /* Disable hover lift on cards for touch */
  .deal-card:hover, .card:hover, .work-product-card:hover, .dashboard-card:hover,
  .overview-card:hover { transform: none; }

  /* Touch-friendly button sizes */
  .btn-primary, .btn-secondary, .btn-small, .btn-action,
  .btn-accent, .btn-danger, .btn-danger-outline {
    min-height: 40px;
    padding: 8px 16px;
  }

  /* Tables — horizontal scroll wrapper */
  .chat-text table, .agent-output table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}

/* ── Small Mobile (max-width: 480px) ── */
@media (max-width: 480px) {
  body { font-size: 13px; }
  .sidebar-toggle { top: 6px; left: 6px; width: 36px; height: 36px; }
  .main-content { padding-top: 48px; }

  /* Pipeline */
  .pipeline-header { padding: var(--space-3) var(--space-3) var(--space-2); }
  .pipeline-header h2 { font-size: 17px; }
  .pipeline-controls .btn-secondary,
  .pipeline-controls .btn-primary { font-size: 12px; padding: 6px 12px; min-height: 36px; }
  .pipeline-stats { padding: 0 var(--space-3) var(--space-3); gap: 6px; }
  .pipeline-stat { padding: 8px 10px; min-width: 0; flex: 1 1 0; }
  .pipeline-stat-value { font-size: 20px; }
  .pipeline-stat-label { font-size: 9px; letter-spacing: 0.04em; white-space: nowrap; }
  .deal-cards-grid { grid-template-columns: 1fr; gap: 10px; padding: 0 var(--space-3) var(--space-4); }
  .deal-stage-filters { padding: 0 var(--space-3) var(--space-2); overflow-x: auto; flex-wrap: nowrap; }
  .stage-pill { padding: 5px 12px; font-size: 11px; }

  /* Deal card compact */
  .deal-card-header { padding: 12px 14px 0; gap: 10px; }
  .deal-card-avatar { width: 42px; height: 42px; font-size: 14px; border-radius: 8px; }
  .deal-card-name { font-size: 14px; }
  .deal-card-body { padding: 10px 14px; }
  .deal-card-row { padding: 4px 0; }
  .deal-card-label { font-size: 10px; }
  .deal-card-value { font-size: 12px; }
  .deal-card-footer { padding: 8px 14px; }

  /* Deal room */
  .dealroom-header { padding: 8px var(--space-3); }
  .dealroom-header h2 { font-size: 15px; }
  .deal-type-badge, .stage-badge { font-size: 9px; padding: 3px 8px; }
  .dealroom-actions .btn-primary,
  .dealroom-actions .btn-secondary,
  .dealroom-actions .btn-small,
  .dealroom-actions .btn-action { font-size: 11px; padding: 5px 10px; min-height: 32px; }

  /* Overview & panels */
  .overview-grid { grid-template-columns: 1fr; }
  .overview-card { padding: 14px; }
  .overview-card h3 { font-size: 10px; margin-bottom: 8px; }
  .dr-card-grid { grid-template-columns: 1fr; }
  .pillar-grid { grid-template-columns: 1fr; }

  /* Re-entry briefing */
  .reentry-briefing { padding: var(--space-4); }
  .reentry-head h2 { font-size: 16px; }
  .reentry-head p { font-size: 12px; }
  .reentry-counts span { font-size: 11px; padding: 4px 8px; }
  .reentry-grid { gap: var(--space-3); }
  .reentry-grid h3 { font-size: 12px; }
  .reentry-grid ul { font-size: 12px; padding-left: 14px; }

  /* Agent activity feed */
  .agent-activity-feed { padding: 12px var(--space-4); }
  .feed-head h3 { font-size: 14px; }
  .agent-activity-feed li { padding: 8px var(--space-1); font-size: 12px; }
  .feed-time { width: 60px; font-size: 11px; }
  .agent-activity-feed small { margin-left: 64px; font-size: 11px; }

  /* Docs, intel, analytics */
  .docs-grid { grid-template-columns: 1fr; }
  .dash-intel-grid { grid-template-columns: 1fr; }
  .analytics-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }

  /* Chat */
  .ac-channels { max-height: 150px; }
  .ac-thread { min-height: 300px; }
  .ac-msg { max-width: 95%; }
  .chat-body { max-width: 95%; }
  .compact-chat { height: 250px; }
  .chat-container { height: calc(100vh - 180px); }

  /* Modals full-screen on small mobile */
  .modal-box { width: 100vw; max-width: 100vw; margin: 0; border-radius: 12px 12px 0 0; }
  .toast { right: 10px; left: 10px; bottom: 10px; max-width: none; }

  /* ERP tabs scroll */
  .erp-tabs { overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
  .erp-tabs::-webkit-scrollbar { display: none; }
  .erp-tab { padding: 6px 12px; font-size: 12px; }
  .wp-card { padding: 10px; }

  /* Specialist / unified panels */
  .specialist-chat { height: 45vh; min-height: 260px; }
  .unified-panel { height: auto; }
  .specialist-panel h3 { font-size: 14px; }
  .integration-actions { gap: var(--space-1); }
  .integration-actions .btn-action,
  .integration-actions .btn-secondary { font-size: 11px; padding: 5px 10px; }

  /* Login mobile polish */
  #view-login .login-container { padding: 28px 18px; }
  .login-brand-lockup { margin-bottom: 20px; }
  .login-brand-lockup .login-logo { width: min(100%, 260px); }
}

/* ── Fluid scaling for all intermediate sizes ── */
@media (max-width: 1024px) {
  .dr-panel { padding: 16px; }
  .view-container, .section { padding: 16px; }
}
@media (max-width: 768px) {
  .dr-panel { padding: 14px; }
  .view-container, .section { padding: 14px; }
}
@media (max-width: 480px) {
  .dr-panel { padding: 10px; }
  .view-container, .section { padding: 10px; }
}

/* ── Touch device optimizations ── */
@media (hover: none) and (pointer: coarse) {
  .deal-card:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--border); }
  .deal-card:active { transform: scale(0.98); }
  .overview-card:hover, .card:hover, .work-product-card:hover, .dashboard-card:hover { transform: none; }
  button:not(:disabled):hover, .btn-primary:not(:disabled):hover,
  .btn-secondary:not(:disabled):hover, .btn-small:not(:disabled):hover { transform: none; }
  .btn-primary:not(:disabled):active, .btn-secondary:not(:disabled):active,
  .btn-small:not(:disabled):active { transform: scale(0.97); }
  .stage-pill:hover { background: var(--white); border-color: var(--border); color: var(--text-dim); }
  .stage-pill:active { background: rgba(79,110,247,0.05); border-color: var(--accent-blue); }
  .stage-pill.active:hover { background: var(--navy); color: #fff; }
}
/* ═══ Re-entry Briefing ═══ */
.reentry-briefing {
  margin: 0 0 var(--space-4);
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.reentry-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  align-items: flex-start;
}
.reentry-head h2 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.reentry-head p { margin: 5px 0 0; color: var(--text-dim); font-size: 13px; }
.reentry-counts, .reentry-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.reentry-actions { margin-top: var(--space-3); }
.reentry-counts span {
  padding: 5px 10px;
  background: var(--accent-blue-dim);
  color: var(--accent-blue);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 600;
}
.reentry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-4);
}
.reentry-grid section {
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-3);
}
.reentry-grid h3 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.reentry-grid ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.7; }
.reentry-grid li .btn-small { margin-left: 4px; padding: 2px 6px; font-size: 10px; }
.reentry-grid em { color: var(--text-muted); }
@media (max-width: 900px) {
  .reentry-grid { grid-template-columns: 1fr; }
  .reentry-head { flex-direction: column; }
}
 .vdr-agent-review{padding:12px 16px;border-top:1px solid var(--border);background:var(--bg-card);font-size:12px}.vdr-agent-review>div{display:flex;gap:8px;margin-top:8px}.vdr-agent-review textarea{flex:1;resize:vertical;min-height:44px;background:var(--bg-secondary);border:1px solid var(--border);border-radius:5px;color:var(--text);padding:7px}.vdr-agent-review #vdrAgentAnswer{display:block;white-space:pre-wrap;color:var(--text);max-height:180px;overflow:auto}
/* ═══ Agent Activity Feed ═══ */
.agent-activity-feed {
  margin: 0 0 var(--space-4);
  padding: 16px var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-xs);
}
.feed-head {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  align-items: center;
}
.feed-head h3 { margin: 0; font-size: 16px; }
.feed-head span { font-size: 12px; color: var(--text-dim); }
.agent-activity-feed ul {
  max-height: 340px;
  overflow: auto;
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}
.agent-activity-feed li {
  padding: 10px var(--space-2);
  border-top: 1px solid var(--border-light);
  font-size: 13px;
  transition: background 0.15s;
}
.agent-activity-feed li:hover {
  background: rgba(79, 110, 247, 0.02);
}
.agent-activity-feed li.feed-new {
  border-left: 3px solid var(--accent-blue);
  background: var(--accent-blue-dim);
}
.agent-activity-feed small {
  display: block;
  color: var(--text-dim);
  margin: 3px 0 0 88px;
  font-size: 12px;
}
.feed-time {
  display: inline-block;
  width: 84px;
  color: var(--text-muted);
  font-size: 12px;
}

/* Full-screen Equiturn OS sign-in experience */
#view-login.active {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  overflow-y: auto;
  background: var(--off-white);
}

#view-login .login-container {
  width: min(100%, 460px);
  max-width: 460px;
  margin: 0;
  padding: 40px 36px;
}

@media (max-width: 560px) {
  #view-login.active {
    padding: 16px;
    align-items: flex-start;
    padding-top: max(40px, 8vh);
  }

  #view-login .login-container {
    padding: 28px 20px;
    width: 100%;
    max-width: 100%;
  }

  #view-login .auth-tabs { font-size: 12px; gap: 0; }
  #view-login .auth-tab { padding: 10px 14px; }
  #view-login .form-label { font-size: 11px; }
  #view-login input[type="email"],
  #view-login input[type="password"],
  #view-login input[type="text"] { font-size: 16px; min-height: 44px; }
  #view-login .btn-primary { min-height: 46px; font-size: 14px; }
}

/* Equiturn OS logo treatment — interface only */
.sidebar-brand .brand-lockup {
  display: block;
  width: 100%;
}

.sidebar-brand .brand-lockup img {
  display: block;
  width: 148px;
  height: auto;
  max-width: 100%;
  opacity: 1;
  filter: invert(1) brightness(1.6);
  mix-blend-mode: screen;
}

.login-brand-lockup .login-logo {
  display: block;
  width: min(100%, 330px);
  height: auto;
  margin: 0 auto;
  filter: none !important;
  opacity: 1 !important;
}

.login-brand-lockup {
  margin-bottom: 26px;
}

/* ═══ Empty State Component ═══ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-state-icon {
  font-size: 36px;
  margin-bottom: var(--space-3);
  opacity: 0.4;
  line-height: 1;
}
.empty-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: var(--space-1);
}
.empty-state-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 320px;
  line-height: 1.5;
}

/* ═══ Scroll snap for horizontal pill filters (mobile) ═══ */
@media (max-width: 768px) {
  .deal-stage-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  }
  .deal-stage-filters::-webkit-scrollbar { display: none; }
  .stage-pill { scroll-snap-align: start; flex-shrink: 0; }
}

/* ═══ Equiturn OS — Modern Interface System (screen UI only) ═══ */
@media screen {
  :root {
    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --shadow-xs: 0 1px 2px rgba(13,18,64,.04);
    --shadow-sm: 0 2px 8px rgba(13,18,64,.05), 0 1px 2px rgba(13,18,64,.02);
    --shadow: 0 4px 16px rgba(13,18,64,.07), 0 2px 4px rgba(13,18,64,.03);
    --shadow-md: 0 8px 28px rgba(13,18,64,.09), 0 3px 8px rgba(13,18,64,.04);
    --shadow-hover: 0 12px 32px rgba(13,18,64,.11), 0 4px 12px rgba(13,18,64,.05);
  }

  button,
  .btn-primary, .btn-secondary, .btn-small, .btn-action,
  .btn-accent, .btn-danger, .btn-danger-outline, .btn-warroom {
    min-height: 36px;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .005em;
    transition: transform .18s var(--ease-out), box-shadow .18s var(--ease-out),
      background .18s var(--ease-out), border-color .18s var(--ease-out);
  }

  .btn-primary, .btn-accent {
    background: linear-gradient(135deg, #171d58 0%, #0d1240 100%);
    box-shadow: 0 2px 8px rgba(13,18,64,.18), inset 0 1px 0 rgba(255,255,255,.10);
  }

  .btn-secondary, .btn-small, .btn-action, .btn-danger-outline {
    background: rgba(255,255,255,.95);
    border-color: var(--border);
    box-shadow: 0 1px 3px rgba(13,18,64,.03);
  }

  button:not(:disabled):hover,
  .btn-primary:not(:disabled):hover, .btn-secondary:not(:disabled):hover,
  .btn-small:not(:disabled):hover, .btn-action:not(:disabled):hover,
  .btn-accent:not(:disabled):hover, .btn-danger:not(:disabled):hover,
  .btn-danger-outline:not(:disabled):hover, .btn-warroom:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(13,18,64,.10);
  }

  button:not(:disabled):active,
  .btn-primary:not(:disabled):active, .btn-secondary:not(:disabled):active,
  .btn-small:not(:disabled):active, .btn-action:not(:disabled):active {
    transform: translateY(0) scale(0.98);
    box-shadow: inset 0 1px 3px rgba(13,18,64,.08);
  }

  input[type="text"], input[type="email"], input[type="password"],
  input[type="search"], input[type="number"], input[type="date"],
  textarea, select {
    min-height: 40px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    background: var(--white);
    box-shadow: inset 0 1px 2px rgba(13,18,64,.02);
    transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
  }

  textarea { min-height: 88px; }

  input:focus, textarea:focus, select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(79,110,247,.10), 0 2px 8px rgba(13,18,64,.04);
  }

  .deal-card, .card, .panel, .agent-output-content,
  .modal, .modal-card, .modal-box, .work-product-card,
  .docs-upload-zone, .dashboard-card {
    border-color: var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
  }

  .deal-card, .card, .panel, .work-product-card, .dashboard-card {
    background: var(--white);
  }

  .deal-card:hover, .card:hover, .work-product-card:hover, .dashboard-card:hover {
    transform: translateY(-2px);
    border-color: rgba(79, 110, 247, 0.25);
    box-shadow: var(--shadow-hover);
  }

  .chat-container {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
  }

  .chat-messages {
    padding: 18px var(--space-5);
    background: linear-gradient(180deg, rgba(247,248,253,.5), #ffffff 30%);
  }

  .chat-msg {
    margin: 0 0 var(--space-3);
    padding: 10px 12px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
  }

  .chat-msg:hover {
    background: rgba(79,110,247,.035);
    border-color: rgba(79,110,247,.08);
  }

  .chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 6px rgba(13,18,64,.10);
  }

  .chat-input-bar {
    gap: 10px;
    padding: 14px;
    border-top: 1px solid var(--border-light);
    background: rgba(248,249,253,.85);
  }

  .chat-input-bar textarea {
    min-height: 44px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: #fff;
  }

  .modal-overlay {
    backdrop-filter: blur(10px);
    background: rgba(8,12,40,.30);
  }

  .modal, .modal-card, .modal-box {
    box-shadow: 0 20px 50px rgba(8,12,40,.20);
    border-radius: var(--radius);
  }

  .agent-output-content {
    padding: 18px;
    background: #fff;
  }
}
/* Per-user Google / Microsoft account connections */
.connected-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border, #e1e5f0); }
.connected-accounts h4 { margin: 0; color: #16214a; font-size: 15px; }
.connected-accounts p { margin: 5px 0 12px; color: #67728f; font-size: 12px; line-height: 1.45; }
.connected-accounts-list { display: grid; gap: 9px; }
.connection-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px; background: #f8faff; border: 1px solid #e1e7f5; border-radius: 12px; }
.connection-card-copy { display: grid; gap: 3px; min-width: 0; }
.connection-card-copy strong { color: #1a2753; font-size: 13px; }
.connection-status { color: #75809a; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 290px; }
.connection-status.is-connected { color: #12744d; }
.connection-card-actions button { white-space: nowrap; }
.connection-loading, .connection-error { margin: 0; padding: 10px 0; color: #75809a; font-size: 12px; }
.connection-error { color: #ae3a38; }
/* ═══ Centered specialist workspaces ═══
   Keep short-form deal tools deliberate and dense; only chat workspaces may fill a viewport. */
@media (min-width: 1025px) {
  .dr-panel > .specialist-panel:not(.unified-panel) {
    width: min(100%, 1240px);
    max-width: 1240px;
    min-height: 0;
    height: auto;
    margin: 0 auto;
    padding: 24px;
  }
}
.dr-panel > .specialist-panel:not(.unified-panel) {
  box-sizing: border-box;
}
.dr-panel > .specialist-panel:not(.unified-panel) .integration-header {
  gap: 16px;
  align-items: center;
}
.dr-panel > .specialist-panel:not(.unified-panel) .integration-header > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.dr-panel > .specialist-panel:not(.unified-panel) .conflicts-content {
  min-height: 0;
}

/* Collaborative documents read as a polished selection surface, not a stretched button wall. */
.dr-panel .collab-grid {
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 14px;
  margin: 18px 0 2px;
}
.dr-panel .collab-btn {
  min-height: 112px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid #dbe2f3;
  border-radius: 13px;
  background: linear-gradient(145deg, #ffffff, #f7f9ff);
  box-shadow: 0 4px 12px rgba(19,30,64,.055);
  color: #1b294e;
}
.dr-panel .collab-btn:hover {
  transform: translateY(-2px);
  border-color: #aebcf7;
  box-shadow: 0 12px 25px rgba(48,69,150,.12);
}
.dr-panel .collab-btn strong { font-size: 15px; }
.dr-panel .collab-btn span { color: #697795; opacity: 1 !important; }
.dr-panel .collab-btn.accent {
  background: linear-gradient(145deg, #eff2ff, #e5eaff);
  border-color: #cbd5ff;
  color: #344fce;
}
@media (max-width: 640px) {
  .dr-panel > .specialist-panel:not(.unified-panel) { padding: 16px; }
  .dr-panel > .specialist-panel:not(.unified-panel) .integration-header { align-items: flex-start; flex-direction: column; }
  .dr-panel > .specialist-panel:not(.unified-panel) .integration-header > div { justify-content: flex-start; }
  .dr-panel .collab-grid { grid-template-columns: 1fr; }
}

/* Profile picture crop editor */
.avatar-crop-overlay { align-items: center; justify-content: center; padding: 20px; }
.avatar-crop-card { width: min(100%, 560px); padding: 24px; border: 1px solid #e1e7f3; border-radius: 22px; background: #fff; box-shadow: 0 25px 70px rgba(15, 29, 75, .24); }
.avatar-crop-card .modal-header { padding: 0 0 18px; border-bottom: 0; }
.avatar-crop-card .modal-header h3 { margin: 0; color: #14214b; font-size: 21px; }
.avatar-crop-card .modal-header p { margin: 6px 0 0; color: #6c7895; font-size: 14px; }
.avatar-crop-stage { width: min(100%, 420px); aspect-ratio: 1; margin: 0 auto; overflow: hidden; cursor: grab; border-radius: 50%; background: #edf1fb; box-shadow: inset 0 0 0 3px #fff, 0 10px 30px rgba(35, 53, 111, .16); touch-action: none; }
.avatar-crop-stage:active { cursor: grabbing; }
.avatar-crop-stage canvas { display: block; width: 100%; height: 100%; }
.avatar-crop-zoom { display: flex; align-items: center; gap: 14px; max-width: 420px; margin: 22px auto 0; color: #24345e; font-weight: 700; font-size: 13px; }
.avatar-crop-zoom input { flex: 1; accent-color: #233979; }
.avatar-crop-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
@media (max-width: 540px) { .avatar-crop-card { padding: 18px; border-radius: 18px; } .avatar-crop-actions { flex-direction: column-reverse; } .avatar-crop-actions button { width: 100%; } }

/* ═══ Deal-room consistency system ═══
   All deal tabs share a controlled workspace width. Chat tabs retain their tools,
   but no longer create an unhelpful blank full-height canvas before work begins. */
@media (min-width: 1025px) {
  .dr-panel {
    width: min(100%, 1440px);
    margin: 0 auto;
    padding: 22px 24px 32px;
  }
  .dr-panel > .specialist-panel.unified-panel {
    width: 100%;
    max-width: none;
    height: min(720px, calc(100vh - 190px));
    min-height: 520px;
    margin: 0;
    padding: 22px;
  }
}
.dr-panel > .specialist-panel.unified-panel {
  box-sizing: border-box;
  overflow: hidden;
}
.unified-panel .unified-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 0;
  border-bottom: 1px solid #e8ecf5;
}
.unified-panel .unified-panel-header h3 {
  margin: 0;
  font-size: 19px;
  letter-spacing: -.025em;
}
.unified-panel .generation-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}
.unified-panel .specialist-chat {
  height: auto;
  min-height: 0;
  flex: 1;
}
.unified-panel .chat-messages:empty {
  display: grid;
  place-items: center;
  min-height: 250px;
  margin: 18px 0;
  padding: 28px;
  border: 1px dashed #d4dced;
  border-radius: 12px;
  background: linear-gradient(145deg, #fbfcff, #f5f7fd);
}
.unified-panel .chat-messages:empty::after {
  content: 'Your specialist team is ready. Choose an analysis above or ask a deal-specific question below.';
  max-width: 440px;
  color: #71809d;
  font-size: 14px;
  line-height: 1.55;
  text-align: center;
}
.unified-panel .chat-input-bar {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #e8ecf5;
}
@media (max-width: 1024px) {
  .dr-panel > .specialist-panel.unified-panel { height: auto; min-height: 520px; padding: 18px; }
}
@media (max-width: 640px) {
  .dr-panel { padding: 12px; }
  .unified-panel .unified-panel-header { align-items: flex-start; flex-direction: column; }
  .unified-panel .generation-actions { justify-content: flex-start; }
  .unified-panel .chat-messages:empty { min-height: 190px; padding: 20px; }
}
