* {
  box-sizing: border-box;
}

:root {
  --ink: #111827;
  --muted: #4b5563;
  --line: #9ca3af;
  --soft: #f3f4f6;
  --paper: #ffffff;
  --accent: #0f766e;
  --warn: #92400e;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  background: var(--paper);
  min-height: 100vh;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.topbar {
  border-bottom: 2px solid var(--ink);
  padding: 28px 36px 22px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
  letter-spacing: 0;
}

.topbar p {
  margin: 0;
  max-width: 920px;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 14px 36px;
  border-bottom: 1px solid var(--line);
  background: var(--soft);
}

.nav a {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 10px;
  font-size: 13px;
}

.content {
  padding: 32px 36px 52px;
}

h2 {
  margin: 34px 0 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
  font-size: 22px;
}

h3 {
  margin: 24px 0 10px;
  font-size: 17px;
}

.lead {
  max-width: 980px;
  color: var(--muted);
}

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

.card,
.module {
  border: 1px solid var(--line);
  background: #fff;
  padding: 14px;
}

.module h3,
.card h3 {
  margin-top: 0;
}

.meta {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
}

.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 10px;
  margin: 16px 0 22px;
  padding: 14px;
  border: 1px solid var(--line);
  background: #f9fafb;
}

.step {
  border: 1px solid var(--ink);
  background: #fff;
  padding: 10px 12px;
  min-width: 150px;
  flex: 1 1 150px;
}

.step strong {
  display: block;
  margin-bottom: 4px;
}

.arrow {
  align-self: center;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.subflow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 10px 0;
}

.subflow div {
  border-left: 4px solid var(--accent);
  background: #f9fafb;
  padding: 9px 11px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
}

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

.table th {
  background: var(--soft);
}

.code,
pre {
  border: 1px solid var(--line);
  background: #f9fafb;
  padding: 12px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.callout {
  border-left: 4px solid var(--warn);
  background: #fffbeb;
  padding: 12px 14px;
  margin: 16px 0;
}

.toc {
  columns: 2;
  column-gap: 32px;
}

.toc li {
  break-inside: avoid;
  margin: 6px 0;
}

@media (max-width: 760px) {
  .topbar,
  .content,
  .nav {
    padding-left: 18px;
    padding-right: 18px;
  }

  .arrow {
    display: none;
  }

  .toc {
    columns: 1;
  }
}
