.editor-shell {
  display: grid;
  gap: 1rem;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  padding: 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.tool-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
}

.tool-btn:hover {
  border-color: rgba(10, 111, 108, 0.35);
}

.tool-btn.active {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.shape-menu-wrap {
  position: relative;
}

.shape-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 30;
  min-width: 12rem;
  padding: 0.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.shape-menu.show {
  display: grid;
  gap: 0.25rem;
}

.shape-menu button {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}

.shape-menu button:hover {
  background: rgba(10, 111, 108, 0.1);
}

.toolbar-sep {
  width: 1px;
  height: 1.6rem;
  background: var(--line);
  margin: 0 0.15rem;
}

.toolbar-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.toolbar-group label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--muted);
}

.toolbar-group select,
.toolbar-group input[type="number"],
.toolbar-group input[type="text"] {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font: inherit;
  font-weight: 600;
  background: #fff;
}

.toolbar-group input[type="color"] {
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  padding: 0;
  background: #fff;
  cursor: pointer;
}

.editor-stage-wrap {
  overflow: auto;
  max-height: min(72vh, 900px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(45deg, #d9e2e6 25%, transparent 25%) 0 0 / 20px 20px,
    linear-gradient(-45deg, #d9e2e6 25%, transparent 25%) 0 0 / 20px 20px,
    #eef3f5;
  padding: 1rem;
}

.editor-stage {
  position: relative;
  margin: 0 auto;
  width: max-content;
  box-shadow: 0 18px 40px rgba(18, 32, 39, 0.18);
  background: #fff;
}

.editor-stage canvas {
  display: block;
}

#overlayCanvas {
  position: absolute;
  inset: 0;
  cursor: crosshair;
}

.editor-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: space-between;
}

.editor-hint {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.inline-text {
  display: none;
  position: absolute;
  z-index: 5;
  margin: 0;
  border: 2px solid #0a6f6c;
  border-radius: 4px;
  padding: 4px 6px;
  resize: none;
  overflow: auto;
  box-sizing: border-box;
  line-height: 1.25;
  background: #fff;
  box-shadow: 0 8px 24px rgba(18, 32, 39, 0.18);
}

.inline-text:focus {
  outline: none;
}

.tool-icon.edit {
  background: linear-gradient(145deg, #0a6f6c, #e39b2b);
}
