body {
  font-family: var(--font);
  font-size: var(--font-size);
  background: var(--bg);
  color: var(--text);
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: var(--left-panel-w) 1fr var(--right-panel-w);
  grid-template-areas:
    "topbar topbar topbar"
    "left canvas right";
  height: 100vh;
  user-select: none;
}

#top-bar {
  grid-area: topbar;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

#left-panel {
  grid-area: left;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 90;
}

#canvas-wrapper {
  grid-area: canvas;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

#right-panel {
  grid-area: right;
  background: var(--surface);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  z-index: 90;
}

/* Scrollbars */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* Rulers */
#ruler-h {
  position: absolute;
  top: 0; left: 24px;
  height: 24px;
  pointer-events: none;
  z-index: 50;
  width: calc(100% - 24px);
}
#ruler-v {
  position: absolute;
  top: 24px; left: 0;
  width: 24px;
  pointer-events: none;
  z-index: 50;
  height: calc(100% - 24px);
}
