:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #2f6fed;
  --accent-ink: #1d4ed8;
  --accent-soft: #eef4ff;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --soft: #f8fafc;
  --ok: #0f766e;
  --focus: #2f6fed;
  --radius: 0.65rem;
  --radius-lg: 1rem;
  --shell: 1160px;
  --toc: 220px;
  --read: 760px;
  --header-h: 4.25rem;
  --jump-sticky-gap: 0.4rem;
  --jump-h: 3.4rem;
  --anchor-offset: calc(var(--header-h) + 1rem);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  --shadow: 0 1px 2px rgb(15 23 42 / 4%), 0 10px 28px rgb(15 23 42 / 6%);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
}

a {
  color: var(--accent-ink);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  padding: 0.55rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transform: translateY(-160%);
  z-index: 40;
}

.skip-link:focus {
  transform: none;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.site-header-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem 1.25rem;
  align-items: center;
  container-type: inline-size;
  container-name: site-header;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.1rem;
}

.brand img {
  width: 2rem;
  height: 2rem;
  display: block;
  flex-shrink: 0;
}

.brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* When the header is tight (small viewport or enlarged text), keep the
   logo icon and rely on the brand link's accessible name. */
/* rem tracks the user's font size, so enlarged text tightens this sooner.
   Threshold is against the header content box (padding excluded). */
@container site-header (max-width: 20rem) {
  .brand-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  font-size: 0.95rem;
  justify-content: flex-end;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--ink);
}

.nav-dashboard {
  display: none;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-self: end;
}

.header-dashboard {
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block;
  width: 1.1rem;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
}

.nav-toggle-bars {
  position: relative;
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
}

.nav-toggle-bars::before {
  top: -5px;
}

.nav-toggle-bars::after {
  top: 5px;
}

.site-header.nav-open .nav-toggle-bars {
  background: transparent;
}

.site-header.nav-open .nav-toggle-bars::before {
  top: 0;
  transform: rotate(45deg);
}

.site-header.nav-open .nav-toggle-bars::after {
  top: 0;
  transform: rotate(-45deg);
}

body.nav-open {
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  cursor: pointer;
}

.btn:hover {
  color: #fff;
  filter: brightness(1.04);
}

.btn.ghost {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn.ghost:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.btn.small {
  min-height: 2.2rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.84rem;
}

.btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.copy-btn.copied {
  color: var(--ok);
  border-color: color-mix(in srgb, var(--ok) 35%, var(--line));
}

main {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 2rem 1.5rem 4.5rem;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 2.5rem;
  align-items: center;
  padding: 1.25rem 0 2.5rem;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0.02em;
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-size: clamp(2.15rem, 4.2vw, 3.4rem);
  letter-spacing: -0.035em;
  line-height: 1.08;
}

.lede {
  margin: 0;
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 34rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 1.5rem;
}

.workflow-label {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-copy > .workflow-label {
  margin-top: 1.35rem;
}

.core-path {
  margin: 0;
  padding-left: 1.35rem;
  color: var(--muted);
  font-size: 1rem;
  max-width: 34rem;
}

.core-path li {
  margin: 0.35rem 0;
}

.core-path a {
  font-weight: 650;
  color: var(--accent-ink);
  text-decoration: none;
}

.core-path a:hover {
  text-decoration: underline;
}

.workflow-note {
  margin: 0 0 0.75rem;
  font-size: 0.92rem;
  color: var(--muted);
  max-width: 28rem;
}

.workflow-note strong {
  color: var(--ink);
}

.workflow-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1rem;
  display: grid;
  gap: 0.85rem;
}

.workflow-kicker {
  display: block;
  margin-bottom: 0.25rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--muted);
}

.workflow-request,
.workflow-link {
  padding: 0.75rem 0.85rem;
  border-radius: calc(var(--radius) - 0.05rem);
  background: var(--soft);
  border: 1px solid var(--line);
}

.workflow-request p,
.workflow-link code {
  margin: 0;
  color: var(--ink);
  font-size: 0.95rem;
}

.workflow-link code {
  display: block;
  font-family: var(--mono);
  font-size: 0.86rem;
  overflow-wrap: anywhere;
}

.mini-site {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 0.05rem);
  overflow: hidden;
  background: linear-gradient(180deg, #faf7f2 0%, #f3ebe1 100%);
}

.mini-chrome {
  display: flex;
  gap: 0.35rem;
  padding: 0.55rem 0.7rem;
  background: #efe6db;
  border-bottom: 1px solid #e2d4c4;
}

.mini-chrome span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #c4b5a5;
}

.mini-body {
  padding: 0.85rem 0.9rem 1rem;
}

.mini-nav {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5c4634;
  margin-bottom: 0.65rem;
}

.mini-hero {
  padding: 0.85rem 0.9rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(135deg, rgb(47 111 237 / 10%), transparent 55%),
    #fffdf9;
  border: 1px solid #e8dccf;
  margin-bottom: 0.65rem;
}

.mini-hero strong {
  display: block;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #2a2118;
}

.mini-hero em {
  display: block;
  margin-top: 0.2rem;
  font-style: normal;
  font-size: 0.8rem;
  color: #6b5745;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.mini-grid div {
  padding: 0.55rem 0.65rem;
  border-radius: 0.4rem;
  background: rgb(255 255 255 / 75%);
  border: 1px solid #e8dccf;
}

.mini-grid b {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #6b5745;
}

.mini-grid i {
  display: block;
  margin-top: 0.15rem;
  font-style: normal;
  font-size: 0.82rem;
  color: #2a2118;
}

.guide {
  display: grid;
  grid-template-columns: var(--toc) minmax(0, var(--read));
  gap: 2.75rem;
  align-items: start;
  justify-content: space-between;
  margin-top: 2.25rem;
}

.toc {
  position: sticky;
  top: calc(var(--header-h) + 0.75rem);
  padding-top: 0.25rem;
}

.toc-title {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}

.toc-nav {
  display: grid;
  gap: 0.15rem;
  border-left: 1px solid var(--line);
  padding-left: 0.85rem;
}

.toc-nav a {
  display: block;
  padding: 0.35rem 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 2px solid transparent;
  margin-left: -0.95rem;
  padding-left: 0.85rem;
}

.toc-nav a:hover {
  color: var(--ink);
}

.toc-nav a.is-active {
  color: var(--accent-ink);
  border-left-color: var(--accent);
  font-weight: 650;
}

.jump {
  display: none;
  margin: 0 0 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0.85rem 1rem;
}

.jump > summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
}

.jump[open] > summary {
  margin-bottom: 0.55rem;
}

.jump nav {
  display: grid;
  gap: 0.15rem;
}

.jump a {
  text-decoration: none;
  padding: 0.45rem 0;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 500;
}

.guide-main {
  min-width: 0;
  max-width: var(--read);
}

.hero,
.step {
  scroll-margin-top: var(--anchor-offset);
}

.step {
  padding: 2.25rem 0;
  border-bottom: 1px solid var(--line);
}

.step:first-of-type {
  padding-top: 0.35rem;
}

.step-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem 0.85rem;
  margin-bottom: 0.85rem;
}

.step-num {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  border-radius: 999px;
  min-width: 2.4rem;
  height: 1.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
}

.step-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.55rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-ink);
  background: var(--surface);
  border: 1px solid var(--line);
}

.step-icon svg {
  width: 1.2rem;
  height: 1.2rem;
}

.step h2 {
  margin: 0;
  flex: 1 1 12rem;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.step h3 {
  margin: 1.6rem 0 0.55rem;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.step-intro {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.05rem;
}

.step p,
.step li {
  color: var(--muted);
}

.step a,
.step strong {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.step p strong,
.step li strong {
  color: var(--ink);
  font-weight: 650;
}

ol.steps {
  margin: 0.85rem 0 0;
  padding-left: 1.25rem;
}

ol.steps > li {
  margin: 0.55rem 0;
  padding-left: 0.2rem;
}

ol.steps > li::marker {
  font-weight: 700;
  color: var(--ink);
}

ul.plain {
  margin: 0.75rem 0 0;
  padding-left: 1.2rem;
}

ul.plain li {
  margin: 0.4rem 0;
}

.note {
  margin: 1.15rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-soft);
  color: var(--ink);
}

.note strong {
  color: inherit;
}

.note-prominent {
  border-left-color: var(--accent-ink);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.section-action {
  margin-top: 1.15rem;
}

.prompt,
.conn-field {
  margin: 1rem 0 0;
  border: 1px solid color-mix(in srgb, var(--accent) 18%, var(--line));
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
  overflow: hidden;
}

.prompt-head,
.conn-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 14%, var(--line));
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}

.prompt-head span,
.conn-field-head span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

.prompt pre,
.conn-field pre {
  margin: 0;
  padding: 1rem 1.05rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--ink);
  background: transparent;
}

.prompt pre {
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
}

.conn-field pre {
  font-family: var(--mono);
  font-size: 0.9rem;
  line-height: 1.5;
}

.inline-code {
  font-family: var(--mono);
  font-size: 0.9em;
  padding: 0.1em 0.35em;
  border-radius: 0.3rem;
  background: color-mix(in srgb, var(--line) 70%, var(--surface));
  color: var(--ink);
  overflow-wrap: anywhere;
}

.example-url {
  margin: 1rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px dashed color-mix(in srgb, var(--accent) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--surface);
  font-family: var(--mono);
  font-size: 0.92rem;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.example-url .label {
  display: block;
  margin-bottom: 0.25rem;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

details.disclosure {
  margin: 1rem 0 0;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

details.disclosure > summary {
  cursor: pointer;
  font-weight: 650;
  color: var(--ink);
}

details.disclosure[open] > summary {
  margin-bottom: 0.65rem;
}

details.disclosure p,
details.disclosure li {
  margin: 0.45rem 0 0;
}

.faq details.disclosure + details.disclosure {
  margin-top: 0.65rem;
}

.cta {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 8%, var(--surface)), var(--surface));
  box-shadow: var(--shadow);
  text-align: center;
}

.cta h2 {
  margin: 0 0 0.55rem;
  font-size: clamp(1.55rem, 2.5vw, 1.9rem);
  letter-spacing: -0.025em;
}

.cta p {
  margin: 0 auto 1.25rem;
  max-width: 32rem;
  color: var(--muted);
}

.cta .hero-actions {
  justify-content: center;
  margin-top: 0;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer-inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 1.35rem 1.5rem 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-brand {
  font-size: 1rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (min-width: 961px) {
  .site-header-inner {
    grid-template-columns: auto 1fr auto;
  }

  .nav {
    grid-column: 2;
    grid-row: 1;
  }

  .header-actions {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 1100px) {
  :root {
    --anchor-offset: calc(var(--header-h) + 0.85rem);
  }

  .guide {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .toc {
    display: none;
  }

  .jump {
    display: block;
    position: relative;
    z-index: auto;
    margin-bottom: 1rem;
    padding: 0.65rem 0.85rem;
  }

  .jump > summary {
    min-height: 2.75rem;
    display: flex;
    align-items: center;
  }

  .guide-main {
    max-width: none;
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1rem 0 1.5rem;
  }

  .guide {
    margin-top: 1.5rem;
  }

  .step {
    padding: 1.65rem 0;
  }

  .step h3 {
    margin-top: 1.25rem;
  }

  .cta {
    margin-top: 2rem;
    padding: 1.65rem 1.15rem;
  }

  main {
    padding-bottom: 3.5rem;
  }

  .site-header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.75rem;
    padding-inline: 1.25rem;
  }

  .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .header-actions {
    flex: 0 0 auto;
    margin-left: auto;
  }

  .header-dashboard {
    padding-inline: 0.7rem;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav {
    display: none;
    flex: 1 1 100%;
    flex-direction: column;
    gap: 0;
    padding: 0.35rem 0 0.5rem;
    border-top: 1px solid var(--line);
  }

  .site-header.nav-open .nav {
    display: flex;
  }

  .nav a {
    display: block;
    padding: 0.9rem 0.1rem;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    color: var(--ink);
  }

  .nav a:last-child {
    border-bottom: 0;
  }

  .nav-dashboard {
    display: block;
    font-weight: 650;
  }

  main {
    padding-inline: 1.25rem;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 8vw, 2.5rem);
  }

  .hero-actions .btn {
    flex: 1 1 11rem;
  }
}

@media (max-width: 520px) {
  .mini-grid {
    grid-template-columns: 1fr;
  }
}
