@import url("./brand.css");

/* ============================================================
   aidokit docs site — modern, clean stylesheet
   Palette: slate + indigo accent (aidokit brand)
   Type: system-ui sans (Inter-compatible fallback chain), no webfonts.
   ============================================================ */

:root {
  /* surfaces */
  --bg: #eef0f8;
  --bg-alt: #e3e6f2;
  --bg-code: #e8eaf3;
  --bg-banner: #0b1220;

  /* text */
  --text: #0b1220;
  --text-strong: #020617;
  --text-muted: #334155;
  --text-dim: #64748b;

  /* lines */
  --border: color-mix(in srgb, #0b1220 16%, transparent);
  --border-strong: color-mix(in srgb, #0b1220 28%, transparent);

  /* accent — aidokit indigo */
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-soft: #eef2ff;
  --accent-strong: #4338ca;

  /* state colors — kept thematic */
  --warn: #b45309;
  --warn-soft: #fffbeb;
  --warn-border: #fde68a;
  --info: #0891b2;
  --info-soft: #ecfeff;
  --info-border: #a5f3fc;
  --success: #15803d;
  --success-soft: #f0fdf4;
  --success-border: #bbf7d0;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;

  /* layout */
  --maxw: 1280px;
  --sidebar-w: 260px;
  --toc-w: 220px;
  --topbar-h: 60px;

  /* type */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* shadows */
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 12px 32px -8px rgba(15, 23, 42, 0.12);
  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01", "ss03";
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 100ms ease;
}
a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

code, pre, kbd { font-family: var(--font-mono); font-size: 0.9em; }

code {
  background: var(--bg-code);
  padding: 0.12em 0.4em;
  border-radius: 4px;
  font-size: 0.86em;
  color: var(--text-strong);
  border: 1px solid var(--border);
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 1em 1.2em;
  overflow-x: auto;
  line-height: 1.6;
  margin: 1.25em 0;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
}
pre code {
  background: transparent;
  padding: 0;
  border: none;
  color: inherit;
  font-size: inherit;
}

hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-strong);
  margin-top: 2em;
  margin-bottom: 0.6em;
  letter-spacing: -0.015em;
}
h1 { font-size: 2.1rem; margin-top: 0; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 1.45rem; padding-top: 0.4em; }
h3 { font-size: 1.15rem; }
h4 { font-size: 0.92rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-weight: 600; }

p { margin: 1em 0; color: var(--text); }
ul, ol { padding-left: 1.4em; margin: 1em 0; }
li { margin: 0.3em 0; }
li > p { margin: 0.3em 0; }
li::marker { color: var(--text-dim); }

blockquote {
  margin: 1.2em 0;
  padding: 0.85em 1.1em;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
blockquote p { margin: 0.3em 0; }

/* tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.93rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.65em 0.95em;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
th {
  background: var(--bg-alt);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
td code { font-size: 0.85em; }

/* ===================== Topbar ===================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--topbar-h);
  display: flex;
  align-items: center;
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.5em;
  display: flex;
  align-items: center;
  gap: 1.4em;
  width: 100%;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-strong);
  letter-spacing: -0.015em;
}
.brand:hover { color: var(--text-strong); text-decoration: none; }
.brand-mark {
  display: inline-block;
  width: 22px;
  height: 22px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-radius: 5px;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid white;
  border-radius: 2px;
  border-right: none;
  border-bottom: none;
}
.brand-tag {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--bg-alt);
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-weight: 500;
  margin-left: 0.2em;
}

.topnav {
  display: flex;
  gap: 1.5em;
  margin-left: auto;
  font-size: 0.92rem;
  font-weight: 500;
}
.topnav a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
  transition: color 100ms ease, border-color 100ms ease;
}
.topnav a:hover, .topnav a.active {
  color: var(--text-strong);
  text-decoration: none;
}
.topnav a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.menu-toggle {
  display: none;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.4em 0.8em;
  cursor: pointer;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
}
.menu-toggle:hover { background: var(--border); }

/* ===================== Shell layout ===================== */
.shell {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2em 1.5em 3em;
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 3em;
  align-items: start;
}

aside.sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 1em);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 2em);
  overflow-y: auto;
  font-size: 0.91rem;
  padding-right: 0.5em;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
aside.sidebar::-webkit-scrollbar { width: 6px; }
aside.sidebar::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }

.sidebar h5 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-strong);
  margin: 1.5em 0 0.5em;
  font-weight: 700;
  padding: 0 0.7em;
}
.sidebar h5:first-child { margin-top: 0; }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin: 0; }
.sidebar a {
  display: block;
  padding: 0.4em 0.7em;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: background 80ms ease, color 80ms ease;
  line-height: 1.45;
}
.sidebar a:hover { background: var(--bg-alt); color: var(--text-strong); text-decoration: none; }
.sidebar a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}

/* ===================== Main content ===================== */
main.content {
  min-width: 0;
  max-width: 760px;
}
main.content > .lead {
  font-size: 1.13rem;
  color: var(--text-muted);
  margin-top: 0.4em;
  margin-bottom: 2.2em;
  line-height: 1.55;
}

main.content h2 {
  scroll-margin-top: calc(var(--topbar-h) + 1em);
}

/* anchors */
.heading-anchor {
  opacity: 0;
  margin-left: 0.4em;
  color: var(--text-dim);
  font-weight: 400;
  text-decoration: none;
}
h2:hover .heading-anchor, h3:hover .heading-anchor { opacity: 1; }
.heading-anchor:hover { color: var(--accent); }

/* ===================== Callouts ===================== */
.callout {
  margin: 1.5em 0;
  padding: 0.9em 1.15em;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: 0.95rem;
  background: var(--bg-alt);
  display: flex;
  gap: 0.85em;
  align-items: flex-start;
}
.callout .icon {
  flex-shrink: 0;
  font-weight: 700;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.78rem;
  margin-top: 1px;
}
.callout .body { flex: 1; min-width: 0; }
.callout .label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 0.2em;
}
.callout p { margin: 0.25em 0; }
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.callout.note    { background: var(--info-soft);    border-color: var(--info-border); }
.callout.note .icon  { background: var(--info); color: white; }
.callout.note .label { color: var(--info); }

.callout.tip     { background: var(--success-soft); border-color: var(--success-border); }
.callout.tip .icon   { background: var(--success); color: white; }
.callout.tip .label  { color: var(--success); }

.callout.warn,
.callout.warning { background: var(--warn-soft);    border-color: var(--warn-border); }
.callout.warn .icon, .callout.warning .icon { background: var(--warn); color: white; }
.callout.warn .label, .callout.warning .label { color: var(--warn); }

.callout.important { background: var(--accent-soft); border-color: #bfdbfe; }
.callout.important .icon  { background: var(--accent); color: white; }
.callout.important .label { color: var(--accent); }

.callout.todo    { background: var(--bg-alt);       border-color: var(--border-strong); border-style: dashed; }
.callout.todo .icon  { background: var(--text-muted); color: white; }
.callout.todo .label { color: var(--text-muted); }

/* ===================== Code blocks ===================== */
.code-block {
  margin: 1.4em 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-alt);
  padding: 0.45em 1em;
  border-bottom: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-weight: 500;
}
.code-block pre { margin: 0; border-radius: 0; box-shadow: none; }
.copy-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  transition: all 80ms ease;
}
.copy-btn:hover { background: var(--bg); color: var(--text); border-color: var(--border-strong); }

/* badges */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.01em;
  vertical-align: middle;
}
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: #bfdbfe; }
.badge.green { background: var(--success-soft); color: var(--success); border-color: var(--success-border); }
.badge.gray { background: var(--bg-code); color: var(--text-dim); border-color: var(--border); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-border); }

/* page footer (prev / next) */
.page-footer {
  margin: 3.5em 0 0.5em;
  padding-top: 1.5em;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1em;
}
.page-footer a {
  display: block;
  padding: 0.9em 1.1em;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-strong);
  text-decoration: none;
  transition: all 100ms ease;
  font-weight: 600;
  font-size: 0.95rem;
}
.page-footer a:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
  transform: translateY(-1px);
}
.page-footer .arrow {
  display: block;
  color: var(--text-dim);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.2em;
}
.page-footer .next { text-align: right; }

/* site footer */
footer.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 5em;
  background: var(--bg-alt);
}
footer.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.5em 1.5em 2em;
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 2.5em;
  font-size: 0.92rem;
}
footer.site-footer h6 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-strong);
  margin: 0 0 0.7em;
  font-weight: 700;
}
footer.site-footer ul { list-style: none; padding: 0; margin: 0; }
footer.site-footer li { margin: 0.3em 0; }
footer.site-footer a { color: var(--text-muted); text-decoration: none; }
footer.site-footer a:hover { color: var(--text-strong); text-decoration: underline; }
footer.site-footer .copy {
  grid-column: 1 / -1;
  border-top: 1px solid var(--border);
  padding-top: 1.2em;
  margin-top: 1.5em;
  color: var(--text-dim);
  font-size: 0.85em;
}

/* ===================== Landing page ===================== */
.banner {
  background: var(--bg-banner);
  color: rgba(255,255,255,0.9);
  padding: 0.55em 1em;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 500;
}
.banner a {
  color: white;
  text-decoration: underline;
  text-decoration-color: rgba(255,255,255,0.4);
  text-underline-offset: 3px;
}
.banner a:hover { text-decoration-color: white; }
.banner code {
  background: rgba(255,255,255,0.12);
  color: white;
  border-color: rgba(255,255,255,0.18);
}

.hero {
  padding: 5em 1.5em 4em;
  max-width: var(--maxw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 4em;
  align-items: center;
}
.hero h1 {
  font-size: 3.2rem;
  line-height: 1.05;
  margin: 0 0 0.6em;
  letter-spacing: -0.035em;
  font-weight: 800;
  color: var(--text-strong);
}
.hero p.tagline {
  font-size: 1.18rem;
  color: var(--text-muted);
  margin: 0 0 1.8em;
  line-height: 1.55;
  max-width: 540px;
}
.hero .cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6em;
  margin-bottom: 1.6em;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.75em 1.3em;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 120ms ease;
  font-family: inherit;
}
.btn.primary {
  background: var(--accent);
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn.primary:hover {
  background: var(--accent-hover);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.btn.ghost {
  background: var(--bg);
  color: var(--text-strong);
  border-color: var(--border-strong);
}
.btn.ghost:hover {
  background: var(--bg-alt);
  border-color: var(--text-muted);
  text-decoration: none;
}

.hero-code {
  background: #0f172a;
  color: #e2e8f0;
  padding: 1.4em 1.7em;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.7;
  overflow-x: auto;
  box-shadow: var(--shadow-lg);
  border: 1px solid #1e293b;
  position: relative;
}
.hero-code::before {
  content: "";
  position: absolute;
  top: 0.9em;
  left: 1em;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 18px 0 0 #f59e0b, 36px 0 0 #10b981;
}
.hero-code { padding-top: 2.4em; }
.hero-code .prompt { color: #64748b; user-select: none; }
.hero-code .cmt { color: #64748b; }
.hero-code .ok { color: #4ade80; }
.hero-code .warn { color: #fbbf24; }
.hero-code .key { color: #60a5fa; }

section.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5em 1.5em;
}
section.section.invert {
  background: var(--bg-alt);
  max-width: none;
  padding-left: max(1.5em, calc((100vw - var(--maxw)) / 2 + 1.5em));
  padding-right: max(1.5em, calc((100vw - var(--maxw)) / 2 + 1.5em));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
section.section h2 {
  font-size: 2rem;
  margin: 0 0 0.4em;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text-strong);
}
section.section p.sublead {
  color: var(--text-muted);
  font-size: 1.08rem;
  max-width: 640px;
  margin: 0 0 2.5em;
  line-height: 1.55;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5em;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5em;
}

.feature {
  padding: 1.6em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 120ms ease;
}
.feature:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.feature.flat {
  background: transparent;
  border: none;
  padding: 0;
}
.feature.flat:hover { box-shadow: none; transform: none; }
.feature h3 {
  margin: 0 0 0.4em;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-strong);
}
.feature p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* responsive */
@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    padding: 3em 1.5em;
    gap: 2.5em;
  }
  .hero h1 { font-size: 2.4rem; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  footer.site-footer .inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .shell {
    grid-template-columns: 1fr;
    gap: 1em;
    padding: 1.2em;
  }
  aside.sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 1em;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1em;
    display: none;
  }
  aside.sidebar.open { display: block; }
  .menu-toggle { display: inline-block; }
  .topnav { display: none; }
  .topbar-inner { gap: 0.8em; }
  .brand-tag { display: none; }
  footer.site-footer .inner { grid-template-columns: 1fr; }
  .page-footer { grid-template-columns: 1fr; }
}

/* utility */
.muted { color: var(--text-muted); }
.center { text-align: center; }
.divider { height: 1px; background: var(--border); margin: 2em 0; border: none; }

/* mermaid container */
.mermaid {
  margin: 1.5em 0;
  padding: 1.4em 1.2em;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
  overflow-x: auto;
}
.mermaid svg { max-width: 100% !important; height: auto !important; }

/* Diagram caption (place under .mermaid blocks) */
.diagram-caption {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: -0.6em 0 1.5em;
  font-style: italic;
}

/* ===================== Mode switch (Docs ↔ Wiki) ===================== */
.mode-switch {
  display: inline-flex;
  align-items: center;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-left: 0.8em;
}
.mode-switch a {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 4px 12px;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 999px;
  transition: all 100ms ease;
  letter-spacing: 0.01em;
}
.mode-switch a:hover { color: var(--text-strong); text-decoration: none; }
.mode-switch a.active {
  background: var(--bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}
.mode-switch a .dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.mode-switch a.active .dot { background: var(--accent); }

/* ===================== Journey / onboarding timeline ===================== */
.journey {
  margin: 2em 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
  counter-reset: jstep;
}
.journey-step {
  position: relative;
  padding: 1.2em 1.1em 1.1em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all 120ms ease;
}
.journey-step::before {
  counter-increment: jstep;
  content: counter(jstep);
  position: absolute;
  top: -14px;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}
.journey-step h4 {
  margin: 0.4em 0 0.4em;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 700;
}
.journey-step h3 {
  margin: 0 0 0.4em;
  font-size: 1rem;
  color: var(--text-strong);
}
.journey-step p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.journey-step:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
@media (max-width: 900px) { .journey { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .journey { grid-template-columns: 1fr; } }

/* ===================== KPI / stat row ===================== */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1em;
  margin: 1.5em 0 2em;
}
.stat {
  padding: 1.1em 1.2em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: left;
}
.stat .num {
  display: block;
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat .lbl {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2em;
}
@media (max-width: 900px) { .stat-row { grid-template-columns: 1fr 1fr; } }

/* ===================== Two-view selector (Docs vs Wiki big cards) ===================== */
.view-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4em;
  margin: 2em 0;
}
.view-card {
  display: block;
  padding: 1.9em 1.7em;
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: all 150ms ease;
  position: relative;
}
.view-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  text-decoration: none;
}
.view-card .tag {
  display: inline-block;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 0.8em;
}
.view-card h3 {
  margin: 0.2em 0 0.4em;
  font-size: 1.35rem;
  color: var(--text-strong);
}
.view-card p {
  color: var(--text-muted);
  margin: 0.4em 0;
  font-size: 0.95rem;
}
.view-card ul {
  margin: 0.8em 0 0.5em;
  padding-left: 1.2em;
}
.view-card li {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin: 0.2em 0;
}
.view-card .open {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  margin-top: 1em;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
}
@media (max-width: 760px) { .view-pick { grid-template-columns: 1fr; } }

/* role chip (used in workflow diagrams listing) */
.role-chip {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 6px;
  background: var(--bg-code);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 0.8rem;
  border: 1px solid var(--border);
  margin: 0 2px;
}

/* pygments syntax highlighting (light overlay on dark pre) */
.highlight { margin: 1.25em 0; }
.highlight pre { margin: 0; }
.codehilite { margin: 1.25em 0; }
.codehilite pre { margin: 0; }
.codehilite .c, .codehilite .cm, .codehilite .c1 { color: #94a3b8; font-style: italic; }
.codehilite .k, .codehilite .kd, .codehilite .kn, .codehilite .kc, .codehilite .kr { color: #c084fc; }
.codehilite .s, .codehilite .s1, .codehilite .s2 { color: #fcd34d; }
.codehilite .n, .codehilite .nv { color: #e2e8f0; }
.codehilite .nf, .codehilite .nc { color: #60a5fa; }
.codehilite .o, .codehilite .p { color: #94a3b8; }
.codehilite .mi, .codehilite .mf { color: #fb7185; }
.codehilite .bp, .codehilite .nb { color: #5eead4; }
.codehilite .nt { color: #60a5fa; }
.codehilite .na { color: #5eead4; }

/* prevent code overflow */
main.content pre { font-size: 12.8px; }
@media (min-width: 760px) { main.content pre { font-size: 13.2px; } }

/* Mermaid click-to-enlarge */
.mermaid-wrap {
  position: relative;
}
pre.mermaid { position: relative; }
.mermaid-expand {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-family: var(--font-sans);
  font-weight: 600;
  background: var(--surface, #fff);
  color: var(--accent, #6366f1);
  border: 1px solid var(--border, rgba(15,23,42,0.16));
  border-radius: 999px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 150ms;
  z-index: 2;
  box-shadow: var(--shadow-sm, 0 1px 2px rgba(15,23,42,0.04));
}
.mermaid-wrap:hover .mermaid-expand,
.mermaid-wrap:focus-within .mermaid-expand { opacity: 1; }
.mermaid-expand:hover { color: var(--accent-hover, #4f46e5); border-color: var(--accent, #6366f1); }

.mermaid-modal {
  position: fixed;
  inset: 0;
  background: rgba(11,18,32,0.92);
  z-index: 9999;
  display: flex;
  flex-direction: column;
}
.mermaid-toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.4);
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mermaid-toolbar button {
  min-width: 40px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-sans, system-ui, sans-serif);
}
.mermaid-toolbar button:hover { background: rgba(255,255,255,0.2); }
.mermaid-stage {
  flex: 1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
.mermaid-stage-svg {
  transform-origin: center center;
  max-width: 92vw;
  max-height: 86vh;
  height: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 64px rgba(0,0,0,0.4);
  transition: transform 60ms linear;
}


/* Source-file links (point to repo .md files outside docs-site) */
.external-source { color: var(--text-muted); border-bottom: 1px dashed currentColor; }
.external-source:hover { color: var(--accent); border-bottom-style: solid; text-decoration: none; }
.external-mark { font-size: 0.85em; opacity: 0.7; margin-left: 2px; }
