:root {
  --bg: #ffffff;
  --fg: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: saturate(180%) blur(6px);
  z-index: 10;
}

.tools label {
  margin-right: 12px;
  font-size: 14px;

  &:has(> input[type="hidden"]) {
    display: none;
  }
}

.status {
  font-size: 12px;
  color: var(--muted);
}

#canvas {
  display: block;
  width: 100vw;
  height: calc(100vh - 50px);
  background: #ffffff;
  touch-action: none;
  cursor: crosshair;
}

button {
  background: var(--accent);
  color: white;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

/* Brush preview overlay */
body.showBrush #brushPreview {
  opacity: 0.8;
}

body.drawing #brushPreview {
  opacity: 1;
}

#brushPreview {
  position: fixed;
  left: 0;
  top: 0;
  width: 24px;
  height: 24px;
  margin: 0;
  transform: translate(-1000px, -1000px);
  border-radius: 50%;
  border: 2px solid #6b7280;
  /* gray-500 */
  background: transparent;
  pointer-events: none;
  opacity: 0;
  transition: opacity 80ms ease;
  box-sizing: border-box;
}

/* When actually drawing, hide cursor and make the preview more visible */
#canvas.drawing {
  cursor: none;
}

body.drawing #brushPreview {
  border-color: #374151;
  /* gray-700 */
  background: rgba(55, 65, 81, 0.15);
}