:root {
  color-scheme: light;
  --bg: #f3f6f8;
  --surface: #fffdf8;
  --surface-2: #eef5f4;
  --ink: #16212b;
  --muted: #667485;
  --line: #d7e1e7;
  --line-strong: #bfccd5;
  --accent: #0f766e;
  --accent-2: #264653;
  --warn: #a15c12;
  --code-bg: #101827;
  --code-ink: #f8fafc;
  --inline-code-bg: #e7f0ef;
  --inline-code-ink: #0f2f36;
  --mono: "SFMono-Regular", "JetBrains Mono", ui-monospace, Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 14px;
}

a {
  color: inherit;
}

.dev-shell {
  display: grid;
  gap: 18px;
  min-height: 100vh;
  padding: 18px;
}

.dev-hero,
.dev-section,
.dev-card,
.flow-card,
.doc-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(22, 33, 43, 0.06);
}

.dev-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(15, 118, 110, 0.35);
  border-radius: 8px;
  background: #ffffff;
  color: var(--accent);
  font-family: var(--mono);
  font-weight: 900;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.8vw, 2.6rem);
  letter-spacing: 0;
  line-height: 1.02;
}

.subtitle {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.hero-links a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 7px 12px;
  font-weight: 800;
  text-decoration: none;
}

.hero-links a:hover,
.dev-card:hover {
  border-color: rgba(15, 118, 110, 0.42);
}

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

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

.dev-section {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.section-head h2 {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.dev-card {
  display: grid;
  gap: 8px;
  min-height: 118px;
  padding: 16px;
  text-decoration: none;
}

.dev-card span {
  font-size: 1rem;
  font-weight: 900;
}

.dev-card small,
.flow-card small {
  color: var(--muted);
  line-height: 1.45;
}

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

.flow-card {
  padding: 14px;
}

.flow-card p {
  margin: 0 0 8px;
  color: var(--accent-2);
  font-weight: 900;
}

.flow-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 0.86rem;
}

.doc-shell {
  min-height: 100vh;
  padding: 18px;
}

.doc-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.doc-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 6px 11px;
  font-weight: 800;
  text-decoration: none;
}

.doc-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px;
}

.doc-page h1 {
  margin-bottom: 6px;
}

.doc-page h2,
.doc-page h3,
.doc-page h4 {
  margin: 26px 0 8px;
}

.doc-path {
  margin: 0 0 18px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.82rem;
}

.doc-content {
  line-height: 1.65;
}

.doc-content a {
  color: var(--accent);
  font-weight: 800;
}

.doc-content :not(pre) > code {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--inline-code-bg);
  color: var(--inline-code-ink);
  padding: 1px 5px;
  font-family: var(--mono);
  font-size: 0.88em;
  user-select: text;
}

.doc-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

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

.doc-content th {
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 0.82rem;
}

.doc-content tr:last-child td {
  border-bottom: 0;
}

.doc-code,
.mermaid {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--code-bg);
  color: var(--code-ink);
  padding: 12px;
  font-family: var(--mono);
  font-size: 0.82rem;
  line-height: 1.5;
  user-select: text;
}

.doc-content pre code {
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: inherit;
  user-select: text;
}

.doc-code code {
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  color: inherit;
  font: inherit;
}

.mermaid {
  background: #ffffff;
  color: var(--ink);
}

@media (max-width: 900px) {
  .dev-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .hero-links {
    justify-content: flex-start;
  }

  .dev-grid,
  .flow-grid {
    grid-template-columns: 1fr;
  }
}
