/* The header and footer fit the viewport even with many projects or model rows. */
:root{--sidebar:#f9f9f9}
:root[data-theme=dark]{--sidebar:#202225}
body>aside{overflow:hidden;min-height:0}
body>aside .sidebar-brand-row{grid-template-columns:minmax(0,1fr) repeat(3,28px);gap:2px}
body>aside .sidebar-brand-row .brand{font-size:17px}
body>aside .sidebar-brand-row .new-work{display:grid;place-items:center;position:relative;width:28px;height:32px;min-width:0;margin:0;padding:6px;border:0;border-radius:7px;background:transparent;color:var(--muted);float:none}
.sidebar-brand-row .new-work svg{width:18px;height:18px}
.sidebar-brand-row button:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}
body>aside .sidebar-content{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;padding-top:12px}
.sidebar-content>.fold-group{flex:none}
.sidebar-content>.history-fold{overflow:visible}
body>aside .sidebar-content .workspace-projects{margin:8px 0;padding:4px 6px 10px;border-bottom:1px solid var(--line)}
.sidebar-content .workspace-projects>.project-heading{display:list-item;cursor:pointer;list-style:disclosure-closed;padding:8px 2px;font-size:11px;color:var(--muted)}
.sidebar-content .workspace-projects[open]>.project-heading{list-style:disclosure-open}
.sidebar-content .workspace-projects>.project-heading strong{font-size:11px;font-weight:500}
body>aside .system-disclosure{flex:0 1 auto;min-height:0;max-height:45%;margin-top:8px;margin-bottom:0;padding:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;overflow-wrap:anywhere}
.system-disclosure>summary{position:sticky;top:0;z-index:1;background:var(--sidebar,#f9f9f9);padding:12px 4px}
.system-disclosure .machine{padding-bottom:8px}
@media(min-width:851px) and (max-width:1150px){
  body>aside{width:248px}
  body:not(.sidebar-collapsed)>main{margin-left:248px}
}
@media(max-width:850px){
  body.sidebar-open>aside{width:min(320px,calc(100vw - 24px));padding-bottom:max(16px,env(safe-area-inset-bottom))}
  body>aside .sidebar-brand-row{grid-template-columns:minmax(0,1fr) repeat(3,44px);gap:0}
  body>aside .sidebar-brand-row :is(.new-work,.sidebar-collapse,#historySearchToggle){width:44px;height:44px;padding:12px}
  body>aside .sidebar-content{padding-top:4px}
  .system-disclosure>summary{min-height:44px}
  body>aside .system-disclosure .machine>:not([hidden]):not(.theme-setting){display:block}
  body>aside .system-disclosure .machine>.dot{display:inline-block}
  body>aside .system-disclosure .machine>button{min-height:44px;min-width:44px}
}
