:root {
  --text: #1f2328;
  --muted: #59636e;
  --border: #d1d9e0;
  --surface: #f6f8fa;
  --accent: #0969da;
  --max: 54rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
  color: var(--text);
  line-height: 1.6;
}

body { margin: 0; }
a { color: var(--accent); }

.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: #fff; padding: 0.5rem; z-index: 10; }

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font-weight: 600; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.site-header nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; }
.site-header nav a { color: var(--muted); text-decoration: none; padding: 0.25rem 0; }
.site-header nav a:hover, .site-header nav a:focus-visible { color: var(--accent); }
.site-header nav a[aria-current="page"] { color: var(--text); font-weight: 600; border-bottom: 2px solid var(--accent); }

.content { max-width: var(--max); margin: 0 auto; padding: 1.5rem; }
.content h1 { font-size: 2rem; margin-top: 0.5rem; }
.content h2 { border-bottom: 1px solid var(--border); padding-bottom: 0.3rem; margin-top: 2.5rem; }

table { border-collapse: collapse; display: block; overflow-x: auto; margin: 1rem 0; }
th, td { border: 1px solid var(--border); padding: 0.4rem 0.75rem; text-align: left; vertical-align: top; }
th { background: var(--surface); }

code { background: var(--surface); padding: 0.1rem 0.3rem; border-radius: 4px; font-size: 0.9em; }
pre { background: var(--surface); padding: 1rem; border-radius: 6px; overflow-x: auto; }
pre code { background: none; padding: 0; }
blockquote { margin: 1rem 0; padding: 0.25rem 1rem; border-left: 4px solid var(--accent); color: var(--muted); }

.diagram {
  margin: 1.5rem 0;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
  overflow-x: auto;
}
/* Block, not inline-block: Mermaid's SVG is width:100%, which an inline-block can't resolve and draws at 300px. */
.diagram .mermaid { display: block; }
.diagram svg { margin: 0 auto; }
.diagram-toggle {
  display: block;
  margin: 0.75rem auto 0;
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}
.diagram-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Mermaid scopes its own edge styles to the SVG's id, so these need the same weight to apply. */
.diagram svg path.adk-active {
  stroke: var(--accent) !important;
  stroke-width: 3px !important;
  stroke-dasharray: 8 6 !important;
  animation: adk-flow 0.8s linear infinite !important;
}
@keyframes adk-flow { to { stroke-dashoffset: -28; } }

.site-footer {
  max-width: var(--max);
  margin: 2rem auto;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.9rem;
}
