* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: #0b1020;
  color: #e6edf7;
}

.app-shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
}

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

.brand-wrap {
  display: grid;
  gap: 8px;
}

.stats-panel {
  position: fixed;
  top: 0;
  left: 0;
  width: min(360px, calc(100vw - 24px));
  height: 100vh;
  padding: 24px;
  background: rgba(9, 14, 28, 0.98);
  border-right: 1px solid #22304d;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  z-index: 30;
  transform: translateX(-100%);
  transition: transform 180ms ease;
}

.stats-panel.open {
  transform: translateX(0);
}

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

.stats-panel-header h2 {
  margin: 0;
  font-size: 18px;
}

.stats-card {
  padding: 18px;
}

.stats-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 16, 0.55);
  border: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
  z-index: 20;
}

.stats-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7aa2ff;
}

h1 {
  margin: 6px 0 10px;
}

.subhead,
.muted {
  color: #9eb0ca;
}

.status-wrap {
  text-align: right;
}

.status-pill {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  background: #16203a;
  border: 1px solid #243453;
}

.chat-shell {
  min-height: 60vh;
}

.chat-thread {
  display: grid;
  gap: 16px;
}

.message {
  border-radius: 20px;
  padding: 16px 18px;
  border: 1px solid #22304d;
  background: #10172b;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.message.user {
  background: #16203a;
}

.message.assistant {
  background: linear-gradient(180deg, rgba(56, 97, 251, 0.16), rgba(16, 23, 43, 1));
}

.message-role {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ea2c4;
  margin-bottom: 8px;
}

.message-body {
  display: grid;
  gap: 12px;
}

.answer-text p {
  margin: 0;
  line-height: 1.6;
}

.executive-summary {
  padding: 18px;
}

.step-plan {
  padding: 18px;
}

.step-plan-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
  color: #e6edf7;
}

.step-plan-list li {
  line-height: 1.5;
}

.section-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ea2c4;
  margin-bottom: 10px;
}

.card {
  background: #0d1428;
  border: 1px solid #22304d;
  border-radius: 16px;
  padding: 14px;
}

.auth-panel {
  max-width: 520px;
  margin-bottom: 24px;
  padding: 22px;
}

.auth-panel h2 {
  margin: 0 0 10px;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.auth-input {
  width: 100%;
  border-radius: 14px;
  border: 1px solid #314565;
  background: #0b1020;
  color: #edf3ff;
  padding: 14px 16px;
  font: inherit;
}

.auth-input:focus {
  outline: 1px solid #7aa2ff;
  border-color: #7aa2ff;
}

.auth-actions {
  justify-content: space-between;
}

.auth-error {
  color: #ff8b8b;
  font-size: 14px;
  min-height: 20px;
}

.empty-state {
  padding: 28px;
  background: linear-gradient(180deg, rgba(56, 97, 251, 0.12), rgba(13, 20, 40, 1));
}

.empty-state-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ea2c4;
  margin-bottom: 10px;
}

.empty-state h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.2;
}

.empty-state p {
  margin: 0;
}

.chart-grid {
  display: grid;
  gap: 12px;
}

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

.chart-shell {
  overflow-x: auto;
}

.chart-axis {
  stroke: #324465;
  stroke-width: 1;
}

.chart-line {
  fill: none;
  stroke: #7aa2ff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-point {
  fill: #bad0ff;
}

.chart-bar {
  fill: #5e8dff;
}

.chart-label {
  fill: #95a8c9;
  font-size: 11px;
}

.chart-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: #9eb0ca;
}

.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  padding: 8px 10px;
  border-radius: 999px;
  background: #111b34;
  border: 1px solid #22304d;
  color: #d5e1f8;
}

.details-panel {
  border: 1px solid #22304d;
  border-radius: 14px;
  overflow: hidden;
}

.details-panel summary {
  cursor: pointer;
  padding: 12px 14px;
  background: #111a31;
  font-weight: 600;
}

.details-panel summary::-webkit-details-marker {
  display: none;
}

.details-body {
  padding: 14px;
}

.text-disclosure .details-body {
  background: #0d1428;
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.5;
}

.drawer-card {
  background: #10172b;
  border: 1px solid #22304d;
  border-radius: 16px;
  padding: 16px;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 16px;
  font-weight: 600;
  cursor: pointer;
  background: #4d7dff;
  color: white;
}

.icon-button {
  width: fit-content;
}

.secondary-button {
  background: transparent;
  border: 1px solid #314565;
  color: #dce7fb;
}

.composer {
  width: 100%;
  margin-top: 28px;
  padding: 14px;
  background: rgba(10, 16, 32, 0.94);
  border: 1px solid #243453;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

textarea {
  width: 100%;
  resize: vertical;
  min-height: 72px;
  max-height: 220px;
  border: 0;
  outline: none;
  background: transparent;
  color: #edf3ff;
  font: inherit;
}

.composer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

@media (max-width: 800px) {
  .topbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .status-wrap {
    text-align: left;
  }

  .composer-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
