/* Keep final lines natural while aligning prose and descriptive table cells. */
html[lang^="zh"] .config-guide :is(p, li, td:not(:first-child)) {
  text-align: justify;
  text-align-last: start;
}

/* Configuration examples follow the existing UA Pro documentation palette. */
.config-guide .code-frame {
  overflow: hidden;
  margin: 20px 0 28px;
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.config-guide .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 18px;
  border-bottom: 1px solid var(--line);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .04em;
}
.config-guide .code-copy {
  padding: 6px 11px;
  border: 1px solid var(--line-2);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  letter-spacing: 0;
  cursor: pointer;
}
.config-guide .code-copy:hover { color: var(--text); background: var(--bg-2); }
.config-guide .code-copy:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; }
.config-guide .code-frame pre {
  max-width: 100%;
  max-height: 32rem;
  overflow: auto;
  margin: 0;
  padding: 18px 20px;
  background: var(--code);
  color: var(--text);
  font: 13px/1.7 "SF Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre;
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
  overscroll-behavior: contain;
}
.config-guide .code-frame pre:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: -3px; }
.config-guide .code-frame pre code {
  display: block;
  min-width: max-content;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  overflow-wrap: normal;
}
/* Colors are applied to static JSON tokens, so examples remain readable without JS. */
.config-guide {
  --json-key: #4932a0;
  --json-string: #126239;
  --json-number: #92500d;
  --json-literal: #a12a49;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .config-guide {
    --json-key: #c3b7ff;
    --json-string: #8cddad;
    --json-number: #f0c687;
    --json-literal: #ff9db3;
  }
}
:root[data-theme="dark"] .config-guide {
  --json-key: #c3b7ff;
  --json-string: #8cddad;
  --json-number: #f0c687;
  --json-literal: #ff9db3;
}
.config-guide .json-key { color: var(--json-key); }
.config-guide .json-string { color: var(--json-string); }
.config-guide .json-number { color: var(--json-number); }
.config-guide .json-literal { color: var(--json-literal); }
html[dir="rtl"] .config-guide :is(p, li, td) code { direction: ltr; unicode-bidi: isolate; }
@media (max-width: 640px) {
  /* Long inline URLs and field names can otherwise leave oversized gaps. */
  html[lang^="zh"] .config-guide :is(p, li, td:not(:first-child)) code { word-break: break-all; }
  .config-guide .code-frame pre { max-height: 26rem; padding: 15px 16px; font-size: 12px; }
}
