:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #637083;
  --line: #dce5ec;
  --teal: #0ea5a4;
  --blue: #2563eb;
  --green: #16a34a;
  --amber: #d97706;
  --red: #dc2626;
  --shadow: 0 18px 52px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Noto Sans SC", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220, 229, 236, 0.86);
  background: rgba(244, 247, 248, 0.9);
  backdrop-filter: blur(16px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1220px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  gap: 24px;
}

.brand,
.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  min-width: 220px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #ffffff;
  font-size: 13px;
  letter-spacing: 0;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav-links a:hover {
  color: var(--ink);
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 20px;
}

main {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 72px;
}

.hero-band {
  display: grid;
  gap: 24px;
  padding: 26px 0 18px;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 900px;
  margin-bottom: 18px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 24px;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 17px;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 780px;
  margin-bottom: 0;
  color: #3f4d5f;
  font-size: 17px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.primary-action,
.secondary-action,
.prompt-row button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 800;
  white-space: nowrap;
}

.primary-action,
.prompt-row button {
  background: var(--ink);
  color: #ffffff;
}

.secondary-action {
  border-color: var(--line);
  background: #ffffff;
}

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

.metric-card,
.panel,
.architecture-grid article,
.event-stream {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 122px;
  padding: 18px;
}

.metric-card span,
.metric-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.7fr);
  gap: 20px;
  margin-top: 14px;
}

.panel {
  padding: 22px;
}

.wide-panel,
.architecture-band {
  margin-top: 20px;
}

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

.panel-header.compact {
  align-items: center;
  margin-bottom: 8px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #e7fbfa;
  color: #087674;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.steward-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.steward-controls label,
.mini-swap-row,
.mini-swap-fields {
  display: grid;
  gap: 8px;
}

.steward-controls label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.steward-controls input,
.steward-controls select,
.prompt-row input,
.mini-swap input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 12px;
  color: var(--ink);
}

.chat-log {
  display: flex;
  flex-direction: column;
  height: 324px;
  overflow: auto;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 8px;
  line-height: 1.55;
  font-size: 14px;
}

.message.user {
  align-self: flex-end;
  background: var(--ink);
  color: #ffffff;
}

.message.ai {
  align-self: flex-start;
  border: 1px solid var(--line);
  background: #ffffff;
}

.prompt-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 12px;
}

.quick-actions,
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quick-actions button,
.segmented button,
.text-button,
.space-actions a,
.space-actions button,
.mini-swap button,
.pool-card button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.quick-actions button,
.segmented button,
.text-button {
  padding: 0 12px;
}

.segmented {
  margin-top: 0;
}

.segmented button.active {
  background: var(--ink);
  color: #ffffff;
  border-color: var(--ink);
}

.allocation-chart {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.donut {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: conic-gradient(#0ea5a4 0 42%, #2563eb 42% 68%, #16a34a 68% 87%, #d97706 87% 100%);
  position: relative;
}

.donut::after {
  content: "";
  position: absolute;
  inset: 36px;
  border-radius: 50%;
  background: #ffffff;
}

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

.allocation-list li {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: center;
  gap: 10px;
  color: #344353;
  font-size: 14px;
}

.swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.space-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 20px 0;
}

.space-actions a,
.space-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  text-align: center;
}

.mini-swap {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.mini-swap-row {
  grid-template-columns: 1fr auto;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.mini-swap-fields {
  grid-template-columns: minmax(0, 1fr) auto;
}

.mini-swap button,
.pool-card button {
  padding: 0 12px;
  color: var(--ink);
}

.mini-swap p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

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

.skill-card {
  display: grid;
  gap: 10px;
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  text-align: left;
}

.skill-card.active,
.skill-card:hover {
  border-color: var(--teal);
  box-shadow: 0 12px 30px rgba(14, 165, 164, 0.12);
}

.skill-level {
  width: fit-content;
  border-radius: 999px;
  background: #eef6ff;
  color: var(--blue);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 850;
}

.skill-card strong {
  font-size: 20px;
}

.skill-card small,
.skill-card em {
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
}

.skill-card em {
  color: #0f766e;
  font-weight: 800;
}

.code-output {
  min-height: 154px;
  margin: 14px 0 0;
  overflow: auto;
  border-radius: 8px;
  background: var(--ink);
  color: #f8fafc;
  padding: 16px;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

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

.pool-card {
  display: grid;
  gap: 12px;
  min-height: 278px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.pool-card.locked {
  opacity: 0.62;
}

.pool-topline,
.pool-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pool-card h3 {
  margin-bottom: 0;
  font-size: 19px;
}

.pool-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.pool-metrics {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfc;
}

.pool-metrics span {
  display: grid;
  gap: 3px;
}

.pool-metrics b {
  font-size: 19px;
}

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

.pool-reason {
  min-height: 66px;
}

.pool-card button {
  align-self: end;
}

.pool-card button:disabled {
  cursor: not-allowed;
  background: #eef2f6;
  color: #64748b;
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.badge.basic {
  background: #e7fbfa;
  color: #087674;
}

.badge.pro {
  background: #eef6ff;
  color: var(--blue);
}

.badge.elite {
  background: #fff4df;
  color: var(--amber);
}

.architecture-band {
  padding: 24px 0 0;
}

.section-heading {
  margin: 0 0 16px;
}

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

.architecture-grid article,
.event-stream {
  padding: 18px;
}

.architecture-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 14px;
}

.event-stream {
  margin-top: 14px;
}

.event-stream ol {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding-left: 22px;
  color: #405061;
  font-size: 13px;
}

.text-button {
  padding: 0 10px;
}

@media (max-width: 1040px) {
  .hero-content,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

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

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

  .nav-links {
    display: none;
  }
}

@media (max-width: 680px) {
  main,
  .topbar {
    width: min(100% - 20px, 1220px);
  }

  .brand {
    min-width: 0;
  }

  .brand span:last-child {
    display: none;
  }

  .summary-grid,
  .architecture-grid,
  .skills-grid,
  .pool-grid,
  .steward-controls,
  .allocation-chart,
  .space-actions {
    grid-template-columns: 1fr;
  }

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

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .prompt-row,
  .mini-swap-fields {
    grid-template-columns: 1fr;
  }

  .donut {
    margin: 0 auto;
  }

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