/* The signed-in library and project views share the Tool Finder's workspace chrome. */
body.workspace-unified {
  --workspace-rail: 222px;
  --workspace-text: #afc0cf;
  --workspace-active: #192b3d;
  --workspace-active-text: #eef6ff;
}

html[data-theme="light"] body.workspace-unified {
  --workspace-text: #334b60;
  --workspace-active: #d4e3f1;
  --workspace-active-text: #173655;
}

html body.workspace-unified #sidebar {
  position: fixed !important;
  z-index: 20 !important;
  inset: 0 auto 0 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0 !important;
  width: var(--workspace-rail) !important;
  height: 100dvh !important;
  min-height: 0 !important;
  overflow: visible !important;
  padding: 12px 8px !important;
  border: 0 !important;
  border-right: 1px solid var(--ff-sidebar-line) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  color: var(--workspace-text);
}

html body.workspace-unified #sidebar > .brand {
  display: flex !important;
  align-items: center;
  gap: 9px;
  width: fit-content !important;
  margin: 0 0 15px !important;
  padding: 8px 7px;
  color: var(--workspace-active-text);
  font-size: 15px;
  white-space: nowrap;
}

html body.workspace-unified #sidebar .side-links {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 3px !important;
  width: 100% !important;
  overflow: visible !important;
}

html body.workspace-unified .side-links > :is(a, button),
html body.workspace-unified .side-links > .workspace-more > summary {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  width: 100% !important;
  min-height: 41px;
  gap: 10px !important;
  padding: 7px 9px !important;
  color: var(--workspace-text) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  font: 500 13px/1.25 Inter, system-ui, sans-serif !important;
  text-align: left;
  white-space: nowrap;
}

html body.workspace-unified .side-links > :is(a, button):is(:hover, [aria-pressed="true"], [aria-current="page"]),
html body.workspace-unified .side-links > .workspace-more > summary:hover {
  color: var(--workspace-active-text) !important;
  background: var(--workspace-active) !important;
}

html body.workspace-unified .side-links .workspace-nav-icon {
  display: grid !important;
  place-items: center;
  flex: 0 0 23px;
  width: 23px !important;
  height: 23px !important;
  color: var(--workspace-text);
  opacity: .9;
}

html body.workspace-unified .side-links .workspace-nav-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7px;
}

.workspace-unified .workspace-more > summary span { margin-left: auto; }
.workspace-unified .sidebar-end { margin-top: auto; padding-top: 12px; }
.workspace-unified .sidebar-end button { width: 100%; color: var(--workspace-text); }

html body.workspace-unified #sidebar .ff-account-menu {
  position: relative !important;
  inset: auto !important;
  width: 100% !important;
  margin: 6px 0 0 !important;
}

html body.workspace-unified #sidebar .ff-account-panel {
  inset: auto 0 calc(100% + 8px) 0 !important;
}

html body.workspace-unified #main-content {
  width: calc(100% - var(--workspace-rail)) !important;
  max-width: none !important;
  margin: 0 0 0 var(--workspace-rail) !important;
  padding: clamp(20px, 3vw, 44px) clamp(18px, 3.3vw, 48px) 36px !important;
}

html body.workspace-unified:not([data-workspace-view="assistant"]) .app-topbar { display: none !important; }
html body.workspace-unified[data-workspace-view="home"] :is(#home-intro, #home-discovery, #home-guide) { display: none !important; }
html body.workspace-unified .persistent-glass { display: none !important; }

.workspace-unified .mobile-header { display: none; }
.workspace-unified .rail-toggle {
  position: absolute;
  top: 12px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ff-sidebar-line);
  border-radius: 8px;
  background: transparent;
  color: var(--workspace-text);
}
.workspace-unified .rail-toggle svg { width: 17px; height: 17px; }

body[data-route-page="projects"] #main {
  width: min(calc(100% - var(--rail)), 1040px);
  margin: 0 auto 0 var(--rail);
  padding: clamp(22px, 4vw, 56px);
}
body[data-route-page="projects"] .member-projects-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 32px;
  padding-top: 14px;
  border-top: 1px solid var(--ff-sidebar-line);
  font-size: .8rem;
}

@media (min-width: 741px) {
  body[data-route-page="projects"].workspace-rail-collapsed { --rail: 64px; }
  body.workspace-rail-collapsed.workspace-unified { --workspace-rail: 62px; }
  html body.workspace-rail-collapsed.workspace-unified .app-sidebar > .brand {
    margin-bottom: 40px !important;
  }
  html body.workspace-rail-collapsed.workspace-unified .side-links > :is(a, button) {
    justify-content: center !important;
    padding-inline: 4px !important;
  }
  .workspace-rail-collapsed.workspace-unified :is(.desktop-brand span, .side-links > :is(button, a) > span:not(.workspace-nav-icon), .sidebar-end) { display: none; }
  .workspace-rail-collapsed.workspace-unified .rail-toggle { top: 49px; right: 14px; }
  .workspace-rail-collapsed.workspace-unified .workspace-more > summary { justify-content: center !important; font-size: 11px !important; }
  .workspace-rail-collapsed.workspace-unified .workspace-more > summary span { display: none; }
  .workspace-rail-collapsed.workspace-unified .workspace-more > div {
    position: absolute;
    z-index: 2;
    left: calc(100% + 4px);
    background: var(--ff-sidebar-color);
    border: 1px solid var(--ff-sidebar-line);
  }
  .workspace-rail-collapsed.workspace-unified .ff-account-menu summary > span { display: none; }
  html body.workspace-rail-collapsed.workspace-unified .app-sidebar .ff-account-panel { inset: auto auto 0 calc(100% + 8px) !important; }
}

@media (max-width: 740px) {
  html body.workspace-unified .mobile-header {
    position: sticky;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    top: 0;
    z-index: 22;
    min-height: 54px;
    padding: 7px 12px;
    border-bottom: 1px solid var(--ff-sidebar-line);
  }
  .workspace-unified .mobile-header .brand { display: flex; align-items: center; gap: 7px; margin-right: auto; color: var(--workspace-active-text); }
  .workspace-unified #menu-toggle { display: flex; align-items: center; gap: 6px; background: transparent; color: var(--workspace-text); border: 1px solid var(--ff-sidebar-line); border-radius: 7px; padding: 7px; }
  .workspace-unified #menu-toggle svg { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; }
  html body.workspace-unified #sidebar { inset-block-start: 54px !important; height: calc(100dvh - 54px) !important; overflow: auto !important; }
  html body.workspace-unified #sidebar:not(.is-open),
  html body.workspace-unified #sidebar > .brand,
  .workspace-unified .rail-toggle { display: none !important; }
  html body.workspace-unified #main-content { width: 100% !important; margin: 0 !important; }
  body[data-route-page="projects"] #main { width: 100%; margin: 0; }
}
