/* KostaCLOUD Docs: public site. Light theme by default; dark via [data-theme=dark]. */
:root {
  --bg: #ffffff; --bg-soft: #f8fafc; --bg-muted: #f1f5f9; --fg: #0f172a; --fg-soft: #334155; --muted: #64748b;
  --line: #e2e8f0; --line-strong: #cbd5e1; --accent: #2563eb; --accent-soft: #eff6ff; --accent-fg: #ffffff;
  --code-bg: #0f172a; --code-fg: #e2e8f0; --inline-code-bg: #f1f5f9;
  --info: #2563eb; --info-bg: #eff6ff; --warning: #b45309; --warning-bg: #fffbeb; --danger: #b91c1c; --danger-bg: #fef2f2; --success: #15803d; --success-bg: #f0fdf4;
  --shadow: 0 10px 30px rgba(15, 23, 42, .12); --radius: 10px; --header-h: 60px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-soft: #0f172a; --bg-muted: #111c33; --fg: #e2e8f0; --fg-soft: #cbd5e1; --muted: #94a3b8;
  --line: #1e293b; --line-strong: #334155; --accent: #60a5fa; --accent-soft: #10213f; --accent-fg: #0b1220;
  --code-bg: #020617; --code-fg: #e2e8f0; --inline-code-bg: #1e293b;
  --info: #60a5fa; --info-bg: #0f1e38; --warning: #fbbf24; --warning-bg: #2a1d07; --danger: #f87171; --danger-bg: #2a0f12; --success: #4ade80; --success-bg: #0b2416;
  --shadow: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body.dc-body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--font); overflow-x: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.i { width: 1em; height: 1em; fill: currentColor; flex: none; vertical-align: -0.125em; }
.dc-skip { position: absolute; left: -9999px; }
.dc-skip:focus { left: 12px; top: 8px; z-index: 100; background: var(--bg); padding: 6px 10px; border-radius: 6px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Preview bar */
.dc-preview-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; background: #111827; color: #e5e7eb; padding: 6px 16px; font-size: 13px; }
.dc-preview-bar a { color: #e5e7eb; display: inline-flex; gap: 6px; align-items: center; padding: 2px 8px; border-radius: 6px; }
.dc-preview-bar a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.dc-preview-actions { display: inline-flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }

/* Header: brand + space switcher | centred "Search or ask" | tools */
.dc-header { position: sticky; top: 0; z-index: 40; height: var(--header-h); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 20px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.dc-header-start { display: flex; align-items: center; gap: 10px; min-width: 0; }
.dc-header-center { display: flex; justify-content: center; min-width: 0; }
.dc-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg); font-weight: 700; white-space: nowrap; }
.dc-brand:hover { text-decoration: none; }
.dc-brand-logo { width: 30px; height: 30px; flex: none; object-fit: contain; }
.dc-header-links { display: flex; gap: 16px; align-items: center; margin-left: auto; margin-right: 8px; }
.dc-header-links a { color: var(--fg-soft); font-size: 14px; font-weight: 500; white-space: nowrap; }
.dc-header-links a:hover { color: var(--accent); }
@media (max-width: 900px) { .dc-header-links { display: none; } }
.dc-brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent); color: var(--accent-fg); flex: none; }
.dc-brand-text span { color: var(--muted); font-weight: 500; }
.dc-switch { position: relative; min-width: 0; }
.dc-switch-btn { display: inline-flex; align-items: center; gap: 6px; max-width: 240px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 5px 10px; font-size: 14px; font-weight: 600; color: var(--fg-soft); cursor: pointer; }
.dc-switch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-switch-btn:hover, .dc-switch-btn[aria-expanded="true"] { background: var(--bg-muted); }
.dc-switch-btn .i { width: .75em; height: .75em; color: var(--muted); }
.dc-switch-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 240px; z-index: 60; background: var(--bg); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px; }
.dc-switch-menu[hidden] { display: none; }
.dc-switch-menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: var(--fg); font-size: 14px; }
.dc-switch-menu a:hover, .dc-switch-menu a:focus-visible { background: var(--bg-muted); text-decoration: none; }
.dc-switch-menu a.current { color: var(--accent); font-weight: 600; }
.dc-switch-menu a > span:nth-child(2) { flex: 1; }
.dc-switch-ic { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 7px; background: var(--bg-muted); color: var(--accent); }
.dc-header-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dc-search-btn { display: flex; align-items: center; gap: 8px; width: 100%; max-width: 520px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); color: var(--muted); cursor: pointer; font-size: 14px; text-align: left; }
.dc-search-btn:hover { border-color: var(--line-strong); }
.dc-search-btn span { flex: 1; }
.dc-search-btn kbd, .dc-dialog kbd { font: 11px var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--muted); background: var(--bg); }
.dc-icon-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 36px; padding: 0 8px; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--fg-soft); cursor: pointer; }
.dc-icon-btn:hover { background: var(--bg-muted); text-decoration: none; }
.dc-ask-btn { border-color: var(--line); color: var(--accent); font-size: 14px; font-weight: 600; }
.dc-signin { font-size: 14px; font-weight: 600; padding: 6px 10px; }
.dc-menu-btn { display: none; }
:root[data-theme="dark"] .dc-moon, :root:not([data-theme="dark"]) .dc-sun { display: none; }
.dc-drawer-head, .dc-drawer-spaces { display: none; }
.dc-scrim { position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42, .45); }
.dc-scrim[hidden] { display: none; }

/* Shell */
.dc-shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - var(--header-h)); }
.dc-sidebar { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); overflow-y: auto; border-right: 1px solid var(--line); padding: 18px 12px 40px; background: var(--bg); }
.dc-version { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); margin: 0 8px 14px; }
.dc-version select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg-soft); color: var(--fg); font: inherit; font-size: 14px; }
.dc-nav ul { list-style: none; margin: 0; padding: 0; }
.dc-nav li ul { padding-left: 12px; margin-left: 8px; border-left: 1px solid var(--line); display: none; }
.dc-nav li.open > ul, .dc-nav .dc-nav-group > ul { display: block; }
.dc-nav .dc-nav-group > ul { padding-left: 0; margin-left: 0; border-left: 0; }
.dc-nav-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 16px 8px 6px; }
.dc-nav-row { display: flex; align-items: center; }
.dc-nav-row a { flex: 1; display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 7px; color: var(--fg-soft); font-size: 14px; line-height: 1.4; min-width: 0; }
.dc-nav-row a span { overflow-wrap: anywhere; }
.dc-nav-row a:hover { background: var(--bg-muted); text-decoration: none; }
.dc-nav-item.active > .dc-nav-row a { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dc-nav-item.hidden-page > .dc-nav-row a { opacity: .6; font-style: italic; }
.dc-nav-toggle { border: 0; background: none; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; cursor: pointer; display: grid; place-items: center; }
.dc-nav-toggle:hover { background: var(--bg-muted); }
.dc-nav-toggle .i { transition: transform .15s; }
.dc-nav-item.open > .dc-nav-row .dc-nav-toggle .i { transform: rotate(90deg); }
.dc-soon { font-style: normal; font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: auto; }

/* Main */
.dc-main { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 40px; padding: 32px 40px 60px; min-width: 0; }
.dc-article { min-width: 0; max-width: 780px; width: 100%; justify-self: center; }
.dc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.dc-crumbs a { color: var(--muted); }
.dc-crumbs .i { width: .8em; height: .8em; }
.dc-page-head h1 { font-size: 34px; line-height: 1.2; margin: 0 0 10px; letter-spacing: -.01em; display: flex; gap: 12px; align-items: center; overflow-wrap: anywhere; }
.dc-page-icon { color: var(--accent); display: inline-flex; }
.dc-lead { font-size: 18px; color: var(--fg-soft); margin: 0 0 14px; }
.dc-page-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.dc-tool { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 10px; font-size: 13px; color: var(--fg-soft); cursor: pointer; }
.dc-tool:hover { background: var(--bg-muted); text-decoration: none; }

/* Content */
.dc-content { overflow-wrap: break-word; }
.dc-content p, .dc-content ul, .dc-content ol { margin: 0 0 16px; }
.dc-content ul, .dc-content ol { padding-left: 24px; }
.dc-content li { margin: 4px 0; }
.dc-content .dc-tasks { list-style: none; padding-left: 4px; }
.dc-content .dc-tasks li.done { color: var(--muted); }
.dc-h { position: relative; line-height: 1.3; margin: 32px 0 12px; scroll-margin-top: calc(var(--header-h) + 16px); }
h2.dc-h { font-size: 24px; padding-top: 8px; } h3.dc-h { font-size: 19px; } h4.dc-h { font-size: 16px; }
.dc-anchor { position: absolute; left: -24px; top: 50%; transform: translateY(-50%); color: var(--muted); opacity: 0; padding: 2px; }
.dc-h:hover .dc-anchor, .dc-anchor:focus { opacity: 1; }
.dc-anchor.copied { color: var(--success); opacity: 1; }
.dc-flash { animation: dcflash 1.6s ease-out; border-radius: 6px; }
@keyframes dcflash { 0% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 35%, transparent); } 100% { box-shadow: 0 0 0 4px transparent; } }
.dc-content code { font: .88em var(--mono); background: var(--inline-code-bg); padding: .12em .38em; border-radius: 5px; overflow-wrap: anywhere; }
.dc-content blockquote { margin: 0 0 16px; padding: 4px 16px; border-left: 3px solid var(--line-strong); color: var(--fg-soft); }
.dc-content hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }
.dc-inline-img { height: 1.3em; width: auto; vertical-align: -0.3em; border-radius: 3px; }
.dc-content mark { background: color-mix(in srgb, #facc15 40%, transparent); color: inherit; padding: 0 2px; border-radius: 3px; }
.dc-fnref a { font-size: .75em; }
.dc-footnotes { font-size: 14px; color: var(--fg-soft); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; }

/* Figures */
.dc-figure { margin: 0 0 20px; text-align: center; }
.dc-figure img, .dc-figure video { max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); background: var(--bg-soft); }
.dc-figure figcaption { font-size: 14px; color: var(--muted); margin-top: 6px; }
.dc-ratio { position: relative; aspect-ratio: 16 / 9; }
.dc-ratio iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 8px; }

/* Hints */
.dc-hint { display: flex; gap: 12px; padding: 12px 16px; border-radius: var(--radius); margin: 0 0 18px; border: 1px solid; }
.dc-hint-icon { padding-top: 2px; }
.dc-hint-body { min-width: 0; flex: 1; }
.dc-hint-body > :last-child { margin-bottom: 0; }
.dc-hint-info { background: var(--info-bg); border-color: color-mix(in srgb, var(--info) 30%, transparent); } .dc-hint-info .dc-hint-icon { color: var(--info); }
.dc-hint-warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 30%, transparent); } .dc-hint-warning .dc-hint-icon { color: var(--warning); }
.dc-hint-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, transparent); } .dc-hint-danger .dc-hint-icon { color: var(--danger); }
.dc-hint-success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, transparent); } .dc-hint-success .dc-hint-icon { color: var(--success); }

/* Tabs, expandables, steps, columns, cards */
.dc-tabs { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 18px; overflow: hidden; }
.dc-tablist { display: flex; overflow-x: auto; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.dc-tablist button { border: 0; background: none; padding: 9px 14px; cursor: pointer; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; white-space: nowrap; }
.dc-tablist button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dc-tabpanel { padding: 16px; }
.dc-tabpanel > :last-child { margin-bottom: 0; }
.dc-expandable { border: 1px solid var(--line); border-radius: var(--radius); margin: 0 0 14px; }
.dc-expandable summary { cursor: pointer; list-style: none; padding: 10px 14px; display: flex; gap: 8px; align-items: center; font-weight: 600; }
.dc-expandable summary::-webkit-details-marker { display: none; }
.dc-expandable[open] .dc-exp-icon { transform: rotate(90deg); }
.dc-exp-icon { transition: transform .15s; color: var(--muted); }
.dc-exp-body { padding: 0 16px 12px; }
.dc-steps { list-style: none; counter-reset: step; padding-left: 0 !important; margin: 0 0 18px; }
.dc-steps > li { counter-increment: step; position: relative; padding: 0 0 12px 44px; border-left: 2px solid var(--line); margin-left: 14px !important; }
.dc-steps > li::before { content: counter(step); position: absolute; left: -15px; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-fg); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.dc-step-title { font-weight: 600; margin-bottom: 6px; }
.dc-columns { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 8px; }
.dc-column { flex: 1 1 260px; min-width: 0; }
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 0 0 18px; }
.dc-card { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--fg); }
.dc-card:hover { border-color: var(--accent); text-decoration: none; }
.dc-card span { color: var(--fg-soft); font-size: 14px; }
.dc-card-icon { color: var(--accent); }
.dc-page-link, .dc-file, .dc-link-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 10px; color: var(--fg); }
.dc-page-link:hover, .dc-file:hover, .dc-link-card:hover { border-color: var(--accent); text-decoration: none; }
.dc-page-link span, .dc-file span, .dc-link-card span { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.dc-file small, .dc-link-card small { color: var(--muted); }
.dc-pl-arrow, .dc-file-dl { color: var(--muted); }

/* Code */
.dc-code { position: relative; margin: 0 0 18px; border-radius: var(--radius); background: var(--code-bg); color: var(--code-fg); overflow: hidden; border: 1px solid var(--line); }
.dc-code-head, .dc-code-tabs { display: flex; align-items: center; min-height: 36px; padding: 0 90px 0 14px; font-size: 12px; color: #94a3b8; border-bottom: 1px solid rgba(148, 163, 184, .18); overflow-x: auto; }
.dc-code-tabs { padding-left: 4px; }
.dc-code-tabs button { border: 0; background: none; color: #94a3b8; padding: 8px 10px; cursor: pointer; font-size: 12px; border-bottom: 2px solid transparent; white-space: nowrap; }
.dc-code-tabs button[aria-selected="true"] { color: #e2e8f0; border-bottom-color: #60a5fa; }
.dc-copy { position: absolute; right: 6px; top: 4px; display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(148, 163, 184, .3); background: rgba(15, 23, 42, .6); color: #cbd5e1; border-radius: 6px; padding: 3px 8px; font-size: 12px; cursor: pointer; }
.dc-pre { margin: 0; padding: 14px 16px; overflow-x: auto; font: 13.5px/1.6 var(--mono); tab-size: 2; }
.dc-pre code { background: none !important; padding: 0 !important; color: inherit; font: inherit; overflow-wrap: normal; }
.tk-c { color: #7c8aa5; font-style: italic; } .tk-s { color: #a5d6a7; } .tk-n { color: #f9c97a; } .tk-k { color: #93c5fd; }

/* Tables */
.dc-table-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); max-width: 100%; }
.dc-table-wrap table { border-collapse: collapse; width: 100%; font-size: 14px; }
.dc-table-wrap th, .dc-table-wrap td { padding: 8px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.dc-table-wrap th { background: var(--bg-soft); font-weight: 600; }
.dc-table-wrap tr:last-child td { border-bottom: 0; }

/* LaTeX (TeXVM SVG through the Papers render service) */
/* Math (inline and display) is sized in em by the renderer (1.21em, like KaTeX) and is never
   scaled down to fit: a formula wider than the column scrolls. Inline math sits on the text
   baseline: the span's bottom edge is the SVG's bottom and vertical-align lowers it by the
   formula's depth. */
.dc-tex-inline { display: inline-block; line-height: 0; max-width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.dc-tex-inline svg { display: block; max-width: none; }
.dc-latex svg, .dc-papers svg { max-width: 100%; height: auto; color: var(--fg); }
.dc-tex svg { color: var(--fg); }
:root[data-theme="dark"] .dc-tex svg, :root[data-theme="dark"] .dc-latex svg, :root[data-theme="dark"] .dc-papers svg { filter: invert(1) hue-rotate(180deg); }
.dc-tex-display { margin: 0 0 18px; }
.dc-tex-scroll { overflow: auto; max-width: 100%; }
/* display: centred while it fits; wider formulas start at the left edge and scroll */
.dc-tex-display .dc-tex-scroll { display: flex; justify-content: safe center; overflow-x: auto; overflow-y: hidden; padding: 2px 0; scrollbar-width: thin; }
.dc-tex-display .dc-tex-scroll svg { display: block; flex: none; max-width: none; }
/* table cells and list items: math keeps its size, the cell scrolls instead of squeezing it */
.dc-table-wrap td .dc-tex-inline, .dc-table-wrap th .dc-tex-inline { max-width: none; }
.dc-latex { margin: 0 0 18px; }
.dc-latex figcaption, .dc-tex-caption { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.dc-papers { margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.dc-papers-body { max-height: 80vh; }
.dc-papers-attr { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.dc-papers-full { margin-left: auto; font-weight: 600; }
.dc-tex a, .dc-latex a, .dc-papers a { cursor: pointer; }
.dc-tex-broken { opacity: .6; }
.dc-tex-fallback { font-size: .9em; }
.dc-tex-fallback-block { margin: 0 0 18px; }
.dc-tex-fallback-block .dc-pre { background: var(--bg-muted); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); }
.dc-tex-note { font-size: 12.5px; color: var(--muted); margin: 0 0 4px; }
/* staff only (preview, editor): a formula that failed, with the TeX message */
.dc-tex-error-block { border: 1px solid var(--danger); background: var(--danger-bg); border-radius: var(--radius); padding: 8px 10px; }
.dc-tex-error-block .dc-tex-note { color: var(--danger); font-weight: 500; }
.dc-tex-error-block .dc-pre { margin: 0; }
.dc-tex-error { position: relative; display: inline; }
.dc-tex-error .dc-tex-fallback { background: var(--danger-bg); color: var(--danger); border: 1px dashed var(--danger); border-radius: 4px; padding: 0 3px; }
.dc-tex-errmsg { display: none; position: absolute; left: 0; top: calc(100% + 4px); z-index: 30; width: max-content; max-width: min(420px, 80vw); white-space: normal; font-size: 12.5px; line-height: 1.4; color: var(--danger); background: var(--danger-bg); border: 1px solid var(--danger); border-radius: 6px; padding: 6px 8px; box-shadow: var(--shadow); }
.dc-tex-error:hover .dc-tex-errmsg, .dc-tex-error:focus .dc-tex-errmsg, .dc-tex-error:focus-within .dc-tex-errmsg { display: block; }
.kc-print-snapshot { display: none; }
@media print {
  .dc-header, .dc-sidebar, .dc-toc, .dc-feedback, .dc-further, .dc-pager, .dc-page-tools, .dc-footer, .dc-preview-bar { display: none !important; }
  .dc-shell, .dc-main { display: block; padding: 0; }
  .kc-iframe .kc-embed-frame { display: none; }
  .kc-print-snapshot { display: block; }
  .dc-papers-body, .dc-tex-scroll { max-height: none; overflow: visible; }
}
.dc-diagram-wrap { margin: 0 0 18px; overflow-x: auto; }
.dc-diagram { max-width: 100%; height: auto; color: var(--fg-soft); }
.dc-diagram .dc-node { fill: var(--bg-soft); stroke: var(--line-strong); stroke-width: 1.5; }
.dc-diagram .dc-node-label, .dc-diagram .dc-edge-label { fill: var(--fg); font-family: var(--font); }

/* API reference */
.dc-api { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 22px; }
.dc-api-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.dc-api-path { font: 14px var(--mono); overflow-wrap: anywhere; }
.dc-method { font: 700 12px var(--mono); padding: 3px 8px; border-radius: 6px; color: #fff; background: #64748b; }
.dc-m-get { background: #15803d; } .dc-m-post { background: #2563eb; } .dc-m-put, .dc-m-patch { background: #b45309; } .dc-m-delete { background: #b91c1c; }
.dc-api h4 { margin: 18px 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.dc-req { font-size: 11px; color: var(--danger); }
.dc-type { font: 12px var(--mono); color: var(--muted); }
.dc-api-responses details { border-top: 1px solid var(--line); padding: 6px 0; }
.dc-api-responses summary { cursor: pointer; }
.dc-status { font: 700 12px var(--mono); padding: 1px 6px; border-radius: 4px; background: var(--bg-muted); }
.dc-s2 { color: var(--success); } .dc-s4, .dc-s5 { color: var(--danger); }
.dc-api-auth { font-size: 14px; color: var(--fg-soft); }
.dc-badge { font-size: 11px; border: 1px solid var(--line); border-radius: 4px; padding: 0 6px; color: var(--warning); }
.dc-tryit { margin-top: 12px; }
.dc-tryit-panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 10px; background: var(--bg-soft); display: grid; gap: 10px; }
.dc-tryit-panel label { font-size: 13px; color: var(--muted); display: grid; gap: 4px; }
.dc-tryit-panel input, .dc-tryit-panel select, .dc-tryit-panel textarea { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--fg); font: 13px var(--mono); }
.dc-tryit-out { max-height: 320px; overflow: auto; }

/* Buttons */
.dc-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 8px; padding: 8px 14px; background: var(--accent); color: var(--accent-fg); font-weight: 600; cursor: pointer; font-size: 14px; }
.dc-btn:hover { filter: brightness(1.05); text-decoration: none; }
.dc-btn.secondary { background: var(--bg-muted); color: var(--fg); }

/* Feedback, Go further, pager */
.dc-feedback { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 40px 0 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.dc-fb-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 10px; cursor: pointer; }
.dc-fb-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.dc-fb-form { width: 100%; display: grid; gap: 6px; }
.dc-fb-form[hidden], .dc-fb-thanks[hidden] { display: none; }
.dc-fb-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--bg); color: var(--fg); font: inherit; }
.dc-fb-form button { justify-self: start; }
.dc-fb-thanks { margin: 0; color: var(--success); width: 100%; }
.dc-further { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 18px; background: var(--bg-soft); }
.dc-further h2 { font-size: 16px; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; }
.dc-further .dc-further-note { margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.dc-further-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.dc-further-item { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; background: var(--bg); color: var(--fg); }
.dc-further-item:hover { border-color: var(--accent); text-decoration: none; }
.dc-further-item .ic { color: var(--accent); padding-top: 2px; }
.dc-further-item b { display: block; font-size: 14px; line-height: 1.35; }
.dc-further-item small { display: block; color: var(--muted); font-size: 12px; }
.dc-trigger { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 14px; }
.dc-trigger p { margin: 0; flex: 1 1 260px; font-size: 14px; }
.dc-trigger-close { border: 0; background: none; cursor: pointer; color: var(--muted); }
.dc-gating { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 12px 14px; margin: 18px 0; font-size: 14px; }
.dc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 24px 0 8px; }
.dc-pager a { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; align-items: center; gap: 14px; color: var(--fg); min-width: 0; }
.dc-pager a > span { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.dc-pager-ic { color: var(--muted); }
.dc-pager a:hover .dc-pager-ic { color: var(--accent); }
.dc-pager a:hover { border-color: var(--accent); text-decoration: none; }
.dc-pager small { color: var(--muted); font-size: 12px; }
.dc-pager span { overflow-wrap: anywhere; font-weight: 600; }
.dc-next { text-align: right; grid-column: 2; }
.dc-updated { color: var(--muted); font-size: 13px; display: flex; gap: 6px; align-items: center; margin: 8px 0 0; }

/* TOC */
.dc-toc { min-width: 0; }
.dc-toc-inner { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; }
.dc-toc-title { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin: 0 0 8px; }
.dc-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.dc-toc li a { display: block; padding: 3px 0 3px 12px; font-size: 13px; color: var(--muted); margin-left: -1px; border-left: 2px solid transparent; }
.dc-toc li.l3 a { padding-left: 24px; }
.dc-toc li a.active { color: var(--accent); border-left-color: var(--accent); }

/* Embeds */
.kc-embed { margin: 0 0 20px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg-soft); }
.kc-embed-frame { position: relative; }
.kc-embed-frame iframe { display: block; width: 100%; height: var(--kc-embed-h, 420px); border: 0; background: var(--bg); }
.kc-embed-loading, .kc-embed-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 160px; color: var(--muted); padding: 20px; text-align: center; }
.kc-embed-placeholder .i { width: 32px; height: 32px; color: var(--accent); }
.kc-embed-fallback img { display: block; max-width: 100%; margin: 0 auto; }
.kc-embed-fallback .dc-table-wrap { margin: 12px; }
.kc-embed.is-live .kc-embed-fallback { display: none; }
.kc-embed-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid var(--line); font-size: 13px; color: var(--fg-soft); background: var(--bg); }
.kc-embed-task { display: inline-flex; gap: 6px; align-items: center; }
.kc-open-app { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.kc-embed figcaption, .kc-embed-caption { font-size: 13px; color: var(--muted); padding: 6px 12px 10px; margin: 0; text-align: center; }
.kc-walkthrough { padding: 12px; }
.kc-wt-stage { position: relative; border-radius: 8px; overflow: hidden; background: var(--bg); }
.kc-wt-stage img { display: block; width: 100%; height: auto; }
.kc-wt-blank { height: 200px; }
.kc-wt-dot { position: absolute; transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; border: 2px solid #fff; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.kc-wt-dot.active { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 40%, transparent); }
.kc-wt-steps { list-style: none; padding: 0; margin: 10px 0 0; }
.kc-wt-steps li { display: none; }
.kc-wt-steps li.active { display: grid; gap: 2px; }
.kc-wt-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.kc-wt-nav button { display: inline-flex; gap: 4px; align-items: center; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 4px 10px; cursor: pointer; }

/* Search and assistant */
.dc-overlay { position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45); display: flex; justify-content: center; align-items: flex-start; padding: 8vh 16px 16px; }
.dc-overlay[hidden] { display: none; }
.dc-dialog { width: min(720px, 100%); max-height: 84vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.dc-dialog-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.dc-dialog-head input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--fg); font: 17px var(--font); }
.dc-modes { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dc-modes button { border: 0; background: none; padding: 6px 10px; border-bottom: 2px solid transparent; cursor: pointer; color: var(--muted); display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.dc-modes button[aria-selected="true"] { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.dc-scope { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); align-items: center; padding-bottom: 6px; }
.dc-scope label { display: inline-flex; gap: 4px; align-items: center; }
.dc-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 999px; padding: 3px 10px; font: inherit; font-size: 12px; cursor: pointer; }
.dc-chip .i { width: 12px; height: 12px; }
.dc-chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dc-kind { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.dc-kind .i { width: 12px; height: 12px; }
.dc-dialog-body { overflow-y: auto; padding: 10px 14px 16px; }
.dc-result { display: block; padding: 10px 12px; border-radius: 9px; color: var(--fg); }
.dc-result:hover, .dc-result.active { background: var(--bg-muted); text-decoration: none; }
.dc-result-ask { display: flex; width: 100%; align-items: center; gap: 10px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; }
.dc-result-ask .dc-ask-ic { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); flex: none; }
.dc-result.dc-result-ask b { display: inline; }
.dc-dialog-head input::-webkit-search-cancel-button { display: none; }
.dc-results-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 10px 12px 4px; }
.dc-dialog-foot { display: flex; flex-wrap: wrap; gap: 14px; padding: 8px 14px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.dc-dialog-foot span { display: inline-flex; gap: 4px; align-items: center; }
.dc-result b { display: block; }
.dc-result small { color: var(--muted); }
.dc-result p { margin: 2px 0 0; font-size: 14px; color: var(--fg-soft); }
.dc-answer { font-size: 15px; }
.dc-answer p { margin: 0 0 10px; }
.dc-answer a.dc-cite { font-size: .75em; vertical-align: super; padding: 0 2px; }
.dc-answer-sources { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; display: grid; gap: 6px; }
.dc-answer-sources a { font-size: 13px; display: flex; gap: 6px; }
.dc-answer-sources a b { color: var(--muted); font-weight: 600; }
.dc-answer-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; align-items: center; font-size: 13px; color: var(--muted); }
.dc-answer-note { font-size: 12px; color: var(--muted); margin-top: 8px; }
.dc-caret { display: inline-block; width: 7px; height: 1em; background: var(--accent); vertical-align: -2px; animation: dcblink 1s steps(2) infinite; }
@keyframes dcblink { 50% { opacity: 0; } }

.dc-footer { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: center; padding: 22px 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.dc-footer a { color: var(--muted); }

/* Responsive */
@media (max-width: 1180px) { .dc-main { grid-template-columns: minmax(0, 1fr); padding: 28px 28px 60px; } .dc-toc { display: none; } }
@media (max-width: 900px) {
  .dc-header { grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; padding: 0 12px; }
  .dc-shell { grid-template-columns: minmax(0, 1fr); }
  .dc-menu-btn { display: inline-flex; }
  .dc-sidebar { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); height: auto; z-index: 50; transform: translateX(-102%); transition: transform .2s; box-shadow: var(--shadow); padding-top: 8px; visibility: hidden; }
  body.dc-nav-open .dc-sidebar { transform: none; visibility: visible; }
  body.dc-nav-open { overflow: hidden; }
  .dc-drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 4px 10px 8px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
  .dc-drawer-title { font-weight: 700; }
  .dc-drawer-spaces { display: grid; gap: 2px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .dc-drawer-spaces a { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 7px; color: var(--fg-soft); font-size: 14px; }
  .dc-drawer-spaces a.current { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
  .dc-switch { display: none; }
  .dc-header-center { justify-content: flex-end; }
  .dc-search-btn { width: auto; padding: 8px 10px; }
  .dc-search-btn span, .dc-search-btn kbd { display: none; }
}
@media (max-width: 600px) {
  .dc-brand-text { display: none; }
  .dc-ask-label { display: none; }
  .dc-main { padding: 20px 16px 48px; }
  .dc-page-head h1 { font-size: 27px; }
  .dc-anchor { display: none; }
  .dc-pager { grid-template-columns: minmax(0, 1fr); }
  .dc-next { grid-column: 1; }
  .dc-overlay { padding: 0; }
  .dc-dialog { max-height: 100vh; height: 100%; border-radius: 0; }
  .dc-dialog-foot { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
