.map-editor-body {
  display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: auto 1fr;
  height: 100vh;
  overflow: hidden;
  background: #12121e;
}

.map-editor-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  background: linear-gradient(135deg, #1a1a30 0%, #222240 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.map-editor-header h1 {
  font-size: 15px;
  font-weight: 600;
  color: #d4d4e8;
  margin: 0;
}

.map-editor-back {
  color: #8899bb;
  text-decoration: none;
  font-size: 13px;
}

.map-editor-back:hover {
  color: #ffd700;
}

.map-editor-hint {
  margin-left: auto;
  font-size: 11px;
  color: #667;
}

.map-editor-sidebar {
  padding: 10px;
  overflow-y: auto;
  background: rgba(18, 18, 30, 0.98);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.map-editor-sidebar h2 {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #7788aa;
  margin: 10px 0 6px 0;
}

.map-editor-sidebar h2:first-child {
  margin-top: 0;
}

.map-editor-tools {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-editor-tool,
.map-editor-palette-btn {
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  color: #c8c8e0;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.map-editor-tool:hover,
.map-editor-palette-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.14);
}

.map-editor-tool.active,
.map-editor-palette-btn.active {
  background: #2a6a3a;
  border-color: #3a8a4a;
  color: #fff;
}

.map-editor-palette {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
}

.map-editor-palette-sm {
  max-height: 160px;
}

.map-editor-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.map-editor-actions .btn {
  width: 100%;
  justify-content: center;
}

.map-editor-help {
  font-size: 10px;
  color: #667;
  line-height: 1.45;
  margin-top: 12px;
}

.map-editor-help a {
  color: #8899bb;
}

.map-editor-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #2d5a22;
}

#editor-canvas {
  flex: 1;
  min-height: 0;
}

.map-editor-status {
  flex-shrink: 0;
  padding: 6px 12px;
  font-size: 11px;
  color: #8899bb;
  background: rgba(0, 0, 0, 0.35);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .map-editor-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
  }

  .map-editor-sidebar {
    max-height: 40vh;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }
}
