:root {
  color-scheme: light;
  --ink: #171515;
  --muted: #5d6561;
  --line: #dfe6e2;
  --paper: #f6f8f6;
  --panel: #ffffff;
  --warm: #7a3f62;
  --warm-dark: #51263e;
  --green: #1f624a;
  --shadow: 0 16px 44px rgba(31, 35, 52, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: inherit;
}

.topbar {
  background: rgba(246, 248, 246, 0.95);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-inner,
main {
  margin: 0 auto;
  max-width: 1040px;
  padding-left: 22px;
  padding-right: 22px;
}

.topbar-inner {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 64px;
}

.brand {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
  text-decoration: none;
}

.brand img {
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.brand-mark {
  align-items: center;
  background: var(--ink);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 42px;
  font-size: 14px;
  font-weight: 820;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  font-size: 16px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
}

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

.nav a {
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  padding: 8px 10px;
  text-decoration: none;
}

.nav a:hover {
  background: #fff;
  border-color: var(--line);
}

main {
  padding-bottom: 76px;
  padding-top: 56px;
}

.eyebrow {
  color: var(--warm);
  font-size: 13px;
  font-weight: 760;
  margin: 0 0 12px;
  text-transform: uppercase;
}

h1 {
  font-size: clamp(38px, 6vw, 68px);
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  max-width: 820px;
}

.lede {
  color: var(--muted);
  font-size: 18px;
  margin: 20px 0 0;
  max-width: 820px;
}

.meta-row {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.pill {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--green);
  font-size: 13px;
  font-weight: 760;
  padding: 8px 12px;
}

.content-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 0.78fr) minmax(280px, 0.38fr);
  margin-top: 34px;
}

.section-stack {
  display: grid;
  gap: 18px;
}

.card,
.notice,
.summary-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
}

.card h2,
.summary-panel h2 {
  font-size: 22px;
  margin: 0 0 10px;
}

.card h3 {
  font-size: 17px;
  margin: 18px 0 8px;
}

.card p,
.card li,
.notice p,
.summary-panel p,
.summary-panel li {
  color: var(--muted);
  font-size: 14px;
}

.card p,
.notice p,
.summary-panel p {
  margin: 0 0 12px;
}

.card p:last-child,
.notice p:last-child,
.summary-panel p:last-child {
  margin-bottom: 0;
}

.card ul,
.summary-panel ul {
  margin: 0;
  padding-left: 20px;
}

.summary-panel {
  align-self: start;
  box-shadow: var(--shadow);
  position: sticky;
  top: 86px;
}

.summary-panel a {
  color: var(--warm-dark);
  font-weight: 760;
  overflow-wrap: anywhere;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.button {
  align-items: center;
  border: 1px solid var(--ink);
  border-radius: 6px;
  display: inline-flex;
  font-size: 14px;
  font-weight: 760;
  min-height: 42px;
  padding: 10px 14px;
  text-decoration: none;
}

.button.primary {
  background: var(--ink);
  color: #fff;
}

.button.secondary {
  background: #fff;
  color: var(--ink);
}

.button[type="button"] {
  cursor: pointer;
}

code {
  background: #eef2ef;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: #33433c;
  font-size: 0.94em;
  padding: 2px 5px;
}

.demo-workbench {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-top: 34px;
  padding: 24px;
}

.demo-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
}

.demo-header h2 {
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
  margin: 0 0 12px;
}

.demo-header p {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.status-badge,
.scope-chip {
  background: #f2f5f3;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--warm-dark);
  display: inline-flex;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.2;
  padding: 8px 12px;
  white-space: nowrap;
}

.status-badge.is-connected {
  background: #edf7f2;
  border-color: #c8ddd4;
  color: var(--green);
}

.app-boundary {
  margin-top: 20px;
}

.app-boundary strong {
  display: block;
  margin-bottom: 8px;
}

.app-boundary ul {
  margin: 0;
  padding-left: 20px;
}

.workflow-steps {
  counter-reset: workflow;
  display: grid;
  gap: 14px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}

.workflow-step {
  align-items: flex-start;
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: 42px minmax(0, 1fr);
  padding: 18px;
}

.workflow-step.is-active {
  border-color: #b9cfc5;
}

.workflow-step.is-complete .step-index {
  background: var(--green);
  color: #fff;
}

.step-index {
  align-items: center;
  background: #eef2ef;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  display: inline-flex;
  font-size: 15px;
  font-weight: 820;
  height: 34px;
  justify-content: center;
  width: 34px;
}

.step-body {
  min-width: 0;
}

.step-body h3 {
  font-size: 18px;
  margin: 2px 0 8px;
}

.step-body p,
.status-line,
.field-label {
  color: var(--muted);
  font-size: 14px;
}

.status-line {
  margin: 12px 0 0;
}

.field-label {
  display: block;
  font-weight: 760;
  margin: 14px 0 6px;
}

.text-input {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font: inherit;
  min-height: 44px;
  padding: 10px 12px;
  width: min(100%, 360px);
}

.output-box {
  background: #f2f5f3;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #34423c;
  margin-top: 12px;
  min-height: 52px;
  overflow-wrap: anywhere;
  padding: 12px;
}

.output-box ul {
  margin: 0;
  padding-left: 20px;
}

.payload-box {
  background: #171515;
  border-radius: 8px;
  color: #f6f8f6;
  font-size: 13px;
  line-height: 1.5;
  margin: 12px 0;
  overflow-x: auto;
  padding: 14px;
}

.payload-box code {
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
  white-space: pre;
}

footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  padding: 26px 22px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar-inner {
    align-items: flex-start;
    flex-direction: column;
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .nav {
    width: 100%;
  }

  .nav a {
    padding-left: 0;
  }

  main {
    padding-top: 38px;
  }

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

  .demo-workbench {
    padding: 18px;
  }

  .demo-header {
    display: grid;
  }

  .status-badge,
  .scope-chip {
    white-space: normal;
  }

  .workflow-step {
    grid-template-columns: 1fr;
  }

  .payload-box {
    font-size: 12px;
  }

  .summary-panel {
    box-shadow: none;
    position: static;
  }
}
