:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f7f5ef;
  color: #17201c;
}

* { box-sizing: border-box; }

html, body, .editor-shell {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body { user-select: none; }

.editor-shell {
  position: relative;
  background: #f7f5ef;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

canvas.is-panning { cursor: grabbing; }

.toolbar, .status, .feedback-link {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  border: 1px solid rgb(23 32 28 / 16%);
  background: rgb(255 255 252 / 92%);
  box-shadow: 0 8px 30px rgb(23 32 28 / 12%);
  backdrop-filter: blur(12px);
}

.toolbar {
  top: 16px;
  left: 50%;
  gap: 4px;
  padding: 5px;
  border-radius: 12px;
  transform: translateX(-50%);
}

.tool-group, .color-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.divider {
  width: 1px;
  height: 28px;
  margin: 0 3px;
  background: rgb(23 32 28 / 14%);
}

.toolbar button {
  min-width: 76px;
  border: 0;
  border-radius: 8px;
  padding: 9px 16px;
  background: transparent;
  color: #354039;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}

.toolbar button:hover { background: #edeae2; }
.toolbar button.active { background: #1f382d; color: #fff; }
.toolbar.keyboard-input button:hover:not(.active) { background: transparent; }
.toolbar button:focus-visible { outline: 3px solid #8bb9a5; outline-offset: 2px; }

.toolbar kbd {
  margin-right: 5px;
  color: inherit;
  font: 700 11px/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  opacity: .65;
}

.toolbar .color-button {
  display: grid;
  min-width: 34px;
  height: 36px;
  place-items: center;
  gap: 1px;
  padding: 3px 5px;
}

.color-button span {
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 50%;
  background: var(--swatch);
  box-shadow: 0 0 0 1px rgb(23 32 28 / 25%);
}

.toolbar .color-button kbd {
  margin: 0;
  font-size: 9px;
}

.toolbar .color-button.active {
  background: #dfe9e3;
  color: #17201c;
  box-shadow: inset 0 0 0 2px #527965;
}

.toolbar .save-button {
  min-width: 82px;
  padding-inline: 10px;
}

.toolbar .save-button.is-saved { background: #38845c; color: #fff; }
.toolbar .save-button.is-save-error { background: #c53f3f; color: #fff; }

.status {
  right: 16px;
  bottom: 16px;
  gap: 14px;
  padding: 9px 13px;
  border-radius: 10px;
  color: #5e655f;
  font-size: 12px;
}

.status strong { color: #1f382d; }

.feedback-link {
  bottom: 16px;
  left: 16px;
  border-radius: 10px;
  padding: 9px 13px;
  color: #354039;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.feedback-link:hover { background: #edeae2; }
.feedback-link:focus-visible { outline: 3px solid #8bb9a5; outline-offset: 2px; }

@media (max-width: 720px) {
  .status span:not(:first-of-type) { display: none; }
  .toolbar { max-width: calc(100% - 20px); overflow-x: auto; }
}
