/* Layout: sidebar + main canvas panel */
body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
}

#sidebar {
  width: 300px;
  min-width: 280px;
  background: #f4f4f4;
  border-right: 1px solid #ddd;
  padding: 1.5rem;
  box-sizing: border-box;
  transition: width 0.3s ease;
  display: flex;
  flex-direction: column;
}

#sidebar.collapsed {
  min-width: 0 !important;
  width: 0;
  padding: 0;
  overflow: hidden;
}

#main {
  flex: 1;
  position: relative;
  background: #111;
  display: flex;
}

#gpu-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Toggle button */
#toggle-sidebar {
  position: absolute;
  bottom: 10px;
  right: 10px;       /* instead of left */
  top: auto;         /* reset */
  left: auto;        /* reset */
  background: rgba(255,255,255,0.8);
  border: none;
  padding: 0.4rem;
  border-radius: 6px;
  cursor: pointer;
  z-index: 10;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#toggle-sidebar:hover {
  background: rgba(255,255,255,1);
}