:root {
  color-scheme: light;
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-2: #f0f2f6;
  --text: #16202a;
  --muted: #607083;
  --line: #d8e0ea;
  --accent: #c92c3b;
  --accent-2: #a52738;
  --accent-soft: #ffebed;
  --code-bg: #0f1720;
  --code-text: #e7eef7;
  --shadow: 0 18px 50px rgba(37, 57, 83, 0.12);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

code {
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 32px;
  background: rgba(246, 248, 251, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-weight: 700;
  border-radius: 8px;
  padding: 6px 8px;
  margin-left: -8px;
}

.brand img {
  width: 92px;
  height: 42px;
  object-fit: contain;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 50%;
  background: #cc2e3d;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.brand:hover {
  background: var(--surface-2);
  text-decoration: none;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-copy strong {
  font-size: 17px;
}

.brand-copy small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow-x: auto;
}

.top-nav a {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.top-nav a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

main {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 28px;
  align-items: center;
  min-height: calc(100vh - 104px);
  padding: 56px 0 42px;
}

.doc-hero {
  min-height: auto;
  padding: 46px 0 28px;
}

.hero-copy h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.download-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 20px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-weight: 700;
}

.button.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.button.ghost {
  background: var(--surface);
  color: var(--text);
}

.button:hover {
  text-decoration: none;
}

.endpoint-panel {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.endpoint-row {
  display: grid;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.endpoint-row span,
.endpoint-grid b {
  color: var(--muted);
  font-size: 13px;
}

.endpoint-row code,
.endpoint-grid code {
  display: block;
  overflow-wrap: anywhere;
  padding: 10px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}

.endpoint-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
}

.content-band {
  margin: 24px 0;
  padding: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-heading {
  margin-bottom: 24px;
}

.section-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-copy {
  max-width: 920px;
  margin: 0 0 22px;
  color: var(--muted);
}

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

.steps article {
  min-height: 176px;
  padding: 22px;
  background: var(--surface-2);
  border-radius: 8px;
}

.step-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--accent);
  color: white;
  border-radius: 50%;
  font-weight: 800;
}

.steps h3,
.sample-card h3 {
  margin: 14px 0 8px;
  font-size: 20px;
  letter-spacing: 0;
}

.steps p,
.sample-card p,
.callout p {
  margin: 0;
  color: var(--muted);
}

.callout {
  margin-top: 18px;
  padding: 18px;
  background: var(--accent-soft);
  border: 1px solid #ecc9ce;
  border-radius: 8px;
}

.code-layout,
.sample-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.code-card,
.sample-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.critical-code {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.critical-code .code-title {
  background: #b91c1c;
  color: #fff7f7;
}

.critical-code pre {
  background: #3b0d0d;
  color: #fff1f2;
}

.wide-code {
  margin-top: 18px;
}

.sample-card {
  padding: 22px;
}

.sample-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.sample-meta code {
  padding: 4px 8px;
  background: var(--surface-2);
  border-radius: 6px;
  font-size: 12px;
}

.code-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  padding: 10px 12px;
  background: #111a24;
  color: #dce6ef;
  border-radius: 8px 8px 0 0;
  font-size: 13px;
  font-weight: 800;
}

.code-card .code-title {
  margin-top: 0;
}

.code-title button {
  min-width: 58px;
  min-height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

pre {
  margin: 0;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 0 0 8px 8px;
}

pre code {
  display: block;
  min-width: 100%;
  padding: 18px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre;
}

.config-table {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.config-table div {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: 8px;
}

.config-table b {
  overflow-wrap: anywhere;
}

.config-table span {
  color: var(--muted);
}

.faq-list {
  display: grid;
  gap: 12px;
}

details {
  padding: 18px 20px;
  background: var(--surface-2);
  border-radius: 8px;
}

summary {
  cursor: pointer;
  font-weight: 800;
}

details p {
  margin: 10px 0 0;
  color: var(--muted);
}

.references ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  width: min(1180px, calc(100% - 40px));
  margin: 32px auto 0;
  padding: 28px 0 40px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

@media (max-width: 900px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding: 14px 20px;
  }

  .top-nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  main,
  .site-footer {
    width: min(100% - 28px, 760px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 36px 0 24px;
  }

  .hero-copy h1 {
    font-size: 42px;
  }

  .endpoint-panel,
  .content-band {
    padding: 22px;
  }

  .steps,
  .code-layout,
  .sample-grid,
  .endpoint-grid,
  .config-table div {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 15px;
  }

  .brand span {
    font-size: 15px;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 11px;
  }

  .top-nav {
    gap: 4px;
  }

  .top-nav a {
    padding: 7px 10px;
    font-size: 13px;
  }

  .hero-copy h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 16px;
  }

  .section-heading h2 {
    font-size: 25px;
  }

  pre code {
    font-size: 12px;
  }
}

/* Codex setup guide */
.top-nav a.is-current {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(11, 122, 117, 0.24);
}

.top-nav a.is-current:hover {
  background: var(--accent);
  color: #ffffff;
  text-decoration: none;
}

.codex-main {
  width: min(1120px, calc(100% - 40px));
}

.codex-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 64px;
  align-items: end;
  padding: 68px 0 48px;
  border-bottom: 1px solid var(--line);
}

.codex-intro h1 {
  margin: 0;
  font-size: 56px;
  line-height: 1.08;
  letter-spacing: 0;
}

.codex-intro .lead {
  max-width: 660px;
  margin-top: 18px;
}

.codex-intro .lead code {
  color: var(--text);
  font-weight: 700;
}

.codex-facts {
  margin: 0;
  border-top: 1px solid var(--line);
}

.codex-facts div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.codex-facts dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.codex-facts dd {
  min-width: 0;
  margin: 0;
}

.codex-facts code {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 13px;
}

.codex-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding-top: 48px;
}

.codex-toc {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 4px;
}

.codex-toc > strong {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.codex-toc a {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 40px;
  padding: 6px 8px;
  border-radius: 6px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.codex-toc a:hover {
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}

.codex-toc a span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  font-size: 12px;
}

.codex-toc .toc-secondary {
  margin-top: 10px;
  padding-left: 42px;
  border-top: 1px solid var(--line);
  border-radius: 0;
}

.codex-guide {
  min-width: 0;
}

.guide-section {
  scroll-margin-top: 96px;
  margin-bottom: 56px;
  padding-bottom: 56px;
  border-bottom: 1px solid var(--line);
}

.software-install-figure {
  width: min(100%, 400px);
  margin: 18px 0;
}

.software-install-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.software-install-figure figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.key-group-figure {
  width: min(100%, 700px);
  margin: 20px 0 0;
}

.key-group-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.key-group-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.claude-guide-figure {
  width: min(100%, 700px);
  margin: 22px 0 0;
}

.claude-guide-figure-narrow {
  width: min(100%, 500px);
}

.claude-guide-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.claude-guide-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.claude-code-page .code-card pre code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.guide-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.guide-heading h2 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.guide-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  margin-top: 2px;
  border-radius: 6px;
  background: var(--text);
  color: white;
  font-size: 15px;
  font-weight: 800;
}

.guide-kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.important-panel {
  padding: 20px 22px;
  background: #fff8e8;
  border-left: 4px solid #d48a12;
}

.important-panel > strong {
  display: block;
  margin-bottom: 12px;
  font-size: 17px;
}

.important-panel p,
.note-panel p,
.download-panel p,
.success-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.group-options {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.group-options code {
  padding: 7px 10px;
  border: 1px solid #e2c887;
  border-radius: 6px;
  background: white;
  color: #6f4705;
  font-weight: 800;
}

.group-options span {
  color: var(--muted);
  font-size: 13px;
}

.clean-steps {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding-left: 24px;
}

.clean-steps li {
  padding-left: 6px;
}

.download-panel {
  display: flex;
  gap: 24px;
  align-items: center;
  justify-content: space-between;
  padding: 22px;
  background: #fff1f2;
  border: 1px solid #f1cdd2;
  border-radius: 8px;
}

.download-panel strong {
  font-size: 17px;
}

.download-panel .button {
  flex: 0 0 auto;
}

.subtle-links {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.subtle-links span {
  margin: 0 5px;
  color: #9ba8b7;
}

.codex-install-grid {
  grid-template-columns: 1fr;
  align-items: start;
}

.codex-install-grid pre {
  min-height: 0;
}

.codex-install-grid .clean-steps {
  margin: 20px 22px 14px;
  padding-left: 24px;
}

.note-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border-left: 3px solid var(--accent-2);
  background: #f2f6fc;
}

.danger-panel {
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid #fecaca;
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  background: #fff1f2;
  color: #7f1d1d;
}

.danger-panel > strong {
  display: block;
  margin-bottom: 8px;
  color: #991b1b;
  font-size: 15px;
}

.danger-panel ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.danger-panel code {
  background: rgba(185, 28, 28, 0.1);
  color: #991b1b;
}

.danger-inline {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  border-radius: 5px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 800;
}

.danger-inline.group-red {
  background: #dc2626;
  color: #ffffff;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.16);
}

.config-summary {
  border-top: 1px solid var(--line);
}

.config-summary > div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
}

.config-summary > div > code {
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 700;
}

.config-summary span {
  color: var(--muted);
}

.config-summary b {
  color: var(--text);
  overflow-wrap: anywhere;
}

.config-details {
  margin-top: 20px;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.config-details summary {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}

.verify-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.verify-list > div {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
}

.verify-list > div > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.verify-list p {
  margin: 1px 0 0;
}

.success-panel {
  margin-top: 20px;
  padding: 18px 20px;
  background: #eaf7ed;
  border-left: 4px solid #27834c;
}

.troubleshooting-section {
  margin-bottom: 32px;
}

.compact-heading {
  padding-left: 54px;
}

.codex-page .faq-list details {
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.codex-bottom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-left: 54px;
}

/* WorkBuddy setup guide */
.workbuddy-page .codex-intro {
  align-items: center;
}

.workbuddy-page .codex-facts dt {
  white-space: nowrap;
}

.workbuddy-page .codex-guide h3 {
  margin: 32px 0 12px;
  font-size: 20px;
}

.workbuddy-figure {
  width: min(100%, 700px);
  margin: 22px 0 0;
}

.workbuddy-figure-compact {
  width: min(100%, 560px);
}

.workbuddy-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.workbuddy-figure figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.workbuddy-group-option {
  display: inline-block;
  margin: 2px 0;
  padding: 3px 8px;
  border: 1px solid #e2c887;
  border-radius: 6px;
  background: #fff3cf;
  color: #6f4705;
  font-weight: 800;
}

.workbuddy-fields {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.workbuddy-fields > div {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.workbuddy-fields > div:last-child {
  border-bottom: 0;
}

.workbuddy-fields strong {
  color: var(--muted);
}

.workbuddy-fields code,
.workbuddy-models code {
  overflow-wrap: anywhere;
}

.workbuddy-models {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.workbuddy-models code {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

/* Seedance video guide */
.seedance-page .codex-intro {
  align-items: center;
}

.seedance-intro h1 {
  max-width: 760px;
}

.status-panel {
  margin-bottom: 18px;
}

.api-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.api-grid article {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.api-grid b {
  display: block;
  margin-bottom: 8px;
}

.api-grid code {
  display: block;
  overflow-wrap: anywhere;
  padding: 9px 10px;
  background: var(--surface-2);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
}

.api-grid p,
.response-grid p,
.subtle-text {
  margin: 10px 0 0;
  color: var(--muted);
}

.response-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(240px, 0.65fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 18px;
}

.response-grid > div {
  min-width: 0;
}

.response-grid h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.response-grid > div:last-child {
  padding: 20px;
  background: var(--surface-2);
  border-radius: 8px;
}

.param-table {
  display: grid;
  gap: 10px;
}

.param-table div {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.param-table b {
  overflow-wrap: anywhere;
  color: var(--text);
}

.param-table span {
  min-width: 0;
  color: var(--muted);
}

.param-table code,
.status-panel code,
.response-grid code {
  overflow-wrap: anywhere;
}

.advanced-block {
  margin-top: 18px;
}

.advanced-block .code-card {
  margin-top: 16px;
}

@media (max-width: 900px) {
  .codex-main {
    width: min(100% - 28px, 760px);
  }

  .codex-intro {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 44px 0 36px;
  }

  .codex-intro h1 {
    font-size: 42px;
  }

  .codex-layout {
    grid-template-columns: 1fr;
    gap: 42px;
    padding-top: 28px;
  }

  .claude-code-page .guide-section {
    scroll-margin-top: 150px;
  }

  .codex-toc {
    position: static;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
  }

  .codex-toc > strong {
    width: 100%;
    margin: 0 0 6px;
  }

  .codex-toc a {
    border: 1px solid var(--line);
    background: var(--surface);
  }

  .codex-toc .toc-secondary {
    margin: 0;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
  }

  .api-grid,
  .response-grid,
  .param-table div {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .workbuddy-fields > div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .codex-intro h1 {
    font-size: 34px;
  }

  .codex-intro .lead {
    font-size: 16px;
  }

  .codex-facts div,
  .config-summary > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .codex-toc a span {
    display: none;
  }

  .guide-section {
    margin-bottom: 42px;
    padding-bottom: 42px;
  }

  .guide-heading {
    gap: 12px;
  }

  .guide-heading h2 {
    font-size: 25px;
  }

  .guide-number {
    width: 34px;
    height: 34px;
  }

  .download-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .download-panel .button {
    width: 100%;
  }

  .compact-heading,
  .codex-bottom-actions {
    padding-left: 0;
  }

  .codex-bottom-actions .button {
    width: 100%;
  }
}
