@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --ink: #172836;
  --muted: #60707d;
  --subtle: #8a98a3;
  --line: #d9e1e7;
  --line-soft: #e9eef2;
  --bg: #f5f7f9;
  --surface: #ffffff;
  --surface-alt: #eef4f8;
  --cpp-blue: #0072bc;
  --cpp-blue-dark: #005d9b;
  --teal: #0f9f9c;
  --green: #4a9d56;
  --amber: #c78328;
  --red: #c85450;
  --violet: #7e6db2;
  --shadow: 0 16px 44px rgba(39, 55, 70, 0.08);
  --radius: 8px;
  font-family:
    Avenir, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfd;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 2px 4px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.brand img {
  width: 172px;
  height: auto;
  display: block;
}

.nav-list {
  display: grid;
  gap: 5px;
}

.nav-item,
.project-button,
.primary-button,
.ghost-button,
.icon-button,
.segmented button,
.prompt-chip,
.citation-chip,
.source-link {
  border: 0;
  border-radius: var(--radius);
}

.nav-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  text-align: left;
}

.nav-item svg,
.primary-button svg,
.ghost-button svg,
.icon-button svg,
.source-icon svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item.active {
  background: #e8f2fa;
  color: var(--cpp-blue);
  font-weight: 700;
}

.nav-section {
  scroll-margin-top: 24px;
}

.nav-section:focus {
  outline: 2px solid rgba(0, 114, 188, 0.22);
  outline-offset: 3px;
}

.section-kicker {
  color: var(--cpp-blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.project-switcher,
.sidebar-panel {
  display: grid;
  gap: 12px;
}

.project-buttons {
  display: grid;
  gap: 10px;
}

.project-button {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
}

.project-button.active {
  border-color: rgba(0, 114, 188, 0.55);
  background: #f0f8fd;
  box-shadow: inset 3px 0 0 var(--cpp-blue);
}

.project-button strong {
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.project-button span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.mini-progress {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4eb;
}

.mini-progress i {
  display: block;
  height: 100%;
  width: var(--progress);
  border-radius: inherit;
  background: var(--cpp-blue);
}

.sidebar-panel {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.coverage-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.coverage-row strong {
  color: var(--ink);
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 14px;
  line-height: 1.3;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  color: var(--ink);
  background: var(--surface);
}

.icon-button {
  width: 38px;
  border: 1px solid var(--line);
}

.primary-button {
  padding: 0 15px;
  color: #fff;
  background: var(--cpp-blue);
  font-weight: 800;
}

.primary-button:hover {
  background: var(--cpp-blue-dark);
}

.ghost-button {
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.project-hero {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(420px, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.project-summary,
.panel,
.agent-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  min-width: 0;
}

.project-summary {
  display: grid;
  align-content: space-between;
  min-height: 188px;
  padding: 20px;
}

.status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.status-line span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.status-pill,
.live-dot,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill {
  color: #0c5c38;
  background: #e6f4ec;
}

#projectThesis {
  max-width: 760px;
  margin: 18px 0;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.team-stack {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--avatar-bg);
  font-size: 12px;
  font-weight: 900;
}

.team-name {
  color: var(--muted);
  font-size: 13px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  font-size: 27px;
  line-height: 1;
}

.metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.main-column {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.panel,
.agent-panel {
  min-width: 0;
  padding: 18px;
}

.panel-header,
.agent-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header.compact {
  margin-bottom: 12px;
}

.segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7fafc;
}

.segmented button {
  min-height: 30px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  font-weight: 800;
}

.segmented button.active {
  color: var(--cpp-blue);
  background: #fff;
  box-shadow: 0 1px 7px rgba(38, 52, 67, 0.1);
}

.roadmap {
  display: grid;
  grid-template-columns: repeat(4, minmax(158px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.lane {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 158px;
}

.lane-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--lane-color);
  border-radius: var(--radius);
  color: var(--lane-color);
  background: var(--lane-bg);
  font-size: 13px;
  font-weight: 900;
}

.lane-title-main {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.lane-stage-icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  color: var(--lane-color);
  background: transparent;
  box-shadow: none;
}

.lane-stage-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.lane-count {
  font-family: var(--font-display);
  font-weight: 900;
}

.task-card {
  display: grid;
  gap: 10px;
  min-height: 146px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.task-card p,
.source-meta,
.insight-body,
.chat-message p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.task-footer,
.source-footer,
.insight-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.tag {
  color: var(--tag-color);
  background: var(--tag-bg);
}

.two-up {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  gap: 16px;
}

.readout-list,
.source-list {
  display: grid;
  gap: 10px;
}

.insight-item {
  display: grid;
  gap: 8px;
  padding: 13px 0;
  border-top: 1px solid var(--line-soft);
}

.insight-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.insight-item h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.severity-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--severity);
}

.insight-footer {
  justify-content: flex-start;
}

.decision-list {
  display: grid;
  gap: 0;
}

.decision-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line-soft);
}

.decision-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.decision-marker {
  width: 11px;
  height: 11px;
  margin-top: 5px;
  border: 3px solid #e8f2fa;
  border-radius: 50%;
  background: var(--cpp-blue);
  box-shadow: 0 0 0 1px rgba(0, 114, 188, 0.25);
}

.decision-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.decision-item h3 {
  margin-bottom: 5px;
}

.decision-item p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.decision-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.citation-chip,
.source-link {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  color: var(--cpp-blue);
  background: #e8f2fa;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.source-item {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.source-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  color: var(--source-color);
  background: var(--source-bg);
}

.source-footer {
  justify-content: flex-start;
  margin-top: 8px;
}

.source-status {
  color: #0c5c38;
  font-size: 12px;
  font-weight: 900;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
  gap: 12px;
}

.chart-card {
  min-height: 258px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.chart-card.wide {
  grid-row: span 2;
}

.chart-title {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 900;
}

.line-chart,
.bar-chart,
.matrix-chart {
  width: 100%;
  min-height: 205px;
}

.chart-svg {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 205px;
}

.axis,
.grid-line {
  stroke: #dce4ea;
  stroke-width: 1;
}

.chart-label {
  fill: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.agent-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  display: grid;
  justify-items: end;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.agent-widget > * {
  pointer-events: auto;
}

.agent-launcher {
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: min(318px, calc(100vw - 32px));
  min-height: 66px;
  padding: 10px 14px 10px 10px;
  border: 1px solid rgba(0, 114, 188, 0.38);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 16px 44px rgba(18, 38, 56, 0.18);
  text-align: left;
}

.agent-launcher:hover {
  border-color: var(--cpp-blue);
  box-shadow: 0 20px 50px rgba(18, 38, 56, 0.22);
}

.agent-launcher-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  background: var(--cpp-blue);
}

.agent-launcher-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.agent-launcher strong,
.agent-launcher small {
  display: block;
}

.agent-launcher strong {
  font-size: 14px;
  line-height: 1.2;
}

.agent-launcher small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-widget.is-open .agent-launcher {
  display: none;
}

.agent-widget:not(.is-open) .agent-panel {
  display: none;
}

.agent-panel {
  display: grid;
  grid-template-rows: auto auto minmax(220px, 1fr) auto;
  gap: 12px;
  width: 100%;
  height: min(760px, calc(100vh - 112px));
  max-height: calc(100vh - 112px);
  overflow: hidden;
  animation: agent-pop 140ms ease-out;
}

.agent-header {
  margin-bottom: 0;
}

.agent-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.agent-close {
  width: 32px;
  min-height: 32px;
}

@keyframes agent-pop {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.live-dot {
  color: #0c5c38;
  background: #e6f4ec;
}

.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.prompt-chip {
  min-height: 30px;
  padding: 0 10px;
  color: var(--cpp-blue);
  background: #e8f2fa;
  font-size: 12px;
  font-weight: 900;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  padding-right: 4px;
}

.chat-message {
  display: grid;
  gap: 8px;
  max-width: 94%;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.chat-message.user {
  align-self: flex-end;
  color: #fff;
  background: var(--cpp-blue);
}

.chat-message.user p {
  color: #fff;
}

.chat-message strong {
  font-size: 13px;
}

.chat-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mini-bars {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.mini-bar {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.mini-bar-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #dbe4eb;
}

.mini-bar-track span {
  display: block;
  width: var(--value);
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color);
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}

.chat-input input {
  width: 100%;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--surface);
}

.chat-input input:focus {
  outline: 2px solid rgba(0, 114, 188, 0.2);
  border-color: rgba(0, 114, 188, 0.55);
}

.icon-button.send {
  color: #fff;
  border-color: var(--cpp-blue);
  background: var(--cpp-blue);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .project-hero,
  .content-grid,
  .two-up,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .agent-panel {
    height: min(720px, calc(100vh - 112px));
    max-height: calc(100vh - 112px);
    grid-template-rows: auto auto minmax(220px, 1fr) auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    width: 100%;
    max-width: 100vw;
    padding: 16px;
    overflow-x: hidden;
  }

  .project-switcher,
  .project-buttons,
  .project-button,
  .sidebar-panel,
  .project-hero,
  .project-summary,
  .metric-grid,
  .content-grid,
  .main-column,
  .panel {
    width: 100%;
    max-width: 100%;
  }

  .coverage-row {
    justify-content: flex-start;
    gap: 8px;
  }

  .coverage-row strong {
    margin-left: 0;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
  }

  .nav-item {
    display: grid;
    place-items: center;
    min-height: 48px;
    padding: 0;
  }

  .nav-item span {
    display: none;
  }

  .sidebar-panel {
    margin-top: 0;
  }

  .workspace {
    width: 100%;
    max-width: 100vw;
    padding: 16px 28px 16px 16px;
    overflow-x: hidden;
  }

  .topbar,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
  }

  .status-line {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
  }

  .status-line .status-pill {
    justify-self: start;
  }

  #projectThesis {
    width: 100%;
    max-width: 300px;
    font-size: 16px;
  }

  .primary-button {
    flex: 1;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .roadmap {
    grid-template-columns: repeat(4, 230px);
  }

  .agent-widget {
    right: 16px;
    bottom: 16px;
    width: calc(100vw - 32px);
  }

  .agent-panel {
    height: min(680px, calc(100vh - 92px));
    max-height: calc(100vh - 92px);
  }

  .agent-header {
    flex-direction: row;
    align-items: center;
  }
}

@media (max-width: 520px) {
  .brand img {
    width: 150px;
  }

  .project-summary,
  .panel,
  .agent-panel {
    padding: 14px;
  }

  .agent-launcher {
    min-width: 0;
    width: 100%;
  }

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

  .metric-card strong {
    font-size: 24px;
  }
}

/* UI/UX Pro Max polish pass: financial executive dashboard */
:root {
  --ink: #0f172a;
  --muted: #64748b;
  --subtle: #8a97a6;
  --line: #d7e0ea;
  --line-soft: #edf2f7;
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-alt: #f1f5f9;
  --cpp-blue: #0b6fb3;
  --cpp-blue-dark: #075d96;
  --teal: #148f8c;
  --green: #16834a;
  --amber: #a16207;
  --red: #c2413b;
  --violet: #6656a4;
  --shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  --shadow-strong: 0 18px 52px rgba(15, 23, 42, 0.14);
  --radius: 8px;
  font-family:
    Avenir, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

body {
  background:
    linear-gradient(180deg, #fbfdff 0, #f8fafc 280px),
    var(--bg);
}

button,
a,
input {
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
.nav-section:focus {
  outline: 2px solid rgba(11, 111, 179, 0.32);
  outline-offset: 3px;
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
}

.sidebar {
  padding: 22px 16px;
  border-right-color: #dce5ee;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  min-height: 42px;
  padding-bottom: 16px;
}

.brand img {
  width: 166px;
}

.nav-list {
  gap: 3px;
}

.nav-item {
  min-height: 38px;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  padding: 0 11px;
  border: 1px solid transparent;
  color: #526474;
  font-size: 14px;
  font-weight: 500;
}

.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.nav-item:hover {
  border-color: #d9e4ee;
  background: #f5f9fc;
  color: var(--ink);
}

.nav-item.active {
  border-color: #c7ddec;
  background: #edf6fc;
  color: var(--cpp-blue);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--cpp-blue);
}

.section-kicker {
  color: var(--cpp-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.11em;
}

.project-switcher,
.sidebar-panel {
  gap: 10px;
}

.project-button {
  gap: 7px;
  padding: 12px;
  border-color: #d8e2ec;
  background: #ffffff;
}

.project-button:hover {
  transform: translateY(-1px);
  border-color: #b9d3e8;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.project-button strong {
  font-size: 13px;
  font-weight: 600;
}

.project-button span {
  font-size: 12px;
  line-height: 1.25;
}

.project-button.active {
  background: #f2f8fc;
  border-color: #87b8dc;
  box-shadow: inset 2px 0 0 var(--cpp-blue);
}

.mini-progress {
  height: 4px;
  background: #dce7ef;
}

.sidebar-panel {
  padding: 12px;
  border-color: #d8e2ec;
  box-shadow: none;
}

.coverage-row {
  font-size: 12px;
}

.workspace {
  padding: 24px 28px 56px;
}

.topbar {
  margin-bottom: 18px;
}

.eyebrow {
  margin-bottom: 5px;
  color: #526474;
  font-size: 12px;
  font-weight: 600;
}

h1 {
  font-size: clamp(28px, 2.2vw, 34px);
  font-weight: 600;
  line-height: 1.12;
}

h2 {
  font-size: 16px;
  font-weight: 600;
}

h3 {
  font-size: 13px;
  font-weight: 600;
}

.icon-button,
.primary-button,
.ghost-button {
  min-height: 34px;
}

.icon-button {
  width: 34px;
  border-color: #d5e0ea;
}

.icon-button:hover,
.ghost-button:hover {
  border-color: #a9c7dc;
  background: #f4f9fd;
}

.primary-button {
  padding: 0 14px;
  background: linear-gradient(180deg, #117ac1 0%, #075d96 100%);
  font-weight: 600;
  box-shadow: 0 9px 20px rgba(11, 111, 179, 0.18);
}

.primary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(11, 111, 179, 0.22);
}

.ghost-button {
  color: #526474;
  font-weight: 600;
}

.project-hero {
  grid-template-columns: minmax(320px, 1.5fr) minmax(420px, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.project-summary,
.panel,
.agent-panel,
.metric-card {
  border-color: #d9e3ed;
  box-shadow: var(--shadow);
}

.project-summary {
  min-height: 160px;
  padding: 18px;
}

.status-line {
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
}

.status-pill,
.live-dot,
.tag {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 600;
}

#projectThesis {
  max-width: 780px;
  margin: 16px 0;
  font-size: 16px;
  line-height: 1.45;
}

.avatar {
  width: 30px;
  height: 30px;
  font-size: 11px;
  font-weight: 700;
}

.team-name {
  font-size: 12px;
}

.metric-grid {
  gap: 10px;
}

.metric-card {
  min-height: 75px;
  padding: 13px 14px;
}

.metric-card span {
  font-size: 12px;
  font-weight: 600;
}

.metric-card strong {
  font-size: 25px;
  font-weight: 600;
  letter-spacing: 0;
}

.metric-card small {
  font-size: 11px;
}

.content-grid,
.main-column {
  gap: 12px;
}

.panel,
.agent-panel {
  padding: 16px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header.compact {
  margin-bottom: 10px;
}

.segmented {
  padding: 2px;
  border-color: #d8e2ec;
}

.segmented button {
  min-height: 28px;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 600;
}

.roadmap {
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  gap: 10px;
}

.lane {
  min-width: 180px;
  gap: 9px;
}

.lane-title {
  min-height: 31px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 600;
}

.task-card {
  gap: 8px;
  min-height: 126px;
  padding: 11px;
  border-color: #dce5ee;
  box-shadow: none;
}

.task-card:hover,
.source-item:hover,
.insight-item:hover,
.decision-item:hover {
  background: #fbfdff;
}

.task-card p,
.source-meta,
.insight-body,
.chat-message p {
  font-size: 12px;
  line-height: 1.42;
}

.two-up {
  gap: 12px;
}

.readout-list,
.source-list {
  gap: 8px;
}

.insight-item {
  padding: 11px 0;
}

.severity-dot {
  width: 8px;
  height: 8px;
}

.citation-chip,
.source-link {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 700;
  background: #eef6fc;
}

.source-item {
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
}

.source-icon {
  width: 32px;
  height: 32px;
}

.source-status {
  font-size: 11px;
  font-weight: 700;
}

.analytics-grid {
  gap: 10px;
}

.chart-card {
  min-height: 236px;
  padding: 12px;
}

.chart-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
}

.line-chart,
.bar-chart,
.matrix-chart,
.chart-svg {
  min-height: 190px;
}

.chart-label {
  font-size: 10px;
  font-weight: 500;
}

.decision-item {
  padding: 12px 0;
}

.decision-meta {
  font-size: 11px;
  font-weight: 600;
}

.decision-item p {
  font-size: 12px;
}

.agent-widget {
  right: 28px;
  bottom: 28px;
  width: min(416px, calc(100vw - 32px));
}

.agent-launcher {
  min-width: min(306px, calc(100vw - 32px));
  min-height: 60px;
  border-color: #b9d8ee;
  box-shadow: var(--shadow-strong);
}

.agent-launcher strong {
  font-size: 13px;
  font-weight: 600;
}

.agent-launcher small {
  font-size: 11px;
  font-weight: 500;
}

.agent-panel {
  height: min(780px, calc(100vh - 104px));
  max-height: calc(100vh - 104px);
  box-shadow: var(--shadow-strong);
}

.agent-close {
  width: 30px;
  min-height: 30px;
}

.prompt-row {
  gap: 7px;
}

.prompt-chip {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11px;
  font-weight: 600;
}

.prompt-chip:hover {
  background: #dceffc;
}

.chat-log {
  gap: 10px;
}

.chat-message {
  gap: 7px;
  padding: 11px;
}

.chat-message strong {
  font-size: 12px;
  font-weight: 600;
}

.mini-bar {
  grid-template-columns: 78px minmax(0, 1fr) 32px;
  gap: 7px;
  font-size: 11px;
}

.chat-input {
  grid-template-columns: minmax(0, 1fr) 36px;
  gap: 7px;
}

.chat-input input {
  min-height: 36px;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .project-hero,
  .two-up,
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .roadmap {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lane {
    min-width: 0;
  }

  .agent-panel {
    height: min(720px, calc(100vh - 104px));
    max-height: calc(100vh - 104px);
  }
}

@media (max-width: 820px) {
  .workspace {
    padding: 16px 20px 88px 16px;
  }

  .agent-widget {
    right: 16px;
    bottom: 16px;
  }

  .agent-panel {
    height: min(680px, calc(100vh - 88px));
    max-height: calc(100vh - 88px);
  }
}

@media (max-width: 520px) {
  h1 {
    font-size: 25px;
  }

  #projectThesis {
    max-width: 300px;
    font-size: 15px;
  }

  .agent-panel {
    height: min(640px, calc(100vh - 78px));
  }
}

/* Denser diligence cockpit treatment */
.analysis-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.analysis-stat {
  display: grid;
  gap: 3px;
  min-height: 70px;
  padding: 10px 12px;
  border: 1px solid #dce5ee;
  border-radius: var(--radius);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.analysis-stat span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.analysis-stat strong {
  color: var(--ink);
  font-size: 21px;
  font-weight: 600;
  line-height: 1.05;
}

.analysis-stat small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.analytics-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}

.analytics-grid .chart-card.wide {
  grid-column: span 7;
}

.analytics-grid .chart-card:nth-child(2) {
  grid-column: span 5;
}

.analytics-grid .chart-card:nth-child(3) {
  grid-column: 1 / -1;
}

.chart-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
}

.chart-card.wide {
  grid-row: auto;
}

.line-chart,
.bar-chart,
.matrix-chart,
.chart-svg {
  min-height: 0;
}

.line-chart .chart-svg {
  height: 252px;
}

.bar-chart .chart-svg {
  height: 178px;
}

.matrix-chart .chart-svg {
  height: 204px;
}

.chart-insights {
  border-top: 1px solid var(--line-soft);
  padding-top: 8px;
}

.insight-table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.insight-table div,
.matrix-readout div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #edf2f7;
  border-radius: 7px;
  background: #ffffff;
}

.insight-table span,
.matrix-readout span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.insight-table strong,
.matrix-readout strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}

.insight-table small {
  color: var(--muted);
  font-size: 11px;
}

.rank-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list li {
  display: grid;
  grid-template-columns: 20px 56px minmax(0, 1fr) 26px;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.rank-list span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: var(--cpp-blue);
  background: #eef6fc;
  font-weight: 700;
}

.rank-list strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
}

.rank-list i {
  display: block;
  height: 6px;
  border-radius: 999px;
  background:
    linear-gradient(90deg, var(--rank-color) 0 var(--rank-width), #e2e8f0 var(--rank-width) 100%);
}

.rank-list em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
}

.matrix-readout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 1180px) {
  .analysis-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid .chart-card.wide,
  .analytics-grid .chart-card:nth-child(2),
  .analytics-grid .chart-card:nth-child(3) {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .analysis-summary,
  .insight-table,
  .matrix-readout {
    grid-template-columns: 1fr;
  }
}

/* User polish corrections: blue workplan, functioning timeline, denser evidence area, sharp UI. */
:root {
  --radius: 0px;
}

*,
*::before,
*::after {
  border-radius: 0 !important;
}

[hidden] {
  display: none !important;
}

.lane-title {
  border-color: color-mix(in srgb, var(--lane-color) 72%, #ffffff);
  background: var(--lane-bg);
}

.task-card {
  border-left: 3px solid #d7e8f5;
}

.timeline-view {
  display: grid;
  gap: 12px;
}

.timeline-axis {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
  padding: 0 0 8px 38px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timeline-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(180px, 1fr));
  grid-auto-rows: minmax(0, auto);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.timeline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-column: var(--timeline-column);
  gap: 8px;
  min-width: 180px;
  padding-top: 6px;
  border-top: 2px solid var(--timeline-accent);
}

.timeline-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--timeline-accent);
  background: var(--timeline-bg);
  font-size: 11px;
  font-weight: 700;
}

.timeline-content {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 10px;
  border: 1px solid #dce5ee;
  background: #ffffff;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.timeline-content p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.42;
}

.analytics-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
}

.analytics-grid .chart-card.wide {
  grid-column: span 6;
}

.analytics-grid .chart-card:nth-child(2),
.analytics-grid .chart-card:nth-child(3) {
  grid-column: span 3;
}

.chart-card {
  min-height: 0;
}

.line-chart .chart-svg {
  height: 228px;
}

.bar-chart .chart-svg,
.matrix-chart .chart-svg {
  height: 168px;
}

.chart-insights {
  padding-top: 7px;
}

.matrix-readout {
  grid-template-columns: 1fr;
  gap: 6px;
}

.matrix-readout div,
.insight-table div {
  padding: 7px 8px;
}

.rank-list li {
  grid-template-columns: 18px 46px minmax(0, 1fr) 24px;
  gap: 7px;
}

.rank-list span {
  width: 18px;
  height: 18px;
}

@media (max-width: 1180px) {
  .timeline-axis,
  .timeline-list {
    grid-template-columns: repeat(4, minmax(180px, 1fr));
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid .chart-card.wide,
  .analytics-grid .chart-card:nth-child(2),
  .analytics-grid .chart-card:nth-child(3) {
    grid-column: auto;
  }

  .matrix-readout {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Typography correction: Avenir for body copy, IBM Plex for titles and numeric readouts. */
:root {
  --font-body: Avenir, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", Avenir, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-number: "IBM Plex Sans", Avenir, "Avenir Next", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--font-body);
}

body,
button,
input,
p,
small,
.project-button span,
.team-name,
.source-meta,
.insight-body,
.decision-item p,
.chat-message p,
.timeline-content p,
.coverage-row,
.source-status {
  font-family: var(--font-body);
}

h1,
h2,
h3,
.eyebrow,
.section-kicker,
.chart-title,
.metric-card .metric-label,
.project-button strong,
.agent-launcher strong,
.chat-message strong,
.nav-item,
.primary-button,
.ghost-button,
.segmented button,
.prompt-chip {
  font-family: var(--font-display);
}

.metric-card strong,
.analysis-stat strong,
.coverage-row strong,
.lane-title span:last-child,
.citation-chip,
.source-link,
.chart-label,
.rank-list span,
.rank-list em,
.insight-table strong,
.matrix-readout strong,
.mini-bar strong,
.timeline-marker,
.timeline-axis,
.timeline-meta,
.status-line,
.thread-topline em,
.thread-foot,
.thread-context {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums lining-nums;
}

/* Collapsible project threads */
.project-buttons {
  gap: 12px;
}

.project-node {
  border: 1px solid #d8e2ec;
  background: #ffffff;
}

.project-node.is-active {
  border-color: #8cbddf;
  background: #f5fafe;
  box-shadow: inset 2px 0 0 var(--cpp-blue);
}

.project-node-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: stretch;
}

.project-node .project-button {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.project-node .project-button:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.project-node .project-button.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.project-toggle {
  display: grid;
  place-items: center;
  width: 30px;
  border: 0;
  border-left: 1px solid #edf2f7;
  color: #526474;
  background: transparent;
}

.project-toggle:hover {
  color: var(--cpp-blue);
  background: #edf6fc;
}

.project-toggle svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 140ms ease;
}

.project-node.is-collapsed .project-toggle svg {
  transform: rotate(-90deg);
}

.thread-list {
  display: grid;
  gap: 2px;
  padding: 0 10px 10px 14px;
  border-top: 1px solid #edf2f7;
}

.project-node.is-collapsed .thread-list {
  display: none;
}

.thread-item {
  display: grid;
  gap: 4px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 1px solid transparent;
  color: #526474;
  background: transparent;
  text-align: left;
}

.thread-item:hover {
  border-color: #dce8f2;
  background: #f7fbfe;
}

.thread-item.active {
  border-color: #bfd8ea;
  color: var(--ink);
  background: #eaf4fb;
  box-shadow: inset 2px 0 0 var(--cpp-blue);
}

.thread-topline,
.thread-meta,
.thread-foot {
  display: flex;
  align-items: center;
  min-width: 0;
}

.thread-topline {
  justify-content: space-between;
  gap: 8px;
}

.thread-topline strong {
  min-width: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-topline em {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  color: var(--cpp-blue);
  background: #dceffc;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.thread-meta {
  gap: 6px;
  color: #64748b;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.thread-meta span + span::before {
  content: "/";
  margin-right: 6px;
  color: #a8b5c1;
}

.thread-foot {
  justify-content: space-between;
  gap: 8px;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.thread-context {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  margin-top: 10px;
  color: #526474;
  font-size: 11px;
  font-weight: 600;
}

.thread-context span,
.thread-context strong {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid #dbe8f2;
  background: #f7fbfe;
}

.thread-context strong {
  color: var(--cpp-blue);
  background: #edf6fc;
}

.task-card.thread-focus,
.timeline-item.thread-focus .timeline-content {
  border-color: #bdd8ec;
  border-left-color: var(--cpp-blue);
  background: #fbfdff;
}

.source-item.thread-source {
  border-color: #bdd8ec;
  background: #fbfdff;
  box-shadow: inset 2px 0 0 var(--cpp-blue);
}

.thread-source-label {
  color: var(--cpp-blue);
  font-size: 11px;
  font-weight: 700;
}

.sidebar {
  overflow-y: auto;
}

.project-switcher {
  min-height: 0;
}

.sidebar-panel {
  margin-top: 0;
}

/* Threaded Copilot conversations */
.agent-panel {
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
}

.agent-thread-bar {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe6ef;
  background: #fbfdff;
}

.agent-thread-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-thread-summary span,
.agent-thread-summary em {
  color: #64748b;
  font-family: var(--font-number);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.agent-thread-summary strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-scope-toggle {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #dbe6ef;
}

.agent-scope-toggle button,
.agent-thread-strip button,
.artifact-actions button {
  min-height: 28px;
  border: 0;
  color: #526474;
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
}

.agent-scope-toggle button + button {
  border-left: 1px solid #dbe6ef;
}

.agent-scope-toggle button.active,
.agent-thread-strip button.active {
  color: var(--cpp-blue);
  background: #edf6fc;
  box-shadow: inset 0 -2px 0 var(--cpp-blue);
}

.agent-thread-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.agent-thread-strip button {
  display: inline-grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: center;
  gap: 6px;
  min-width: max-content;
  padding: 0 8px;
  border: 1px solid #dbe6ef;
}

.agent-thread-strip span {
  max-width: 132px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-thread-strip em {
  min-width: 16px;
  color: var(--cpp-blue);
  font-family: var(--font-number);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.chat-artifact {
  display: grid;
  gap: 8px;
  margin-top: 2px;
  padding: 10px;
  border: 1px solid #dbe6ef;
  background: #ffffff;
}

.chat-artifact span {
  display: block;
  color: var(--cpp-blue);
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chat-artifact strong {
  margin-top: 2px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}

.chat-artifact ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.artifact-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.artifact-actions button {
  border: 1px solid #dbe6ef;
  color: var(--cpp-blue);
  background: #f7fbfe;
}

.artifact-actions button:hover {
  border-color: #bdd8ec;
  background: #edf6fc;
}

/* Copilot prominence pass */
.agent-widget {
  right: 28px;
  bottom: 28px;
  z-index: 120;
  width: min(476px, calc(100vw - 40px));
}

.agent-widget::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.08) 72%, rgba(15, 23, 42, 0.16) 100%);
  opacity: 0;
  transition: opacity 140ms ease;
}

.agent-widget.is-open::before {
  opacity: 1;
}

.agent-launcher {
  min-width: min(360px, calc(100vw - 40px));
  min-height: 70px;
  padding: 12px 16px 12px 12px;
  border: 2px solid #0b6fb3;
  color: #ffffff;
  background:
    linear-gradient(135deg, #0a4775 0%, #0b6fb3 56%, #1677b7 100%);
  box-shadow:
    0 26px 70px rgba(5, 36, 64, 0.34),
    0 0 0 6px rgba(11, 111, 179, 0.12);
}

.agent-launcher:hover {
  border-color: #084c7f;
  background:
    linear-gradient(135deg, #083f68 0%, #075d96 58%, #0b6fb3 100%);
  box-shadow:
    0 30px 78px rgba(5, 36, 64, 0.4),
    0 0 0 7px rgba(11, 111, 179, 0.16);
}

.agent-launcher-icon {
  width: 44px;
  height: 44px;
  color: #0b6fb3;
  background: #ffffff;
}

.agent-launcher strong {
  color: #ffffff;
  font-size: 14px;
}

.agent-launcher small {
  color: #d9edf9;
}

.agent-panel {
  width: 100%;
  border: 2px solid #0a4775;
  background: #ffffff;
  box-shadow:
    0 32px 90px rgba(5, 25, 45, 0.34),
    0 0 0 1px rgba(255, 255, 255, 0.9),
    0 0 0 8px rgba(11, 111, 179, 0.08);
}

.agent-header {
  margin: -16px -16px 0;
  padding: 14px 16px;
  color: #ffffff;
  background: #0a4775;
  border-bottom: 1px solid #083d64;
}

.agent-header .section-kicker,
.agent-header h2 {
  color: #ffffff;
}

.agent-header .section-kicker {
  opacity: 0.74;
}

.agent-header .live-dot {
  color: #074e2f;
  background: #dff5e8;
}

.agent-header .icon-button {
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.08);
}

.agent-header .icon-button:hover {
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.16);
}

.agent-thread-bar,
.prompt-row,
.chat-log,
.chat-input {
  position: relative;
  z-index: 1;
}

.agent-thread-bar {
  border-color: #bdd8ec;
  background: #f5fafe;
}

.chat-log {
  margin: 0 -2px;
  padding: 12px;
  border: 1px solid #d3e3ef;
  background:
    linear-gradient(180deg, #f8fbfe 0%, #ffffff 100%);
  box-shadow: inset 0 1px 0 rgba(11, 111, 179, 0.06);
}

.chat-message {
  border-color: #d1dfeb;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.chat-message.user {
  border-color: #0b6fb3;
  background: #0b6fb3;
  box-shadow: 0 8px 24px rgba(11, 111, 179, 0.22);
}

.chat-input {
  margin: 0 -16px -16px;
  padding: 12px 16px 16px;
  border-top: 1px solid #bdd8ec;
  background: #f5fafe;
}

.chat-input input {
  border: 2px solid #8fbfe2;
  background: #ffffff;
}

.icon-button.send {
  border-color: #0a4775;
  background: #0a4775;
}

/* Copilot simplification pass: keep the assistant prominent without boxed-in chrome. */
.agent-widget::before {
  background:
    linear-gradient(90deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.035) 70%, rgba(15, 23, 42, 0.075) 100%);
}

.agent-widget.is-open::before {
  opacity: 1;
}

.agent-launcher {
  min-height: 62px;
  border: 0;
  background: #0a5f9d;
  box-shadow:
    0 24px 64px rgba(6, 36, 62, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.18) inset;
}

.agent-launcher:hover {
  border: 0;
  background: #084f83;
  box-shadow:
    0 28px 72px rgba(6, 36, 62, 0.33),
    0 0 0 1px rgba(255, 255, 255, 0.22) inset;
}

.agent-launcher-icon {
  color: #0a5f9d;
  background: #ffffff;
  box-shadow: none;
}

.agent-panel {
  gap: 0;
  padding: 0;
  border: 0;
  background: #ffffff;
  box-shadow:
    0 34px 92px rgba(10, 32, 52, 0.36),
    0 0 0 1px rgba(10, 71, 117, 0.08);
}

.agent-header {
  margin: 0;
  padding: 18px 20px 14px;
  color: var(--ink);
  background: #ffffff;
  border: 0;
  box-shadow: inset 0 4px 0 #0a5f9d;
}

.agent-header .section-kicker {
  color: var(--cpp-blue);
  opacity: 1;
}

.agent-header h2 {
  color: var(--ink);
}

.agent-header .live-dot {
  color: #0c5c38;
  background: #e8f5ee;
}

.agent-header .icon-button {
  color: var(--muted);
  border: 0;
  background: transparent;
}

.agent-header .icon-button:hover {
  color: var(--ink);
  border: 0;
  background: #eef4f8;
}

.agent-thread-bar {
  gap: 10px;
  padding: 12px 20px 10px;
  border: 0;
  background: #ffffff;
}

.agent-thread-summary {
  padding-bottom: 2px;
}

.agent-scope-toggle {
  display: inline-flex;
  justify-self: start;
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.agent-scope-toggle button,
.agent-thread-strip button,
.artifact-actions button {
  border: 0;
  background: transparent;
}

.agent-scope-toggle button + button {
  border-left: 0;
}

.agent-scope-toggle button.active,
.agent-thread-strip button.active {
  color: #064f82;
  background: transparent;
  box-shadow: none;
}

.agent-thread-strip {
  gap: 14px;
  padding-bottom: 0;
}

.agent-thread-strip button {
  min-height: 22px;
  padding: 0;
  color: #697887;
  background: transparent;
}

.agent-thread-strip button.active {
  color: #0a5f9d;
  background: transparent;
}

.prompt-row {
  padding: 0 20px 16px;
  gap: 14px;
}

.prompt-chip {
  min-height: 22px;
  padding: 0;
  border: 0;
  color: #0a5f9d;
  background: transparent;
}

.prompt-chip:hover {
  color: #064f82;
  background: transparent;
}

.chat-log {
  flex: 1;
  margin: 0;
  padding: 12px 20px 20px;
  border: 0;
  background: #ffffff;
  box-shadow: none;
}

.chat-message {
  max-width: 96%;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.chat-message > strong {
  color: var(--ink);
}

.chat-message p {
  max-width: 100%;
}

.chat-message.user {
  padding: 9px 11px;
  color: #ffffff;
  background: #0a5f9d;
  box-shadow: none;
}

.chat-message.user p {
  color: #ffffff;
}

.mini-bars {
  padding: 2px 0 0;
}

.mini-bar-track {
  height: 5px;
  border-radius: 0;
  background: #e4ebf1;
}

.chat-artifact {
  margin-top: 8px;
  padding: 10px 0 0;
  border: 0;
  background: transparent;
}

.artifact-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.artifact-actions button {
  min-height: 26px;
  padding: 0;
  color: #0a5f9d;
  background: transparent;
}

.artifact-actions button:hover {
  color: #064f82;
  background: transparent;
}

.chat-links {
  gap: 6px;
}

.chat-input {
  margin: 0;
  padding: 14px 20px 20px;
  border-top: 0;
  background: #ffffff;
}

.chat-input input {
  min-height: 42px;
  border: 0;
  background: #f2f6f9;
  box-shadow: inset 0 0 0 1px transparent;
}

.chat-input input:focus {
  border-color: transparent;
  outline: 0;
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px #7eb8df,
    0 0 0 3px rgba(0, 114, 188, 0.12);
}

.icon-button.send {
  border: 0;
  color: #ffffff;
  background: #0a5f9d;
}

.icon-button.send:hover {
  border: 0;
  background: #084f83;
}

/* Financial Review cockpit */
.finance-review-panel {
  background:
    linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.finance-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.finance-scenarios {
  display: inline-flex;
  border: 1px solid #d8e2ec;
  background: #f3f7fb;
}

.finance-scenarios button {
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  color: #526474;
  background: transparent;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
}

.finance-scenarios button + button {
  border-left: 1px solid #d8e2ec;
}

.finance-scenarios button.active {
  color: #ffffff;
  background: #0b6fb3;
}

.finance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.finance-stat {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 11px 12px;
  border: 1px solid #dce5ee;
  background: #ffffff;
}

.finance-stat span,
.finance-control span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.finance-stat strong {
  color: var(--ink);
  font-family: var(--font-number);
  font-size: 23px;
  font-weight: 650;
  line-height: 1;
}

.finance-stat small,
.finance-control p {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.finance-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.finance-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-content: stretch;
  gap: 10px;
  grid-column: span 3;
  min-height: 266px;
  padding: 13px 14px;
  border: 1px solid #dce5ee;
  background: #ffffff;
}

.finance-card.wide {
  grid-column: span 6;
}

.finance-card:nth-child(-n + 3) {
  min-height: 286px;
}

.finance-card.table-card {
  grid-column: span 8;
  min-height: 258px;
}

.finance-card:last-child {
  grid-column: span 4;
  min-height: 258px;
}

.finance-chart {
  min-width: 0;
  min-height: 232px;
  height: 100%;
}

.finance-card.wide .finance-chart {
  min-height: 232px;
}

.finance-svg {
  display: block;
  width: 100%;
  height: 232px;
  overflow: visible;
  background: #fbfdff;
}

.finance-svg.compact {
  height: 232px;
}

.finance-axis {
  stroke: #cdd8e2;
  stroke-width: 1;
}

.finance-line {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.finance-line.active {
  stroke: #0b6fb3;
}

.finance-line.muted {
  stroke: #8b98a5;
  stroke-dasharray: 5 5;
  stroke-width: 1.6;
}

.finance-dot.active {
  fill: #ffffff;
  stroke: #0b6fb3;
  stroke-width: 2.5;
}

.finance-label,
.finance-direct-label,
.finance-annotation {
  font-family: var(--font-number);
  fill: #64748b;
  font-size: 11px;
  font-weight: 600;
}

.finance-label.strong {
  fill: #1f2a37;
  font-family: var(--font-display);
}

.finance-direct-label.active {
  fill: #0b6fb3;
}

.finance-direct-label.muted {
  fill: #64748b;
}

.finance-annotation {
  fill: #334155;
}

.finance-table-wrap {
  overflow-x: auto;
}

.finance-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  color: var(--ink);
  font-size: 12px;
}

.finance-table th {
  padding: 7px 8px;
  border-bottom: 1px solid #b8c7d4;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.finance-table td {
  padding: 7px 8px;
  border: 0;
  color: #334155;
}

.finance-table tr.separator td {
  border-top: 1px solid #dce5ee;
}

.finance-table .num {
  text-align: right;
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums lining-nums;
}

.finance-table .positive {
  color: #0b6fb3;
}

.finance-table .negative {
  color: #b94b48;
}

.finance-reliability {
  display: grid;
  gap: 8px;
}

.finance-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf2f7;
}

.finance-control:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.finance-control div {
  display: grid;
  gap: 3px;
}

.finance-control strong {
  color: #0b6fb3;
  font-family: var(--font-number);
  font-size: 19px;
  font-weight: 650;
}

@media (max-width: 1180px) {
  .finance-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .finance-card,
  .finance-card.wide,
  .finance-card.table-card,
  .finance-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .finance-header-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .finance-scenarios {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finance-scenarios button + button {
    border-left: 0;
  }

  .finance-summary {
    grid-template-columns: 1fr;
  }

  .finance-svg,
  .finance-svg.compact {
    height: 200px;
  }
}

/* Lighter active diligence navigation */
.project-switcher {
  gap: 8px;
}

.project-buttons {
  gap: 6px;
}

.project-node {
  border: 0;
  background: transparent;
}

.project-node.is-active {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.project-node-header {
  grid-template-columns: minmax(0, 1fr) 24px;
  align-items: center;
}

.project-node .project-button {
  gap: 5px;
  min-height: 0;
  padding: 8px 2px 8px 0;
  border: 0;
  background: transparent;
}

.project-node .project-button:hover,
.project-node .project-button.active {
  background: transparent;
  box-shadow: none;
}

.project-node .project-button strong {
  font-size: 12px;
  line-height: 1.25;
}

.project-node .project-button span {
  color: #657386;
  font-size: 11px;
  line-height: 1.25;
}

.project-node .project-button.active strong {
  color: var(--ink);
}

.project-node .mini-progress {
  width: 78%;
  height: 3px;
  background: #e2eaf1;
}

.project-toggle {
  width: 24px;
  min-height: 24px;
  border: 0;
  color: #64748b;
}

.project-toggle:hover {
  color: var(--cpp-blue);
  background: transparent;
}

.project-toggle svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.1;
}

.thread-list {
  gap: 1px;
  margin: 0 0 2px 5px;
  padding: 2px 0 6px 9px;
  border-top: 0;
  border-left: 1px solid #dde7ef;
}

.thread-item {
  position: relative;
  gap: 2px;
  min-height: 0;
  padding: 7px 5px 7px 10px;
  border: 0;
  color: #526474;
  background: transparent;
}

.thread-item:hover {
  border-color: transparent;
  background: #f7fafc;
}

.thread-item.active {
  border-color: transparent;
  color: var(--ink);
  background: #f7fafc;
  box-shadow: none;
}

.thread-item.active::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -10px;
  width: 2px;
  background: var(--cpp-blue);
}

.thread-topline {
  gap: 7px;
}

.thread-topline strong {
  font-size: 11.5px;
  font-weight: 600;
}

.thread-topline em {
  min-width: 16px;
  height: 16px;
  color: #0b6fb3;
  background: transparent;
  font-size: 10px;
  font-weight: 650;
}

.thread-meta {
  gap: 5px;
  color: #738195;
  font-size: 9.5px;
  font-weight: 550;
  letter-spacing: 0.035em;
}

.thread-meta span + span::before {
  margin-right: 5px;
  color: #b8c3ce;
}

.thread-foot {
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
}

.thread-foot span:last-child {
  color: #5f6f83;
}

.sidebar .project-switcher {
  flex: 1 1 auto;
  overflow-y: auto;
  padding-right: 2px;
}

.sidebar .sidebar-panel {
  flex: 0 0 auto;
}

/* Assigned team avatars */
.team-stack {
  gap: 6px;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50% !important;
  box-shadow: 0 0 0 2px #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 650;
}

/* Copilot tag pills */
.agent-scope-toggle,
.agent-thread-strip,
.prompt-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.agent-scope-toggle {
  justify-self: stretch;
}

.agent-scope-toggle button,
.agent-thread-strip button,
.prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #d7e4ee;
  border-radius: 999px !important;
  color: #526474;
  background: #f7fafc;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
}

.agent-scope-toggle button:hover,
.agent-thread-strip button:hover,
.prompt-chip:hover {
  border-color: #b8d4e8;
  color: #0b5f99;
  background: #eef6fc;
}

.agent-scope-toggle button.active,
.agent-thread-strip button.active,
.prompt-chip:focus-visible {
  border-color: #9cc7e5;
  color: #064f82;
  background: #e7f3fb;
  box-shadow: inset 0 0 0 1px rgba(11, 111, 179, 0.08);
}

.agent-thread-strip button em {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px !important;
  color: #0b6fb3;
  background: #ffffff;
  font-family: var(--font-number);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
}

.agent-thread-strip button.active em {
  color: #ffffff;
  background: #0b6fb3;
}

.agent-thread-strip span {
  max-width: 154px;
}

.prompt-row {
  padding: 2px 20px 16px;
}

/* Executive metric cards with sparklines */
.metric-grid {
  gap: 10px;
}

.metric-card {
  position: relative;
  display: block;
  min-height: 154px;
  padding: 18px 18px 16px;
  border-color: #d7e3ed;
  background: #ffffff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 14px 34px rgba(15, 23, 42, 0.055);
  overflow: hidden;
}

.metric-card::before {
  content: "";
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--metric-accent), color-mix(in srgb, var(--metric-accent) 16%, #ffffff));
}

.metric-copy {
  display: grid;
  gap: 8px;
  width: 46%;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.metric-card .metric-label {
  color: #5f6f83;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.14;
}

.metric-card strong {
  color: #0f172a;
  font-family: var(--font-number);
  font-size: 34px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.95;
}

.metric-card small {
  color: #64748b;
  font-size: 11.5px;
  line-height: 1.25;
}

.metric-spark {
  position: absolute;
  right: 16px;
  bottom: 15px;
  display: grid;
  align-items: end;
  justify-items: end;
  width: min(56%, 188px);
  min-width: 0;
}

.metric-sparkline {
  display: block;
  width: 100%;
  height: 72px;
  overflow: visible;
}

.metric-sparkline-range {
  stroke: #d4dde6;
  stroke-width: 1;
}

.metric-sparkline-area {
  fill: var(--metric-accent);
  opacity: 0.11;
}

.metric-sparkline-line {
  fill: none;
  stroke: var(--metric-accent);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-sparkline.is-inverse .metric-sparkline-line {
  stroke: var(--metric-accent);
}

.metric-sparkline-min {
  fill: #ffffff;
  stroke: #93a4b5;
  stroke-width: 1.5;
}

.metric-sparkline-max,
.metric-sparkline-end {
  fill: #ffffff;
  stroke: var(--metric-accent);
  stroke-width: 2.1;
}

.metric-sparkline-label {
  fill: var(--metric-accent);
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 700;
}

@media (max-width: 1320px) {
  .metric-card {
    min-height: 154px;
  }

  .metric-copy {
    width: 46%;
  }

  .metric-sparkline {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .metric-card {
    min-height: 132px;
  }

  .metric-copy {
    width: 100%;
  }

  .metric-spark {
    position: static;
    justify-items: start;
    width: 188px;
    margin-top: 10px;
  }

  .metric-sparkline {
    width: 100%;
  }
}

/* Avenir readability pass: body copy needs a little more size and air. */
body {
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#projectThesis,
.task-card p,
.source-meta,
.insight-body,
.decision-item p,
.timeline-content p,
.chat-message p,
.finance-control p {
  font-size: 14px;
  line-height: 1.52;
}

.source-meta,
.insight-body,
.decision-item p,
.timeline-content p,
.chat-message p,
.finance-control p,
.task-card p {
  color: #58687c;
}

.project-button span,
.project-node .project-button span,
.team-name,
.coverage-row,
.source-status,
.metric-card small,
.analysis-stat small,
.finance-stat small {
  font-size: 12.5px;
  line-height: 1.38;
}

.thread-meta,
.thread-foot {
  font-size: 11px;
  line-height: 1.35;
}

.thread-topline strong {
  font-size: 12.25px;
  line-height: 1.25;
}

.finance-table {
  font-size: 13px;
  line-height: 1.42;
}

.finance-table td {
  padding-top: 8px;
  padding-bottom: 8px;
}

.finance-table th,
.finance-control span,
.finance-stat span,
.analysis-stat span {
  font-size: 11.5px;
}

.chat-input input {
  font-size: 14px;
}

/* Copilot height pass: open drawer should read as a full-height workspace. */
.agent-widget.is-open {
  bottom: 2.5vh;
}

.agent-widget.is-open .agent-panel {
  height: 95vh;
  height: 95dvh;
  max-height: 95vh;
  max-height: 95dvh;
}

.agent-launcher-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.agent-launcher .agent-launcher-icon {
  background: transparent;
  box-shadow: none;
}

.agent-launcher {
  border-radius: 14px !important;
}

@media (max-width: 820px) {
  .agent-widget.is-open {
    right: 12px;
    bottom: 2.5vh;
    width: calc(100vw - 24px);
  }

  .agent-widget.is-open .agent-panel {
    height: 95dvh;
    max-height: 95dvh;
  }
}

/* KPI card clarity pass: stacked hierarchy with sparklines as quiet evidence. */
.metric-grid {
  gap: 14px;
  align-items: stretch;
}

.metric-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto auto minmax(52px, 1fr);
  gap: 0;
  min-height: 174px;
  padding: 16px 16px 12px;
  border: 1px solid #d7e3ed;
  border-top: 3px solid var(--metric-accent);
  background:
    linear-gradient(180deg, #fffefa 0%, #ffffff 72%),
    var(--surface);
  box-shadow:
    0 16px 34px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.metric-card::before {
  display: none;
}

.metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-height: 30px;
}

.metric-card .metric-label {
  max-width: 150px;
  color: #53667b;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 650;
  line-height: 1.12;
  letter-spacing: 0;
}

.metric-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  color: var(--metric-accent);
  background: var(--metric-accent-soft);
}

.metric-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card .metric-value {
  margin-top: 9px;
  color: #0b1328;
  font-family: var(--font-number);
  font-size: 40px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 0.95;
}

.metric-detail {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 7px;
  margin-top: 8px;
  min-width: 0;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--metric-accent);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.metric-change-icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-card small {
  min-width: 0;
  color: #58687c;
  font-size: 13px;
  line-height: 1.25;
}

.metric-spark {
  position: static;
  align-self: end;
  justify-items: stretch;
  width: 100%;
  margin-top: 7px;
  min-width: 0;
}

.metric-sparkline {
  display: block;
  width: 100%;
  height: 58px;
  overflow: visible;
}

.metric-sparkline-range {
  stroke: #d7e0e8;
  stroke-width: 1;
}

.metric-sparkline-area {
  fill: var(--metric-accent);
  opacity: 0.1;
}

.metric-sparkline-line {
  fill: none;
  stroke: var(--metric-accent);
  stroke-width: 2.15;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.metric-sparkline-start {
  fill: #ffffff;
  stroke: #9aa9b8;
  stroke-width: 1.7;
}

.metric-sparkline-end {
  fill: #ffffff;
  stroke: var(--metric-accent);
  stroke-width: 2.25;
}

@media (max-width: 1320px) {
  .metric-card {
    min-height: 170px;
    padding: 15px 15px 12px;
  }

  .metric-card .metric-value {
    font-size: 38px;
  }

  .metric-card .metric-label {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .metric-card {
    min-height: 160px;
  }

  .metric-card .metric-value {
    font-size: 35px;
  }

  .metric-sparkline {
    height: 52px;
  }
}

/* Compact hero pass: keep the first viewport dense and decision-focused. */
.project-hero {
  grid-template-columns: minmax(480px, 1.45fr) repeat(2, minmax(240px, 0.475fr));
  grid-template-rows: auto auto;
  align-items: stretch;
  gap: 10px 12px;
  margin-bottom: 12px;
}

.hero-deal-column {
  display: contents;
}

.project-summary {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  align-items: end;
  gap: 9px 18px;
  min-height: 0;
  padding: 14px 16px;
}

.project-summary .status-line {
  grid-column: 1 / -1;
  gap: 8px;
}

.project-summary .thread-context {
  grid-column: 1 / -1;
  margin-top: 0;
}

.project-summary #projectThesis {
  grid-column: 1;
  margin: 2px 0 0;
  max-width: none;
  font-size: 14.5px;
  line-height: 1.42;
}

.project-summary .team-stack {
  grid-column: 2;
  align-self: end;
  min-height: 28px;
  margin-left: 6px;
}

.project-summary .avatar {
  width: 28px;
  height: 28px;
  font-size: 10px;
}

.deal-timeline {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 184px;
  padding: 16px 20px 14px;
  border: 1px solid #d9e3ed;
  background: #ffffff;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.deal-timeline-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 10px;
}

.deal-timeline-head h3 {
  margin-top: 1px;
  color: #0b1328;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.1;
}

.deal-timeline-head span {
  color: #53667b;
  font-family: var(--font-number);
  font-size: 11.5px;
  font-weight: 650;
  white-space: nowrap;
}

.deal-timeline-chart {
  display: block;
  width: 100%;
  height: 132px;
  overflow: visible;
}

.deal-timeline-axis,
.deal-timeline-tick {
  stroke: #dce6ef;
  stroke-width: 1;
}

.deal-timeline-today {
  stroke: #9bc6e7;
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.86;
}

.deal-timeline-track {
  stroke: var(--timeline-track, #edf3f8);
  stroke-width: 8;
  stroke-linecap: round;
}

.deal-timeline-progress {
  stroke: var(--timeline-color, #86c7ff);
  stroke-width: 8;
  stroke-linecap: round;
}

.deal-timeline-end {
  fill: #ffffff;
  stroke: var(--timeline-color, #86c7ff);
  stroke-width: 2;
}

.deal-timeline-label {
  fill: #243245;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 650;
}

.deal-timeline-detail,
.deal-timeline-date {
  fill: #64748b;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

.metric-grid {
  display: contents;
}

.metric-card {
  grid-template-rows: auto auto auto 42px;
  min-height: 128px;
  padding: 11px 12px 9px;
  border-top-width: 2px;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.045),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.metric-card:focus-visible {
  outline: 2px solid rgba(0, 114, 188, 0.3);
  outline-offset: 3px;
}

.metric-card:nth-child(1) {
  grid-column: 2;
  grid-row: 1;
}

.metric-card:nth-child(2) {
  grid-column: 3;
  grid-row: 1;
}

.metric-card:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
}

.metric-card:nth-child(4) {
  grid-column: 3;
  grid-row: 2;
}

.metric-head {
  min-height: 22px;
  gap: 9px;
}

.metric-card .metric-label {
  max-width: none;
  font-size: 12.5px;
  line-height: 1.12;
}

.metric-icon {
  width: 22px;
  height: 22px;
}

.metric-icon svg {
  width: 13px;
  height: 13px;
}

.metric-card .metric-value {
  margin-top: 7px;
  font-size: 31px;
  line-height: 0.92;
}

.metric-detail {
  gap: 6px;
  margin-top: 7px;
}

.metric-change {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
}

.metric-change-icon {
  width: 11px;
  height: 11px;
}

.metric-card small {
  font-size: 11.5px;
  line-height: 1.18;
}

.metric-spark {
  margin-top: 5px;
}

.metric-sparkline {
  height: 42px;
}

.metric-sparkline-target {
  fill: transparent;
  pointer-events: all;
}

.metric-sparkline-hover-dot {
  fill: var(--metric-accent);
  opacity: 0;
  transition: opacity 140ms ease;
}

.metric-spark-hit:hover .metric-sparkline-hover-dot {
  opacity: 1;
}

.metric-sparkline-line {
  stroke-width: 1.9;
}

.metric-sparkline-area {
  opacity: 0.085;
}

.metric-sparkline-start {
  stroke-width: 1.4;
}

.metric-sparkline-end {
  stroke-width: 2;
}

.metric-hover {
  position: absolute;
  right: 10px;
  bottom: 9px;
  z-index: 3;
  display: grid;
  gap: 7px;
  width: min(72%, 236px);
  padding: 10px;
  border: 1px solid color-mix(in srgb, var(--metric-accent) 24%, #d9e4ee);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.13);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 150ms ease,
    transform 150ms ease;
  pointer-events: none;
}

.metric-card:hover .metric-hover,
.metric-card:focus-visible .metric-hover,
.metric-card:focus-within .metric-hover {
  opacity: 1;
  transform: translateY(0);
}

.metric-hover-kicker {
  color: var(--metric-accent);
  font-family: var(--font-display);
  font-size: 10px !important;
  font-weight: 800 !important;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.metric-hover strong {
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

.metric-hover dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
  margin: 0;
}

.metric-hover div {
  display: grid;
  gap: 1px;
}

.metric-hover dt,
.metric-hover dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.18;
}

.metric-hover dt {
  color: #66758a;
  font-weight: 650;
}

.metric-hover dd {
  color: #111827;
  font-family: var(--font-number);
  font-weight: 750;
}

@media (max-width: 1180px) {
  .project-hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    align-items: start;
  }

  .hero-deal-column {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .project-summary,
  .deal-timeline {
    grid-column: auto;
    grid-row: auto;
  }

  .metric-grid .metric-card:nth-child(n) {
    grid-column: auto;
    grid-row: auto;
  }

  .metric-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 820px) {
  .project-summary {
    grid-template-columns: 1fr;
  }

  .project-summary .team-stack {
    grid-column: 1;
    margin-left: 0;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Light chart aesthetic pass: airy fills, soft strokes, and pastel variance colors. */
.chart-card,
.finance-card {
  border-color: #e1e9f1;
  background: #ffffff;
  box-shadow: 0 16px 38px rgba(15, 23, 42, 0.035);
}

.chart-svg,
.finance-svg {
  background: linear-gradient(180deg, #ffffff 0%, #ffffff 68%, #fbfdff 100%);
}

.axis,
.grid-line,
.finance-axis {
  stroke: #e4ebf2;
  stroke-width: 1;
}

.grid-line {
  opacity: 0.56;
}

.chart-label,
.finance-label,
.finance-direct-label,
.finance-annotation {
  fill: #6c7b8c;
}

.chart-focus-dot {
  fill: #1688e8;
  stroke: #ffffff;
  stroke-width: 4;
  filter: drop-shadow(0 6px 12px rgba(22, 136, 232, 0.22));
}

.finance-area {
  fill: url(#financeLineFill);
}

.finance-line.active {
  stroke: #1688e8;
  stroke-width: 3;
}

.finance-line.muted {
  stroke: #aebdca;
  stroke-dasharray: 6 6;
  stroke-width: 1.5;
  opacity: 0.64;
}

.finance-dot.active {
  fill: #1688e8;
  stroke: #ffffff;
  stroke-width: 4;
  filter: drop-shadow(0 7px 12px rgba(22, 136, 232, 0.2));
}

.finance-focus-guide {
  stroke: #8c98a6;
  stroke-width: 1.4;
  stroke-dasharray: 5 6;
  opacity: 0.75;
}

.finance-tooltip {
  fill: #ffffff;
  stroke: #edf2f6;
  stroke-width: 1;
  filter: drop-shadow(0 8px 16px rgba(15, 23, 42, 0.16));
}

.finance-tooltip-text {
  fill: #0f172a;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 650;
}

.finance-variance-bar.positive,
.finance-waterfall-bar.positive {
  fill: #8fc8ff;
}

.finance-variance-bar.negative,
.finance-waterfall-bar.negative {
  fill: #eda8a5;
}

.finance-waterfall-bar.anchor {
  fill: #7daee6;
}

.finance-table th {
  border-bottom-color: #d9e4ee;
}

/* Sidebar icon color pass: quiet pastel cues without adding visual weight. */
.sidebar .nav-item {
  grid-template-columns: 30px 1fr;
}

.sidebar .nav-item svg {
  width: 25px;
  height: 25px;
  padding: 4px;
  color: var(--nav-icon, #5f7183);
  background: var(--nav-icon-bg, #f1f5f8);
  box-sizing: border-box;
  stroke-width: 1.8;
}

.sidebar .nav-item:nth-child(1) {
  --nav-icon: #0b72b6;
  --nav-icon-bg: #e6f3fb;
}

.sidebar .nav-item:nth-child(2) {
  --nav-icon: #52758d;
  --nav-icon-bg: #edf5f8;
}

.sidebar .nav-item:nth-child(3) {
  --nav-icon: #5c7ec2;
  --nav-icon-bg: #eef2ff;
}

.sidebar .nav-item:nth-child(4) {
  --nav-icon: #a87932;
  --nav-icon-bg: #fbf2e4;
}

.sidebar .nav-item:nth-child(5) {
  --nav-icon: #6c75ae;
  --nav-icon-bg: #f0effb;
}

.sidebar .nav-item:nth-child(6) {
  --nav-icon: #5d8a6a;
  --nav-icon-bg: #edf7ef;
}

.sidebar .nav-item:hover svg {
  background: color-mix(in srgb, var(--nav-icon-bg) 70%, #ffffff);
}

.sidebar .nav-item.active svg {
  color: #006fb1;
  background: #dff0fb;
}

@media (max-width: 1000px) {
  .sidebar .nav-item {
    grid-template-columns: 1fr;
  }
}

/* Button roundrect pass: soften controls while preserving sharp app panels. */
.icon-button,
.primary-button,
.ghost-button,
.segmented,
.segmented button,
.finance-scenarios,
.finance-scenarios button {
  border-radius: 10px !important;
}

.icon-button {
  border-radius: 9px !important;
}

.primary-button,
.ghost-button {
  border-radius: 10px !important;
}

.segmented,
.finance-scenarios {
  padding: 3px;
  gap: 3px;
  overflow: hidden;
  border-color: #d2dfeb;
  background: #f3f7fb;
}

.segmented button,
.finance-scenarios button {
  min-height: 32px;
  border: 0;
}

.finance-scenarios button + button {
  border-left: 0;
}

.segmented button.active,
.finance-scenarios button.active {
  box-shadow: 0 2px 8px rgba(21, 43, 68, 0.1);
}

/* Theme switcher */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 34px;
  padding: 0 11px 0 7px;
  border: 1px solid #d2dfeb;
  border-radius: 999px !important;
  color: #526474;
  background: #ffffff;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.theme-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  width: 48px;
  height: 24px;
  padding: 2px;
  border-radius: 999px !important;
  background: #eaf1f7;
}

.theme-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px !important;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(15, 23, 42, 0.18);
  transition: transform 180ms ease;
}

.theme-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #8292a4;
}

.theme-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon-sun {
  color: #c78328;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f4f1e9;
  --muted: #b4aca0;
  --subtle: #8f8a82;
  --line: #3b3934;
  --line-soft: #2e2d29;
  --bg: #171715;
  --surface: #23221f;
  --surface-alt: #2b2925;
  --cpp-blue: #6bbcff;
  --cpp-blue-dark: #318ad6;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] body {
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(60, 54, 44, 0.5) 0%, rgba(23, 23, 21, 0.92) 30%, rgba(18, 18, 17, 1) 100%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    #171715;
}

html[data-theme="dark"] .app-shell {
  background: rgba(18, 18, 17, 0.74);
}

html[data-theme="dark"] .workspace {
  background: transparent;
}

html[data-theme="dark"] .sidebar {
  border-right-color: #373630;
  background: rgba(31, 31, 28, 0.9);
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.02);
}

html[data-theme="dark"] .brand {
  border-bottom-color: #34332f;
}

html[data-theme="dark"] .brand img {
  filter: brightness(0) invert(1) opacity(0.92);
}

html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .metric-card .metric-value,
html[data-theme="dark"] .analysis-stat strong,
html[data-theme="dark"] .finance-stat strong,
html[data-theme="dark"] .coverage-row strong,
html[data-theme="dark"] .project-node .project-button.active strong,
html[data-theme="dark"] .chat-message > strong {
  color: #faf6ec;
}

html[data-theme="dark"] .eyebrow,
html[data-theme="dark"] .status-line,
html[data-theme="dark"] .coverage-row,
html[data-theme="dark"] .project-button span,
html[data-theme="dark"] .project-node .project-button span,
html[data-theme="dark"] .thread-meta,
html[data-theme="dark"] .thread-foot,
html[data-theme="dark"] .source-meta,
html[data-theme="dark"] .insight-body,
html[data-theme="dark"] .decision-item p,
html[data-theme="dark"] .timeline-content p,
html[data-theme="dark"] .task-card p,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .finance-stat small,
html[data-theme="dark"] .analysis-stat small,
html[data-theme="dark"] .deal-timeline-detail,
html[data-theme="dark"] .deal-timeline-date {
  color: #b8b0a4;
}

html[data-theme="dark"] .section-kicker,
html[data-theme="dark"] .chart-title {
  color: #ff8a2b;
}

html[data-theme="dark"] .project-summary,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .agent-panel,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .deal-timeline,
html[data-theme="dark"] .chart-card,
html[data-theme="dark"] .finance-card,
html[data-theme="dark"] .analysis-stat,
html[data-theme="dark"] .finance-stat,
html[data-theme="dark"] .source-item,
html[data-theme="dark"] .task-card,
html[data-theme="dark"] .decision-item,
html[data-theme="dark"] .timeline-content,
html[data-theme="dark"] .sidebar-panel {
  border-color: #3b3934;
  background:
    linear-gradient(180deg, rgba(44, 43, 39, 0.98) 0%, rgba(34, 33, 30, 0.98) 100%),
    #23221f;
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .project-summary,
html[data-theme="dark"] .metric-card,
html[data-theme="dark"] .deal-timeline {
  background:
    linear-gradient(180deg, rgba(48, 47, 42, 0.98) 0%, rgba(33, 32, 29, 0.98) 100%),
    #24231f;
}

html[data-theme="dark"] .topbar-actions .icon-button,
html[data-theme="dark"] .ghost-button,
html[data-theme="dark"] .theme-toggle {
  border-color: #414039;
  color: #e7dfd3;
  background: #282721;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .topbar-actions .icon-button:hover,
html[data-theme="dark"] .ghost-button:hover,
html[data-theme="dark"] .theme-toggle:hover {
  border-color: #565146;
  background: #302e28;
}

html[data-theme="dark"] .primary-button {
  color: #fff7ec;
  background: linear-gradient(180deg, #ff8f2d 0%, #d86610 100%);
  box-shadow: 0 12px 26px rgba(255, 122, 24, 0.22);
}

html[data-theme="dark"] .theme-toggle-track {
  background: #181817;
  box-shadow: inset 0 0 0 1px #3c3a34;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(24px);
  background: #ff8a2b;
}

html[data-theme="dark"] .theme-icon-sun {
  color: #776f62;
}

html[data-theme="dark"] .theme-icon-moon {
  color: #ffffff;
}

html[data-theme="dark"] .nav-item {
  color: #b8b0a4;
}

html[data-theme="dark"] .nav-item:hover {
  border-color: #424039;
  color: #f4efe4;
  background: #282721;
}

html[data-theme="dark"] .nav-item.active {
  border-color: rgba(255, 138, 43, 0.38);
  color: #ffd2aa;
  background: rgba(255, 138, 43, 0.12);
  box-shadow: inset 2px 0 0 #ff8a2b;
}

html[data-theme="dark"] .sidebar .nav-item svg {
  color: var(--nav-icon);
  background: color-mix(in srgb, var(--nav-icon) 17%, #25241f);
}

html[data-theme="dark"] .sidebar .nav-item.active svg {
  color: #ffb36d;
  background: rgba(255, 138, 43, 0.16);
}

html[data-theme="dark"] .project-node .project-button,
html[data-theme="dark"] .project-node .project-button:hover,
html[data-theme="dark"] .project-node .project-button.active {
  background: transparent;
}

html[data-theme="dark"] .thread-list {
  border-left-color: #3a3934;
}

html[data-theme="dark"] .thread-item {
  color: #b8b0a4;
}

html[data-theme="dark"] .thread-item:hover,
html[data-theme="dark"] .thread-item.active {
  color: #f4efe4;
  background: rgba(255, 255, 255, 0.035);
}

html[data-theme="dark"] .thread-item.active::before {
  background: #ff8a2b;
}

html[data-theme="dark"] .mini-progress {
  background: #393832;
}

html[data-theme="dark"] .mini-progress i {
  background: #6bbcff;
}

html[data-theme="dark"] .status-pill,
html[data-theme="dark"] .live-dot {
  color: #bff0cd;
  background: rgba(49, 155, 96, 0.16);
}

html[data-theme="dark"] .thread-context span,
html[data-theme="dark"] .thread-context strong,
html[data-theme="dark"] .citation-chip,
html[data-theme="dark"] .source-link,
html[data-theme="dark"] .tag {
  border-color: #3f3d36;
  color: #9fd2ff;
  background: rgba(84, 166, 234, 0.12);
}

html[data-theme="dark"] .avatar {
  box-shadow: 0 0 0 2px #24231f;
}

html[data-theme="dark"] .metric-card {
  background:
    linear-gradient(180deg, rgba(46, 45, 40, 0.98) 0%, rgba(34, 33, 30, 0.98) 72%),
    #24231f;
}

html[data-theme="dark"] .metric-card .metric-label {
  color: #bfb6aa;
}

html[data-theme="dark"] .metric-hover {
  border-color: color-mix(in srgb, var(--metric-accent) 30%, #3d3a34);
  background: rgba(43, 41, 37, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .metric-hover strong,
html[data-theme="dark"] .metric-hover dd {
  color: #f5efe6;
}

html[data-theme="dark"] .metric-hover dt {
  color: #b8b0a4;
}

html[data-theme="dark"] .metric-change {
  color: color-mix(in srgb, var(--metric-accent) 72%, #ffffff);
}

html[data-theme="dark"] .metric-sparkline-range {
  stroke: #3d3b36;
}

html[data-theme="dark"] .metric-sparkline-area {
  opacity: 0.22;
}

html[data-theme="dark"] .metric-sparkline-start,
html[data-theme="dark"] .metric-sparkline-end {
  fill: #24231f;
}

html[data-theme="dark"] .deal-timeline-axis,
html[data-theme="dark"] .deal-timeline-tick {
  stroke: #403f39;
}

html[data-theme="dark"] .deal-timeline-label,
html[data-theme="dark"] .deal-timeline-head h3 {
  fill: #f4efe4;
  color: #f4efe4;
}

html[data-theme="dark"] .deal-timeline-head span {
  color: #b8b0a4;
}

html[data-theme="dark"] .deal-timeline-track {
  opacity: 0.28;
}

html[data-theme="dark"] .lane-title {
  border-color: rgba(107, 188, 255, 0.32) !important;
  color: #aedbff;
  background: rgba(107, 188, 255, 0.08) !important;
}

html[data-theme="dark"] .lane-stage-icon {
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .task-card.thread-focus,
html[data-theme="dark"] .timeline-item.thread-focus .timeline-content,
html[data-theme="dark"] .source-item.thread-source {
  border-color: rgba(255, 138, 43, 0.46);
  border-left-color: #ff8a2b;
  background:
    linear-gradient(180deg, rgba(54, 45, 36, 0.98) 0%, rgba(36, 33, 29, 0.98) 100%),
    #24231f;
}

html[data-theme="dark"] .segmented,
html[data-theme="dark"] .finance-scenarios {
  border-color: #3f3d36;
  background: #1e1d1a;
}

html[data-theme="dark"] .segmented button,
html[data-theme="dark"] .finance-scenarios button {
  color: #b8b0a4;
}

html[data-theme="dark"] .segmented button.active,
html[data-theme="dark"] .finance-scenarios button.active {
  color: #fff7ec;
  background: #ff7a18;
  box-shadow: 0 4px 12px rgba(255, 122, 24, 0.2);
}

html[data-theme="dark"] .source-icon {
  color: color-mix(in srgb, var(--source-color) 76%, #ffffff);
  background: color-mix(in srgb, var(--source-color) 19%, #24231f) !important;
}

html[data-theme="dark"] .source-status {
  color: #8bd59f;
}

html[data-theme="dark"] .thread-source-label {
  color: #ffad66;
}

html[data-theme="dark"] .chart-svg,
html[data-theme="dark"] .finance-svg {
  background: linear-gradient(180deg, rgba(39, 38, 34, 0.96) 0%, rgba(31, 30, 27, 0.96) 100%);
}

html[data-theme="dark"] .grid-line,
html[data-theme="dark"] .axis,
html[data-theme="dark"] .finance-axis {
  stroke: #3d3b36;
}

html[data-theme="dark"] .chart-label,
html[data-theme="dark"] .finance-label,
html[data-theme="dark"] .finance-direct-label,
html[data-theme="dark"] .finance-annotation {
  fill: #b8b0a4;
}

html[data-theme="dark"] .chart-svg rect[fill="#fff"],
html[data-theme="dark"] .chart-svg rect[fill="#ffffff"],
html[data-theme="dark"] .finance-svg rect[fill="#fff"],
html[data-theme="dark"] .finance-svg rect[fill="#ffffff"] {
  fill: #272622;
  stroke: #43413a;
}

html[data-theme="dark"] .chart-svg circle[fill="#fff"],
html[data-theme="dark"] .finance-svg circle[fill="#fff"] {
  fill: #24231f;
}

html[data-theme="dark"] .finance-line.active {
  stroke: #5eb8ff;
}

html[data-theme="dark"] .finance-line.muted {
  stroke: #776f62;
}

html[data-theme="dark"] .finance-tooltip {
  fill: #302f2a;
  stroke: #4a4740;
}

html[data-theme="dark"] .finance-tooltip-text {
  fill: #faf6ec;
}

html[data-theme="dark"] .finance-table th {
  color: #a8a095;
  border-bottom-color: #45423b;
}

html[data-theme="dark"] .finance-table td {
  color: #e6ded2;
  border-bottom-color: #34332e;
}

html[data-theme="dark"] .finance-reliability-row {
  border-bottom-color: #34332e;
}

html[data-theme="dark"] .matrix-readout div,
html[data-theme="dark"] .insight-table div,
html[data-theme="dark"] .rank-list li {
  border-color: #3c3a34;
  background: rgba(255, 255, 255, 0.026);
}

html[data-theme="dark"] .rank-list i {
  background: #3a3934;
}

html[data-theme="dark"] .decision-item {
  border-bottom-color: #33322e;
}

html[data-theme="dark"] .agent-launcher {
  color: #fff7ec;
  background: linear-gradient(180deg, #1f5f95 0%, #0b3b63 100%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.36);
}

html[data-theme="dark"] .agent-launcher .agent-launcher-icon img {
  filter: drop-shadow(0 0 10px rgba(139, 211, 255, 0.3));
}

html[data-theme="dark"] .agent-thread-bar,
html[data-theme="dark"] .chat-input {
  border-color: #3b3934;
  background: #24231f;
}

html[data-theme="dark"] .agent-scope-toggle button,
html[data-theme="dark"] .agent-thread-strip button,
html[data-theme="dark"] .prompt-chip {
  border-color: #3d3b36;
  color: #b8b0a4;
  background: #2a2925;
}

html[data-theme="dark"] .agent-scope-toggle button.active,
html[data-theme="dark"] .agent-thread-strip button.active,
html[data-theme="dark"] .prompt-chip:hover {
  border-color: rgba(255, 138, 43, 0.4);
  color: #ffd4aa;
  background: rgba(255, 138, 43, 0.12);
}

html[data-theme="dark"] .chat-message {
  color: #d9d1c4;
}

html[data-theme="dark"] .chat-message.user {
  color: #fff7ec;
  background: #a75413;
}

html[data-theme="dark"] .mini-bar-track {
  background: #3c3a34;
}

html[data-theme="dark"] .chat-artifact {
  border-top-color: #393832;
}

html[data-theme="dark"] .chat-input input {
  color: #f4efe4;
  background: #1d1c19;
}

html[data-theme="dark"] .chat-input input::placeholder {
  color: #8f8a82;
}

html[data-theme="dark"] .icon-button.send {
  color: #fff7ec;
  background: #ff7a18;
}

html[data-theme="dark"] ::selection {
  color: #171715;
  background: #ffb36d;
}

/* Dribbble-inspired day/night toggle: scenic pill, sliding orb, clouds and stars. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle {
  position: relative;
  width: 78px;
  min-width: 78px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 0;
  border-radius: 999px !important;
  background: transparent;
  box-shadow: none;
}

.theme-toggle-track {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  height: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(92, 149, 188, 0.36);
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 62% 76%, rgba(255, 255, 255, 0.95) 0 7px, transparent 8px),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.78) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 79%, rgba(255, 255, 255, 0.92) 0 7px, transparent 8px),
    linear-gradient(180deg, #7fd4ff 0%, #58b9f4 52%, #9bdcff 100%);
  box-shadow:
    inset 0 2px 5px rgba(255, 255, 255, 0.48),
    inset 0 -5px 10px rgba(9, 95, 158, 0.14),
    0 8px 20px rgba(43, 112, 167, 0.18);
}

.theme-toggle-track::before,
.theme-toggle-track::after {
  content: "";
  position: absolute;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.theme-toggle-track::before {
  right: 9px;
  bottom: 6px;
  width: 25px;
  height: 11px;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    -13px 3px 0 -1px rgba(255, 255, 255, 0.72),
    -3px -5px 0 -2px rgba(255, 255, 255, 0.75);
}

.theme-toggle-track::after {
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 20% 29%, #ffffff 0 1.4px, transparent 1.8px),
    radial-gradient(circle at 30% 68%, rgba(255, 255, 255, 0.82) 0 1.2px, transparent 1.7px),
    radial-gradient(circle at 52% 23%, rgba(255, 255, 255, 0.9) 0 1px, transparent 1.5px),
    radial-gradient(circle at 65% 58%, rgba(255, 255, 255, 0.74) 0 1.2px, transparent 1.7px);
}

.theme-toggle-thumb {
  top: 4px;
  left: 4px;
  width: 30px;
  height: 30px;
  border-radius: 999px !important;
  background:
    radial-gradient(circle at 34% 28%, #fff9b8 0 18%, transparent 19%),
    radial-gradient(circle at 58% 64%, rgba(255, 169, 48, 0.5) 0 13%, transparent 14%),
    linear-gradient(145deg, #ffe46b 0%, #ffc044 52%, #f59a24 100%);
  box-shadow:
    0 4px 12px rgba(240, 156, 41, 0.42),
    inset 0 2px 3px rgba(255, 255, 255, 0.62),
    inset 0 -3px 6px rgba(194, 101, 13, 0.22);
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background 180ms ease,
    box-shadow 180ms ease;
}

.theme-toggle-thumb::before,
.theme-toggle-thumb::after {
  content: "";
  position: absolute;
  border-radius: 999px !important;
  opacity: 0;
  transition: opacity 160ms ease;
}

.theme-toggle-thumb::before {
  top: 8px;
  left: 8px;
  width: 6px;
  height: 6px;
  background: rgba(160, 174, 195, 0.38);
}

.theme-toggle-thumb::after {
  right: 7px;
  bottom: 8px;
  width: 4px;
  height: 4px;
  background: rgba(160, 174, 195, 0.28);
  box-shadow: -8px 7px 0 1px rgba(160, 174, 195, 0.22);
}

.theme-icon {
  position: absolute;
  top: 50%;
  z-index: 2;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(255, 255, 255, 0.72);
  opacity: 0.62;
}

.theme-icon-sun {
  left: 10px;
  color: rgba(255, 255, 255, 0.78);
}

.theme-icon-moon {
  right: 10px;
  color: rgba(24, 66, 112, 0.54);
}

.theme-icon svg {
  width: 13px;
  height: 13px;
  stroke-width: 2;
}

html[data-theme="dark"] .theme-toggle {
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .theme-toggle-track {
  border-color: rgba(120, 127, 174, 0.34);
  background:
    radial-gradient(circle at 21% 78%, rgba(76, 92, 129, 0.55) 0 8px, transparent 9px),
    radial-gradient(circle at 36% 77%, rgba(76, 92, 129, 0.38) 0 6px, transparent 7px),
    linear-gradient(180deg, #1d2b63 0%, #121936 58%, #0c1025 100%);
  box-shadow:
    inset 0 2px 4px rgba(255, 255, 255, 0.1),
    inset 0 -5px 12px rgba(0, 0, 0, 0.34),
    0 9px 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .theme-toggle-track::before {
  opacity: 0;
}

html[data-theme="dark"] .theme-toggle-track::after {
  opacity: 1;
}

html[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(40px);
  background:
    radial-gradient(circle at 36% 31%, rgba(168, 179, 199, 0.52) 0 10%, transparent 11%),
    radial-gradient(circle at 68% 62%, rgba(168, 179, 199, 0.36) 0 12%, transparent 13%),
    linear-gradient(145deg, #f8fbff 0%, #d8e4f4 60%, #aebdd2 100%);
  box-shadow:
    0 4px 12px rgba(160, 179, 215, 0.32),
    inset 0 2px 4px rgba(255, 255, 255, 0.72),
    inset 0 -3px 7px rgba(92, 104, 124, 0.25);
}

html[data-theme="dark"] .theme-toggle-thumb::before,
html[data-theme="dark"] .theme-toggle-thumb::after {
  opacity: 1;
}

html[data-theme="dark"] .theme-icon-sun {
  color: rgba(255, 204, 111, 0.4);
  opacity: 0.45;
}

html[data-theme="dark"] .theme-icon-moon {
  color: rgba(255, 255, 255, 0.82);
  opacity: 0.75;
}

/* Dark-mode contrast and copilot surface refinements. */
html[data-theme="dark"] .agent-panel {
  position: relative;
  isolation: isolate;
  opacity: 1 !important;
  transform: none !important;
  animation: none;
  color: #eee7dc;
  background:
    linear-gradient(180deg, #23221e 0%, #1b1a17 100%),
    #1b1a17;
  box-shadow:
    0 34px 92px rgba(0, 0, 0, 0.56),
    0 0 0 1px rgba(255, 138, 43, 0.1);
}

html[data-theme="dark"] .agent-widget {
  z-index: 420;
}

html[data-theme="dark"] .agent-header {
  color: #f7efe2;
  background:
    linear-gradient(180deg, rgba(45, 43, 37, 0.99) 0%, rgba(31, 30, 26, 0.99) 100%),
    #22211d;
  box-shadow: inset 0 4px 0 #ff8a2b;
}

html[data-theme="dark"] .agent-header h2,
html[data-theme="dark"] .agent-header .section-kicker {
  color: #f7efe2;
}

html[data-theme="dark"] .agent-header .section-kicker {
  color: #ff9b42;
}

html[data-theme="dark"] .agent-header .icon-button {
  color: #d7cec0;
  background: transparent;
}

html[data-theme="dark"] .agent-header .icon-button:hover {
  color: #fff7ec;
  background: rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .agent-thread-bar,
html[data-theme="dark"] .prompt-row,
html[data-theme="dark"] .chat-log,
html[data-theme="dark"] .chat-input {
  background: transparent;
}

html[data-theme="dark"] .agent-thread-summary span,
html[data-theme="dark"] .agent-thread-summary em,
html[data-theme="dark"] .chat-message p,
html[data-theme="dark"] .chat-artifact li,
html[data-theme="dark"] .chat-links a,
html[data-theme="dark"] .artifact-actions button,
html[data-theme="dark"] .finance-control p,
html[data-theme="dark"] .finance-stat small,
html[data-theme="dark"] .source-meta,
html[data-theme="dark"] .insight-body,
html[data-theme="dark"] .decision-item p,
html[data-theme="dark"] .timeline-content p,
html[data-theme="dark"] .task-card p {
  color: #c8bfb1;
}

html[data-theme="dark"] .agent-thread-summary strong,
html[data-theme="dark"] .chat-message > strong,
html[data-theme="dark"] .finance-control span {
  color: #eee7dc;
}

html[data-theme="dark"] .agent-scope-toggle button,
html[data-theme="dark"] .agent-thread-strip button,
html[data-theme="dark"] .prompt-chip {
  color: #c6bdaf;
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .agent-scope-toggle button.active,
html[data-theme="dark"] .agent-thread-strip button.active,
html[data-theme="dark"] .prompt-chip:hover {
  color: #ffd0a0;
  background: rgba(255, 138, 43, 0.13);
  box-shadow: inset 0 0 0 1px rgba(255, 138, 43, 0.28);
}

html[data-theme="dark"] .chat-message {
  color: #eee7dc;
}

html[data-theme="dark"] .chat-input {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(25, 24, 21, 0.98);
}

html[data-theme="dark"] .chat-input input {
  color: #f7efe2;
  background: #171614;
  box-shadow: inset 0 0 0 1px rgba(107, 188, 255, 0.28);
}

html[data-theme="dark"] .chat-input input:focus {
  background: #141311;
  box-shadow:
    inset 0 0 0 1px rgba(107, 188, 255, 0.62),
    0 0 0 3px rgba(107, 188, 255, 0.12);
}

html[data-theme="dark"] .finance-control {
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .finance-control strong {
  color: #6bbcff;
}

html[data-theme="dark"] .finance-label,
html[data-theme="dark"] .finance-direct-label,
html[data-theme="dark"] .finance-annotation {
  fill: #c8bfb1;
}

html[data-theme="dark"] .finance-label.strong,
html[data-theme="dark"] .finance-variance-label {
  fill: #e7dfd3;
}

html[data-theme="dark"] .finance-variance-value {
  fill: #d8d0c4;
}

html[data-theme="dark"] .finance-svg {
  background:
    linear-gradient(180deg, rgba(34, 33, 29, 0.98) 0%, rgba(29, 28, 25, 0.98) 100%),
    #1d1c19;
}

html[data-theme="dark"] .finance-variance-bar.positive,
html[data-theme="dark"] .finance-waterfall-bar.positive {
  fill: #80b8ee;
}

html[data-theme="dark"] .finance-variance-bar.negative,
html[data-theme="dark"] .finance-waterfall-bar.negative {
  fill: #e19a98;
}

/* Asset-backed day/night switch. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width: 66px;
  min-width: 66px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 10px !important;
  background: var(--surface);
  box-shadow: none;
  overflow: hidden;
}

.theme-toggle-track {
  position: absolute;
  inset: 5px 7px;
  display: block;
  width: auto;
  height: auto;
  overflow: hidden;
  border: 0;
  border-radius: 999px !important;
  background: transparent;
  box-shadow: none;
}

.theme-toggle-track::before,
.theme-toggle-track::after,
.theme-toggle-thumb::before,
.theme-toggle-thumb::after {
  display: none;
}

.theme-toggle-asset {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 180ms ease;
  opacity: 0;
  transform: scale(0.92);
  filter:
    opacity(0.88)
    drop-shadow(0 4px 8px rgba(15, 23, 42, 0.08));
}

.theme-toggle-asset-light {
  opacity: 1;
}

.theme-toggle-asset-dark {
  filter:
    invert(94%)
    sepia(11%)
    saturate(350%)
    hue-rotate(346deg)
    brightness(1.02)
    opacity(0.9)
    drop-shadow(0 4px 10px rgba(0, 0, 0, 0.22));
}

html[data-theme="dark"] .theme-toggle {
  border-color: #414039;
  background: #282721;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .theme-toggle-track {
  border: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] .theme-toggle-asset-light {
  opacity: 0;
  transform: scale(0.9);
}

.theme-toggle-asset-dark {
  opacity: 0;
}

html[data-theme="dark"] .theme-toggle-asset-dark {
  opacity: 1;
  transform: scale(0.92);
}

/* Datawrapper-informed typography system. */
:root {
  --font-body: Avenir, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "IBM Plex Sans", Avenir, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-number: "IBM Plex Sans", Avenir, "Avenir Next", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ink: #111827;
  --muted: #64748b;
  --subtle: #7a8795;
  --line: #d8e2ec;
  --line-soft: #e8eef5;
  font-family: var(--font-body);
}

html[data-theme="dark"] {
  --ink: #f5efe6;
  --muted: #aaa196;
  --subtle: #938b80;
  --line: #3d3a34;
  --line-soft: #312f2a;
}

body,
button,
input,
p,
small {
  font-family: var(--font-body);
}

body {
  color: var(--ink);
  font-size: 15px;
  font-weight: 400;
  line-height: 23px;
}

h1,
h2,
h3,
.panel-header h2,
.agent-header h2,
.chart-title,
.section-kicker,
.primary-button,
.ghost-button,
.segmented button,
.finance-scenarios button,
.prompt-chip,
.agent-thread-strip button,
.agent-scope-toggle button,
.project-button strong,
.thread-topline strong,
.chat-message > strong,
.chat-artifact strong,
.lane-title,
.metric-card .metric-label,
.finance-stat span,
.finance-control span,
.analysis-stat span {
  font-family: var(--font-display);
}

h1 {
  font-size: 36px;
  font-weight: 600;
  line-height: 42px;
  letter-spacing: 0;
}

h2,
.panel-header h2,
.agent-header h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 26px;
  letter-spacing: 0;
}

h3,
.task-card h3,
.timeline-content h3,
.source-item h3,
.decision-item h3,
.chat-artifact strong {
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
}

.section-kicker {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 17px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#projectThesis,
.project-summary #projectThesis,
.task-card p,
.timeline-content p,
.decision-item p,
.insight-body,
.chat-message p,
.finance-control p,
.deal-timeline-detail {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 23px;
}

.source-meta,
.source-status,
.coverage-row,
.team-name,
.thread-meta,
.thread-foot,
.project-button span,
.metric-card small,
.finance-stat small,
.analysis-stat small,
.deal-timeline-date,
.agent-thread-summary span,
.agent-thread-summary em,
.chat-artifact li,
.artifact-actions button,
.chat-links a {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 17px;
}

.nav-item {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.nav-item.active {
  font-weight: 600;
}

.project-button strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 19px;
}

.thread-meta {
  letter-spacing: 0;
  text-transform: none;
}

.primary-button,
.ghost-button,
.segmented button,
.finance-scenarios button,
.prompt-chip,
.agent-thread-strip button,
.agent-scope-toggle button {
  font-size: 12.5px;
  font-weight: 600;
  line-height: 16px;
}

.chart-label,
.finance-label,
.finance-direct-label,
.finance-annotation,
.metric-sparkline-label,
.deal-timeline-label,
.deal-timeline-head h3,
.timeline-axis,
.timeline-meta {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 16px;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.finance-label.strong,
.finance-variance-label {
  font-weight: 600;
}

.finance-table,
.insight-table,
.finance-table td {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 20px;
}

.finance-table th,
.insight-table span,
.chat-artifact span {
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.metric-card .metric-value,
.metric-card strong,
.finance-stat strong,
.finance-control strong,
.analysis-stat strong,
.coverage-row strong,
.lane-count,
.citation-chip,
.source-link,
.chart-label,
.finance-label,
.finance-direct-label,
.finance-annotation,
.finance-table .num,
.metric-sparkline-label,
.thread-topline em,
.thread-foot span:last-child,
.thread-context,
.status-line,
.status-pill,
.live-dot,
.tag,
.avatar,
.mini-bar strong,
.timeline-marker,
.agent-thread-strip button em,
.chat-artifact span {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.metric-card .metric-value,
.metric-card strong {
  font-size: 36px;
  font-weight: 650;
  line-height: 38px;
  letter-spacing: 0;
}

.finance-stat strong,
.analysis-stat strong {
  font-size: 26px;
  font-weight: 650;
  line-height: 30px;
}

.finance-control strong {
  font-size: 22px;
  font-weight: 650;
  line-height: 26px;
}

.finance-table td {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
  line-height: 20px;
}

.finance-table td.num,
.finance-table .num {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.citation-chip,
.source-link,
.status-pill,
.live-dot,
.tag,
.lane-count,
.avatar,
.thread-topline em,
.agent-thread-strip button em,
.chat-artifact span {
  font-size: 12.5px;
  font-weight: 650;
  line-height: 16px;
}

.lane-title {
  font-size: 13.5px;
  font-weight: 600;
  line-height: 18px;
}

.chat-message > strong,
.agent-thread-summary strong,
.chat-artifact strong {
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.chat-input input {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 400;
  line-height: 23px;
}

.metric-card .metric-label,
.metric-change {
  font-weight: 600;
}

.metric-card .metric-hover strong {
  color: #0f172a;
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.25;
}

.metric-card .metric-hover dt,
.metric-card .metric-hover dd {
  font-size: 11px;
  line-height: 1.18;
}

.metric-card .metric-hover dd {
  color: #111827;
  font-family: var(--font-number);
  font-weight: 750;
}

html[data-theme="dark"] body,
html[data-theme="dark"] h1,
html[data-theme="dark"] h2,
html[data-theme="dark"] h3,
html[data-theme="dark"] .chat-message > strong,
html[data-theme="dark"] .finance-table td,
html[data-theme="dark"] .project-button strong,
html[data-theme="dark"] .thread-topline strong {
  color: #f5efe6;
}

html[data-theme="dark"] #projectThesis,
html[data-theme="dark"] .project-summary #projectThesis,
html[data-theme="dark"] .task-card p,
html[data-theme="dark"] .timeline-content p,
html[data-theme="dark"] .decision-item p,
html[data-theme="dark"] .insight-body,
html[data-theme="dark"] .chat-message p,
html[data-theme="dark"] .finance-control p,
html[data-theme="dark"] .deal-timeline-detail {
  color: #d0c7ba;
}

html[data-theme="dark"] .source-meta,
html[data-theme="dark"] .source-status,
html[data-theme="dark"] .coverage-row,
html[data-theme="dark"] .team-name,
html[data-theme="dark"] .thread-meta,
html[data-theme="dark"] .thread-foot,
html[data-theme="dark"] .project-button span,
html[data-theme="dark"] .metric-card small,
html[data-theme="dark"] .finance-stat small,
html[data-theme="dark"] .analysis-stat small,
html[data-theme="dark"] .deal-timeline-date,
html[data-theme="dark"] .agent-thread-summary span,
html[data-theme="dark"] .agent-thread-summary em,
html[data-theme="dark"] .chat-artifact li,
html[data-theme="dark"] .artifact-actions button,
html[data-theme="dark"] .chat-links a {
  color: #aaa196;
}

html[data-theme="dark"] .metric-card .metric-hover strong,
html[data-theme="dark"] .metric-card .metric-hover dd {
  color: #f5efe6;
}

html[data-theme="dark"] .metric-card .metric-hover dt {
  color: #b8b0a4;
}

html[data-theme="dark"] .chart-label,
html[data-theme="dark"] .finance-label,
html[data-theme="dark"] .finance-direct-label,
html[data-theme="dark"] .finance-annotation {
  fill: #d0c7ba;
}

html[data-theme="dark"] .finance-label.strong,
html[data-theme="dark"] .finance-variance-label {
  fill: #f5efe6;
}

/* Analytics panel alignment: all cited-evidence charts share one visual row. */
.analytics-grid {
  grid-template-columns: minmax(0, 6fr) minmax(0, 3fr) minmax(0, 3fr);
  align-items: stretch;
  gap: 12px;
}

.analytics-grid .chart-card.wide,
.analytics-grid .chart-card:nth-child(2),
.analytics-grid .chart-card:nth-child(3) {
  grid-column: auto;
}

.analytics-grid .chart-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  align-content: stretch;
  align-items: stretch;
  gap: 12px;
  min-height: 560px;
  height: 100%;
  padding: 16px 18px;
}

.analytics-grid .line-chart,
.analytics-grid .bar-chart,
.analytics-grid .matrix-chart {
  display: grid;
  align-items: center;
  min-height: 0;
  height: 100%;
}

.analytics-grid .chart-svg,
.analytics-grid .line-chart .chart-svg,
.analytics-grid .bar-chart .chart-svg,
.analytics-grid .matrix-chart .chart-svg {
  min-height: 0;
  height: 100%;
}

.analytics-grid .chart-insights {
  align-self: end;
  min-height: 104px;
}

.analytics-grid .chart-card:nth-child(2) .chart-insights,
.analytics-grid .chart-card:nth-child(3) .chart-insights {
  min-height: 176px;
}

@media (max-width: 1180px) {
  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .analytics-grid .chart-card {
    min-height: 0;
  }

  .analytics-grid .line-chart .chart-svg {
    height: 280px;
  }

  .analytics-grid .bar-chart .chart-svg,
  .analytics-grid .matrix-chart .chart-svg {
    height: 220px;
  }
}

/* Finance statement column alignment. */
.finance-table {
  table-layout: fixed;
  min-width: 920px;
}

.finance-table th,
.finance-table td {
  box-sizing: border-box;
  vertical-align: middle;
}

.finance-table th:first-child,
.finance-table td:first-child {
  width: 22%;
  text-align: left;
}

.finance-table th:nth-child(2),
.finance-table td:nth-child(2),
.finance-table th:nth-child(4),
.finance-table td:nth-child(4) {
  width: 8.5%;
}

.finance-table th:nth-child(3),
.finance-table td:nth-child(3),
.finance-table th:nth-child(5),
.finance-table td:nth-child(5) {
  width: 9.5%;
}

.finance-table th:nth-child(6),
.finance-table td:nth-child(6),
.finance-table th:nth-child(7),
.finance-table td:nth-child(7),
.finance-table th:nth-child(8),
.finance-table td:nth-child(8) {
  width: 12%;
}

.finance-table th:last-child,
.finance-table td:last-child {
  width: 6%;
}

.finance-table th:nth-child(n + 2),
.finance-table td:nth-child(n + 2) {
  text-align: right;
}

.finance-table th:last-child,
.finance-table td:last-child {
  text-align: center;
}

.finance-table td:last-child .source-link {
  justify-content: center;
  min-width: 44px;
}

/* Informative evidence charts: direct labels, forecast context, and readable axes. */
.market-forecast-chart,
.driver-score-chart,
.matrix-position-chart {
  overflow: visible;
}

.chart-soft-grid {
  stroke: #dbe5ef;
  stroke-width: 1;
  stroke-dasharray: 4 5;
  opacity: 0.72;
}

.chart-axis-line,
.matrix-frame {
  fill: none;
  stroke: #cbd7e2;
  stroke-width: 1;
}

.chart-forecast-band {
  fill: #f3f7ff;
  opacity: 0.78;
}

.chart-forecast-rule,
.driver-benchmark,
.matrix-leader {
  stroke: #9aa9bd;
  stroke-width: 1.2;
  stroke-dasharray: 5 5;
}

.market-line-actual,
.market-line-forecast {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.1;
}

.market-line-actual {
  stroke: #1f80e8;
}

.market-line-forecast {
  stroke: #6f7fd1;
  stroke-dasharray: 7 7;
}

.market-point {
  fill: #ffffff;
  stroke: #88c1f3;
  stroke-width: 2.2;
}

.market-point.forecast {
  stroke: #8f98dc;
}

.chart-hover-anchor {
  cursor: pointer;
  outline: none;
}

.chart-hit-area,
.chart-hit-rect {
  fill: transparent;
  outline: none;
  pointer-events: all;
}

.chart-hover-bg {
  fill: rgba(255, 255, 255, 0.98);
  stroke: #d8e3ec;
  stroke-width: 1;
  filter: drop-shadow(0 14px 24px rgba(15, 23, 42, 0.12));
}

.chart-hover-card {
  opacity: 0;
  transition: opacity 140ms ease;
  pointer-events: none;
}

.chart-hover-anchor:hover .chart-hover-card,
.chart-hover-anchor:focus .chart-hover-card,
.chart-hover-anchor:focus-visible .chart-hover-card,
.chart-hover-anchor:focus-within .chart-hover-card,
.chart-hover-anchor.is-active .chart-hover-card {
  opacity: 1;
}

.chart-hover-anchor:focus-visible .chart-hit-area,
.chart-hover-anchor:focus-visible .chart-hit-rect,
.chart-hit-area:focus-visible,
.chart-hit-rect:focus-visible {
  stroke: rgba(0, 114, 188, 0.34);
  stroke-width: 1.5;
}

.chart-hover-title {
  fill: #0f172a;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 750;
}

.chart-hover-label {
  fill: #66758a;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 650;
}

.chart-hover-value {
  fill: #111827;
  font-family: var(--font-number);
  font-size: 10.5px;
  font-weight: 750;
}

.chart-axis-label {
  fill: #6b7b8e;
  font-size: 12px;
}

.chart-context-label,
.chart-callout-text {
  fill: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.chart-callout-bg,
.driver-callout-bg {
  fill: #ffffff;
  stroke: #dce5ee;
  stroke-width: 1;
  filter: drop-shadow(0 10px 20px rgba(30, 55, 90, 0.08));
}

.chart-callout-value {
  fill: #111827;
  font-family: var(--font-number);
  font-size: 15px;
  font-weight: 650;
  font-variant-numeric: tabular-nums lining-nums;
}

.driver-track {
  fill: #e7edf4;
}

.driver-bar {
  opacity: 0.98;
}

.driver-rank {
  fill: #0b6fb3;
  font-weight: 650;
}

.driver-name,
.driver-value {
  fill: #334155;
  font-weight: 600;
}

.driver-readout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.driver-readout div {
  display: grid;
  gap: 2px;
  padding: 8px;
  border: 1px solid #edf2f7;
  background: #ffffff;
}

.driver-readout span {
  color: var(--muted);
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.driver-readout strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
}

.driver-readout small {
  color: var(--muted);
  font-size: 11.5px;
}

.matrix-value-zone {
  fill: #eef7ff;
  opacity: 0.72;
}

.matrix-risk-zone {
  fill: #fff7eb;
  opacity: 0.56;
}

.matrix-point {
  opacity: 0.72;
}

.matrix-point.active {
  opacity: 1;
  stroke: #ffffff;
  stroke-width: 2;
}

.matrix-active-halo {
  fill: rgba(31, 128, 232, 0.14);
}

.matrix-active-label,
.matrix-quadrant-label {
  fill: #334155;
  font-weight: 600;
}

.matrix-peer-label {
  fill: #7a8795;
  font-size: 10.5px;
}

.insight-table {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.matrix-readout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-theme="dark"] .chart-soft-grid {
  stroke: #3d3a34;
  opacity: 0.82;
}

html[data-theme="dark"] .chart-axis-line,
html[data-theme="dark"] .matrix-frame {
  stroke: #565146;
}

html[data-theme="dark"] .chart-forecast-band {
  fill: #202945;
  opacity: 0.38;
}

html[data-theme="dark"] .chart-forecast-rule,
html[data-theme="dark"] .driver-benchmark,
html[data-theme="dark"] .matrix-leader {
  stroke: #8d8578;
}

html[data-theme="dark"] .market-line-actual {
  stroke: #63adf2;
}

html[data-theme="dark"] .market-line-forecast {
  stroke: #a9a4df;
}

html[data-theme="dark"] .market-point {
  fill: #23221f;
  stroke: #88c1f3;
}

html[data-theme="dark"] .chart-hover-bg {
  fill: rgba(43, 41, 37, 0.98);
  stroke: #45413a;
}

html[data-theme="dark"] .chart-hover-title,
html[data-theme="dark"] .chart-hover-value {
  fill: #f5efe6;
}

html[data-theme="dark"] .chart-hover-label {
  fill: #b8b0a4;
}

html[data-theme="dark"] .chart-axis-label,
html[data-theme="dark"] .chart-context-label,
html[data-theme="dark"] .chart-callout-text,
html[data-theme="dark"] .matrix-peer-label {
  fill: #d0c7ba;
}

html[data-theme="dark"] .chart-callout-bg,
html[data-theme="dark"] .driver-callout-bg,
html[data-theme="dark"] .driver-readout div {
  fill: #2b2925;
  stroke: #3d3a34;
  background: #2b2925;
  border-color: #3d3a34;
}

html[data-theme="dark"] .chart-callout-value,
html[data-theme="dark"] .driver-name,
html[data-theme="dark"] .driver-value,
html[data-theme="dark"] .matrix-active-label,
html[data-theme="dark"] .matrix-quadrant-label,
html[data-theme="dark"] .driver-readout strong {
  fill: #f5efe6;
  color: #f5efe6;
}

html[data-theme="dark"] .driver-track {
  fill: #3d3a34;
}

html[data-theme="dark"] .matrix-value-zone {
  fill: #183a5d;
  opacity: 0.34;
}

html[data-theme="dark"] .matrix-risk-zone {
  fill: #4a2f19;
  opacity: 0.26;
}

html[data-theme="dark"] .matrix-active-halo {
  fill: rgba(99, 173, 242, 0.18);
}

@media (max-width: 1180px) {
  .insight-table,
  .driver-readout,
  .matrix-readout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Bare icon controls in the topbar. */
.topbar-actions .icon-button,
.topbar-actions .theme-toggle {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.topbar-actions .icon-button:hover,
.topbar-actions .theme-toggle:hover {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

.topbar-actions .icon-button:focus-visible,
.topbar-actions .theme-toggle:focus-visible {
  outline: 2px solid rgba(0, 114, 188, 0.36);
  outline-offset: 3px;
}

html[data-theme="dark"] .topbar-actions .icon-button,
html[data-theme="dark"] .topbar-actions .theme-toggle,
html[data-theme="dark"] .topbar-actions .icon-button:hover,
html[data-theme="dark"] .topbar-actions .theme-toggle:hover {
  border-color: transparent !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Keep the finance statement inside its card without wrapping the right edge. */
.finance-card.table-card {
  min-width: 0;
  overflow: hidden;
}

.finance-table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.finance-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}

.finance-table .line-col {
  width: 23%;
}

.finance-table .money-col {
  width: 9.5%;
}

.finance-table .pct-col {
  width: 9%;
}

.finance-table .variance-col {
  width: 11%;
}

.finance-table .source-col {
  width: 7%;
}

.finance-table th,
.finance-table td {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.finance-table td {
  font-size: 13px;
}

.finance-table td:last-child .source-link {
  justify-content: center;
  width: 32px;
  min-width: 0;
  padding: 0;
}

/* Private Equity Due Diligence rebrand and voice Copilot */
.app-brand {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(135deg, #0072bc, #0f9f9c);
  font-family: "IBM Plex Sans", Avenir, "Avenir Next", system-ui, sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-copy strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.1;
}

.brand-copy span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
}

.voice-console {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 86%, var(--surface-alt));
}

.voice-console-head,
.voice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.voice-console h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.15;
}

.voice-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #0b5786;
  background: #e8f4fb;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.voice-status[data-status="listening"],
.voice-status[data-status="speaking"] {
  color: #0b5a41;
  background: #e7f5ed;
}

.voice-status[data-status="thinking"] {
  color: #7c5218;
  background: #fff3df;
}

.voice-status[data-status="transcript-only"] {
  color: #744443;
  background: #fbe8e8;
}

.voice-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.voice-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 700;
}

.voice-button.primary {
  border-color: transparent;
  color: #ffffff;
  background: #0072bc;
}

.voice-button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.voice-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18);
}

.voice-transcript {
  min-height: 54px;
  max-height: 128px;
  overflow-y: auto;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  font-size: 12.5px;
  line-height: 1.4;
}

.voice-transcript p {
  margin: 0 0 8px;
}

.voice-transcript p:last-child {
  margin-bottom: 0;
}

.voice-transcript span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.voice-transcript .agent span {
  color: #0072bc;
}

.voice-provider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.voice-provider {
  display: grid;
  gap: 3px;
  min-height: 84px;
  padding: 9px;
  border: 1px solid var(--line-soft);
  border-left: 3px solid #c78328;
  border-radius: 8px;
  background: var(--surface);
}

.voice-provider.ready {
  border-left-color: #0f9f9c;
}

.voice-provider span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.voice-provider strong {
  color: var(--ink);
  font-size: 13px;
}

.voice-provider small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

html[data-theme="dark"] .brand-copy strong,
html[data-theme="dark"] .voice-console h3,
html[data-theme="dark"] .voice-provider strong {
  color: #f5efe6;
}

html[data-theme="dark"] .brand-copy span,
html[data-theme="dark"] .voice-provider small,
html[data-theme="dark"] .voice-transcript,
html[data-theme="dark"] .voice-provider span {
  color: #c9c0b4;
}

html[data-theme="dark"] .voice-console {
  border-color: #3d3a34;
  background: #25231f;
}

html[data-theme="dark"] .voice-button,
html[data-theme="dark"] .voice-transcript,
html[data-theme="dark"] .voice-provider {
  border-color: #3d3a34;
  background: #2b2925;
}

html[data-theme="dark"] .voice-button.primary {
  color: #071119;
  background: #8fc4f5;
}

@media (max-width: 720px) {
  .voice-console-head,
  .voice-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .voice-status,
  .voice-button {
    justify-content: center;
  }

  .voice-provider-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 721px) and (max-width: 820px) {
  .app-shell {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
  }

  .sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    width: auto;
    max-width: none;
    padding: 18px 14px;
    overflow-y: auto;
  }

  .workspace {
    width: auto;
    max-width: none;
    padding: 18px 18px 96px;
  }

  .nav-list {
    grid-template-columns: 1fr;
  }

  .nav-item {
    display: grid;
    grid-template-columns: 1fr;
    place-items: center;
    min-height: 42px;
    padding: 0;
  }
}

/* Copilot interaction polish */
.agent-widget {
  right: 22px;
  bottom: 22px;
  width: min(560px, calc(100vw - 32px));
}

.agent-panel {
  display: grid;
  grid-template-rows: auto auto auto minmax(220px, 1fr) auto;
  gap: 0;
  width: 100%;
  height: min(820px, calc(100vh - 86px));
  max-height: calc(100vh - 86px);
  padding: 0;
  overflow: hidden;
  border-color: #bfd2e1;
  background: #ffffff;
  box-shadow:
    0 28px 80px rgba(15, 38, 58, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.72) inset;
}

.agent-header {
  min-height: 76px;
  margin: 0;
  padding: 16px 18px 14px;
  border-bottom: 1px solid #dce7ef;
  background:
    linear-gradient(135deg, rgba(232, 245, 252, 0.96), rgba(255, 255, 255, 0.96) 58%),
    #ffffff;
}

.agent-header h2 {
  font-size: 20px;
  letter-spacing: 0;
}

.agent-header .section-kicker {
  margin-bottom: 4px;
}

.agent-header-actions {
  align-self: start;
}

.live-dot {
  gap: 6px;
  min-height: 26px;
  color: #0b5a41;
  background: #e7f5ed;
}

.live-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.agent-close {
  width: 34px;
  min-height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.agent-thread-bar {
  display: grid;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e3edf4;
  background: #fbfdff;
}

.agent-thread-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.agent-thread-summary span,
.agent-thread-summary em {
  color: #64748b;
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
  text-transform: uppercase;
}

.agent-thread-summary strong {
  min-width: 0;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-scope-toggle,
.agent-thread-strip,
.prompt-row {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.agent-scope-toggle,
.agent-thread-strip {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.agent-scope-toggle button,
.agent-thread-strip button,
.prompt-chip {
  min-height: 30px;
  max-width: 100%;
  border-color: #d5e3ee;
  color: #506577;
  background: #f8fbfd;
  font-size: 12px;
}

.agent-scope-toggle button.active,
.agent-thread-strip button.active,
.prompt-chip:hover,
.prompt-chip:focus-visible {
  color: #064f82;
  background: #e8f4fb;
  border-color: #9cc7e5;
}

.agent-thread-strip span {
  max-width: 170px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.voice-console {
  gap: 9px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin: 12px 16px;
  padding: 12px;
  border-color: #dce8f1;
  background: linear-gradient(180deg, #f9fcff, #ffffff);
}

.voice-console-head {
  align-items: flex-start;
}

.voice-console h3 {
  font-size: 14px;
}

.voice-actions {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  gap: 8px;
}

.voice-button {
  min-height: 32px;
  border-color: #d4e0ea;
  font-size: 12px;
}

.voice-button.primary {
  background: #0a67a7;
}

.voice-transcript {
  grid-column: 1 / -1;
  min-height: 46px;
  max-height: 58px;
  font-size: 12px;
}

.voice-provider-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.voice-provider {
  min-height: 58px;
  padding: 8px;
  border-left-width: 3px;
  background: #ffffff;
}

.voice-provider.standby {
  border-left-color: #8aa0b3;
}

.voice-provider span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.voice-provider strong {
  font-size: 12.5px;
}

.voice-provider small {
  display: block;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
}

.prompt-row {
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  min-height: 48px;
  padding: 8px 16px 10px;
  border-bottom: 1px solid #e3edf4;
  scrollbar-width: thin;
}

.prompt-chip {
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.chat-log {
  min-height: 0;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background:
    linear-gradient(180deg, rgba(248, 251, 253, 0.96), rgba(244, 248, 251, 0.96)),
    #f7fafc;
  box-shadow: none;
}

.chat-message {
  gap: 9px;
  max-width: 100%;
  padding: 12px;
  border: 1px solid #dce8f1;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(31, 56, 77, 0.07);
}

.chat-message.user {
  max-width: 90%;
  padding: 10px 12px;
  border-color: #0a67a7;
  border-radius: 8px;
  background: #0a67a7;
  box-shadow: 0 10px 22px rgba(10, 103, 167, 0.18);
}

.message-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.message-head strong {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.message-head span {
  min-height: 21px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #0a5f9d;
  background: #e8f4fb;
  font-size: 10.5px;
  font-weight: 800;
  white-space: nowrap;
}

.chat-message p {
  color: #526474;
  font-size: 13px;
  line-height: 1.48;
}

.chat-message.user p {
  color: #ffffff;
}

.chat-message.typing {
  width: 190px;
}

.typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 18px;
}

.typing-dots i {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #7aaed4;
  animation: copilot-typing 1s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
  animation-delay: 120ms;
}

.typing-dots i:nth-child(3) {
  animation-delay: 240ms;
}

@keyframes copilot-typing {
  0%,
  80%,
  100% {
    opacity: 0.35;
    transform: translateY(0);
  }

  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

.mini-bars {
  gap: 7px;
  padding-top: 2px;
}

.mini-bar {
  grid-template-columns: 92px minmax(0, 1fr) 34px;
}

.mini-bar-track {
  height: 6px;
  border-radius: 999px;
  background: #e2ebf2;
}

.chat-artifact {
  margin-top: 2px;
  padding: 10px;
  border: 1px solid #e3edf4;
  border-radius: 8px;
  background: #f8fbfd;
}

.chat-artifact ul {
  margin: 8px 0 0;
}

.artifact-actions button {
  min-height: 28px;
  padding: 0 9px;
  border-radius: 8px;
  color: #0a5f9d;
  background: #e8f4fb;
}

.chat-input {
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 9px;
  margin: 0;
  padding: 13px 16px 16px;
  border-top: 1px solid #dce8f1;
  background: #ffffff;
}

.chat-input input {
  min-height: 44px;
  border: 1px solid #c8d9e6;
  border-radius: 8px;
  background: #fbfdff;
  box-shadow: none;
}

.chat-input input::placeholder {
  color: #8a9aad;
}

.chat-input input:focus {
  border-color: #7eb8df;
  outline: 0;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 114, 188, 0.12);
}

.icon-button.send {
  width: 42px;
  min-height: 42px;
  border-radius: 8px;
  background: #0a67a7;
}

.icon-button.send:hover {
  background: #07578e;
}

html[data-theme="dark"] .agent-panel {
  border-color: #3d3a34;
  background: #1f1e1b;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .agent-header,
html[data-theme="dark"] .agent-thread-bar,
html[data-theme="dark"] .chat-input {
  border-color: #3d3a34;
  background: #25231f;
}

html[data-theme="dark"] .agent-header {
  background: linear-gradient(135deg, rgba(35, 46, 54, 0.98), rgba(31, 30, 27, 0.98));
}

html[data-theme="dark"] .agent-thread-summary strong,
html[data-theme="dark"] .message-head strong {
  color: #f5efe6;
}

html[data-theme="dark"] .chat-log {
  background: #1b1a18;
}

html[data-theme="dark"] .chat-message,
html[data-theme="dark"] .chat-artifact,
html[data-theme="dark"] .voice-provider {
  border-color: #3d3a34;
  background: #25231f;
}

html[data-theme="dark"] .chat-message p {
  color: #d8d0c7;
}

html[data-theme="dark"] .chat-message.user p {
  color: #ffffff;
}

html[data-theme="dark"] .chat-input input {
  border-color: #45423b;
  background: #1b1a18;
}

@media (max-width: 720px) {
  .agent-widget {
    right: 14px;
    bottom: 14px;
    width: calc(100vw - 28px);
  }

  .agent-panel {
    height: min(720px, calc(100vh - 76px));
    max-height: calc(100vh - 76px);
  }

  .voice-console {
    grid-template-columns: minmax(0, 1fr);
  }

  .voice-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .voice-provider-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .agent-thread-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .agent-thread-summary em {
    display: none;
  }
}

/* Configured launcher and nudge parity with the platform widget. */
.agent-launcher {
  --pe-launcher-background: #030213;
  --pe-launcher-hover-background: var(--pe-launcher-background);
  --pe-launcher-text-color: #ffffff;
  --pe-search-pill-label-color: var(--pe-launcher-text-color);
  --pe-search-pill-icon-color: var(--pe-launcher-text-color);
  --pe-nudge-duration: 1800ms;
  --pe-search-pulse-duration: 3200ms;
  --pe-nudge-start: #ffffff;
  --pe-nudge-accent: #c7b8ff;
  --pe-nudge-end: #7dd3fc;
  position: relative;
  isolation: isolate;
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: auto;
  min-width: min(232px, calc(100vw - 32px));
  max-width: min(360px, calc(100vw - 32px));
  min-height: 64px;
  padding: 0 20px;
  overflow: hidden;
  border: 0;
  border-radius: 40px !important;
  color: var(--pe-launcher-text-color);
  background: var(--pe-launcher-background);
  box-shadow:
    0 18px 38px rgba(3, 2, 19, 0.22),
    0 8px 18px rgba(11, 111, 179, 0.14);
  text-align: center;
  transition:
    transform 180ms ease,
    background-color 180ms ease,
    box-shadow 180ms ease;
}

.agent-launcher:hover {
  border: 0;
  background: var(--pe-launcher-hover-background);
  box-shadow:
    0 20px 44px rgba(3, 2, 19, 0.28),
    0 10px 20px rgba(11, 111, 179, 0.16);
  transform: translateY(-1px);
}

.agent-launcher-icon,
.agent-launcher-copy,
.agent-launcher-label {
  position: relative;
  z-index: 2;
}

.agent-launcher-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 0;
  color: var(--pe-search-pill-icon-color);
  background: transparent;
  box-shadow: none;
}

.agent-launcher-icon img {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.agent-launcher-copy {
  min-width: 0;
}

.agent-launcher-label,
.agent-launcher strong.agent-launcher-label {
  display: block;
  max-width: 260px;
  overflow: hidden;
  color: inherit;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-launcher[data-nudge-style="search_pill"] {
  gap: 18px;
  min-width: min(232px, calc(100vw - 32px));
  color: var(--pe-search-pill-label-color);
  background: rgba(3, 2, 19, 0.12);
  box-shadow:
    0 4px 10px rgba(0, 0, 0, 0.08),
    0 1px 4px rgba(0, 0, 0, 0.05);
}

.agent-launcher[data-nudge-style="search_pill"]::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 4px;
  border-radius: inherit;
  background: var(--pe-launcher-background, #ffffff);
  pointer-events: none;
}

.agent-launcher[data-nudge-style="search_pill"] .agent-launcher-label {
  color: var(--pe-search-pill-label-color);
  font-weight: 800;
}

.agent-launcher[data-nudge-style="search_pill"][data-has-custom-icon="false"] .agent-launcher-icon img {
  display: none;
}

.agent-launcher[data-nudge-style="search_pill"][data-has-custom-icon="false"] .agent-launcher-icon::before {
  content: "+";
  display: block;
  width: 24px;
  color: var(--pe-search-pill-icon-color, #1f1f1f);
  font-size: 32px;
  font-weight: 400;
  line-height: 24px;
}

.agent-launcher-nudge[data-nudge-style="color_sweep"] {
  animation: pe-launcher-nudge var(--pe-nudge-duration, 1800ms) cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.agent-launcher-nudge[data-nudge-style="color_sweep"] .agent-launcher-label,
.agent-launcher-nudge[data-nudge-style="search_pill"] .agent-launcher-label {
  color: transparent;
  background: linear-gradient(
    90deg,
    var(--pe-nudge-start, #ffffff) 0%,
    var(--pe-nudge-accent, #c7b8ff) 38%,
    var(--pe-nudge-end, #7dd3fc) 62%,
    var(--pe-nudge-start, #ffffff) 100%
  );
  background-size: 300% 100%;
  background-position: 140% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: pe-launcher-color-sweep var(--pe-nudge-duration, 1800ms) linear infinite;
}

.agent-launcher-nudge .agent-launcher-icon {
  animation: pe-launcher-icon-sweep var(--pe-nudge-duration, 1800ms) ease-in-out infinite;
}

.agent-launcher-nudge[data-nudge-style="search_pill"]::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background:
    conic-gradient(
      from 220deg,
      transparent 0deg,
      transparent 22deg,
      #4285f4 68deg,
      #4285f4 118deg,
      #ea4335 150deg,
      #fbbc05 184deg,
      #34a853 232deg,
      transparent 286deg,
      transparent 360deg
    );
  filter: blur(0.4px) saturate(1.35);
  opacity: 0;
  transform: rotate(-120deg);
  transform-origin: center;
  animation: pe-launcher-search-orbit var(--pe-search-pulse-duration, 3200ms) ease-in-out infinite;
  pointer-events: none;
}

@keyframes pe-launcher-nudge {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  28% {
    transform: translateY(-4px) scale(1.045);
  }

  62% {
    transform: translateY(-2px) scale(1.025);
  }
}

@keyframes pe-launcher-color-sweep {
  0% {
    background-position: 140% 0;
  }

  100% {
    background-position: -140% 0;
  }
}

@keyframes pe-launcher-icon-sweep {
  0%,
  100% {
    transform: scale(1);
  }

  38% {
    transform: scale(1.12);
  }

  62% {
    transform: scale(1.08);
  }
}

@keyframes pe-launcher-search-orbit {
  0%,
  100% {
    opacity: 0;
    transform: rotate(-130deg);
  }

  14% {
    opacity: 0;
    transform: rotate(-90deg);
  }

  24% {
    opacity: 1;
    transform: rotate(-12deg);
  }

  38% {
    opacity: 1;
    transform: rotate(92deg);
  }

  52% {
    opacity: 0.9;
    transform: rotate(206deg);
  }

  66% {
    opacity: 0.48;
    transform: rotate(318deg);
  }

  78%,
  84% {
    opacity: 0;
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .agent-launcher-nudge,
  .agent-launcher-nudge .agent-launcher-label,
  .agent-launcher-nudge .agent-launcher-icon,
  .agent-launcher-nudge[data-nudge-style="search_pill"]::after {
    animation: none;
  }
}

/* Chat composer voice behavior */
.chat-input {
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 16px;
  min-height: 88px;
  padding: 16px 24px;
  border-top: 1px solid #dbe4ec;
  background: #ffffff;
}

.chat-input input {
  width: 100%;
  min-height: 58px;
  padding: 0 30px;
  border: 1px solid #d8e0e8;
  border-radius: 999px !important;
  color: #171924;
  background: #ffffff;
  box-shadow:
    0 3px 10px rgba(15, 36, 58, 0.06),
    inset 0 0 0 1px rgba(255, 255, 255, 0.85);
  font-size: 18px;
  font-weight: 750;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    text-align 160ms ease;
}

.chat-input input::placeholder {
  color: #5f6072;
  opacity: 1;
}

.chat-input input:focus,
.chat-input[data-voice-state="listening"] input {
  border-color: #b7c7dc;
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(28, 105, 170, 0.08),
    0 6px 18px rgba(15, 36, 58, 0.08);
  text-align: left;
}

.chat-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  min-height: 64px;
  flex: 0 0 64px;
  border: 0;
  border-radius: 999px !important;
  color: #0b0c10;
  background: #eef2fb;
  box-shadow: none;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.chat-action-button:hover {
  background: #e2e8f5;
  transform: translateY(-1px);
}

.chat-action-button:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 4px rgba(11, 111, 179, 0.16),
    0 8px 18px rgba(15, 36, 58, 0.12);
}

.chat-action-button.has-input {
  color: #ffffff;
  background: #0a67a7;
}

.chat-action-button.is-listening {
  color: #ffffff;
  background: #1f2a44;
  box-shadow: 0 0 0 6px rgba(31, 42, 68, 0.12);
}

.chat-action-button.is-processing {
  color: #ffffff;
  background: #52606f;
}

.chat-action-button:disabled {
  color: #9ca4b1;
  background: #edf0f5;
  cursor: not-allowed;
  transform: none;
}

.chat-action-icon,
.chat-action-icon svg {
  display: block;
  width: 28px;
  height: 28px;
}

.chat-action-icon svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html[data-theme="dark"] .chat-input {
  border-color: #3d3a34;
  background: #25231f;
}

html[data-theme="dark"] .chat-input input {
  border-color: #46433c;
  color: #f5efe6;
  background: #1b1a18;
  box-shadow: none;
}

html[data-theme="dark"] .chat-input input::placeholder {
  color: #a79f97;
}

html[data-theme="dark"] .chat-action-button {
  color: #f7f2ea;
  background: #333833;
}

html[data-theme="dark"] .chat-action-button.has-input,
html[data-theme="dark"] .chat-action-button.is-listening {
  color: #ffffff;
  background: #0a67a7;
}

@media (max-width: 720px) {
  .chat-input {
    grid-template-columns: minmax(0, 1fr) 56px;
    gap: 12px;
    min-height: 78px;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
  }

  .chat-input input {
    min-height: 54px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 750;
  }

  .chat-action-button {
    width: 56px;
    height: 56px;
    min-height: 56px;
    flex-basis: 56px;
  }
}
