:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --surface: #ffffff;
  --surface-soft: #f8fbfa;
  --line: #d7dfdc;
  --line-strong: #b8c6c1;
  --text: #17201d;
  --muted: #63716d;
  --blue: #2563eb;
  --green: #12805f;
  --coral: #d7503f;
  --amber: #a86d09;
  --ink: #101826;
  --shadow: 0 16px 40px rgba(22, 32, 29, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

a { color: inherit; }
button, input { font: inherit; }
textarea, select { font: inherit; }
h1, h2, p { margin: 0; }
h1 { font-size: 42px; line-height: 1.05; max-width: 760px; }
h2 { font-size: 20px; line-height: 1.2; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.site-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

nav a,
.button,
button {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 9px 12px;
  font-weight: 800;
  text-decoration: none;
  min-height: 38px;
  cursor: pointer;
}

nav a:hover,
.button:hover,
button:hover {
  border-color: #8fa8d8;
}

.button.primary,
button.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.workbench {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px;
  gap: 24px;
  align-items: center;
  padding: 24px 0 44px;
}

.intro {
  display: grid;
  gap: 18px;
}

.eyebrow {
  width: max-content;
  max-width: 100%;
  color: var(--green);
  background: #e8f7f1;
  border: 1px solid #bce6d5;
  border-radius: 999px;
  padding: 5px 10px;
  font-weight: 900;
}

.lead {
  max-width: 690px;
  color: var(--muted);
  font-size: 17px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.relay-visual {
  min-height: 520px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.08), transparent 32%, transparent 68%, rgba(18, 128, 95, 0.08)),
    #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
  position: relative;
  overflow: hidden;
  display: grid;
  align-content: center;
  gap: 20px;
}

.relay-visual::before {
  content: "";
  position: absolute;
  inset: 24px;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.35;
}

.lane,
.hub,
.metrics {
  position: relative;
  z-index: 1;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  border-radius: 8px;
}

.lane,
.hub {
  padding: 16px;
  display: grid;
  gap: 6px;
}

.lane span,
.hub span,
.metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hub {
  border-color: #a9c0f6;
  background: #f4f7ff;
}

.hub strong { color: #164ca9; }
.upstream { justify-self: start; width: min(100%, 340px); }
.downstream { justify-self: end; width: min(100%, 340px); }

.signal {
  position: absolute;
  height: 3px;
  background: var(--blue);
  border-radius: 999px;
  z-index: 1;
}

.signal.one {
  width: 46%;
  left: 26%;
  top: 40%;
}

.signal.two {
  width: 46%;
  left: 28%;
  top: 61%;
  background: var(--green);
}

.metrics {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  background: var(--line);
}

.metrics div {
  background: #fff;
  padding: 12px;
  min-width: 0;
}

.metrics code,
.metrics b {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
  font-size: 16px;
}

.status-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.status-band div,
.section-block,
.query-panel,
.model-panel,
.ops-card,
.endpoint-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.status-band div {
  padding: 14px;
  min-height: 82px;
}

.status-band span,
.section-head p,
.query-panel p,
.model-panel p {
  color: var(--muted);
}

.status-band span {
  display: block;
  font-size: 12px;
  font-weight: 900;
}

.status-band b {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.section-block {
  padding: 18px;
  margin: 14px 0;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}

.section-head.compact {
  display: block;
}

.text-link {
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
}

.package-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: var(--surface-soft);
  display: grid;
  gap: 12px;
  min-height: 225px;
}

.package-card strong {
  font-size: 17px;
}

.package-card small {
  display: inline-block;
  margin-left: 6px;
  color: var(--amber);
  font-size: 12px;
}

.price {
  font-size: 30px;
  line-height: 1;
  color: var(--ink);
  font-weight: 900;
}

.facts {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.facts div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
}

.console-grid,
.docs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 14px;
  background: transparent;
  border: 0;
  padding: 0;
}

.query-panel,
.model-panel,
.ops-card {
  padding: 18px;
}

.query-panel {
  display: grid;
  gap: 12px;
}

.query-panel label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.key-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 98px;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
}

textarea,
select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 10px;
  background: #fff;
}

textarea {
  resize: vertical;
  min-height: 92px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hidden-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.integration-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: var(--surface-soft);
  display: grid;
  gap: 8px;
  min-height: 152px;
}

.integration-card strong {
  display: block;
  font-size: 15px;
}

.integration-card p {
  color: var(--muted);
}

.pill {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  border: 1px solid #bce6d5;
  background: #e8f7f1;
  color: var(--green);
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
}

.pill.off {
  border-color: #ead7a6;
  background: #fff8e8;
  color: var(--amber);
}

.apply-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(320px, 1fr);
  gap: 14px;
}

.lead-form {
  display: grid;
  gap: 10px;
}

.result-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  padding: 14px;
  min-height: 148px;
  display: grid;
  gap: 10px;
}

.result-box.empty {
  color: var(--muted);
  align-content: center;
}

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

.wallet-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.wallet-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.wallet-grid b {
  display: block;
  margin-top: 4px;
}

.model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.model-list span {
  border: 1px solid #bfd0f5;
  background: #f2f6ff;
  color: #174aa6;
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 800;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.endpoint-card {
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  align-items: center;
  margin: 12px 0;
}

.endpoint-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.endpoint-card code {
  display: block;
  margin-top: 5px;
  overflow-wrap: anywhere;
}

.code-block {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111827;
  color: #edf7f2;
  padding: 16px;
  min-height: 240px;
  overflow: auto;
  white-space: pre-wrap;
}

.ops-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.ops-list div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface-soft);
}

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

.ops-list span {
  margin-top: 4px;
  color: var(--muted);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 10px 12px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  h1 { font-size: 32px; }
  .site-header {
    height: auto;
    padding: 14px 0;
    align-items: flex-start;
    flex-direction: column;
  }
  nav { justify-content: flex-start; }
  .workbench,
  .console-grid,
  .apply-layout,
  .docs-layout {
    grid-template-columns: 1fr;
  }
  .workbench {
    min-height: auto;
    padding-top: 10px;
  }
  .relay-visual {
    min-height: 460px;
  }
  .status-band {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
  }
  .status-band,
  .metrics,
  .wallet-grid,
  .key-row,
  .endpoint-card {
    grid-template-columns: 1fr;
  }
  .section-head {
    display: grid;
  }
}
