body {
  margin: 0;
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: sans-serif;
}
.tools {
  width: 180px;
  background: #222;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
  gap: 10px;
}
.tools button {
  width: 100%;
  padding: 6px;
  border: none;
  border-radius: 6px;
  background: #444;
  color: white;
  cursor: pointer;
}
.tools button:hover { background: #555; }
.colors, .bgcolors {
  display: grid;
  grid-template-columns: repeat(4, 30px);
  gap: 6px;
}
.color, .bgcolor {
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #aaa;
  cursor: pointer;
}
.workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.tabs {
  display: flex;
  background: #ddd;
  padding: 4px;
  overflow-x: auto;
  align-items: center;
}
.tab {
  background: #eee;
  border: 1px solid #bbb;
  padding: 4px 10px;
  margin-right: 5px;
  border-radius: 4px;
  cursor: pointer;
  user-select: none;
}
.tab.active {
  background: #fff;
  border-bottom: 2px solid #000;
}
.tab .close {
  margin-left: 6px;
  color: #a00;
  cursor: pointer;
}
#addPage {
  padding: 4px 10px;
  border: 1px dashed #aaa;
  border-radius: 4px;
  background: #f8f8f8;
  cursor: pointer;
}
canvas {
  flex: 1;
  background: white;
  cursor: crosshair;
  display: block;
}
