:root {
  --bg: #f5f8f6;
  --surface: #ffffff;
  --sidebar: #f8fbfa;
  --ink: #12281f;
  --muted: #51685e;
  --brand: #1f7a57;
  --brand-dark: #0f3b2b;
  --line: #dce9e2;
  --soft-line: #edf3f0;
  --code-bg: #f7fbf9;
  --ring: #9ecdb9;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
}

a {
  color: var(--brand);
}

.docs-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--line);
}

.sidebar-inner {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.35rem 1.1rem;
  overflow-y: auto;
}

.brand {
  display: block;
  color: var(--ink);
  text-decoration: none;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.brand-title {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
}

.brand-subtitle {
  display: block;
  margin-top: 0.12rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.toc {
  display: grid;
  gap: 0.15rem;
  margin-top: 1rem;
}

.toc a {
  display: block;
  padding: 0.42rem 0.55rem;
  border-radius: 0.45rem;
  color: #244a3b;
  text-decoration: none;
  font-size: 0.94rem;
  font-weight: 600;
}

.toc a:hover {
  background: #edf5f1;
}

.toc a.toc-subitem {
  padding-left: 1.2rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.sidebar-actions {
  display: grid;
  gap: 0.45rem;
  margin-top: 1.1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

.sidebar-actions a {
  color: var(--brand-dark);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
}

.content {
  width: min(100%, 1180px);
  padding: 2.2rem 2.4rem 3rem;
}

.doc-hero {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.6rem;
  margin-bottom: 1.8rem;
}

.kicker {
  margin: 0 0 0.4rem;
  color: var(--brand);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: 2.45rem;
  line-height: 1.15;
}

.subtitle {
  max-width: 860px;
  margin: 1rem 0 1.25rem;
  color: var(--muted);
  font-size: 1.06rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.btn {
  display: inline-block;
  border: 1px solid var(--line);
  border-radius: 0.45rem;
  padding: 0.52rem 0.82rem;
  color: var(--brand-dark);
  background: var(--surface);
  text-decoration: none;
  font-weight: 700;
}

.btn.primary {
  background: var(--brand-dark);
  color: #ffffff;
  border-color: var(--brand-dark);
}

.doc-section {
  max-width: 900px;
  padding: 1.4rem 0;
  border-bottom: 1px solid var(--soft-line);
  scroll-margin-top: 1.5rem;
}

.doc-section h2 {
  margin: 0 0 0.6rem;
  font-size: 1.62rem;
  line-height: 1.25;
}

.doc-section h3 {
  margin: 0 0 0.35rem;
  font-size: 1.04rem;
}

.doc-section p {
  margin: 0.55rem 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.mini-card {
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  padding: 0.85rem;
}

.mini-card p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

ul,
ol {
  margin: 0.55rem 0 0.3rem;
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.28rem;
}

.workflow-figure {
  width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  background: #fcfffd;
  border-radius: 0.6rem;
  padding: 0.8rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1rem;
}

.workflow-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.45rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: #edf5f1;
  color: var(--brand-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.workflow-figure h3 {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.workflow-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.35rem;
}

.workflow-figure figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.workflow-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 0.9rem;
}

.workflow-links a {
  font-weight: 700;
  text-decoration: none;
}

.markdown-body {
  max-width: 860px;
}

.markdown-body h1 {
  font-size: 2rem;
  line-height: 1.18;
  margin: 0 0 1rem;
}

.markdown-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.6rem;
  font-size: 1.55rem;
}

.markdown-body h3 {
  margin-top: 1.4rem;
  margin-bottom: 0.45rem;
  font-size: 1.08rem;
}

.markdown-body p,
.markdown-body li {
  color: #244236;
}

.markdown-body img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.4rem;
}

.diagram-figure {
  margin: 1rem 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: #fcfffd;
  padding: 0.75rem;
}

.diagram-figure figcaption {
  margin-top: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  overflow: hidden;
  display: block;
  overflow-x: auto;
}

.markdown-body th,
.markdown-body td {
  border-bottom: 1px solid var(--soft-line);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

.markdown-body th {
  background: #f5faf7;
  font-weight: 700;
}

.markdown-body pre {
  margin: 0.8rem 0 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.85rem 0.95rem;
  overflow-x: auto;
}

.markdown-body pre code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.92rem;
  color: #183327;
}

.repo-tree,
.example-block {
  margin: 0.8rem 0 0;
  background: var(--code-bg);
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  padding: 0.85rem 0.95rem;
  overflow-x: auto;
}

.repo-tree code,
.example-block code,
code {
  font-family: Consolas, "Courier New", monospace;
}

.repo-tree code,
.example-block code {
  font-size: 0.92rem;
  color: #183327;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.logo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}

.logo-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 118px;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf8 100%);
}

.logo-card img {
  display: block;
  max-width: 100%;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
}

.section-links a {
  font-weight: 700;
  text-decoration: none;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  padding: 1rem 2rem;
  margin-left: 280px;
}

a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

@media (max-width: 980px) {
  .docs-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sidebar-inner {
    position: static;
    height: auto;
    padding: 0.9rem 1rem;
  }

  .brand {
    padding-bottom: 0.7rem;
  }

  .toc {
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    overflow-x: auto;
    padding-bottom: 0.25rem;
  }

  .sidebar-actions {
    display: none;
  }

  .content {
    padding: 1.4rem 1rem 2rem;
  }

  .footer {
    margin-left: 0;
  }
}

@media (max-width: 760px) {
  h1 {
    font-size: 2rem;
  }

  .summary-grid,
  .grid-2,
  .logo-strip {
    grid-template-columns: 1fr;
  }

  .doc-section {
    padding: 1.15rem 0;
  }
}
