/* ============================================================================
 * Lingxing OpenAPI — Calm Editorial Documentation & White API Workbench
 * Design Language: Pure white seamless canvas, hairline hierarchy, zero card
 * clutter, optical CJK+Latin+Mono typography, unified light/dark themes.
 * ============================================================================ */

:root {
  color-scheme: light;

  /* ── Typography Tokens (Unified System Sans + Mono Strictly for Code Blocks) ── */
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --font-display: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", "SFMono-Regular", Menlo, Monaco, Consolas, "PingFang SC", "Microsoft YaHei", monospace;

  --text-display: 2rem;          /* 32px — H1 */
  --text-h2: 1.5rem;             /* 24px — H2 */
  --text-h3: 1.125rem;           /* 18px — H3 */
  --text-h4: 0.875rem;           /* 14px — H4 */
  --font-size-body: 0.9375rem;   /* 15px — Body */
  --text-ui: 0.875rem;           /* 14px — UI */
  --text-sm: 0.8125rem;          /* 13px — Compact UI / Table */
  --text-xs: 0.75rem;            /* 12px — Meta / Badge */
  --text-2xs: 0.6875rem;         /* 11px — Micro label */

  --leading-display: 1.35;
  --leading-h2: 1.4;
  --leading-h3: 1.45;
  --leading-body: 1.72;
  --leading-ui: 1.5;
  --leading-sm: 1.55;
  --leading-tight: 1.35;

  --tracking-display: -0.015em;
  --tracking-h2: -0.01em;
  --tracking-h3: -0.005em;
  --tracking-eyebrow: 0.05em;

  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ── Surface Hierarchy (Light Mode — Seamless Pure White) ── */
  --chrome-bg: #ffffff;
  --sidebar-bg: #fbfcfd;
  --bg: #ffffff;
  --surface: #f7f8fa;
  --surface-subtle: #f2f4f7;
  --surface-hover: #f5f6f8;
  --surface-active: #eef4ff;
  --surface-elevated: #ffffff;

  /* ── Ink Hierarchy (Feishu Calm Charcoal) ── */
  --text: #1f2329;
  --text-strong: #1f2329;
  --text-body: #4e5969;
  --muted: #646a73;
  --subtle: #8f959e;

  /* ── Structural Hairlines ── */
  --line: #dee0e3;
  --line-subtle: #f0f1f4;
  --line-strong: #d5d9e0;

  /* ── Brand Accent (Feishu Blue) ── */
  --brand: #1456f0;
  --brand-dark: #0f3fa7;
  --brand-soft: #eef4ff;
  --brand-hover: #e1ecff;
  --brand-border: rgb(20 86 240 / 32%);
  --brand-ring: rgb(20 86 240 / 16%);

  --cta-bg: #1456f0;
  --cta-bg-hover: #0f3fa7;
  --cta-text: #ffffff;

  /* ── Inline Code Chips ── */
  --code-inline-bg: #f3f4f6;
  --code-inline-border: transparent;
  --code-inline-text: #1f2329;

  /* ── Unified Code & Playground Surface (Bright Light in Light Mode) ── */
  --code-bg: #f7f8fa;
  --code-head-bg: #f2f4f7;
  --code-border: #e6e8ec;
  --code-text: #1f2329;
  --code-muted: #646a73;
  --code-subtle: #8f959e;

  /* ── Bright Light Syntax Tokens (Matching AGENTS.md) ── */
  --syn-key: #1456f0;
  --syn-string: #0e7c52;
  --syn-number: #7c3aed;
  --syn-null: #cf222e;
  --syn-keyword: #1456f0;
  --syn-code-str: #0e7c52;
  --syn-comment: #8f959e;
  --syn-var: #b45309;

  /* ── Semantic HTTP & Status Colors ── */
  --method-get: #059669;
  --method-get-bg: rgb(5 150 105 / 9%);
  --method-get-border: rgb(5 150 105 / 20%);

  --method-post: #1456f0;
  --method-post-bg: rgb(20 86 240 / 9%);
  --method-post-border: rgb(20 86 240 / 20%);

  --method-put: #c26a0a;
  --method-put-bg: rgb(194 106 10 / 9%);
  --method-put-border: rgb(194 106 10 / 20%);

  --method-delete: #dc2626;
  --method-delete-bg: rgb(220 38 38 / 9%);
  --method-delete-border: rgb(220 38 38 / 20%);

  --status-ok: #0e7c52;
  --status-ok-bg: rgb(14 124 82 / 10%);
  --status-warn: #b45309;
  --status-warn-bg: #fffbeb;
  --status-warn-border: #fde68a;
  --status-err: #dc2626;
  --status-err-bg: rgb(220 38 38 / 8%);
  --status-err-border: rgb(220 38 38 / 22%);

  /* ── Quiet Callout (No Outer Border) ── */
  --callout-bg: #f5f7fa;
  --callout-border: transparent;
  --callout-bar: #1456f0;
  --callout-text: #4e5969;

  /* ── Minimal Elevation (Popovers & Modals Only) & Scrollbars ── */
  --shadow-xs: none;
  --shadow-popover: 0 8px 24px rgb(15 23 42 / 9%), 0 2px 6px rgb(15 23 42 / 4%);
  --shadow-modal: 0 20px 50px rgb(15 23 42 / 16%), 0 4px 12px rgb(15 23 42 / 6%);
  --backdrop: rgb(15 23 42 / 36%);

  --scrollbar-thumb: rgb(31 35 41 / 16%);
  --scrollbar-thumb-hover: rgb(31 35 41 / 30%);
  --scrollbar-track: transparent;

  /* ── Geometry (Strict 8px Radius Discipline) ── */
  --radius: 8px;
  --radius-sm: 5px;
  --radius-xs: 4px;
  --topbar-h: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --chrome-bg: #111318;
  --sidebar-bg: #0e1015;
  --bg: #111318;
  --surface: #171a22;
  --surface-subtle: #1c202a;
  --surface-hover: rgb(255 255 255 / 5%);
  --surface-active: rgb(96 165 250 / 13%);
  --surface-elevated: #181c25;

  --text: #f3f4f6;
  --text-strong: #f9fafb;
  --text-body: #b6becb;
  --muted: #8b94a5;
  --subtle: #646e82;

  --line: rgb(255 255 255 / 9%);
  --line-subtle: rgb(255 255 255 / 5.5%);
  --line-strong: rgb(255 255 255 / 16%);

  --brand: #60a5fa;
  --brand-dark: #3b82f6;
  --brand-soft: rgb(96 165 250 / 13%);
  --brand-hover: rgb(96 165 250 / 20%);
  --brand-border: rgb(96 165 250 / 34%);
  --brand-ring: rgb(96 165 250 / 24%);

  --cta-bg: #2563eb;
  --cta-bg-hover: #3b82f6;
  --cta-text: #ffffff;

  --code-inline-bg: rgb(255 255 255 / 8%);
  --code-inline-border: transparent;
  --code-inline-text: #e2e8f0;

  --code-bg: #161922;
  --code-head-bg: #1b1f2b;
  --code-border: rgb(255 255 255 / 9%);
  --code-text: #e6edf3;
  --code-muted: #94a3b8;
  --code-subtle: #64748b;

  --syn-key: #7dd3fc;
  --syn-string: #6ee7b7;
  --syn-number: #c4b5fd;
  --syn-null: #fda4af;
  --syn-keyword: #93c5fd;
  --syn-code-str: #86efac;
  --syn-comment: #64748b;
  --syn-var: #fde68a;

  --method-get: #34d399;
  --method-get-bg: rgb(52 211 153 / 13%);
  --method-get-border: rgb(52 211 153 / 26%);

  --method-post: #60a5fa;
  --method-post-bg: rgb(96 165 250 / 13%);
  --method-post-border: rgb(96 165 250 / 26%);

  --method-put: #fbbf24;
  --method-put-bg: rgb(251 191 36 / 13%);
  --method-put-border: rgb(251 191 36 / 26%);

  --method-delete: #f87171;
  --method-delete-bg: rgb(248 113 113 / 13%);
  --method-delete-border: rgb(248 113 113 / 26%);

  --status-ok: #4ade80;
  --status-ok-bg: rgb(74 222 128 / 13%);
  --status-warn: #fbbf24;
  --status-warn-bg: rgb(251 191 36 / 10%);
  --status-warn-border: rgb(251 191 36 / 28%);
  --status-err: #f87171;
  --status-err-bg: rgb(248 113 113 / 13%);
  --status-err-border: rgb(248 113 113 / 30%);

  --callout-bg: #161a24;
  --callout-border: transparent;
  --callout-bar: #60a5fa;
  --callout-text: #c2cad8;

  --shadow-popover: 0 16px 38px rgb(0 0 0 / 50%), 0 2px 8px rgb(0 0 0 / 30%);
  --shadow-modal: 0 24px 64px rgb(0 0 0 / 64%), 0 4px 16px rgb(0 0 0 / 40%);
  --backdrop: rgb(0 0 0 / 65%);

  --scrollbar-thumb: rgb(255 255 255 / 16%);
  --scrollbar-thumb-hover: rgb(255 255 255 / 28%);
}

/* ============================================================================
 * BASE RESET & OPTICAL TYPOGRAPHY FOUNDATION
 * ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  height: 100%;
  scroll-padding-top: 24px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html.lx-app-booting .shell,
html.lx-access-pending .topbar,
html.lx-access-pending .shell {
  visibility: hidden;
}

body {
  height: 100%;
  overflow: hidden;
  margin: 0;
  color: var(--text);
  background: var(--chrome-bg);
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  accent-color: var(--brand);
}

button,
input,
select,
textarea {
  font-family: var(--font-sans);
}

a {
  color: var(--brand);
  text-decoration: none;
  transition: color 0.14s ease;
}

a:hover {
  color: var(--brand-dark);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

img {
  max-width: 100%;
  height: auto;
}

/* Standard scrollbars with WebKit fallback */
.sidebar,
.content,
.doc-rail,
.playground-console-panel,
.lx-json-block,
.lx-code-shell .code-block,
.curl-preview,
.search-results-list,
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}

@supports not (scrollbar-color: auto) {
  .sidebar,
  .content,
  .doc-rail,
  .playground-console-panel,
  .lx-json-block,
  .curl-preview,
  .search-results-list,
  .table-wrap {
    scrollbar-width: auto;
  }

  .sidebar::-webkit-scrollbar,
  .content::-webkit-scrollbar,
  .doc-rail::-webkit-scrollbar,
  .playground-console-panel::-webkit-scrollbar,
  .lx-json-block::-webkit-scrollbar,
  .curl-preview::-webkit-scrollbar,
  .search-results-list::-webkit-scrollbar,
  .table-wrap::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }

  .sidebar::-webkit-scrollbar-thumb,
  .content::-webkit-scrollbar-thumb,
  .doc-rail::-webkit-scrollbar-thumb,
  .playground-console-panel::-webkit-scrollbar-thumb,
  .lx-json-block::-webkit-scrollbar-thumb,
  .curl-preview::-webkit-scrollbar-thumb,
  .search-results-list::-webkit-scrollbar-thumb,
  .table-wrap::-webkit-scrollbar-thumb {
    border-radius: 99px;
    background: var(--scrollbar-thumb);
  }
}

/* ============================================================================
 * TOPBAR — Pure White Seamless Header (Zero Box Clutter)
 * ============================================================================ */
.topbar {
  position: relative;
  z-index: 30;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  width: calc(clamp(280px, 18vw, 300px) - 32px);
  color: var(--text);
}

body.sidebar-collapsed .brand {
  width: auto;
  margin-right: 12px;
}

.brand img {
  height: 22px;
  width: auto;
  display: block;
}

:root[data-theme="dark"] .brand img {
  filter: brightness(1.65) contrast(1.08);
}

/* Hidden in topbar while desktop sidebar is open (collapse button lives inside sidebar) */
.sidebar-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

body.sidebar-collapsed .sidebar-toggle {
  display: inline-flex;
}

.sidebar-toggle svg {
  width: 17px;
  height: 17px;
}

.sidebar-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-toggle[aria-expanded="true"] {
  color: var(--brand);
  background: var(--brand-soft);
}

/* Clean Minimal Command-K Search Bar */
.search-box {
  position: relative;
  width: min(460px, 42vw);
  min-width: 0;
  flex: 0 1 460px;
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.search-box:hover {
  background: var(--surface-subtle);
}

.search-box:focus-within {
  border-color: var(--brand);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.search-box-icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--subtle);
}

.search-box:focus-within .search-box-icon {
  color: var(--brand);
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: var(--text-sm);
}

.search-box input::placeholder {
  color: var(--subtle);
}

.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search-clear {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 0;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.search-clear:hover {
  color: var(--text);
  background: var(--line);
}

.search-shortcut {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 21px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--subtle);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  user-select: none;
}

.search-box.has-query .search-shortcut {
  display: none;
}

.search-box .search-submit {
  display: none;
}

/* Anchored Command-K Dropdown (Strictly Aligned Left & Right with .search-box) */
.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: -1px;
  right: -1px;
  z-index: 60;
  max-height: min(520px, calc(100vh - 96px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-popover);
}

.search-results-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--subtle);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.search-results-list {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}

.search-result {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 11px;
  border-radius: var(--radius);
  color: var(--text);
  transition: background-color 0.12s ease;
}

.search-result:hover,
.search-result.is-selected {
  color: var(--text);
  background: var(--surface-active);
}

.search-result-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.search-result-method {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: var(--weight-bold);
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  line-height: 1.2;
}

.search-result-method.method-get { color: var(--method-get); background: var(--method-get-bg); }
.search-result-method.method-post { color: var(--method-post); background: var(--method-post-bg); }
.search-result-method.method-put,
.search-result-method.method-patch { color: var(--method-put); background: var(--method-put-bg); }
.search-result-method.method-delete { color: var(--method-delete); background: var(--method-delete-bg); }

.search-result strong {
  min-width: 0;
  overflow: hidden;
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result mark {
  padding: 0 2px;
  border-radius: 3px;
  color: var(--brand);
  background: var(--brand-soft);
}

.search-result-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.4;
}

.search-result-group,
.search-result-path {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-result-path {
  color: var(--subtle);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-variant-ligatures: none;
}

.search-result-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--muted);
}

.search-result-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: var(--text-ui);
}

.search-result-empty span {
  font-size: var(--text-sm);
}

.search-results-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 7px 14px;
  border-top: 1px solid var(--line-subtle);
  color: var(--subtle);
  background: var(--surface);
  font-size: var(--text-2xs);
}

.search-results-footer kbd {
  display: inline-flex;
  align-items: center;
  padding: 1px 5px;
  margin-right: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: 10px;
}

/* Topbar Right Utility Controls — Borderless & Lightweight */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex: 0 0 auto;
}

.theme-segmented {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  height: 32px;
  padding: 3px;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
}

.theme-segmented button {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 0;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.theme-segmented button svg {
  width: 14px;
  height: 14px;
}

.theme-segmented button:hover {
  color: var(--text);
}

.theme-segmented button.is-active {
  color: var(--text);
  background: var(--bg);
}

.topbar-actions #lx-lang-switch {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.topbar-actions #lx-lang-switch:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* ============================================================================
 * THREE-PANE SEAMLESS WORKSPACE SHELL (No Box-Inside-Box Outer Frame)
 * ============================================================================ */
.shell {
  display: grid;
  grid-template-columns: clamp(280px, 18vw, 300px) minmax(0, 1fr);
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  overflow: hidden;
  background: var(--bg);
}

body.sidebar-collapsed .shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

/* Left Navigation Rail */
.sidebar {
  position: relative;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 0 12px 36px;
}

body.sidebar-collapsed .sidebar {
  visibility: hidden;
  overflow: hidden;
  border-right: 0;
  padding: 0;
}

.sidebar-filter-wrap {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 0 10px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--sidebar-bg);
}

.sidebar-filter-box {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 8px 0 10px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: var(--surface-subtle);
  color: var(--subtle);
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.sidebar-collapse-btn {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.sidebar-collapse-btn svg {
  width: 16px;
  height: 16px;
}

.sidebar-collapse-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-filter-box:focus-within {
  border-color: var(--brand);
  background: var(--bg);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.sidebar-filter-box svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.sidebar-filter-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  font-size: var(--text-sm);
}

.sidebar-filter-input::placeholder {
  color: var(--subtle);
}

.sidebar-filter-clear {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 0;
  color: var(--muted);
  background: var(--surface-subtle);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.sidebar-filter-empty {
  padding: 20px 10px;
  color: var(--subtle);
  font-size: var(--text-sm);
  text-align: center;
}

.sidebar-content {
  display: block;
}

.sidebar-group-header {
  --sidebar-indent: 0px;
  margin: 2px 0 2px var(--sidebar-indent);
}

.sidebar-group-header.depth-0 {
  margin-top: 16px;
}

.sidebar-group-header.depth-0:first-child {
  margin-top: 2px;
}

.sidebar-group-header.depth-1 { --sidebar-indent: 12px; }
.sidebar-group-header.depth-2 { --sidebar-indent: 24px; }
.sidebar-group-header.depth-3 { --sidebar-indent: 36px; }
.sidebar-group-header.depth-4 { --sidebar-indent: 48px; }

.sidebar-group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 32px;
  border: 0;
  border-radius: var(--radius);
  padding: 5px 10px;
  color: var(--text-strong);
  background: transparent;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  font-weight: var(--weight-semibold);
  text-align: left;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.sidebar-group-toggle:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.sidebar-group-title {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-group-arrow {
  display: block;
  width: 5.5px;
  height: 5.5px;
  flex: 0 0 5.5px;
  margin-right: 2px;
  border-right: 1.5px solid var(--subtle);
  border-bottom: 1.5px solid var(--subtle);
  transform: rotate(-45deg);
  transition: transform 0.16s ease, border-color 0.14s ease;
}

.sidebar-group-toggle:hover .sidebar-group-arrow {
  border-color: var(--text);
}

.sidebar-group-toggle[aria-expanded="true"] .sidebar-group-arrow {
  transform: rotate(45deg);
}

.sidebar-group {
  --sidebar-link-indent: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-group.depth-1 { --sidebar-link-indent: 22px; }
.sidebar-group.depth-2 { --sidebar-link-indent: 34px; }
.sidebar-group.depth-3 { --sidebar-link-indent: 46px; }
.sidebar-group.depth-4 { --sidebar-link-indent: 58px; }

.sidebar-link {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 33px;
  margin: 1px 0 1px var(--sidebar-link-indent);
  padding: 6px 10px;
  border-radius: var(--radius);
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  font-weight: var(--weight-regular);
  transition: color 0.14s ease, background-color 0.14s ease;
}

.sidebar-link:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Soft Feishu Blue active navigation highlight */
.sidebar-link.is-active {
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: var(--weight-medium);
}

.sidebar-link.is-active::before {
  display: none;
}

.sidebar-link.is-missing {
  color: var(--subtle);
}

.sidebar-link-title {
  min-width: 0;
  flex: 1 1 auto;
  overflow-wrap: anywhere;
}

/* Scalar-style bare right-aligned colored monospace HTTP method micro-tags */
.sidebar-method {
  flex: 0 0 auto;
  min-width: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  margin-left: auto;
  margin-top: 1px;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 19px;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  text-align: right;
}

.sidebar-method.method-get { color: var(--method-get); background: transparent; }
.sidebar-method.method-post { color: var(--method-post); background: transparent; }
.sidebar-method.method-put,
.sidebar-method.method-patch { color: var(--method-put); background: transparent; }
.sidebar-method.method-delete { color: var(--method-delete); background: transparent; }

.sidebar-backdrop {
  position: fixed;
  inset: var(--topbar-h) 0 0;
  z-index: 25;
  background: var(--backdrop);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ============================================================================
 * SEAMLESS FULL-BLEED READING CANVAS
 * ============================================================================ */
.content {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto;
  gap: 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
  scrollbar-gutter: stable;
  padding: 0 0 0 40px;
  background: var(--bg);
}

.content.has-aside {
  grid-template-columns: minmax(0, 1fr) clamp(420px, 33vw, 480px);
  align-items: start;
}

.content.has-doc-rail-only,
.content.is-playground-closed {
  grid-template-columns: minmax(0, 1000px) 260px;
  justify-content: center;
  gap: 32px;
  padding-right: 40px;
}

.doc-content {
  width: 100%;
  min-width: 0;
  align-self: start;
  min-height: calc(100vh - var(--topbar-h));
  color: var(--text-body);
  font-size: var(--font-size-body);
  line-height: var(--leading-body);
  overflow-wrap: break-word;
}

.doc-content-inner {
  container-type: inline-size;
  width: 100%;
  max-width: 1000px;
  min-width: 0;
  margin: 0 auto;
  padding: 32px 12px 92px 0;
}

.content.has-doc-rail-only .doc-content-inner,
.content.is-playground-closed .doc-content-inner {
  padding-right: 0;
}

/* ============================================================================
 * EDITORIAL TYPOGRAPHY, BREADCRUMB & SPLIT COPY MENU
 * ============================================================================ */
.doc-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  color: var(--subtle);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1.4;
}

.doc-breadcrumb-home {
  color: var(--muted);
}

.doc-breadcrumb-home:hover {
  color: var(--text);
}

.doc-breadcrumb-sep {
  color: var(--line-strong);
  user-select: none;
}

.doc-breadcrumb-item:last-child {
  color: var(--text-body);
  font-weight: var(--weight-semibold);
}

.doc-content h1 {
  margin: 0 0 12px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-display);
  line-height: var(--leading-display);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-display);
  text-rendering: optimizeLegibility;
  text-wrap: balance;
}

.doc-content h2 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-h2);
  text-rendering: optimizeLegibility;
  text-wrap: balance;
}

.doc-content h3 {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 8px;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-h3);
  text-wrap: balance;
}

.doc-content h4,
.doc-content h5,
.doc-content h6 {
  margin: 18px 0 8px;
  color: var(--text);
  font-size: var(--text-h4);
  line-height: 1.45;
  font-weight: var(--weight-semibold);
}

.doc-heading-anchor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 0;
  color: var(--subtle);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: var(--weight-medium);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.doc-content h2:hover .doc-heading-anchor,
.doc-content h3:hover .doc-heading-anchor,
.doc-heading-anchor:focus-visible {
  opacity: 1;
}

.doc-heading-anchor:hover {
  color: var(--text);
  background: var(--surface-hover);
}

.doc-content p {
  margin: 12px 0;
  color: var(--text-body);
  line-height: var(--leading-body);
  text-wrap: pretty;
}

.doc-content ul,
.doc-content ol {
  margin: 12px 0;
  padding-left: 22px;
}

.doc-content li {
  margin: 6px 0;
  color: var(--text-body);
}

.doc-content strong,
.doc-content b {
  color: var(--text);
  font-weight: var(--weight-semibold);
}

.lead {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: var(--font-size-body);
  line-height: 1.68;
  text-wrap: pretty;
}

.muted,
.schema-note {
  color: var(--muted);
  font-size: var(--text-sm);
}

/* Title Row & Resend Split Copy Menu */
.lx-copy-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}

.lx-copy-title-row h1 {
  min-width: 0;
  margin: 0;
}

#lx-copy-menu {
  position: relative;
  z-index: 20;
  flex: 0 0 auto;
}

#lx-copy-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  line-height: 1;
  white-space: nowrap;
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease, scale 0.12s ease;
}

#lx-copy-trigger:hover {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

#lx-copy-trigger:active {
  scale: 0.96;
}

#lx-copy-trigger .lx-copy-icon {
  width: 14px;
  height: 14px;
  display: inline-flex;
  flex: none;
}

#lx-copy-trigger .lx-copy-chevron {
  width: 14px;
  height: 14px;
  margin-left: -2px;
  color: var(--subtle);
  flex: none;
  transition: transform 0.15s ease;
}

#lx-copy-trigger[aria-expanded="true"] .lx-copy-chevron {
  transform: rotate(180deg);
}

#lx-copy-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 176px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-popover);
  transform-origin: top right;
}

@media (prefers-reduced-motion: no-preference) {
  #lx-copy-options:not([hidden]) {
    animation: lx-pop-in 0.14s ease-out both;
  }
}

@keyframes lx-pop-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#lx-copy-options button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  text-align: left;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

#lx-copy-options button:hover,
#lx-copy-options button:focus-visible {
  background: var(--surface-active);
}

#lx-copy-options button strong {
  color: inherit;
  font-weight: var(--weight-semibold);
}

#lx-copy-options button span {
  color: var(--subtle);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
}

.content.has-aside:not(.is-playground-closed) #lx-copy-trigger {
  width: 34px;
  padding: 0;
}

.content.has-aside:not(.is-playground-closed) #lx-copy-trigger .lx-copy-label,
.content.has-aside:not(.is-playground-closed) #lx-copy-trigger .lx-copy-chevron {
  display: none;
}

/* ============================================================================
 * HOMEPAGE — Open Editorial Header (Zero Box / Zero Card Clutter)
 * ============================================================================ */
.portal-hero {
  margin: 0 0 32px;
  padding: 6px 0 32px;
  border-bottom: 1px solid var(--line);
}

.portal-hero-eyebrow {
  margin: 0 0 8px;
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.portal-hero h1 {
  margin: 0 0 10px;
  font-size: 1.75rem;
  line-height: 1.28;
  font-weight: var(--weight-semibold);
  letter-spacing: -0.02em;
}

.portal-hero-subtitle {
  max-width: 64ch;
  margin: 0 0 22px;
  color: var(--muted);
  font-size: var(--font-size-body);
  line-height: 1.72;
  text-wrap: pretty;
}

.portal-hero-cta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-btn-primary,
.hero-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.hero-btn-primary {
  border: 1px solid var(--brand);
  color: var(--cta-text);
  background: var(--brand);
}

.hero-btn-primary:hover {
  color: var(--cta-text);
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.hero-btn-secondary {
  border: 1px solid var(--line-strong);
  color: var(--text);
  background: transparent;
}

.hero-btn-secondary:hover {
  color: var(--brand);
  border-color: var(--brand-border);
  background: var(--brand-soft);
}

.portal-hero-quick {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: var(--text-sm);
}

.portal-hero-quick-label {
  color: var(--subtle);
  font-size: var(--text-xs);
  margin-right: 2px;
}

.hero-quick-link {
  color: var(--text-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  transition: color 0.14s ease;
}

.hero-quick-link:hover {
  color: var(--brand);
}

.hero-quick-sep {
  color: var(--line-strong);
  user-select: none;
}

/* ============================================================================
 * ARCHITECTURAL DIRECTORY GRID (Hairline-Divided, Zero Stacked Cards)
 * ============================================================================ */
.doc-card-grid {
  display: grid;
  margin: 16px 0 32px;
}

.doc-card-grid.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.doc-card-grid.cols-3,
.doc-card-grid.cols-4 {
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0 24px;
}

.doc-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 12px;
  margin: 0 -12px;
  border: 0;
  border-top: 1px solid var(--line-subtle);
  border-radius: 0;
  color: var(--text);
  background: transparent;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.doc-card-grid.cols-2 .doc-card {
  border-top: 0;
  border-radius: var(--radius);
  padding: 16px 14px;
  margin: 0 -14px;
}

.doc-card:hover {
  background: var(--surface);
  color: var(--text);
}

.doc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.doc-card-icon {
  position: relative;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  background: transparent;
  transition: color 0.14s ease;
}

.doc-card-grid.cols-4 .doc-card-icon {
  color: var(--muted);
}

.doc-card:hover .doc-card-icon {
  color: var(--brand);
}

.doc-card-icon::before {
  content: "";
  width: 17px;
  height: 17px;
  background-color: currentColor;
  mask-repeat: no-repeat;
  mask-position: center;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  -webkit-mask-size: contain;
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="rocket"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z'/%3E%3Cpath d='m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0'/%3E%3Cpath d='M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z'/%3E%3Cpath d='m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0'/%3E%3Cpath d='M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="lock"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="key"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6'/%3E%3Cpath d='m15.5 7.5 3 3L22 7l-3-3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='7.5' cy='15.5' r='5.5'/%3E%3Cpath d='m21 2-9.6 9.6'/%3E%3Cpath d='m15.5 7.5 3 3L22 7l-3-3'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="circle-question"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="triangle-exclamation"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z'/%3E%3Cpath d='M12 9v4'/%3E%3Cpath d='M12 17h.01'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="database"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M3 5v14a9 3 0 0 0 18 0V5'/%3E%3Cpath d='M3 12a9 3 0 0 0 18 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cellipse cx='12' cy='5' rx='9' ry='3'/%3E%3Cpath d='M3 5v14a9 3 0 0 0 18 0V5'/%3E%3Cpath d='M3 12a9 3 0 0 0 18 0'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="shopping-bag"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z'/%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M16 10a4 4 0 0 1-8 0'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="truck"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M14 18V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v11a1 1 0 0 0 1 1h2'/%3E%3Cpath d='M15 18H9'/%3E%3Cpath d='M19 18h2a1 1 0 0 0 1-1v-3.65a1 1 0 0 0-.22-.624l-3.48-4.35A1 1 0 0 0 17.52 8H14'/%3E%3Ccircle cx='17' cy='18' r='2'/%3E%3Ccircle cx='7' cy='18' r='2'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="warehouse"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z'/%3E%3Cpath d='M6 18h12'/%3E%3Cpath d='M6 14h12'/%3E%3Crect x='6' y='10' width='12' height='12'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M22 8.35V20a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8.35A2 2 0 0 1 3.26 6.5l8-3.2a2 2 0 0 1 1.48 0l8 3.2A2 2 0 0 1 22 8.35Z'/%3E%3Cpath d='M6 18h12'/%3E%3Cpath d='M6 14h12'/%3E%3Crect x='6' y='10' width='12' height='12'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="box"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5'/%3E%3Cpath d='M12 22V12'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="chart"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m19 9-5 5-4-4-3 3'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m19 9-5 5-4-4-3 3'/%3E%3C/svg%3E");
}

.doc-card-icon[data-icon="megaphone"]::before {
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 18-5v12L3 14v-3z'/%3E%3Cpath d='M11.6 16.8a3 3 0 1 1-5.8-1.6'/%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 11 18-5v12L3 14v-3z'/%3E%3Cpath d='M11.6 16.8a3 3 0 1 1-5.8-1.6'/%3E%3C/svg%3E");
}

.doc-card-arrow {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid var(--subtle);
  border-top: 1.5px solid var(--subtle);
  opacity: 0.45;
  transform: rotate(45deg);
  transition: transform 0.16s ease, border-color 0.16s ease, opacity 0.16s ease;
}

.doc-card:hover .doc-card-arrow {
  opacity: 1;
  border-color: var(--brand);
  transform: translateX(3px) rotate(45deg);
}

.doc-card-title {
  color: var(--text);
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
  transition: color 0.14s ease;
}

.doc-card:hover .doc-card-title {
  color: var(--brand);
}

.doc-card-desc {
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.55;
}

/* ============================================================================
 * ENDPOINT BAR (Calm Flat Light Surface + Feishu Blue Debug CTA)
 * ============================================================================ */
.endpoint-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 16px 0 18px;
  padding: 8px 10px 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.endpoint-path {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-strong);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  overflow-wrap: anywhere;
}

.endpoint-param {
  display: inline-block;
  padding: 0 5px;
  margin: 0 1px;
  border-radius: var(--radius-xs);
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: var(--weight-semibold);
}

.endpoint-copy-button {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease, scale 0.12s ease;
}

.endpoint-copy-button svg {
  width: 15px;
  height: 15px;
}

.endpoint-copy-button:hover {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface);
}

.endpoint-copy-button:active {
  scale: 0.94;
}

.endpoint-debug-button {
  flex: 0 0 auto;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-left: auto;
  border: 1px solid var(--cta-bg);
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--cta-text);
  background: var(--cta-bg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, scale 0.12s ease;
}

.endpoint-debug-button svg {
  width: 12px;
  height: 12px;
}

.endpoint-debug-button:hover:not(:disabled) {
  border-color: var(--cta-bg-hover);
  background: var(--cta-bg-hover);
}

.endpoint-debug-button:active:not(:disabled) {
  scale: 0.97;
}

.endpoint-debug-button:disabled,
.endpoint-debug-button:disabled:hover {
  border-color: var(--line);
  color: var(--subtle);
  background: var(--surface-subtle);
  cursor: not-allowed;
}

/* Soft Tinted Method Badges (Resend Craft — strictly scoped to .method-badge) */
.method-badge,
.status-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.method-badge.method-get {
  color: var(--method-get);
  background: var(--method-get-bg);
  border: 1px solid var(--method-get-border);
}

.method-badge.method-post {
  color: var(--method-post);
  background: var(--method-post-bg);
  border: 1px solid var(--method-post-border);
}

.method-badge.method-put,
.method-badge.method-patch {
  color: var(--method-put);
  background: var(--method-put-bg);
  border: 1px solid var(--method-put-border);
}

.method-badge.method-delete {
  color: var(--method-delete);
  background: var(--method-delete-bg);
  border: 1px solid var(--method-delete-border);
}

.method-badge.method-default,
.status-code {
  color: var(--text-body);
  background: var(--surface-subtle);
  border: 1px solid var(--line);
}

.status-code.status-success {
  color: var(--status-ok);
  background: var(--status-ok-bg);
  border-color: rgb(22 163 74 / 24%);
}

.status-code.status-client-error {
  color: var(--status-warn);
  background: var(--status-warn-bg);
  border-color: var(--status-warn-border);
}

.status-code.status-server-error {
  color: var(--status-err);
  background: var(--status-err-bg);
  border-color: var(--status-err-border);
}

/* ============================================================================
 * INLINE CODE & BRIGHT LIGHT CODE / JSON BLOCKS (Optical Mixed-Font Sizing)
 * ============================================================================ */
code {
  padding: 1.5px 6px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--code-inline-text);
  background: var(--code-inline-bg);
  font-family: var(--font-sans);
  font-size: 0.94em;
}

.doc-content .code-block {
  position: relative;
  overflow: auto;
  margin: 14px 0;
  padding: 14px 16px;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  color: var(--code-text);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.65;
  font-variant-ligatures: none;
  overscroll-behavior: contain;
}

.doc-content .code-block code {
  font-family: inherit;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-size-adjust: none;
}

/* Clean Bright Code Shell for Doc JSON & Plain Code */
.lx-json-shell,
.lx-code-shell {
  position: relative;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  margin: 14px 0;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  background: var(--code-bg);
}

.lx-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--code-border);
  background: var(--code-head-bg);
}

.lx-code-lang {
  color: var(--code-muted);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.lx-code-shell .code-block,
.doc-content .lx-json-shell .code-block.lx-json-block {
  max-width: 100%;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: var(--code-bg);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.lx-code-shell .code-block {
  padding: 14px 16px;
  max-height: 360px;
}

.doc-content .lx-json-shell .code-block.lx-json-block {
  max-height: 280px;
  padding: 10px 0;
}

.lx-json-copy {
  position: static;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--code-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.lx-json-copy:hover {
  border-color: var(--code-border);
  color: var(--text);
  background: var(--bg);
}

.lx-json-copy svg {
  width: 13px;
  height: 13px;
  flex: none;
}

.doc-content .lx-json-block code {
  display: block;
  min-width: max-content;
}

.doc-content .lx-json-block .line {
  display: flex;
  min-height: 24px;
  line-height: 24px;
}

.doc-content .lx-json-block .line[hidden] {
  display: none;
}

.doc-content .lx-json-block .line-number {
  position: sticky;
  left: 0;
  z-index: 1;
  display: inline-flex;
  width: 68px;
  flex: 0 0 68px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 7px;
  border-right: 1px solid var(--code-border);
  color: var(--code-subtle);
  background: var(--code-bg);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.doc-content .lx-json-block .line-number-value {
  width: 30px;
  flex: 0 0 30px;
  text-align: right;
}

.json-fold-toggle,
.json-fold-spacer {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.json-fold-toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 0;
  color: var(--code-muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.12s ease, background-color 0.12s ease;
}

.json-fold-toggle:hover,
.json-fold-toggle:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
}

.json-fold-toggle span {
  width: 5.5px;
  height: 5.5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.14s ease;
}

.json-fold-toggle[aria-expanded="false"] span {
  transform: translateX(-2px) rotate(-45deg);
}

.doc-content .lx-json-block .line-code {
  display: block;
  min-width: 0;
  padding-right: 24px;
  padding-left: 16px;
  white-space: pre;
}

.doc-content .lx-json-block .line.is-collapsed .line-code::after {
  content: "  …";
  color: var(--code-subtle);
  font-weight: var(--weight-semibold);
}

.doc-content .lx-json-key { color: var(--syn-key); }
.doc-content .lx-json-string { color: var(--syn-string); }
.doc-content .lx-json-number,
.doc-content .lx-json-boolean { color: var(--syn-number); }
.doc-content .lx-json-null { color: var(--syn-null); }
.doc-content .lx-json-comment { color: var(--syn-comment); font-style: italic; }

/* ============================================================================
 * TABLES (Borderless Editorial Hairline Tables; Header Excluded from Hover)
 * ============================================================================ */
.table-wrap {
  width: 100%;
  margin: 14px 0 20px;
  overflow-x: auto;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: var(--bg);
  font-size: var(--text-sm);
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-subtle);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-wrap: balance;
  white-space: nowrap;
}

td {
  color: var(--text-body);
  transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.doc-table th {
  white-space: normal;
}

.doc-table td {
  overflow-wrap: anywhere;
}

.doc-table td.col-compact {
  overflow-wrap: normal;
}

/* Let native table layout fit translated labels and scroll inside the wrapper
   when the document column is narrower than the readable column widths. */
.doc-table.has-description th {
  min-width: 4.5rem;
}

.doc-table.has-description th.col-desc {
  width: 42%;
  min-width: 10rem;
}

.doc-table.has-description th.col-name,
.doc-table.has-description th.col-path {
  width: 26%;
  min-width: 6rem;
}

.doc-table.has-description th.col-type,
.doc-table.has-description th.col-compact {
  width: 5.25rem;
}

.doc-table.has-description th.col-req {
  width: 1%;
  min-width: 0;
  white-space: nowrap;
}

.doc-table .col-req {
  padding-inline: 8px;
}

.doc-table td.col-name {
  color: var(--text);
  font-weight: var(--weight-medium);
}

.doc-table td.col-example,
.doc-table td.col-type {
  color: var(--muted);
}

.doc-table td.col-desc {
  line-height: 1.6;
}

tbody tr:hover td,
tbody tr:focus-within td {
  background: var(--brand-soft);
}

tbody tr:hover td:first-child,
tbody tr:focus-within td:first-child {
  box-shadow: inset 3px 0 0 var(--brand);
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ============================================================================
 * QUIET ARCHITECTURAL CALLOUTS & WARNINGS
 * ============================================================================ */
blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border: 0;
  border-left: 3px solid var(--callout-bar);
  border-radius: var(--radius);
  background: var(--callout-bg);
  color: var(--callout-text);
  font-size: var(--text-sm);
  line-height: 1.7;
  text-wrap: pretty;
}

blockquote p {
  margin: 0;
  color: inherit;
}

blockquote p + p {
  margin-top: 6px;
}

blockquote:has(+ blockquote) {
  margin-bottom: 0;
  padding-bottom: 6px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

blockquote + blockquote {
  margin-top: 0;
  padding-top: 6px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.warning-box {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--status-warn-border);
  border-radius: var(--radius);
  color: var(--status-warn);
  background: var(--status-warn-bg);
  font-size: var(--text-sm);
}

/* ============================================================================
 * SCHEMA PARAMETER & RESPONSE ROWS (Resend × Scalar Clean Editorial Rows)
 * ============================================================================ */
.doc-section {
  margin-top: 36px;
}

.api-description {
  margin: 14px 0 0;
  color: var(--text-body);
  font-size: var(--font-size-body);
}

.api-description > :first-child { margin-top: 0; }
.api-description > :last-child { margin-bottom: 0; }

.schema-list {
  width: 100%;
  min-width: 0;
  border-top: 1px solid var(--line);
}

.schema-field {
  min-width: 0;
  border-bottom: 1px solid var(--line-subtle);
  padding: 0;
}

.schema-field:last-child {
  border-bottom: 0;
}

.schema-field-main {
  display: grid;
  height: 65px;
  min-height: 65px;
  align-content: center;
  gap: 4px;
  overflow: hidden;
  padding: 7px 8px;
  margin: 0 -8px;
  border-radius: var(--radius);
  transition: background-color 0.12s ease;
}

.schema-field-main:hover {
  background: var(--surface);
}

.schema-field-main.is-editable {
  grid-template-areas:
    "head editor"
    "meta editor";
  grid-template-columns: minmax(0, 1fr) minmax(164px, 206px);
  column-gap: 16px;
}

.schema-field-main.is-editable .schema-field-head { grid-area: head; }
.schema-field-main.is-editable .schema-field-meta { grid-area: meta; }

.schema-field-head {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 7px;
  min-width: 0;
  overflow: hidden;
  font-size: var(--text-ui);
}

.schema-name {
  max-width: 46%;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  font-size-adjust: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-type,
.schema-required,
.schema-optional,
.schema-location {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: var(--radius-xs);
  padding: 1px 6px;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1.3;
  font-weight: var(--weight-medium);
}

.schema-type {
  border: 0;
  font-family: var(--font-sans);
  font-size-adjust: none;
  color: var(--muted);
  background: var(--surface-subtle);
}

.schema-required {
  color: var(--status-err);
  background: var(--status-err-bg);
  font-weight: var(--weight-semibold);
}

.schema-optional,
.schema-location {
  color: var(--muted);
  background: var(--surface-subtle);
}

.schema-badges {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow: hidden;
}

.schema-badges code {
  overflow: hidden;
  padding: 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-size-adjust: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-field-meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 9px;
  overflow: hidden;
}

.schema-description {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.48;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-description.is-empty {
  display: none;
}

.schema-description p {
  margin: 0;
  overflow: hidden;
  color: inherit;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-meta-divider {
  width: 1px;
  height: 12px;
  flex: 0 0 1px;
  background: var(--line-strong);
}

.schema-example {
  min-width: 0;
  overflow: hidden;
  color: var(--subtle);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1.48;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.schema-example > span {
  font-family: var(--font-sans);
  color: var(--muted);
}

.source-schema .schema-field-main {
  height: auto;
  min-height: 65px;
  overflow: visible;
}

.source-schema .schema-field-meta {
  align-items: flex-start;
  flex-wrap: wrap;
  overflow: visible;
}

.source-schema .schema-description,
.source-schema .schema-description p,
.source-schema .schema-example {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* Inline Request Body Field Controls (Linear / Stripe Inspector Polish) */
.schema-inline-editor {
  grid-area: editor;
  align-self: center;
  min-width: 0;
}

.schema-inline-editor input,
.schema-inline-editor select {
  width: 100%;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 5px 10px;
  color: var(--text);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  transition: border-color 0.14s ease, background-color 0.14s ease, box-shadow 0.14s ease;
}

.schema-inline-editor input::placeholder {
  color: var(--subtle);
}

.schema-inline-editor input:hover,
.schema-inline-editor select:hover {
  border-color: var(--line-strong);
  background: var(--bg);
}

.schema-inline-editor input:focus,
.schema-inline-editor select:focus {
  border-color: var(--brand);
  background: var(--bg);
  box-shadow: 0 0 0 3px var(--brand-ring);
  outline: 0;
}

.schema-inline-editor .has-value {
  border-color: var(--brand-border);
  background: var(--bg);
}

.schema-inline-editor .is-invalid {
  border-color: var(--status-err);
  background: var(--status-err-bg);
}

/* Nested Schema Accordions (Clean Guide Line, No Box-Inside-Box Card) */
.schema-children {
  margin: 0 0 12px 10px;
  border: 0;
  border-left: 2px solid var(--line);
  border-radius: 0;
  background: transparent;
  overflow: hidden;
}

.schema-children > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px 0 14px;
  border-bottom: 1px solid var(--line-subtle);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.schema-children > summary::-webkit-details-marker {
  display: none;
}

.schema-children > summary:hover {
  color: var(--brand);
  background: var(--surface);
}

.schema-children > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: auto;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.schema-children:not([open]) > summary {
  border-bottom: 0;
}

.schema-children:not([open]) > summary::after {
  transform: translateX(-2px) rotate(-45deg);
}

.schema-children:not([open]) > summary .schema-label-open,
.schema-children[open] > summary .schema-label-closed {
  display: none;
}

.schema-children-count {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-xs);
  color: var(--subtle);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.schema-child-list {
  padding: 0 0 0 14px;
}

/* Response Accordion Blocks (Clean Hairline Sections, Not Stacked Cards) */
.response-block {
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
  overflow: hidden;
}

.response-block > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 8px 6px;
  color: var(--text);
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.14s ease;
}

.response-block > summary::-webkit-details-marker {
  display: none;
}

.response-block > summary::after {
  content: "";
  width: 6.5px;
  height: 6.5px;
  margin-left: auto;
  flex: 0 0 auto;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.16s ease;
}

.response-block:not([open]) > summary::after {
  transform: translateX(-2px) rotate(-45deg);
}

.response-block > summary:hover {
  background: var(--surface);
}

.response-block[open] > summary {
  border-bottom: 1px solid var(--line-subtle);
}

.response-block .content-type-block {
  padding: 0 0 12px;
}

.request-section > .content-type-block {
  margin: 8px 0 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.request-section > .content-type-block > .schema-list,
.response-block .content-type-block > .schema-list {
  border-top: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .schema-children::details-content,
  .response-block::details-content {
    interpolate-size: allow-keywords;
    overflow: clip;
    contain: layout;
    transition: block-size 0.22s ease-out, content-visibility 0.22s ease-out allow-discrete;
  }

  .schema-children:not([open])::details-content,
  .response-block:not([open])::details-content {
    block-size: 0;
  }
}

/* ============================================================================
 * PREV / NEXT PAGE FOOTER NAVIGATION (Clean Borderless Hairline Links)
 * ============================================================================ */
.doc-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 52px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.doc-pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  margin: 0 -12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  transition: background-color 0.14s ease, color 0.14s ease;
}

.doc-pager-link:hover {
  background: var(--surface);
  color: var(--brand);
}

.doc-pager-link:hover .doc-pager-title {
  color: var(--brand);
}

.doc-pager-link.is-next {
  text-align: right;
  align-items: flex-end;
}

.doc-pager-label {
  color: var(--subtle);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.doc-pager-link.is-prev .doc-pager-label::before { content: "← "; }
.doc-pager-link.is-next .doc-pager-label::after { content: " →"; }

.doc-pager-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  color: var(--text);
  font-size: var(--text-ui);
  font-weight: var(--weight-semibold);
  line-height: 1.4;
}

.doc-pager-method {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--weight-semibold);
}

.doc-pager-method.method-get { color: var(--method-get); }
.doc-pager-method.method-post { color: var(--method-post); }
.doc-pager-method.method-put,
.doc-pager-method.method-patch { color: var(--method-put); }
.doc-pager-method.method-delete { color: var(--method-delete); }

/* ============================================================================
 * RIGHT TABLE OF CONTENTS RAIL (256px, No Full-Height Left Divider)
 * ============================================================================ */
.doc-rail {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  contain: layout paint;
  border-left: 0;
  padding: 36px 0 40px;
  color: var(--muted);
  background: var(--bg);
}

.doc-rail-inner {
  width: 100%;
  max-width: 224px;
}

.doc-rail h2 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: var(--text-xs);
  line-height: 1.5;
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.doc-rail-nav {
  position: relative;
  display: grid;
  gap: 2px;
  border-left: 1.5px solid var(--line-subtle);
  padding-left: 14px;
}

.doc-rail-link {
  position: relative;
  display: block;
  padding: 5px 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.14s ease;
}

.doc-rail-link::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: -15.5px;
  width: 2px;
  border-radius: 2px;
  background: transparent;
  transition: background-color 0.14s ease;
}

.doc-rail-link.depth-h3 {
  padding-left: 14px;
  font-size: var(--text-xs);
}

.doc-rail-link:hover,
.doc-rail-link.is-active {
  color: var(--text);
}

.doc-rail-link.is-active {
  font-weight: var(--weight-semibold);
}

.doc-rail-link.is-active::before {
  background: var(--brand);
}

.doc-rail-empty {
  display: block;
  padding: 6px 4px;
  color: var(--subtle);
  font-size: var(--text-xs);
}

/* ============================================================================
 * PURE WHITE API PLAYGROUND WORKBENCH (Light Mode White / Cohesive Dark Mode)
 * ============================================================================ */
.playground-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  color: var(--text);
  background: var(--bg);
  border-left: 1px solid var(--line);
  overflow: hidden;
}

.playground-panel[data-enhanced="true"] {
  position: sticky;
  top: 0;
  align-self: start;
  height: calc(100vh - var(--topbar-h));
  max-height: calc(100vh - var(--topbar-h));
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--bg);
}

.playground-toolbar {
  flex: 0 0 auto;
  padding: 14px 20px 10px;
  background: var(--bg);
}

.playground-toolbar-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.playground-toolbar-title {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.playground-toolbar-title h2 {
  margin: 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-h4);
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.playground-endpoint-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  min-width: 0;
}

.studio-method {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.02em;
}

.studio-method.method-get { color: var(--method-get); }
.studio-method.method-post { color: var(--method-post); }
.studio-method.method-put,
.studio-method.method-patch { color: var(--method-put); }
.studio-method.method-delete { color: var(--method-delete); }

.playground-endpoint-meta code {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--subtle);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.playground-toolbar-controls {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.playground-close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.playground-close:hover {
  color: var(--text);
  background: var(--surface-hover);
}

/* Compact Inline App Credential Trigger (Zero Bulky Card) */
.playground-app-switch {
  max-width: 176px;
  min-width: 0;
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--text-body);
  background: var(--surface);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.playground-app-switch:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.playground-app-dot {
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--subtle);
}

.playground-app-dot[data-state="ready"] {
  background: var(--status-ok);
}

.playground-app-dot[data-state="partial"] {
  background: var(--status-warn);
}

.playground-app-id-value {
  overflow: hidden;
  color: inherit;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Clean Hairline Underline Tabs (Strictly 2 Primary Tabs, Zero Extra Box) */
.playground-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.playground-tabs button {
  position: relative;
  min-height: 38px;
  border: 0;
  border-radius: 0;
  padding: 0 2px;
  color: var(--muted);
  background: transparent;
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color 0.14s ease;
}

.playground-tabs button:hover {
  color: var(--text);
}

.playground-tabs button[aria-selected="true"] {
  color: var(--brand);
  font-weight: var(--weight-semibold);
}

.playground-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
}

/* Console & Example Panels */
.api-playground.lx-playground-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: block;
  overflow: hidden;
  padding: 0;
  background: var(--bg);
}

.lx-playground-shell .playground-tab-panel {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.lx-playground-shell .playground-console-panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  contain: layout paint;
  scrollbar-gutter: stable;
  padding: 14px 20px 24px;
}

.lx-playground-shell .playground-console-panel > * + * {
  margin-top: 14px;
}

.lx-playground-shell .playground-inline-submit {
  display: none;
}

/* 1. Auto-Sign Clean Row (Proportional Switch + Borderless Action) */
.playground-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.playground-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  user-select: none;
}

.playground-check input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 28px;
  height: 16px;
  flex: 0 0 28px;
  margin: 0;
  border: 0;
  border-radius: 99px;
  background: var(--line-strong);
  cursor: pointer;
  transition: background-color 0.16s ease;
}

.playground-check input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  box-shadow: 0 1px 2px rgb(15 23 42 / 20%);
  transition: transform 0.16s ease;
}

.playground-check input[type="checkbox"]:checked {
  background: var(--brand);
}

.playground-check input[type="checkbox"]:checked::after {
  transform: translateX(12px);
}

.playground-check input[type="checkbox"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.api-playground .playground-options button {
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.api-playground .playground-options button:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.playground-message {
  padding: 9px 12px;
  border: 1px solid var(--status-warn-border);
  border-radius: var(--radius);
  color: var(--status-warn);
  background: var(--status-warn-bg);
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* 2. Lightweight Manual Request Headers (Hidden when Auto-Sign Checked) */
.playground-request-headers {
  display: grid;
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line-subtle);
}

.playground-request-heading,
.playground-section-title,
.lx-playground-shell .playground-subtitle {
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  line-height: 20px;
  margin: 0;
}

.playground-token-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
}

.playground-token-control {
  min-width: 0;
  height: 36px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.playground-token-control:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.playground-token-prefix {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--line);
  color: var(--muted);
  background: var(--surface);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
}

.playground-token-input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  padding: 0 10px;
  color: var(--text);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  outline: 0;
}

.playground-token-input::placeholder {
  color: var(--subtle);
}

.secret-visibility-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 100%;
  border: 0;
  padding: 0;
  color: var(--subtle);
  background: transparent;
  cursor: pointer;
}

.secret-visibility-btn:hover {
  color: var(--text);
}

.secret-visibility-btn svg {
  width: 14px;
  height: 14px;
}

/* 3. Request Body Light JSON Editor & Mini Actions */
.body-json-field {
  display: grid;
  gap: 8px;
}

.playground-section-head,
.playground-response-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.playground-mini-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.playground-mini-btn {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border: 0;
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color 0.14s ease, background-color 0.14s ease;
}

.playground-mini-btn:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.api-playground textarea {
  width: 100%;
  min-height: 200px;
  resize: vertical;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  padding: 10px 12px;
  color: var(--code-text);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 24px;
}

/* Clean Bright CodeMirror JSON Editor (68px gutter, 24px row height, matching doc JSON) */
.api-code-editor-shell,
.api-response-code-editor {
  position: relative;
  min-width: 0;
}

.api-response-code-editor {
  min-height: 256px;
}

.api-json-editor .CodeMirror,
.api-response-code-view {
  width: 100%;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  color: var(--code-text);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--weight-regular);
  line-height: 24px;
  font-variant-ligatures: none;
  box-shadow: none;
}

.api-json-code-editor-body { height: 228px; }
.api-json-code-editor-headers { height: 140px; }
.api-response-code-view { height: 256px; }

.api-json-editor .CodeMirror-lines,
.api-response-code-view .CodeMirror-lines {
  padding: 10px 0;
}

.api-code-editor-shell .CodeMirror-code,
.api-response-code-editor .CodeMirror-code {
  padding-right: 72px;
}

.api-json-editor .CodeMirror pre.CodeMirror-line,
.api-json-editor .CodeMirror pre.CodeMirror-line-like,
.api-response-code-view pre.CodeMirror-line,
.api-response-code-view pre.CodeMirror-line-like {
  padding: 0 14px;
  line-height: 24px;
}

.api-json-editor .CodeMirror-gutters,
.api-response-code-view .CodeMirror-gutters {
  border-right: 1px solid var(--code-border);
  background: var(--code-bg);
}

.api-json-editor .CodeMirror-linenumbers,
.api-response-code-view .CodeMirror-linenumbers {
  width: 44px !important;
}

.api-json-editor .CodeMirror-linenumber,
.api-response-code-view .CodeMirror-linenumber {
  width: 30px !important;
  padding: 0 7px !important;
  color: var(--code-subtle);
  font-weight: var(--weight-regular);
  font-variant-numeric: tabular-nums;
}

.api-json-editor .CodeMirror-foldgutter,
.api-response-code-view .CodeMirror-foldgutter {
  width: 24px !important;
}

.api-json-editor .CodeMirror-foldgutter-open,
.api-json-editor .CodeMirror-foldgutter-folded,
.api-response-code-view .CodeMirror-foldgutter-open,
.api-response-code-view .CodeMirror-foldgutter-folded {
  color: var(--code-muted);
  font-size: 0;
  cursor: pointer;
}

.api-json-editor .CodeMirror-foldgutter-open::after,
.api-json-editor .CodeMirror-foldgutter-folded::after,
.api-response-code-view .CodeMirror-foldgutter-open::after,
.api-response-code-view .CodeMirror-foldgutter-folded::after {
  content: "";
  display: inline-block;
  width: 5.5px;
  height: 5.5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
}

.api-json-editor .CodeMirror-foldgutter-open::after,
.api-response-code-view .CodeMirror-foldgutter-open::after {
  transform: translateY(-2px) rotate(45deg);
}

.api-json-editor .CodeMirror-foldgutter-folded::after,
.api-response-code-view .CodeMirror-foldgutter-folded::after {
  transform: translateX(-2px) rotate(-45deg);
}

.api-json-editor .CodeMirror-focused {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand-ring);
}

.api-json-editor .CodeMirror-cursor {
  border-left-color: var(--text);
}

.api-json-editor .CodeMirror-selected,
.api-response-code-view .CodeMirror-selected {
  background: var(--brand-soft);
}

.api-json-editor .CodeMirror-scroll,
.api-response-code-view .CodeMirror-scroll {
  overscroll-behavior: contain;
}

.api-json-editor .cm-property,
.api-response-code-view .cm-property,
.api-json-editor .cm-string.cm-property,
.api-response-code-view .cm-string.cm-property {
  color: var(--syn-key);
  font-weight: var(--weight-regular);
}

.api-json-editor .cm-string,
.api-response-code-view .cm-string {
  color: var(--syn-string);
  font-weight: var(--weight-regular);
}

.api-json-editor .cm-number,
.api-json-editor .cm-atom,
.api-response-code-view .cm-number,
.api-response-code-view .cm-atom {
  color: var(--syn-number);
}

/* Hover/Focus-Revealed Copy Button inside Playground Editors */
.api-playground .api-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 5;
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 9px;
  color: var(--muted);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.14s ease, transform 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.api-code-editor-shell:hover .api-code-copy,
.api-code-editor-shell:focus-within .api-code-copy,
.api-response-code-editor:hover .api-code-copy,
.api-response-code-editor:focus-within .api-code-copy,
.api-playground .api-code-copy:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.api-playground .api-code-copy:hover {
  border-color: var(--brand-border);
  color: var(--brand);
}

.api-code-copy svg {
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
}

@media (hover: none) {
  .api-playground .api-code-copy {
    opacity: 1;
    transform: none;
  }
}

/* 4. Response Section & Calm Light Empty State */
.playground-response {
  display: grid;
  gap: 8px;
}

.response-meta-bar {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
}

.response-meta-status {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: var(--radius-xs);
  font-weight: var(--weight-semibold);
}

.response-meta-status[data-tone="ok"] { color: var(--status-ok); background: var(--status-ok-bg); }
.response-meta-status[data-tone="warn"] { color: var(--status-warn); background: var(--status-warn-bg); }
.response-meta-status[data-tone="err"] { color: var(--status-err); background: var(--status-err-bg); }

.response-meta-stat {
  color: var(--subtle);
}

.api-response-empty {
  min-height: 248px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px solid var(--code-border);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--muted);
  text-align: center;
}

.api-response-empty-svg {
  width: 104px;
  height: 74px;
  color: var(--brand);
}

.api-response-empty p {
  margin: 0;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.api-response-empty-kbd {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--subtle);
  font-size: var(--text-xs);
}

.api-response-empty-kbd kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  color: var(--muted);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
}

/* Example Code Tab (6 Languages — Bright Calm Code Viewer) */
.lx-playground-shell .playground-example-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px;
  background: var(--bg);
}

.example-code-toolbar {
  flex: 0 0 auto;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--code-border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 0 8px;
  background: var(--code-head-bg);
}

.example-language-tabs {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-self: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}

.example-language-tabs::-webkit-scrollbar { display: none; }

.api-playground .example-language-tabs button {
  position: relative;
  min-width: 44px;
  height: 100%;
  flex: 0 0 auto;
  border: 0;
  border-radius: 0;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: color 0.14s ease;
}

.api-playground .example-language-tabs button:hover {
  color: var(--text);
}

.api-playground .example-language-tabs button[aria-selected="true"] {
  color: var(--brand);
  font-weight: var(--weight-semibold);
}

.api-playground .example-language-tabs button[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 0;
  left: 8px;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: var(--brand);
}

.example-toolbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.api-playground .example-code-toolbar .example-fold-all,
.api-playground .example-code-toolbar .example-copy-button {
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background-color 0.14s ease;
}

.api-playground .example-code-toolbar .example-fold-all:hover,
.api-playground .example-code-toolbar .example-copy-button:hover {
  border-color: var(--code-border);
  color: var(--text);
  background: var(--bg);
}

.example-copy-button svg { width: 13px; height: 13px; }

.lx-playground-shell .playground-example-panel .curl-preview {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  margin: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--code-border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 12px 0;
  color: var(--code-text);
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 24px;
  font-variant-ligatures: none;
  white-space: pre;
}

.playground-example-panel .curl-preview code {
  font-family: inherit;
  display: block;
  min-width: max-content;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: inherit;
  font-size-adjust: none;
}

.example-code-line { display: flex; min-height: 24px; line-height: 24px; }
.example-code-line[hidden] { display: none; }

.example-code-gutter {
  position: sticky;
  left: 0;
  z-index: 1;
  display: inline-flex;
  width: 62px;
  flex: 0 0 62px;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  padding-right: 7px;
  border-right: 1px solid var(--code-border);
  color: var(--code-subtle);
  background: var(--code-bg);
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.example-code-line-number { width: 28px; flex: 0 0 28px; text-align: right; }

.code-fold-toggle,
.code-fold-spacer { width: 16px; height: 16px; flex: 0 0 16px; }

.api-playground .code-fold-toggle {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-xs);
  padding: 0;
  color: var(--code-muted);
  background: transparent;
  cursor: pointer;
}

.api-playground .code-fold-toggle:hover,
.api-playground .code-fold-toggle:focus-visible {
  color: var(--brand);
  background: var(--brand-soft);
}

.code-fold-toggle span {
  width: 5.5px;
  height: 5.5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.14s ease;
}

.code-fold-toggle[aria-expanded="false"] span { transform: translateX(-2px) rotate(-45deg); }

.example-code-content { display: block; min-width: 0; padding: 0 18px 0 14px; white-space: pre; }
.example-code-line.is-collapsed .example-code-content::after { content: "  …"; color: var(--code-subtle); font-weight: var(--weight-semibold); }

.code-token-keyword { color: var(--syn-keyword); font-weight: var(--weight-medium); }
.code-token-string { color: var(--syn-code-str); }
.code-token-comment { color: var(--syn-comment); }
.code-token-number,
.code-token-literal { color: var(--syn-number); }
.code-token-variable { color: var(--syn-var); }

/* Flush White Footer — Feishu Blue Primary CTA */
.playground-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  border-top: 1px solid var(--line);
  padding: 12px 20px;
  background: var(--bg);
}

.playground-footer button {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: var(--radius);
  padding: 0 16px;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.playground-run {
  border: 1px solid var(--brand);
  color: #ffffff;
  background: var(--brand);
}

.playground-run:hover:not(:disabled) {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.playground-run:disabled { opacity: 0.7; cursor: wait; }
.playground-run svg { width: 13px; height: 13px; }
.playground-run.is-loading svg { animation: lx-spin 0.8s linear infinite; }

@keyframes lx-spin { to { transform: rotate(360deg); } }

.playground-secondary {
  border: 1px solid var(--line-strong);
  color: var(--text-body);
  background: var(--bg);
}

.playground-secondary:hover {
  border-color: var(--brand-border);
  color: var(--brand);
  background: var(--brand-soft);
}

/* ============================================================================
 * MODALS (Credentials 2-Input, Doc Access Gate, Native Lightbox) & TOAST
 * ============================================================================ */
.doc-access-modal,
.credential-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.doc-access-modal { z-index: 120; }

.doc-access-backdrop,
.credential-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  cursor: default;
}

.doc-access-dialog,
.credential-dialog {
  position: relative;
  width: min(460px, calc(100vw - 40px));
  max-height: calc(100% - 2px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-modal);
}

.doc-access-dialog {
  width: min(420px, calc(100vw - 40px));
  padding: 26px 24px 24px;
}

.doc-access-dialog h2 {
  margin: 0 0 8px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
}

.doc-access-dialog label {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: var(--text-sm);
}

.doc-access-dialog input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--bg);
  font-size: var(--text-ui);
}

.doc-access-dialog input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  outline: 0;
}

.doc-access-error {
  min-height: 22px;
  margin: 8px 0 14px;
  color: var(--status-err);
  font-size: var(--text-sm);
}

.doc-access-dialog button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 38px;
  margin-left: auto;
  padding: 0 18px;
  border: 1px solid var(--cta-bg);
  border-radius: var(--radius);
  color: var(--cta-text);
  background: var(--cta-bg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.doc-access-dialog button[type="submit"]:hover:not(:disabled) { background: var(--cta-bg-hover); }
.doc-access-dialog button[type="submit"]:disabled { opacity: 0.65; cursor: wait; }

.credential-dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px 10px;
}

.credential-kicker {
  display: inline-block;
  color: var(--brand);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
}

.credential-dialog-header h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-semibold);
}

.credential-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.credential-close:hover { color: var(--text); background: var(--surface-hover); }

.credential-hint {
  margin: 0;
  padding: 0 24px 4px;
  color: var(--muted);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.credential-body {
  display: grid;
  gap: 14px;
  padding: 16px 24px 20px;
}

.credential-body label {
  display: grid;
  gap: 6px;
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.credential-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.credential-body input:not([type="hidden"]) {
  width: 100%;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 12px;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}

.credential-body .credential-input-wrap input { padding-right: 38px; }

.credential-input-wrap .secret-visibility-btn {
  position: absolute;
  right: 2px;
  top: 2px;
  bottom: 2px;
  height: auto;
  color: var(--subtle);
}

.credential-input-wrap .secret-visibility-btn:hover { color: var(--text); }

.credential-body input:not([type="hidden"]):focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
  outline: 0;
}

.credential-status {
  min-height: 0;
  color: var(--muted);
  font-size: var(--text-xs);
  line-height: 1.5;
  word-break: break-word;
}

.credential-status[data-tone="ok"] { color: var(--status-ok); }
.credential-status[data-tone="error"] { color: var(--status-err); }

.credential-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line-subtle);
  padding: 14px 24px;
  background: var(--surface);
}

.credential-actions button {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0 16px;
  color: var(--text-body);
  background: var(--bg);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  cursor: pointer;
}

.credential-actions button:hover:not(:disabled) { border-color: var(--text); color: var(--text); }

.credential-actions #lx-cred-save {
  border-color: var(--cta-bg);
  color: var(--cta-text);
  background: var(--cta-bg);
}

.credential-actions #lx-cred-save:hover:not(:disabled) {
  border-color: var(--cta-bg-hover);
  background: var(--cta-bg-hover);
  color: var(--cta-text);
}

.credential-actions #lx-cred-save:disabled { opacity: 0.65; cursor: wait; }

/* Native <dialog> Image Lightbox */
.doc-image-preview {
  border: 0;
  padding: 0;
  max-width: 100%;
  background: transparent;
  vertical-align: middle;
  cursor: zoom-in;
}

.doc-image-preview img {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  cursor: zoom-in;
}

dialog.lx-lightbox {
  max-width: min(92vw, 1180px);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface-elevated);
  color: var(--text);
  box-shadow: var(--shadow-modal);
  overflow: hidden;
}

dialog.lx-lightbox:modal { overscroll-behavior: contain; }
dialog.lx-lightbox::backdrop {
  background: var(--backdrop);
  backdrop-filter: blur(4px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.lx-lightbox-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-subtle);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.lx-lightbox-close {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius);
  color: var(--muted);
  background: transparent;
  font-size: 20px;
  cursor: pointer;
}

.lx-lightbox-body { padding: 16px; max-height: calc(90vh - 54px); overflow: auto; text-align: center; }
.lx-lightbox-body img { display: inline-block; max-width: 100%; max-height: calc(90vh - 96px); object-fit: contain; border-radius: var(--radius-sm); }

/* Action Toast */
.lx-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 140;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  background: var(--surface-elevated);
  box-shadow: var(--shadow-popover);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.lx-toast.is-visible { opacity: 1; transform: translateY(0); }
.lx-toast-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--status-ok); }

/* ============================================================================
 * RESPONSIVE BREAKPOINTS (980px compact, 860px mobile drawer, 640px narrow)
 * ============================================================================ */
@media (max-width: 980px) {
  .content,
  .content.has-aside,
  .content.has-doc-rail-only,
  .content.is-playground-closed {
    display: block;
    overflow-y: auto;
    padding: 0 24px 64px;
  }

  .doc-content { min-height: 0; }
  .doc-content-inner { padding: 28px 0 36px; }
  .doc-rail { display: none; }

  .playground-panel[data-enhanced="true"] {
    position: static;
    height: min(760px, calc(100vh - 100px));
    max-height: none;
    max-width: 880px;
    margin: 28px auto 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }
}

@media (max-width: 860px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .sidebar-toggle { display: inline-flex; }
  .sidebar-collapse-btn { display: none; }
  .brand { width: auto; min-width: 0; }
  .search-shortcut { display: none; }
  .search-box { width: 100%; flex: 1 1 auto; }

  .shell,
  body.sidebar-collapsed .shell {
    grid-template-columns: 1fr;
  }

  .content {
    border-left: 0;
    border-top-left-radius: 0;
  }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    top: var(--topbar-h);
    bottom: 0;
    left: 0;
    z-index: 35;
    width: min(304px, 86vw);
    height: auto;
    padding: 10px 14px 36px;
    border-right: 1px solid var(--line);
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-105%);
    transition: transform 0.2s ease, visibility 0.2s ease;
    box-shadow: var(--shadow-modal);
  }

  body.sidebar-open .sidebar {
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
  }

  .content,
  .content.has-aside,
  .content.has-doc-rail-only,
  .content.is-playground-closed {
    padding: 0 16px 56px;
  }

  .doc-content h1,
  .portal-hero h1 { font-size: 1.625rem; }

  .doc-card-grid.cols-2,
  .doc-pager { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .topbar { gap: 4px; padding: 0 8px; }
  .brand { width: 24px; overflow: hidden; }
  .brand img { height: 24px; max-width: none; flex: none; }
  .search-box { padding-left: 8px; gap: 4px; }
  .search-box:focus-within {
    position: absolute;
    inset: auto 8px;
    z-index: 2;
    width: auto;
  }
  .search-results-footer { flex-wrap: wrap; }

  .topbar-actions #lx-lang-switch { padding: 0 8px; font-size: var(--text-xs); }

  .portal-hero { padding: 20px 16px; }
  .lx-copy-title-row { display: grid; gap: 10px; }
  #lx-copy-menu { justify-self: end; }

  .playground-toolbar,
  .lx-playground-shell .playground-console-panel,
  .lx-playground-shell .playground-example-panel {
    padding-right: 14px;
    padding-left: 14px;
  }

  .playground-footer,
  .credential-actions { flex-wrap: wrap; }
}

@container (max-width: 460px) {
  .schema-field-main.is-editable {
    grid-template-areas: "head" "meta" "editor";
    grid-template-columns: minmax(0, 1fr);
    height: auto;
    min-height: 106px;
    row-gap: 6px;
  }
}
