/* Documentation shell follows the supplied LM Studio reference. */
:root { --bg: #fafafa; --panel: #f3f3f3; --text: #171717; --muted: #737373; --line: #e2e2e2; --sidebar-width: 280px; }
:root[data-theme=dark] { --bg: #111111; --panel: #191919; --text: #ededed; --muted: #a3a3a3; --line: #292929; }
body { font-size: 16px; line-height: 1.6; }
.docs-layout { display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr) 190px; max-width: none; min-height: 100dvh; margin: 0; }
.docs-layout.docs-home { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 0 16px; background: var(--panel); border-right: 1px solid var(--line); overflow: visible; z-index: 30; min-width: 0; }
.sidebar-brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 50px; flex-shrink: 0; padding: 0 10px; }
.brand { gap: 10px; font-size: 16px; font-weight: 500; min-width: 0; }
.brand-mark { width: 27px; height: 27px; border-radius: 6px; background: linear-gradient(145deg, #8b7bff, #5530c9); color: white; font-size: 17px; }
.brand-mark.site-logo { width: 32px; height: 32px; flex-shrink: 0; }
.site-logo { object-fit: contain; }
#sidebar-collapse, #menu-toggle, #sidebar-restore { border: 0; background: transparent; color: var(--muted); padding: 2px 4px; font-size: 20px; }
#sidebar-restore { position: fixed; top: 10px; left: 14px; z-index: 40; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.sidebar-tools { padding: 0 10px 14px; flex-shrink: 0; }
#search-open { width: 100%; justify-content: space-between; gap: 8px; padding: 5px 9px; height: 34px; border-radius: 10px; color: var(--muted); background: transparent; margin-bottom: 12px; font-size: 14px; }
kbd { font-family: ui-monospace, monospace; background: var(--bg); font-size: 12px; line-height: 1.4; }
.project-selector { position: relative; }
.sidebar .project-selector > summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 8px 9px; border: 1px solid var(--line); border-radius: 9px; font-size: 14px; font-weight: 500; background: color-mix(in srgb, var(--text) 5%, var(--panel)); cursor: pointer; }
.project-selector > summary::-webkit-details-marker, .open-page > summary::-webkit-details-marker { display: none; }
.project-chevron { margin-left: auto; color: var(--muted); }
.project-selector[open] .project-chevron { transform: rotate(180deg); }
.project-icon { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; color: var(--accent); font-size: 12px; font-weight: 650; border-radius: 5px; background: color-mix(in srgb, var(--accent) 9%, var(--bg)); }
.brand-mark.site-logo, .project-icon.site-logo { background: transparent; border-radius: 0; }
.project-options { position: absolute; top: calc(100% + 5px); left: -2px; right: -2px; padding: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 7px 18px #0002; max-height: min(560px, calc(100dvh - 155px)); overflow-y: auto; z-index: 50; }
.sidebar .project-options > a { display: flex; align-items: center; gap: 10px; border-radius: 7px; padding: 9px 7px; margin: 0; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 400; }
.sidebar .project-options > a:hover, .sidebar .project-options > a:focus-visible { background: var(--panel); }
.sidebar .project-options > a[aria-current] { background: color-mix(in srgb, var(--text) 4%, var(--bg)); color: var(--text); }
.project-option-label { min-width: 0; overflow-wrap: anywhere; }
.project-check { margin-left: auto; font-size: 15px; }
.project-home { border-bottom: 1px solid var(--line); margin-bottom: 4px !important; }
.article-nav { overflow-y: auto; flex: 1; min-height: 0; padding: 0 8px 16px; scrollbar-width: thin; }
.sidebar .article-nav > a, .sidebar .nav-nested > a { padding: 8px 10px; margin: 2px 0; line-height: 1.6; font-size: 14px; }
.sidebar .article-nav a[aria-current=page] { color: var(--text); font-weight: 500; background: color-mix(in srgb, var(--text) 5%, var(--panel)); }
.nav-heading { margin: 25px 10px 8px; text-transform: none; letter-spacing: 0; color: var(--text); font-weight: 500; font-size: 14px; }
.article-nav > .nav-heading:first-child { margin-top: 10px; }
.sidebar-footer { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 0; padding: 12px 10px; flex-shrink: 0; font-size: 12px; }
.sidebar-footer button { font-size: 12px; padding: 3px 6px; }
.docs-layout main { padding: 46px 26px 70px 90px; width: 100%; min-width: 0; max-width: 1320px; margin: 0 auto; }
.page-header h1 { font-size: 28px; font-weight: 650; letter-spacing: -.03em; margin: 0 0 22px; line-height: 1.3; }
.page-header .lead { font-size: 18px; color: var(--muted); line-height: 1.6; margin: 0 0 28px; }
.page-header { border-bottom: 1px solid var(--line); padding-bottom: 20px; margin-bottom: 40px; }
.page-header-compact { border-bottom: 0; padding-bottom: 0; }
.page-actions { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.page-actions button, .open-page > summary { border: 1px solid var(--line); border-radius: 7px; background: var(--panel); color: var(--text); font-size: 12px; font-weight: 500; padding: 6px 9px; line-height: 1.4; cursor: pointer; }
.copy-markdown { display: flex; gap: 7px; align-items: center; }
.copy-markdown > span { color: var(--muted); font-size: 16px; line-height: 1; }
.open-page { position: relative; }
.open-page > summary { display: flex; list-style: none; gap: 12px; align-items: center; }
.open-page-options { position: absolute; top: calc(100% + 5px); left: 0; width: 175px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); padding: 5px; box-shadow: 0 5px 16px #0002; z-index: 10; }
.open-page-options a { display: block; padding: 7px; border-radius: 5px; text-decoration: none; color: var(--text); }
.open-page-options a:hover { background: var(--panel); }
h2 { font-size: 24px; font-weight: 600; letter-spacing: -.025em; }
.explore-heading { margin: 0 0 26px; }
.home-cards { gap: 12px; }
.home-card { background: var(--panel); border: 1px solid var(--line); border-radius: 13px; padding: 17px; }
.home-card:hover { background: color-mix(in srgb, var(--text) 4%, var(--panel)); border-color: color-mix(in srgb, var(--text) 20%, var(--line)); }
.home-card .project-icon { width: 34px; height: 34px; border-radius: 9px; background: var(--bg); border: 1px solid var(--line); box-shadow: 0 3px 4px #0002; font-size: 14px; margin-bottom: 9px; }
.home-card h3 { margin: 0 0 3px; font-size: 16px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.project-icon.section-logo { object-fit: contain; padding: 0; background: transparent; border: 0; border-radius: 0; box-shadow: none; }
.home-card .section-logo { width: 40px; height: 40px; }
.article-nav .project-icon { display: inline-block; width: 20px; height: 20px; margin-right: 8px; vertical-align: middle; }
.page-header h1 .section-logo { width: 38px; height: 38px; margin-right: 12px; vertical-align: middle; }
.sidebar-footer .about-link { display: block; margin-top: 5px; color: var(--muted); text-underline-offset: 3px; }
.sidebar-footer .about-link:hover, .sidebar-footer .about-link[aria-current="page"] { color: var(--text); }
.home-card p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted); }
.site-page-divider { border: 0; border-top: 1px solid var(--line); margin: 16px 10px; }
.sidebar .article-nav .site-page-link { display: flex; align-items: center; gap: 8px; }
.article-nav .site-page-link .project-icon { margin-right: 0; }
.prose .visual-index-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; }
.prose .visual-index-grid > li { min-width: 0; margin: 0; }
.visual-index-link { display: flex; flex-direction: column; align-items: center; gap: 20px; min-height: 280px; height: 100%; padding: 20px 12px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text); text-decoration: none; text-align: center; }
.visual-index-link:hover, .visual-index-link:focus-visible { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 5%, var(--panel)); }
.prose .visual-index-link img { width: 192px; height: 192px; max-width: 100%; flex-shrink: 0; object-fit: contain; margin: 0; border: 0; border-radius: 0; }
.visual-index-label { min-width: 0; width: 100%; overflow-wrap: anywhere; }
.visual-index-label strong { display: block; font-size: 22px; line-height: 1.35; font-weight: 500; }
.visual-index-fallback { display: grid; place-items: center; width: 192px; height: 192px; max-width: 100%; flex-shrink: 0; border-radius: 12px; background: var(--bg); color: var(--accent); font-size: 48px; }
.toc { top: 0; max-height: 100dvh; padding-top: 49px; }
.sidebar-collapsed .sidebar { display: none; }
.sidebar-collapsed .docs-layout { grid-template-columns: minmax(0, 1fr) 190px; }
.sidebar-collapsed .docs-layout.docs-home { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 1150px) {
  .docs-layout, .docs-layout.docs-home { grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
  .sidebar-collapsed .docs-layout { grid-template-columns: minmax(0, 1fr); }
  .docs-layout main { padding: 38px 32px 60px; }
}
@media (max-width: 760px) {
  .docs-layout, .docs-layout.docs-home, .sidebar-collapsed .docs-layout { display: block; }
  .sidebar { display: flex; position: sticky; top: 0; width: 100%; height: auto; padding: 0 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-brand { height: 48px; }
  #sidebar-collapse { display: none; }
  #menu-toggle { display: block; }
  .sidebar-tools { display: grid; grid-template-columns: minmax(90px, .7fr) minmax(0, 1fr); align-items: center; gap: 8px; padding-bottom: 10px; }
  #search-open { margin: 0; height: 38px; }
  .project-options { left: auto; right: 0; width: min(310px, calc(100vw - 44px)); max-height: min(500px, calc(100dvh - 140px)); }
  .sidebar .article-nav, .sidebar-footer { display: none; }
  .sidebar.is-open .article-nav { display: block; max-height: 50dvh; }
  .sidebar.is-open .sidebar-footer { display: flex; }
  .docs-layout main { padding: 28px 22px 45px; }
  .page-header h1 { font-size: 26px; margin-bottom: 16px; }
  .page-header .lead { font-size: 16px; margin-bottom: 22px; }
  .page-header { margin-bottom: 28px; }
  .home-cards { grid-template-columns: 1fr; }
}
@media print {
  .sidebar, #sidebar-restore, .page-actions { display: none !important; }
  .docs-layout, .docs-layout.docs-home { display: block; }
}
