
  .docs-pages-shell {
    position: relative;
    isolation: isolate;
  }

  .docs-page-root {
    --docs-accent: var(--primary-color, #2563eb);
    --docs-accent-deep: color-mix(in srgb, var(--docs-accent) 76%, #0f172a);
    --docs-accent-soft: color-mix(in srgb, var(--docs-accent) 12%, #ffffff);
    --docs-accent-border: color-mix(in srgb, var(--docs-accent) 22%, #cbd5e1);
    --docs-ink: var(--public-text-strong, #0f172a);
    --docs-muted: var(--public-text-muted, #64748b);
    --docs-panel: color-mix(in srgb, var(--public-panel-bg, rgba(255, 255, 255, 0.92)) 88%, transparent);
    --docs-panel-strong: color-mix(in srgb, var(--public-panel-bg, rgba(255, 255, 255, 0.98)) 92%, transparent);
    position: relative;
    background: transparent;
  }
  .docs-page-shell { position: relative; z-index: 1; }
  .docs-hero-card {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: 24px;
    border: 1px solid var(--docs-accent-border);
    background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.98)) 90%, transparent);
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.08);
  }
  .docs-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 9999px;
    background: var(--docs-accent-soft);
    color: var(--docs-accent-deep);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
  }
  .docs-kicker-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--docs-accent), #f97316);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--docs-accent) 16%, transparent);
  }
  .docs-page-title {
    margin-top: 1rem;
    color: var(--docs-ink);
    font-size: clamp(2rem, 3.6vw, 3.2rem);
    line-height: 1.02;
    letter-spacing: -0.05em;
    font-weight: 800;
    max-width: none;
  }
  .docs-page-subtitle {
    max-width: none;
    margin-top: 0.9rem;
    color: #475569;
    font-size: 1.02rem;
    line-height: 1.75;
  }
  .docs-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.25rem;
  }
  .docs-meta-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 0.9rem;
    border-radius: 9999px;
    background: color-mix(in srgb, var(--public-subcard-bg, rgba(255,255,255,0.90)) 90%, transparent);
    border: 1px solid var(--public-divider-color, rgba(148, 163, 184, 0.24));
    color: var(--public-text-muted, #475569);
    font-size: 0.82rem;
    font-weight: 600;
    backdrop-filter: blur(12px);
  }
  .docs-meta-chip i { color: var(--docs-accent); }
  .docs-surface {
    background: var(--docs-panel-strong);
    border: 1px solid var(--public-panel-border, rgba(148, 163, 184, 0.2));
    border-radius: 22px;
    box-shadow: 0 20px 45px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(14px);
  }
  .docs-section-label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #64748b;
  }
  .docs-section-label i { color: var(--docs-accent); }
  /* ── Modern docs prose styles ── */
  .docs-prose { word-break: break-word; overflow-wrap: anywhere; color: var(--public-text-muted, #334155); line-height: 1.8; }
  .docs-prose { font-size: 1.02rem; }
  .docs-prose img, .docs-prose video, .docs-prose iframe, .docs-prose svg, .docs-prose canvas { max-width: 100%; height: auto; border-radius: 8px; }
  .docs-prose pre { overflow-x: auto; background: linear-gradient(180deg, #0f172a, #1e293b); color: #e2e8f0; border-radius: 18px; padding: 1.15rem 1.35rem; font-size: 0.875rem; line-height: 1.7; margin: 1.75rem 0; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04), 0 16px 35px rgba(15, 23, 42, 0.2); }
  .docs-prose code:not(pre code) { background: color-mix(in srgb, var(--docs-accent) 10%, #ffffff); color: var(--docs-accent-deep); padding: 0.2rem 0.5rem; border-radius: 9999px; font-size: 0.84em; font-weight: 600; }
  .docs-prose pre code { background: none; color: inherit; padding: 0; border-radius: 0; font-size: inherit; }
  .docs-prose table { width: 100%; max-width: 100%; border-collapse: separate; border-spacing: 0; margin: 1.75rem 0; border-radius: 16px; overflow: hidden; border: 1px solid rgba(148, 163, 184, 0.2); box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06); }
  .docs-prose th { background: color-mix(in srgb, var(--public-subcard-bg, rgba(248,251,255,0.98)) 94%, transparent); font-weight: 700; text-align: left; padding: 0.85rem 1rem; border-bottom: 1px solid var(--public-divider-color, rgba(148, 163, 184, 0.18)); font-size: 0.82rem; color: var(--public-text-strong, #334155); text-transform: uppercase; letter-spacing: 0.08em; }
  .docs-prose td { padding: 0.9rem 1rem; border-bottom: 1px solid color-mix(in srgb, var(--public-divider-color, rgba(148,163,184,0.18)) 70%, transparent); font-size: 0.95rem; background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.95)) 92%, transparent); }
  .docs-prose tr:hover td { background: #f8fbff; }
  .docs-prose h1, .docs-prose h2, .docs-prose h3, .docs-prose h4 { scroll-margin-top: 96px; color: var(--public-text-strong, #0f172a); font-weight: 700; letter-spacing: -0.02em; }
  .docs-prose h1 { font-size: 2.15rem; margin-top: 2.75rem; margin-bottom: 1rem; padding-bottom: 0.7rem; border-bottom: 1px solid rgba(148, 163, 184, 0.22); }
  .docs-prose h2 { font-size: 1.62rem; margin-top: 2.25rem; margin-bottom: 0.9rem; }
  .docs-prose h3 { font-size: 1.3rem; margin-top: 1.7rem; margin-bottom: 0.65rem; }
  .docs-prose h4 { font-size: 1.1rem; margin-top: 1.25rem; margin-bottom: 0.5rem; }
  .docs-prose p { margin: 0.95rem 0; color: var(--public-text-muted, #334155); }
  .docs-prose blockquote { border: 1px solid var(--docs-accent-border); border-left: 4px solid var(--docs-accent); background: linear-gradient(135deg, rgba(255,255,255,0.98), var(--docs-accent-soft)); padding: 1.1rem 1.3rem; margin: 1.75rem 0; border-radius: 0 18px 18px 0; color: #475569; box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04); }
  .docs-prose ul, .docs-prose ol { padding-left: 1.5rem; margin: 0.95rem 0; }
  .docs-prose li { margin: 0.45rem 0; padding-left: 0.15rem; }
  .docs-prose a { color: var(--docs-accent-deep); text-decoration: none; font-weight: 600; background-image: linear-gradient(transparent calc(100% - 2px), color-mix(in srgb, var(--docs-accent) 36%, transparent) 0); background-size: 0% 100%; background-repeat: no-repeat; transition: color 0.2s ease, background-size 0.2s ease; }
  .docs-prose a:hover { text-decoration: none; background-size: 100% 100%; }
  .docs-prose hr { border: none; border-top: 1px solid rgba(148, 163, 184, 0.24); margin: 2.4rem 0; }
  .docs-prose > *:first-child { margin-top: 0; }
  .docs-prose > :where(h2, h3, h4) { position: relative; }
  .docs-prose > :where(h2, h3, h4)::before {
    content: '';
    position: absolute;
    left: -1rem;
    top: 0.72em;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: linear-gradient(135deg, var(--docs-accent), #f97316);
    box-shadow: 0 0 0 5px color-mix(in srgb, var(--docs-accent) 14%, transparent);
  }

  /* ── TOC sidebar ── */
  .docs-toc-sidebar { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow-y: auto; padding: 1rem 0.85rem; border-radius: 22px; border: 1px solid var(--public-panel-border, rgba(148, 163, 184, 0.18)); background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.82)) 88%, transparent); box-shadow: 0 18px 35px rgba(15, 23, 42, 0.08); backdrop-filter: blur(18px); }
  .docs-toc-sidebar::-webkit-scrollbar { width: 3px; }
  .docs-toc-sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
  .docs-toc-link { display: block; padding: 0.45rem 0.85rem; border-left: 2px solid transparent; border-radius: 0.9rem; font-size: 0.84rem; color: var(--public-text-muted, #64748b); transition: all 0.15s; line-height: 1.4; }
  .docs-toc-link:hover { color: var(--docs-accent-deep); background: var(--docs-accent-soft); }
  .docs-toc-link.active { color: var(--docs-accent-deep); border-left-color: var(--docs-accent); font-weight: 700; background: linear-gradient(90deg, var(--docs-accent-soft), rgba(255,255,255,0.8)); }

  .docs-nav-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid var(--public-panel-border, rgba(148, 163, 184, 0.2));
    background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.94)) 90%, transparent);
    box-shadow: 0 14px 26px rgba(15, 23, 42, 0.08);
  }
  .docs-nav-card:hover {
    border-color: var(--docs-accent-border);
    box-shadow: 0 22px 36px rgba(37, 99, 235, 0.12);
    transform: translateY(-2px);
  }
  .docs-nav-card::after {
    content: '';
    position: absolute;
    inset: auto 0 0;
    height: 3px;
    background: linear-gradient(90deg, var(--docs-accent), #f97316);
    opacity: 0;
    transition: opacity 0.18s ease;
  }
  .docs-nav-card:hover::after { opacity: 1; }
  .docs-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: 9999px;
    border: 1px solid var(--public-divider-color, rgba(148, 163, 184, 0.18));
    background: color-mix(in srgb, var(--public-subcard-bg, rgba(255,255,255,0.90)) 90%, transparent);
    color: var(--public-text-muted, #475569);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.18s ease;
  }
  .docs-tag i { color: var(--docs-accent); font-size: 0.72rem; }
  .docs-tag:hover {
    color: var(--docs-accent-deep);
    border-color: var(--docs-accent-border);
    background: var(--docs-accent-soft);
    transform: translateY(-1px);
  }
  .docs-article-shell {
    padding: clamp(1.1rem, 2vw, 1.5rem);
    border-radius: 24px;
    border: 1px solid var(--public-panel-border, rgba(148, 163, 184, 0.18));
    background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.97)) 90%, transparent);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 22px 44px rgba(15, 23, 42, 0.08);
  }
  .docs-article-shell .docs-prose {
    padding: clamp(1rem, 1.8vw, 1.75rem);
    border-radius: 20px;
    background: color-mix(in srgb, var(--public-subcard-bg, rgba(255,255,255,0.96)) 92%, transparent);
  }
  .docs-related-panel {
    padding: 1.3rem;
    border-radius: 22px;
    border: 1px solid var(--public-panel-border, rgba(148, 163, 184, 0.18));
    background: color-mix(in srgb, var(--public-panel-bg, rgba(255,255,255,0.95)) 90%, transparent);
    box-shadow: 0 16px 32px rgba(15, 23, 42, 0.08);
  }
  .docs-related-link {
    border-radius: 16px;
    border: 1px solid var(--public-divider-color, rgba(148, 163, 184, 0.18));
    background: color-mix(in srgb, var(--public-subcard-bg, rgba(255,255,255,0.92)) 92%, transparent);
    transition: all 0.18s ease;
  }
    :is(body.ui-mode-dark, body.public-site-body.preset-mode-dark) .docs-page-root {
      --docs-accent-soft: color-mix(in srgb, var(--theme-primary) 18%, rgba(15,23,42,0.92));
    }

    :is(body.ui-mode-dark, body.public-site-body.preset-mode-dark) .docs-prose blockquote {
      color: var(--public-text-muted, rgba(226, 232, 240, 0.86));
    }

  .docs-related-link:hover {
    border-color: var(--docs-accent-border);
    background: linear-gradient(145deg, rgba(255,255,255,1), var(--docs-accent-soft));
    transform: translateY(-1px);
  }

  /* ── Inline Quill Editor ── */
  #docsEditorWrapper .ql-container { min-height: 400px; font-size: 1rem; line-height: 1.8; border: 1px solid #e2e8f0; border-top: none; border-radius: 0 0 8px 8px; }
  #docsEditorWrapper .ql-toolbar { border: 1px solid #e2e8f0; border-radius: 8px 8px 0 0; background: #f8fafc; position: sticky; top: 64px; z-index: 20; flex-wrap: wrap; }
  #docsEditorWrapper .ql-editor { min-height: 400px; padding: 1.5rem; color: #1e293b; }
  #docsEditorWrapper .ql-editor p { margin: 0.5rem 0; }
  #docsEditorWrapper .ql-toolbar .ql-table::before { content: '▦'; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1; }
  #docsEditorWrapper .ql-toolbar .ql-fullscreen::before { content: '⤢'; font-family: inherit; font-weight: 700; font-size: 14px; line-height: 1; }
  #docsEditorWrapper .ql-toolbar .ql-fullscreen.active::before { content: '⤡'; }
  #docsEditorWrapper.docs-editor-fullscreen { position: fixed; inset: 0; z-index: 120; background: #fff; padding: 0; margin: 0; }
  #docsEditorWrapper.docs-editor-fullscreen .ql-toolbar { position: sticky; top: 0; border-radius: 0; }
  #docsEditorWrapper.docs-editor-fullscreen .ql-container { min-height: calc(100vh - 48px); height: calc(100vh - 48px); border-radius: 0; border-left: none; border-right: none; border-bottom: none; }
  #docsEditorWrapper.docs-editor-fullscreen .ql-editor { min-height: calc(100vh - 48px); }

  /* ── Markdown editor ── */
  #docsMarkdownEditor { width: 100%; min-height: 500px; padding: 1.25rem; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 0.875rem; line-height: 1.7; color: #1e293b; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; resize: vertical; tab-size: 4; }
  #docsMarkdownEditor:focus { outline: none; border-color: #818cf8; box-shadow: 0 0 0 3px rgba(129,140,248,0.15); }
  .docs-md-help { max-height: 400px; overflow-y: auto; }
  .docs-md-help h4 { font-size: 0.8125rem; font-weight: 700; color: #475569; margin: 0.75rem 0 0.25rem; }
  .docs-md-help h4:first-child { margin-top: 0; }
  .docs-md-help code { background: #f1f5f9; color: #e11d48; padding: 0.1rem 0.35rem; border-radius: 3px; font-size: 0.8125rem; }
  .docs-md-help table { width: 100%; font-size: 0.8125rem; border-collapse: collapse; }
  .docs-md-help th, .docs-md-help td { padding: 0.3rem 0.5rem; border-bottom: 1px solid #e2e8f0; text-align: left; }
  .docs-md-help th { font-weight: 600; color: #475569; }

  /* ── Editor action bar ── */
  .docs-editor-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.75rem 1rem; background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 8px; margin-bottom: 1rem; }
  .docs-editor-actions .action-btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.4rem 0.75rem; font-size: 0.8125rem; font-weight: 500; border-radius: 6px; border: 1px solid #e2e8f0; background: white; color: #475569; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
  .docs-editor-actions .action-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
  .docs-editor-actions .action-btn.primary { background: var(--primary-color, #0066cc); color: white; border-color: transparent; }
  .docs-editor-actions .action-btn.primary:hover { opacity: 0.9; }
  .docs-editor-actions .action-btn.ai { background: #f5f3ff; color: #6d28d9; border-color: #ddd6fe; }
  .docs-editor-actions .action-btn.ai:hover { background: #ede9fe; }
  .docs-editor-actions .action-btn.danger { color: #dc2626; }
  .docs-editor-actions .action-btn.danger:hover { background: #fef2f2; border-color: #fecaca; }
  .docs-editor-actions .action-sep { width: 1px; height: 1.5rem; background: #e2e8f0; }

  /* ── AI selection bar ── */
  .docs-ai-selection-bar { position: absolute; z-index: 30; background: white; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); padding: 0.35rem; display: flex; gap: 0.25rem; }
  .docs-ai-selection-bar button { padding: 0.35rem 0.625rem; font-size: 0.75rem; font-weight: 500; border-radius: 5px; border: none; cursor: pointer; transition: all 0.15s; white-space: nowrap; }

  /* ── Mobile TOC ── */
  @media (max-width: 1023px) {
    .docs-toc-sidebar { position: static; max-height: none; }
    .docs-hero-card { padding: 1.2rem; border-radius: 20px; }
    .docs-page-title { max-width: none; }
    .docs-prose > :where(h2, h3, h4)::before { display: none; }
  }

  /* ── Responsive table wrapper ── */
  .docs-prose .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.5rem 0; }
  .docs-prose .table-responsive table { margin: 0; }

  /* ── Toast ── */
  .docs-toast { position: fixed; top: 1rem; right: 1rem; z-index: 70; padding: 0.625rem 1rem; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); font-size: 0.875rem; font-weight: 500; transition: all 0.3s ease; }

  /* ── Back to top ── */
  .docs-back-top { position: fixed; right: 1rem; bottom: 1rem; width: 2.75rem; height: 2.75rem; border-radius: 9999px; border: 1px solid #dbeafe; background: #2563eb; color: #fff; z-index: 80; box-shadow: 0 8px 24px rgba(37,99,235,0.3); display: inline-flex; align-items: center; justify-content: center; transition: all 0.2s ease; }
  .docs-back-top:hover { transform: translateY(-2px); background: #1d4ed8; }
  .docs-back-top.hidden { opacity: 0; pointer-events: none; transform: translateY(8px); }

  /* ── Shared hero metric cards (mirrors blog-detail-shell) ── */
  .docs-pages-shell .detail-hero-meta {
    display: grid;
    gap: 0.9rem;
  }
  .docs-pages-shell .detail-metric {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-radius: 1.2rem;
    border: 1px solid color-mix(in srgb, var(--public-panel-border, rgba(148,163,184,0.18)) 92%, transparent);
    background: color-mix(in srgb, var(--public-subcard-bg, rgba(255,255,255,0.76)) 84%, transparent);
  }
  .docs-pages-shell .detail-metric-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--public-text-soft, #94a3b8);
  }
  .docs-pages-shell .detail-metric-value {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    color: var(--public-text-strong, #0f172a);
  }

  /* Tighten docs title block spacing inside hero. */
  .docs-pages-shell .public-hero .public-display {
    margin: 0;
    line-height: 1.02;
  }

  .docs-pages-shell .public-hero .public-lead {
    margin-top: 0.55rem;
  }
