:root {
  --accent: #6d28ff;
  --accent-dark: #4c16d7;
  --accent-soft: rgba(109, 40, 255, 0.1);
  --ink: #070817;
  --muted: #666d82;
  --line: #e8e9f2;
  --panel: #ffffff;
  --soft: #f7f8fc;
  --green: #0f9f6e;
  --shadow: 0 24px 70px rgba(25, 23, 49, 0.1);
  --search-bg: rgba(255, 255, 255, 0.92);
}

.brain-hero,
.hero-stats,
.section-header,
.rail-header {
  display: flex;
  align-items: center;
}

.brain-orb,
.chat-message span {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #0a0b18, var(--accent));
  font-weight: 820;
}

.brain-hero,
.chat-panel,
.rail-panel {
  position: static;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-form input:focus {
  border-color: rgba(109, 40, 255, 0.45);
  outline: 3px solid rgba(109, 40, 255, 0.1);
}

.brain-main {
  display: grid;
  gap: 20px;
  max-width: 1480px;
  margin: 0 auto;
  padding: 24px 30px 42px;
}

.brain-hero {
  position: relative;
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr) minmax(420px, 1.1fr);
  gap: 24px;
  overflow: hidden;
  padding: 28px;
}

.brain-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    radial-gradient(circle at 78% 20%, rgba(109, 40, 255, 0.16), transparent 28%),
    linear-gradient(135deg, rgba(255, 255, 255, 0), rgba(109, 40, 255, 0.05));
}

.brain-orb,
.brain-copy,
.hero-stats {
  position: relative;
}

.brain-orb {
  width: 112px;
  height: 112px;
  border-radius: 999px;
  box-shadow: 0 24px 70px rgba(109, 40, 255, 0.26);
}

.brain-orb span {
  position: absolute;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: inherit;
}

.brain-copy h2 {
  margin: 6px 0 8px;
  font-size: 34px;
}

.brain-copy h2 span {
  color: var(--green);
}

.brain-copy p {
  margin: 0 0 4px;
  color: #24283d;
  font-size: 15px;
  font-weight: 680;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.hero-stats div {
  border-inline-start: 1px solid rgba(109, 40, 255, 0.14);
  padding-inline-start: 16px;
}

.hero-stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.hero-stats strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.brain-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 360px);
  align-items: start;
  gap: 20px;
  min-width: 0;
}

.brain-primary,
.brain-rail {
  display: grid;
  min-width: 0;
  gap: 18px;
}

.brain-rail {
  position: static;
  width: 100%;
  align-content: start;
}

.chat-panel,
.rail-panel {
  min-width: 0;
  padding: 20px;
}

.section-header,
.rail-header {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-header h2,
.rail-header h2 {
  margin: 4px 0 0;
  font-size: 18px;
}

.status-pill {
  border: 1px solid rgba(15, 159, 110, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--green);
  background: rgba(15, 159, 110, 0.08);
  font-size: 12px;
  font-weight: 780;
}

.chat-log {
  display: grid;
  min-height: 420px;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(109, 40, 255, 0.04), rgba(255, 255, 255, 0)),
    #ffffff;
}

.chat-message {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  max-width: 82%;
}

.chat-message span {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 11px;
}

.chat-message p {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px 14px;
  color: #22263d;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(24, 29, 54, 0.06);
  line-height: 1.45;
}

.chat-message.user {
  grid-template-columns: minmax(0, 1fr) 36px;
  justify-self: end;
}

.chat-message.user span {
  grid-column: 2;
  grid-row: 1;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.chat-message.user p {
  grid-column: 1;
  grid-row: 1;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.prompt-chips button {
  min-height: 44px;
  border: 1px solid rgba(109, 40, 255, 0.14);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--accent);
  background: #ffffff;
  font-size: 12px;
  font-weight: 760;
  box-shadow: 0 12px 26px rgba(24, 29, 54, 0.05);
}

.prompt-chips button:focus-visible,
.chat-form button:focus-visible {
  outline: 3px solid rgba(109, 40, 255, 0.2);
  outline-offset: 2px;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 16px;
}

.chat-form input {
  min-width: 0;
  height: 50px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  color: var(--ink);
  background: #ffffff;
}

.chat-form button {
  border: 0;
  border-radius: 8px;
  padding: 0 20px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  font-weight: 820;
  box-shadow: 0 16px 36px rgba(109, 40, 255, 0.24);
}

.chat-form button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.plan-list,
.memory-list,
.worker-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-list article,
.worker-list article,
.memory-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #ffffff;
}

.plan-list strong,
.worker-list strong,
.plan-list span,
.worker-list span {
  display: block;
}

.plan-list strong,
.worker-list strong {
  font-size: 14px;
}

.plan-list span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.memory-list li {
  color: #252943;
  font-size: 13px;
  font-weight: 760;
}

.worker-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.worker-list span {
  border-radius: 999px;
  padding: 6px 9px;
  color: var(--green);
  background: rgba(15, 159, 110, 0.1);
  font-size: 12px;
  font-weight: 780;
}

@media (max-width: 1260px) {
.brain-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .hero-stats {
    grid-column: 1 / -1;
  }

  .brain-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 900px) {
.brain-main {
    padding: 18px 18px 104px;
  }

  .brain-hero,
.hero-stats,
.brain-rail {
    grid-template-columns: 1fr;
  }

  .brain-orb {
    width: 92px;
    height: 92px;
  }

  .chat-log {
    min-height: 360px;
  }
}

@media (max-width: 560px) {
.brain-main {
    gap: 16px;
  }

  .brain-hero,
.chat-panel,
.rail-panel {
    padding: 16px;
  }

  .brain-copy h2 {
    font-size: 28px;
  }

  .section-header,
.rail-header {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form button {
    min-height: 46px;
  }
}
