:root {
  --ink: #17211d;
  --muted: #5e6a66;
  --line: #d7dfdc;
  --page: #f7f9f7;
  --panel: #ffffff;
  --panel-soft: #eef4f1;
  --green: #0b7a53;
  --blue: #1f5f99;
  --red: #a83f39;
  --gold: #b7791f;
  --shadow: 0 18px 50px rgba(20, 33, 29, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--page);
}

a {
  color: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px clamp(18px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 247, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--green), var(--blue));
  font-weight: 800;
}

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

.brand small,
.eyebrow,
.doc-meta {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topnav a,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  text-decoration: none;
  font-weight: 700;
}

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

.button.small {
  min-height: 34px;
  padding: 0 12px;
  font-size: 0.88rem;
}

main {
  display: grid;
  gap: clamp(28px, 6vw, 72px);
  padding-bottom: 56px;
}

.overview,
.workflow-band,
.docs-shell,
.run-local {
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
}

.overview {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: clamp(28px, 5vw, 56px);
  align-items: center;
  min-height: calc(100vh - 76px);
  padding: 32px 0;
}

.overview h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 5.8rem);
  line-height: 0.95;
}

.lede {
  max-width: 640px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

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

.pipeline-panel {
  min-height: 360px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

#pipelineCanvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 12 / 7;
}

.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.pipeline-steps span,
.workflow-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  text-align: center;
  font-weight: 800;
}

.workflow-band,
.run-local {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: start;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.workflow-band h2,
.run-local h2,
.sidebar-head h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
  line-height: 1.08;
}

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

.workflow-item {
  display: grid;
  gap: 8px;
  text-align: left;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.workflow-item code,
.run-local pre {
  display: block;
  overflow-x: auto;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #18211f;
  color: #e9f2ef;
  font-size: 0.92rem;
  white-space: pre-wrap;
}

.docs-shell {
  display: grid;
  grid-template-columns: minmax(250px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.doc-sidebar,
.doc-reader {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.doc-sidebar {
  position: sticky;
  top: 82px;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.sidebar-head {
  padding: 18px 18px 8px;
}

.search-field {
  display: grid;
  gap: 6px;
  padding: 0 18px 14px;
}

.search-field span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.search-field input,
.reader-toolbar select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
}

.doc-list {
  max-height: calc(100vh - 245px);
  overflow: auto;
  border-top: 1px solid var(--line);
}

.doc-button {
  display: grid;
  width: 100%;
  gap: 4px;
  padding: 12px 18px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.doc-button:hover,
.doc-button.active {
  background: var(--panel-soft);
}

.doc-button strong {
  font-size: 0.95rem;
}

.doc-button small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.doc-reader {
  min-height: 720px;
  overflow: hidden;
}

.reader-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
}

.doc-meta {
  padding: 16px 26px 0;
}

.doc-content {
  padding: 8px 26px 34px;
  line-height: 1.65;
}

.doc-content h1,
.doc-content h2,
.doc-content h3 {
  line-height: 1.15;
}

.doc-content h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.doc-content h2 {
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--line);
}

.doc-content a {
  color: var(--blue);
  font-weight: 700;
}

.doc-content pre,
.doc-content table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #121918;
  color: #edf5f2;
}

.doc-content pre {
  overflow: auto;
  padding: 16px;
}

.doc-content blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--gold);
  background: #fff8e8;
}

.doc-table-wrap {
  overflow: auto;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  color: var(--ink);
}

.doc-content th,
.doc-content td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.doc-content img {
  max-width: 100%;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .topbar,
  .topnav {
    align-items: stretch;
  }

  .topbar {
    flex-direction: column;
  }

  .topnav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .overview,
  .workflow-band,
  .run-local,
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .overview {
    min-height: auto;
  }

  .doc-sidebar {
    position: static;
    max-height: none;
  }

  .doc-list {
    max-height: 280px;
  }

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

@media (max-width: 560px) {
  .overview,
  .workflow-band,
  .docs-shell,
  .run-local {
    width: min(100% - 24px, 1180px);
  }

  .reader-toolbar {
    grid-template-columns: 1fr;
  }

  .doc-content {
    padding-inline: 16px;
  }
}
