 :root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #07111f;
  color: #e5eefb;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(56, 189, 248, 0.18), transparent 24%),
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.15), transparent 18%),
    linear-gradient(180deg, #07111f 0%, #0b1729 100%);
}

a {
  color: inherit;
}

button,
input,
textarea {
  font: inherit;
}

code,
pre {
  font-family: 'SFMono-Regular', ui-monospace, SFMono-Regular, Menlo, monospace;
}

#root {
  min-height: 100vh;
}

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

.workspace {
  padding: 32px;
  display: grid;
  gap: 24px;
}

.card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(10, 17, 31, 0.78);
  backdrop-filter: blur(14px);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 18px 48px rgba(2, 8, 23, 0.28);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: #7dd3fc;
  margin: 0 0 12px;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

.hero h1,
.section-head h2,
.context-card h2,
.copilot-panel-header h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  line-height: 1.05;
}

.hero-copy,
.copilot-panel-header p,
.metric-card p,
.chart-caption {
  color: #b7c6dc;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 0.82rem 1.1rem;
  background: linear-gradient(135deg, #38bdf8, #2563eb);
  color: #eff6ff;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.28);
}

button:hover {
  transform: translateY(-1px);
}

button.secondary,
.link-button {
  background: rgba(30, 41, 59, 0.85);
  color: #d8e7fb;
  box-shadow: none;
}

.link-button {
  padding-left: 0;
  padding-right: 0;
  background: transparent;
  color: #7dd3fc;
}

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

.metric-card strong {
  display: block;
  font-size: 2rem;
  margin-bottom: 12px;
}

.metric-head,
.section-head,
.table-head,
.deal-row {
  display: grid;
  align-items: center;
}

.metric-head {
  grid-template-columns: 1fr auto;
  gap: 12px;
  color: #d8e7fb;
  margin-bottom: 18px;
}

.delta {
  color: #7dd3fc;
  font-size: 0.9rem;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 20px;
}

.section-head {
  grid-template-columns: 1fr auto;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head.compact {
  grid-template-columns: 1fr;
}

.bars {
  height: 220px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 18px;
  padding: 12px 0 0;
}

.bars span {
  border-radius: 20px 20px 10px 10px;
  background: linear-gradient(180deg, #38bdf8 0%, #1d4ed8 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.context-card pre {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 14px;
  color: #d9e7f8;
  line-height: 1.55;
}

.context-card h3 {
  margin: 18px 0 10px;
  font-size: 0.95rem;
  color: #8acdf3;
}

.table-head,
.deal-row {
  grid-template-columns: 1.2fr 1fr 0.7fr 0.7fr;
  gap: 12px;
}

.table-head {
  color: #8da2c0;
  font-size: 0.84rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0 0 10px;
}

.deal-list {
  display: grid;
  gap: 12px;
}

.deal-row {
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: #e2ebf8;
}

.metric-card.is-selected,
.chart-card.is-selected,
.deal-row.is-selected {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.25), 0 18px 48px rgba(2, 8, 23, 0.28);
}

.copilot-panel {
  border-left: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(2, 6, 23, 0.75);
  padding: 24px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.copilot-panel-header {
  padding: 12px 4px 0;
}

.copilot-panel :where(.copilotKitWindow, .copilotKitSidebar, .copilotKitChat) {
  height: 100%;
  max-height: calc(100vh - 160px);
}

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

  .copilot-panel {
    position: static;
    min-height: auto;
    border-left: 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
  }
}

@media (max-width: 920px) {
  .metrics-grid,
  .grid-two {
    grid-template-columns: 1fr;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 720px) {
  .workspace,
  .copilot-panel {
    padding: 18px;
  }

  .table-head {
    display: none;
  }

  .deal-row {
    grid-template-columns: 1fr 1fr;
  }
}
